.swal-footer {
    text-align: center;
}
.side-menu {
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* SAMINDO sidenav active state and menu icon refinement */
#sidebar-menu .sam-sidenav-menu {
    padding: 8px 12px 18px;
}

#sidebar-menu .sam-sidenav-menu > .nav-item {
    margin: 3px 0;
}

#sidebar-menu .sam-sidenav-menu > .nav-item > .sam-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 11px 14px !important;
    border-radius: 14px;
    color: #818181;
    font-weight: 600;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#sidebar-menu .sam-sidenav-menu > .nav-item > .sam-nav-link i {
    width: 22px;
    min-width: 22px;
    margin: 0;
    text-align: center;
    font-size: 15px;
    color: inherit;
}

#sidebar-menu .sam-sidenav-menu > .nav-item > .sam-nav-link .nav-link-text {
    margin-left: 0;
    line-height: 1.25;
}

#sidebar-menu .sam-sidenav-menu > .nav-item > .sam-nav-link:hover,
#sidebar-menu .sam-sidenav-menu > .nav-item > .sam-nav-link:focus {
    color: #fe0000;
    background: rgba(254, 0, 0, 0.07);
    text-decoration: none;
}

#sidebar-menu .sam-sidenav-menu > .nav-item.sam-menu-active > .sam-nav-link {
    color: #fe0000 !important;
    background: linear-gradient(90deg, rgba(254, 0, 0, 0.13), rgba(254, 0, 0, 0.04));
    box-shadow: inset 4px 0 0 #fe0000;
    font-weight: 800;
}

#sidebar-menu .sam-sidenav-menu > .nav-item.sam-menu-active > .sam-nav-link i,
#sidebar-menu .sam-sidenav-menu > .nav-item.sam-menu-active > .sam-nav-link .nav-link-text {
    color: #fe0000 !important;
}

#sidebar-menu .sam-sidenav-menu > .nav-item.sam-menu-active > .sam-nav-link::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-radius: 999px;
    background: #fe0000;
    box-shadow: 0 0 0 4px rgba(254, 0, 0, 0.10);
}

.selectize-input {
    padding-top: 5px;
    padding-bottom: 5px;
}

.topbar .navbar-custom {
    position: relative !important;
}

.topbar .navbar-custom .sam-topbar-title {
    position: absolute !important;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: block !important;
    color: #ffffff !important;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.98;
}

/* Professional realtime dashboard */
.sam-dashboard {
    padding: 18px;
    background: #f7f8fb;
    min-height: calc(100vh - 70px);
}

.sam-monitor-hero {
    position: relative;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #5f0f0f 0%, #c90000 52%, #fe0000 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    box-shadow: 0 14px 30px rgba(254, 0, 0, 0.16);
    overflow: hidden;
}

.sam-monitor-hero::after {
    content: "";
    position: absolute;
    inset: -50% -15% auto auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
}

.sam-monitor-hero > * {
    position: relative;
    z-index: 1;
}

.sam-dashboard-hero h1 {
    font-size: 27px;
    line-height: 1.2;
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
}

.sam-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.82;
}

.sam-muted {
    color: rgba(255, 255, 255, 0.8);
    max-width: 760px;
}

.sam-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.sam-date-card {
    min-width: 210px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.sam-date-card span {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.75;
}

.sam-date-card strong {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.25;
}

.sam-date-card small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.78);
}

.sam-live-pill,
.sam-refresh-btn {
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(254, 0, 0, 0.14);
}

.sam-refresh-btn {
    color: #fe0000 !important;
    border-color: rgba(254, 0, 0, 0.12) !important;
}

.sam-refresh-btn:hover {
    color: #ffffff !important;
    background: #fe0000 !important;
    border-color: #fe0000 !important;
}

.sam-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    backdrop-filter: blur(12px);
}

.sam-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2dce89;
    box-shadow: 0 0 0 5px rgba(45, 206, 137, 0.18);
}

.sam-live-pill.is-refreshing .sam-live-dot {
    animation: samPulse 1s ease-in-out infinite;
}

@keyframes samPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
}

.sam-loading,
.sam-empty {
    border-radius: 14px;
    padding: 22px;
    background: #ffffff;
    color: #7a828e;
    text-align: center;
    box-shadow: 0 10px 24px rgba(29, 31, 36, 0.06);
}

.sam-loading i {
    margin-right: 8px;
}

.sam-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.sam-kpi-card {
    position: relative;
    border: 0;
    border-radius: 14px;
    padding: 14px;
    background: #ffffff;
    text-align: left;
    display: flex;
    gap: 12px;
    min-height: 118px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(29, 31, 36, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
}

.sam-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -36px -54px auto;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: rgba(254, 0, 0, 0.07);
}

.sam-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(29, 31, 36, 0.11);
}

.sam-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    background: linear-gradient(135deg, rgba(254, 0, 0, 0.12), rgba(254, 0, 0, 0.04));
    color: #fe0000;
    font-size: 17px;
}

.sam-kpi-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sam-kpi-title {
    font-size: 11px;
    font-weight: 800;
    color: #7b8794;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.sam-kpi-body strong {
    font-size: 23px;
    line-height: 1.15;
    color: #2b2f38;
    margin-bottom: 4px;
    white-space: nowrap;
}

.sam-kpi-subtitle {
    color: #505763;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}

.sam-kpi-body small {
    color: #7a828e;
    font-size: 11px;
}

.sam-dashboard-row {
    align-items: stretch;
}

.sam-panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(29, 31, 36, 0.06);
    border: 1px solid rgba(29, 31, 36, 0.06);
}

.sam-panel:not(.sam-panel-blue):not(.sam-panel-orange) {
    border-top: 3px solid rgba(254, 0, 0, 0.72);
}

.sam-panel-fill {
    height: 100%;
}

.sam-panel-blue,
.sam-panel-orange {
    padding-top: 0;
    overflow: hidden;
}

.sam-panel-blue .sam-panel-header,
.sam-panel-orange .sam-panel-header {
    margin: 0 -16px 12px;
    padding: 9px 14px;
    color: #ffffff;
}

.sam-panel-blue .sam-panel-header {
    background: linear-gradient(90deg, #e00000, #fe0000);
}

.sam-panel-orange .sam-panel-header {
    background: linear-gradient(90deg, #d80000, #ff3b30);
}

.sam-panel-blue .sam-panel-header h3,
.sam-panel-blue .sam-panel-header p,
.sam-panel-blue .sam-panel-header strong,
.sam-panel-orange .sam-panel-header h3,
.sam-panel-orange .sam-panel-header p,
.sam-panel-orange .sam-panel-header strong {
    color: #ffffff;
}

.sam-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.sam-panel-header h3 {
    font-size: 16px;
    margin: 0 0 4px;
    color: #2b2f38;
    font-weight: 800;
}

.sam-panel-header p {
    margin: 0;
    color: #7a828e;
    font-size: 12px;
}

.sam-panel-header strong {
    white-space: nowrap;
    font-size: 14px;
}

.sam-panel-header-with-actions {
    align-items: center;
}

.sam-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sam-panel-actions button {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fe0000;
    background: rgba(254, 0, 0, 0.08);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sam-panel-actions button:hover {
    color: #ffffff;
    background: #fe0000;
    transform: translateY(-1px);
}

.sam-svg-chart {
    height: 270px;
    width: 100%;
    overflow: visible;
}

.sam-svg-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sam-grid-line {
    stroke: rgba(116, 124, 135, 0.22);
    stroke-width: 1;
}

.sam-grid-label,
.sam-axis-label {
    fill: #697386;
    font-size: 12px;
    font-weight: 700;
}

.sam-line-path {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 6px 8px rgba(254, 0, 0, 0.13));
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: samDrawLine 1.2s ease forwards;
}

@keyframes samDrawLine {
    to { stroke-dashoffset: 0; }
}

.sam-line-path.line-0,
.sam-line-dot.line-0 {
    stroke: #fe0000;
}

.sam-line-path.line-1,
.sam-line-dot.line-1 {
    stroke: #3a3f46;
}

.sam-line-dot {
    fill: #ffffff;
    stroke-width: 4;
    cursor: pointer;
    transition: r 0.18s ease, filter 0.18s ease;
}

.sam-line-dot:hover {
    r: 9;
    filter: drop-shadow(0 5px 9px rgba(23, 43, 77, 0.26));
}

.sam-chart-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
    margin-top: -4px;
    margin-bottom: 4px;
    color: #505763;
    font-size: 12px;
    font-weight: 800;
}

.sam-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sam-chart-legend i {
    display: inline-block;
    width: 18px;
    height: 4px;
    border-radius: 999px;
}

.sam-chart-legend .line-0 {
    background: #fe0000;
}

.sam-chart-legend .line-1 {
    background: #3a3f46;
}

.sam-inventory-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
    gap: 18px;
    align-items: center;
}

.sam-status-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sam-status-card {
    border: 0;
    border-radius: 12px;
    padding: 12px;
    min-height: 94px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #2b2f38;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sam-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(23, 43, 77, 0.12);
}

.sam-status-card span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sam-status-card strong {
    font-size: 28px;
    line-height: 1;
}

.sam-status-card small {
    font-size: 11px;
    color: rgba(23, 43, 77, 0.72);
}

.sam-status-card.status-in_stock {
    background: rgba(45, 206, 137, 0.18);
}

.sam-status-card.status-low_stock {
    background: rgba(244, 244, 86, 0.36);
}

.sam-status-card.status-restock {
    background: rgba(245, 158, 11, 0.20);
}

.sam-status-card.status-out_of_stock {
    background: rgba(245, 54, 92, 0.18);
}

.sam-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.sam-donut {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(29, 31, 36, 0.10);
}

.sam-donut-hole {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: inset 0 0 0 1px rgba(29, 31, 36, 0.06);
}

.sam-donut-hole span {
    font-size: 11px;
    text-transform: uppercase;
    color: #7a828e;
    font-weight: 800;
}

.sam-donut-hole strong {
    color: #2b2f38;
    font-size: 27px;
}

.sam-donut-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    width: 100%;
    color: #505763;
    font-size: 12px;
    font-weight: 700;
}

.sam-donut-legend div {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sam-donut-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.sam-po-chart {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.sam-po-header small {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 700;
    margin-top: 3px;
}

.sam-po-header-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.sam-po-header-total span {
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 800;
}

.sam-po-axis {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) 140px;
    gap: 10px;
    align-items: end;
}

.sam-po-axis-spacer,
.sam-po-axis-value-spacer {
    min-height: 1px;
}

.sam-po-axis-bottom {
    margin-top: 8px;
    margin-bottom: 6px;
}

.sam-po-axis-labels {
    position: relative;
    height: 20px;
    color: #7a828e;
    font-size: 12px;
    font-weight: 700;
}

.sam-po-axis-labels span {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.sam-po-axis-labels span:first-child {
    transform: translateX(0);
}

.sam-po-axis-labels span:last-child {
    transform: translateX(-100%);
}

.sam-po-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.sam-po-year {
    font-weight: 800;
    color: #505763;
}

.sam-po-series-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.sam-po-series {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr) 140px;
    gap: 10px;
    align-items: center;
}

.sam-po-series-clickable {
    cursor: pointer;
}

.sam-po-series-clickable:hover .sam-po-track {
    box-shadow: 0 0 0 3px rgba(254, 0, 0, 0.08);
}

.sam-po-series-clickable:hover .sam-po-series-name {
    text-decoration: underline;
}

.sam-po-series-name {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: #505763;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    padding-left: 6px;
}

.sam-po-series-name::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 8px;
}

.sam-po-series-name.local::before {
    background: #fe0000;
}

.sam-po-series-name.import::before {
    background: #3a3f46;
}

.sam-po-track {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: #f2f4f8;
    overflow: hidden;
}

.sam-po-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(122, 130, 142, 0.25);
    z-index: 1;
    pointer-events: none;
}

.sam-po-bar {
    position: relative;
    z-index: 2;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    transition: width 0.45s ease, filter 0.2s ease;
    cursor: pointer;
}

.sam-po-bar:hover {
    filter: brightness(1.06);
}

.sam-po-bar.local {
    background: linear-gradient(90deg, #e50000, #ff3b3b);
}

.sam-po-bar.import {
    background: linear-gradient(90deg, #2f343b, #5b6470);
}

.sam-po-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    text-align: right;
    color: #2b2f38;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.15;
}

.sam-po-value small {
    color: #7a828e;
    font-size: 11px;
    font-weight: 800;
}

.sam-po-value-count {
    white-space: nowrap;
}

.sam-po-value.local {
    color: #fe0000;
}

.sam-po-value.import {
    color: #3a3f46;
}

.sam-po-legend {
    justify-content: center;
    margin-top: 14px;
}

.sam-po-legend .po-local {
    background: #fe0000;
}

.sam-po-legend .po-import {
    background: #3a3f46;
}

.sam-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.sam-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fe0000, #ff5a5a);
    transition: width 0.35s ease;
}

.sam-supplier-list,
.sam-risk-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sam-supplier-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.sam-supplier-row:last-child {
    border-bottom: 0;
}

.sam-supplier-row strong,
.sam-risk-item strong {
    display: block;
    color: #2b2f38;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sam-supplier-row small,
.sam-risk-item small {
    color: #7a828e;
    font-size: 11px;
}

.sam-risk-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #eef2f7;
}

.sam-risk-item:last-child {
    border-bottom: 0;
}

.sam-risk-item span {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(245, 54, 92, 0.1);
    color: #c81e46;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
}

.sam-table-scroll {
    max-height: 360px;
    overflow: auto;
}


/* Dashboard activity and attention list: show 10 rows by default, scroll only when data is longer. */
.sam-activity-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sam-activity-panel .sam-panel-header {
    flex: 0 0 auto;
}

.sam-activity-scroll {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sam-scroll-limit-10.is-scrollable {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(254, 0, 0, 0.45) rgba(254, 0, 0, 0.08);
}

.sam-scroll-limit-10.is-scrollable::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.sam-scroll-limit-10.is-scrollable::-webkit-scrollbar-track {
    background: rgba(254, 0, 0, 0.08);
    border-radius: 999px;
}

.sam-scroll-limit-10.is-scrollable::-webkit-scrollbar-thumb {
    background: rgba(254, 0, 0, 0.45);
    border-radius: 999px;
}

.sam-activity-scroll.sam-scroll-limit-10 {
    max-height: 718px;
}

.sam-risk-list.sam-scroll-limit-10 {
    max-height: 718px;
    overflow: hidden;
}

.sam-risk-list.sam-scroll-limit-10.is-scrollable {
    overflow-y: auto;
}

.sam-activity-panel .sam-dashboard-table {
    margin-bottom: 0 !important;
}

.sam-activity-panel .sam-dashboard-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
}

.sam-activity-panel .sam-dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.sam-dashboard-table th {
    font-size: 11px;
    text-transform: uppercase;
    color: #7a828e;
    border-top: 0;
}

.sam-dashboard-table td {
    vertical-align: middle;
    cursor: pointer;
}

.sam-dashboard-table tbody tr:hover {
    background: #fff5f5;
}

.sam-table-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: #fe0000;
    background: rgba(254, 0, 0, 0.08);
}

.sam-soft-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef2ff;
    color: #344767;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 1400px) {
    .sam-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .sam-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sam-monitor-hero,
    .sam-dashboard-actions,
    .sam-inventory-layout {
        flex-direction: column;
        display: flex;
        align-items: stretch;
    }

    .sam-dashboard-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .sam-dashboard {
        padding: 12px;
    }

    .sam-dashboard-hero h1 {
        font-size: 22px;
    }

    .sam-kpi-grid,
    .sam-status-strip,
    .sam-donut-legend {
        grid-template-columns: 1fr;
    }

    .sam-po-row {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 8px;
    }

    .sam-po-series {
        grid-template-columns: 48px minmax(0, 1fr) 82px;
        gap: 8px;
    }

    .sam-po-series-name {
        font-size: 10px;
    }

    .sam-supplier-row {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 991.98px) {
    .sam-po-axis {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sam-po-axis-spacer,
    .sam-po-axis-value-spacer {
        display: none;
    }

    .sam-po-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sam-po-series {
        grid-template-columns: 92px minmax(0, 1fr) 110px;
    }
}

@media (max-width: 1199.98px) {
    .sam-topbar-title {
        display: none;
    }
}

/* Keep navbar-custom label visible on desktop, hide only when space is limited. */
@media (min-width: 992px) {
    .topbar .navbar-custom .sam-topbar-title {
        display: block !important;
    }
}

@media (max-width: 991.98px) {
    .topbar .navbar-custom .sam-topbar-title {
        display: none !important;
    }
}


/* Force topbar center label for SAMINDO dashboard. */
.sam-topbar-title,
.sam-topbar-title-overlay,
.topbar .navbar-custom .sam-topbar-title {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    display: block !important;
    color: #ffffff !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    opacity: 1 !important;
}

.sam-topbar-title-overlay {
    position: fixed !important;
    top: 35px !important;
    left: calc(240px + ((100vw - 240px) / 2)) !important;
}

.topbar .navbar-custom {
    position: relative !important;
}

@media (max-width: 1199.98px) {
    .sam-topbar-title,
    .sam-topbar-title-overlay,
    .topbar .navbar-custom .sam-topbar-title {
        display: none !important;
    }
}


/* Header title duplicate guard: the title is rendered only inside topbar.html. */
.sam-topbar-title-overlay {
    display: none !important;
}

/* Dashboard hero title: vertically center left title and remove top-heavy spacing. */
.sam-monitor-hero > div:first-child {
    display: flex;
    align-items: center;
    min-height: 92px;
}

.sam-monitor-hero .sam-dashboard-actions {
    align-items: center;
}

.sam-dashboard-hero h1 {
    margin: 0;
}


/* Prevent short duplicate cards during 30-second dashboard auto-refresh. */
.sam-dashboard .ng-enter,
.sam-dashboard .ng-leave,
.sam-dashboard .ng-move,
.sam-dashboard .ng-enter-active,
.sam-dashboard .ng-leave-active,
.sam-dashboard .ng-move-active {
    transition: none !important;
    animation: none !important;
}

.sam-dashboard .ng-leave,
.sam-dashboard .ng-leave-active {
    display: none !important;
}
