/* Dashboard layout inspired by the supplied tablet concept. */
.workspace-page {
    --sidebar-width: 295px;
    --dashboard-ink: #132344;
    --dashboard-muted: #73819a;
    --dashboard-line: #e8eef6;
    --dashboard-blue: #159ce9;
    --dashboard-cyan: #31c3e8;
    --paper: #f5f8fc;
    --surface: #fff;
    --ink: #132344;
    --muted: #73819a;
    --line: #e8eef6;
    --accent: #159ce9;
    --accent-hover: #087acb;
    --accent-soft: #eaf6ff;
    --button-navy: #168ddc;
    --button-navy-hover: #0877c4;
    --radius: 20px;
    background: #f2f7fb;
    color: var(--dashboard-ink);
}

.workspace-page .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100dvh;
    padding: 0 12px 24px;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--dashboard-line);
    box-shadow: 8px 0 28px #18345a08;
    z-index: 100;
}
.workspace-page .studio-brand {
    padding: 25px 8px 29px;
    min-width: 0;
    gap: 10px;
}
.workspace-page .brand-mark {
    width: 60px;
    height: 60px;
    font-size: 1.6875rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f8be2, #45d1e5);
    color: #fff;
    box-shadow: 0 8px 18px #149ce62a;
}
.workspace-page .brand-mark > span { color: #fff; }
.workspace-page .brand-name { color: #12254b; font-size: 1.0625rem; }
.workspace-page .brand-name small { color: #6e91b2; font-size: 0.75rem; }
.workspace-page .sidebar > .nav-label,
.workspace-page .sidebar .nav .nav-label {
    display: block;
    padding: 10px 12px 8px;
    color: #8292a8;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 1.2px;
}
.workspace-page .sidebar .nav .nav-label { padding-top: 26px; }
.workspace-page .sidebar .nav {
    display: block;
    padding: 0;
    min-width: 0;
}
.workspace-page .sidebar .nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    margin: 3px 0;
    padding: 10px 12px;
    border-radius: 13px;
    color: #34435f;
    font-size: 1.0625rem;
    font-weight: 600;
}
.workspace-page .sidebar .nav a:hover { color: #0879ca; background: #f0f8ff; }
.workspace-page .sidebar .nav a.active,
.workspace-page .sidebar .nav a.active:hover {
    color: #087acb;
    background: #eaf6ff;
    box-shadow: none;
}
.workspace-page .sidebar .nav-icon {
    display: inline-flex;
    flex: 0 0 27px;
    color: inherit;
    font-size: 1.5rem;
}
.workspace-page .sidebar .nav-text { display: inline; }
.workspace-page main.content {
    margin: 0 0 0 var(--sidebar-width);
    padding: 28px 30px 36px;
    min-width: 0;
    max-width: none;
    background: radial-gradient(circle at 4% 0, #e6f4fc 0, transparent 33%), #f5f8fc;
}
.workspace-page .content .topbar {
    position: relative;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 48px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    width: 100%;
    height: auto;
    background: transparent;
}
.dashboard-page .topbar > div:first-child,
.workspace-page .dashboard-search { display: none; }
.workspace-page .top-right { gap: 10px; }
.workspace-page .notification-toggle,
.workspace-page .admin-avatar {
    background: #f3f8fd;
    color: #2c4c72;
    border: 1px solid var(--dashboard-line);
    border-radius: 50%;
}
.workspace-page .admin {
    min-height: 45px;
    padding: 3px 8px 3px 4px;
    background: #f6f9fd;
    border: 1px solid var(--dashboard-line);
    border-radius: 28px;
    color: #1d3153;
}
.workspace-page .admin-avatar { width: 36px; height: 36px; background: #e4f4ff; color: #1689db; }

.dashboard-intro { display: grid; grid-template-columns: minmax(220px, 1.1fr) minmax(0, 3fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.dashboard-welcome { display: flex; gap: 13px; align-items: center; padding: 14px 4px; min-width: 0; }
.dashboard-welcome-icon,
.dashboard-panel-title .panel-icon,
.dashboard-metric .metric-icon,
.dashboard-list-item .list-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.dashboard-welcome-icon { width: 46px; height: 46px; background: #e5f5ff; color: #149de9; border-radius: 16px; font-size: 1.5625rem; }
.dashboard-kicker { margin: 0 0 5px; color: #4b9aca; font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px; }
.dashboard-welcome h1 { margin: 0 0 6px; color: #102449; font-size: clamp(23px, calc(1.7vw + 2px),  30px); letter-spacing: -.8px; line-height: 1.2; }
.dashboard-welcome p:last-child { margin: 0; color: var(--dashboard-muted); font-size: 0.875rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 137px;
    padding: 17px 18px;
    background: #fff;
    border: 1px solid var(--dashboard-line);
    border-radius: 20px;
    box-shadow: 0 10px 25px #1b456b08;
    color: var(--dashboard-ink);
    text-decoration: none;
    overflow: hidden;
}
.dashboard-metric::after { content: none; }
.dashboard-metric:hover { border-color: #bcdff7; color: var(--dashboard-ink); }
.dashboard-metric .metric-icon { width: 35px; height: 35px; margin-bottom: 8px; border-radius: 12px; background: #e9f6ff; color: #139be5; font-size: 1.25rem; }
.dashboard-metric.metric-materials .metric-icon { background: #f1eaff; color: #8054d9; }
.dashboard-metric.metric-sales .metric-icon { background: #e9f9f5; color: #11ad9d; }
.dashboard-metric.metric-orders .metric-icon { background: #e8f4ff; color: #148de1; }
.dashboard-metric .metric-label { position: relative; z-index: 1; max-width: 100%; font-size: 0.8125rem; font-weight: 600; color: #50627b; line-height: 1.3; }
.dashboard-metric strong { position: relative; z-index: 1; margin-top: 5px; font-size: clamp(24px, calc(2vw + 2px),  32px); line-height: 1.1; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.dashboard-metric small { position: relative; z-index: 1; margin-top: 5px; font-size: 0.75rem; color: var(--dashboard-muted); }

.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr); gap: 18px; margin-bottom: 18px; }
.dashboard-bottom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dashboard-panel { min-width: 0; padding: 19px; background: #fff; border: 1px solid var(--dashboard-line); border-radius: 22px; box-shadow: 0 10px 26px #203f6508; }
.dashboard-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dashboard-panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dashboard-panel-title .panel-icon { width: 38px; height: 38px; border-radius: 13px; color: #1399e6; background: #eaf7ff; font-size: 1.3125rem; }
.dashboard-panel-title .panel-icon-alert { color: #ee5c73; background: #fff0f3; }
.dashboard-panel-title h2 { margin: 0; color: #102449; font-size: 1.125rem; line-height: 1.25; white-space: nowrap; }
.dashboard-panel-link { color: #298aca; font-size: 0.8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dashboard-panel-link:hover { text-decoration: underline; }
.workspace-page .period-select { min-width: 125px; width: auto; min-height: 35px; padding: 6px 11px; background: #f8fbfe; border-color: var(--dashboard-line); border-radius: 18px; color: #405774; font-size: 0.8125rem; }
.dashboard-chart-area { position: relative; height: 350px; }
.dashboard-chart-area canvas, .dashboard-top-products canvas { width: 100% !important; height: 100% !important; }
.dashboard-chart-empty { position: absolute; inset: 42% 0 auto; padding: 8px; margin: 0; text-align: center; color: var(--dashboard-muted); background: #fff; font-size: 0.875rem; }
.dashboard-stock-visual { display: flex; align-items: center; justify-content: center; gap: 17px; min-height: 205px; }
.dashboard-doughnut { position: relative; width: min(53%, 237px); aspect-ratio: 1; flex: 0 0 auto; }
.dashboard-doughnut canvas { width: 100% !important; height: 100% !important; }
.dashboard-doughnut-total { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; pointer-events: none; text-align: center; }
.dashboard-doughnut-total strong { font-size: 1.8125rem; line-height: 1; }
.dashboard-doughnut-total span { margin-top: 5px; color: var(--dashboard-muted); font-size: 0.75rem; }
.dashboard-stock-key { flex: 1; min-width: 0; }
.dashboard-stock-key > div { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 9px 0; font-size: 0.8125rem; }
.dashboard-stock-key strong { font-size: 0.9375rem; }
.stock-key-dot { width: 10px; height: 10px; border-radius: 50%; }
.stock-key-0 { background: #37c6e8; }.stock-key-1 { background: #ffbf4e; }.stock-key-2 { background: #fb5a78; }
.workspace-page .material-stock-groups { margin-top: 9px; border-top-color: var(--dashboard-line); }
.workspace-page .material-stock-group { padding: 8px 0; border-bottom-color: var(--dashboard-line); }
.workspace-page .material-stock-group summary { color: #344b6b; font-size: 0.8125rem; }
.workspace-page .material-stock-group ul { max-height: 120px; }
.workspace-page .material-stock-open { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #344b6b; font: inherit; font-size: 0.8125rem; font-weight: 600; line-height: normal; text-align: left; cursor: pointer; box-shadow: none; }
.workspace-page .material-stock-label { display: inline-flex; align-items: center; gap: 6px; }
.workspace-page .material-stock-marker { width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 7px solid currentColor; }
.workspace-page .material-stock-open > span:last-child { color: var(--muted); }
.workspace-page .material-stock-open:hover { color: #344b6b; background: transparent; box-shadow: none; }
.workspace-page .material-stock-open:focus-visible { outline: 2px solid #168ddc; outline-offset: 4px; }
.material-stock-dialog { position: fixed; inset: auto; z-index: 1100; width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: 0; padding: 0; overflow-y: auto; border: 1px solid #dbe8f5; border-radius: 16px; background: #fff; color: #193153; box-shadow: 0 12px 36px #13234426; text-align: left; }
.material-stock-dialog::backdrop { background: transparent; backdrop-filter: none; }
.material-stock-dialog .material-stock-modal-list { list-style: none; margin: 0; padding: 0; }
.material-stock-dialog .material-stock-modal-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e3edf6; }
.material-stock-dialog .material-stock-modal-list li:last-child { border-bottom: 0; }
.material-stock-dialog .material-stock-modal-list a { color: #176b9c; overflow-wrap: anywhere; }
.material-stock-dialog .material-stock-modal-list li > span { color: #617b98; text-align: right; overflow-wrap: anywhere; }
.dashboard-list { display: flex; flex-direction: column; gap: 9px; }
.dashboard-list-panel { min-height: 285px; }
.dashboard-list-item { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 60px; padding: 9px 10px; background: #f8fbfe; border: 1px solid #f0f4f9; border-radius: 14px; color: var(--dashboard-ink); text-decoration: none; }
a.dashboard-list-item:hover { border-color: #c8e9fc; color: var(--dashboard-ink); }
.dashboard-list-item .list-symbol { width: 42px; height: 42px; border-radius: 12px; background: #e6f5ff; color: #169ce7; font-size: 1.3125rem; }
.dashboard-list-item .list-symbol-danger { background: #fff0f2; color: #ea5b70; }
.dashboard-list-item .list-symbol-warning { background: #fff7e6; color: #eaa829; }
.dashboard-list-item .list-copy { min-width: 0; flex: 1; }
.dashboard-list-item .list-copy strong { display: block; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-item small { display: block; margin-top: 3px; color: var(--dashboard-muted); font-size: 0.75rem; }
.dashboard-list-item .list-value { text-align: right; flex: 0 0 auto; }
.dashboard-list-item .list-value strong { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.dashboard-list-item .list-value small { color: #248e7a; }
.dashboard-list-empty { margin: 18px 0; color: var(--dashboard-muted); font-size: 0.875rem; }
.material-alert-badge { padding: 5px 7px; border-radius: 9px; font-size: 0.75rem; white-space: nowrap; }
.alert-out { background: #ffebef; color: #c5435b; }.alert-low { background: #fff3da; color: #ab7418; }
.dashboard-top-products { position: relative; height: 242px; }

@media (max-width: 1390px) {
    .dashboard-intro { grid-template-columns: 1fr; }
    .dashboard-welcome { padding: 5px 4px; }
}
@media (max-width: 1140px) {
    .dashboard-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-bottom-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
    .dashboard-main-grid { grid-template-columns: 1fr; }
    .dashboard-stock-visual { justify-content: flex-start; }
}
@media (max-width: 800px) {
    .workspace-page .sidebar {
        inset: 0 auto 0 0;
        width: min(var(--sidebar-width), 100vw);
        height: 100dvh;
        padding: 54px 12px 24px;
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        transform: translateX(-100%);
        z-index: 220;
    }
    .workspace-page.navigation-open .sidebar { transform: translateX(0); }
    .workspace-page .studio-brand { padding: 20px 8px; }
    .workspace-page .sidebar .brand-name { display: block; }
    .workspace-page .sidebar .nav { padding: 0; }
    .workspace-page main.content { margin-left: 0; padding: 78px 18px 28px; }
    .dashboard-page .content .topbar { position: absolute; top: 12px; right: 18px; width: auto; margin: 0; }
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
    .dashboard-bottom-grid > :last-child { grid-column: auto; }
    .dashboard-metric { min-height: 126px; }
    .dashboard-metric .metric-label { width: 100%; line-height: 1.3; white-space: normal; }
    .dashboard-panel { padding: 15px; }
    .dashboard-panel-title h2 { font-size: 1rem; }
    .dashboard-chart-area { height: 273px; }
    .dashboard-list-panel { min-height: 0; }
}

/* Shared section styling. The Overview keeps its more compact chart layout. */
.workspace-page:not(.dashboard-page) .content .topbar {
    min-height: 76px;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
    padding: 0 2px;
}
.workspace-page:not(.dashboard-page) .topbar > div:first-child { display: block; }
.workspace-page:not(.dashboard-page) .topbar .account-menu,
.workspace-page:not(.dashboard-page) .topbar .admin {
    position: relative;
    z-index: 110;
    flex: 0 0 auto;
    margin: 0;
}
.workspace-page:not(.dashboard-page) .topbar .account-menu .user-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--dashboard-line);
    border-radius: 25px;
    background: #f6f9fd;
    color: #1d3153;
}
.workspace-page:not(.dashboard-page) .topbar .account-menu .user-summary > span:nth-child(2) { font-weight: 600; line-height: 1.15; }
.workspace-page:not(.dashboard-page) .topbar .account-menu .user-summary small { color: var(--dashboard-muted); font-weight: 400; }
.workspace-page:not(.dashboard-page) .account-menu-panel,
.workspace-page:not(.dashboard-page) .admin-menu { border-color: var(--dashboard-line); border-radius: 14px; box-shadow: 0 16px 35px #203f651b; }
.workspace-page:not(.dashboard-page) .eyebrow { color: #4b9aca; font-size: 0.75rem; letter-spacing: 1.5px; }
.workspace-page:not(.dashboard-page) .page-title { color: #102449; font-size: clamp(25px, calc(2vw + 2px),  32px); font-weight: 700; letter-spacing: -.8px; }
.workspace-page:not(.dashboard-page) .page-description { color: var(--dashboard-muted); font-size: 0.875rem; }
.workspace-page:not(.dashboard-page) .content h2,
.workspace-page:not(.dashboard-page) .content h3 { color: #102449; }
.workspace-page:not(.dashboard-page) .content .panel,
.workspace-page:not(.dashboard-page) .content .container,
.workspace-page:not(.dashboard-page) .content .table-container,
.workspace-page:not(.dashboard-page) .content .sales-card {
    background: #fff;
    border: 1px solid var(--dashboard-line);
    border-radius: 22px;
    box-shadow: 0 10px 26px #203f6508;
}
.workspace-page:not(.dashboard-page) .content .panel,
.workspace-page:not(.dashboard-page) .content .sales-card { padding: 22px; }
.workspace-page:not(.dashboard-page) .content .container { padding: 26px; }
.workspace-page:not(.dashboard-page) .stat-grid,
.workspace-page:not(.dashboard-page) .stats,
.workspace-page:not(.dashboard-page) .report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
    overflow: visible;
    background: none;
    border: 0;
}
.workspace-page:not(.dashboard-page) .stat-grid .stat-card,
.workspace-page:not(.dashboard-page) .stats .stat-card,
.workspace-page:not(.dashboard-page) .report-summary .report-metric {
    min-width: 0;
    min-height: 120px;
    margin: 0;
    padding: 19px 20px;
    background: #fff;
    border: 1px solid var(--dashboard-line);
    border-radius: 20px;
    box-shadow: 0 10px 25px #1b456b08;
}
.workspace-page:not(.dashboard-page) .stat-label,
.workspace-page:not(.dashboard-page) .stat-title,
.workspace-page:not(.dashboard-page) .report-metric span { color: #50627b; font-size: 0.875rem; font-weight: 600; }
.workspace-page:not(.dashboard-page) .stat-value,
.workspace-page:not(.dashboard-page) .report-metric strong { color: #132344; font-size: clamp(25px, calc(2vw + 2px),  32px); font-weight: 700; letter-spacing: -.8px; }
.workspace-page:not(.dashboard-page) .toolbar { gap: 12px; margin-bottom: 20px; }
.workspace-page:not(.dashboard-page) .toolbar p,
.workspace-page:not(.dashboard-page) .report-note,
.workspace-page:not(.dashboard-page) .muted { color: var(--dashboard-muted); }
.workspace-page:not(.dashboard-page) input:not([type=checkbox]):not([type=radio]),
.workspace-page:not(.dashboard-page) select,
.workspace-page:not(.dashboard-page) textarea {
    min-height: 42px;
    border: 1px solid #dce7f2;
    border-radius: 11px;
    background: #fbfdff;
    color: #193153;
}
.workspace-page:not(.dashboard-page) input:focus,
.workspace-page:not(.dashboard-page) select:focus,
.workspace-page:not(.dashboard-page) textarea:focus { border-color: #62bdf0; outline: 0; box-shadow: 0 0 0 3px #dff3ff; }
.workspace-page:not(.dashboard-page) label,
.workspace-page:not(.dashboard-page) .form-group label { color: #405774; font-weight: 600; }
.workspace-page:not(.dashboard-page) .content button:not(:where(.popup-close, .chip, .qty-box button, .account-menu-panel button, .admin-menu button)),
.workspace-page:not(.dashboard-page) .content .button,
.workspace-page:not(.dashboard-page) .content .btn,
.workspace-page:not(.dashboard-page) .content .back {
    min-height: 38px;
    border: 1px solid #168ddc;
    border-radius: 11px;
    background: linear-gradient(135deg, #0988e5, #30bce8);
    color: #fff;
    font-weight: 650;
    box-shadow: 0 5px 12px #159ce820;
}
.workspace-page:not(.dashboard-page) .content button:not(:where(.popup-close, .chip, .qty-box button, .account-menu-panel button, .admin-menu button)):hover,
.workspace-page:not(.dashboard-page) .content .button:hover,
.workspace-page:not(.dashboard-page) .content .btn:hover,
.workspace-page:not(.dashboard-page) .content .back:hover { background: #087acb; border-color: #087acb; color: #fff; }
.workspace-page:not(.dashboard-page) .content .button.secondary,
.workspace-page:not(.dashboard-page) .content button.secondary,
.workspace-page:not(.dashboard-page) .content .btn-secondary,
.workspace-page:not(.dashboard-page) .content .back,
.workspace-page:not(.dashboard-page) .content .material-row-action,
.workspace-page:not(.dashboard-page) .content .product-actions .button {
    border-color: #c9e1f3;
    background: #edf7ff;
    color: #256794;
    box-shadow: none;
}
.workspace-page:not(.dashboard-page) .content .button.secondary:hover,
.workspace-page:not(.dashboard-page) .content button.secondary:hover,
.workspace-page:not(.dashboard-page) .content .btn-secondary:hover,
.workspace-page:not(.dashboard-page) .content .back:hover,
.workspace-page:not(.dashboard-page) .content .material-row-action:hover,
.workspace-page:not(.dashboard-page) .content .product-actions .button:hover { border-color: #9ad0f0; background: #dff1fd; color: #135a91; }
.workspace-page:not(.dashboard-page) .content .button.danger,
.workspace-page:not(.dashboard-page) .content .btn-danger { border-color: #f5d5dd; background: #fff0f3; color: #b74b62; box-shadow: none; }
.workspace-page:not(.dashboard-page) .content .button.danger:hover,
.workspace-page:not(.dashboard-page) .content .btn-danger:hover { background: #ffe4eb; color: #a5324d; }
.workspace-page:not(.dashboard-page) .content button:disabled,
.workspace-page:not(.dashboard-page) .content button:disabled:hover {
    border-color: #d3dce7;
    background: #e5ebf2;
    color: #6d7c91;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}
.workspace-page:not(.dashboard-page) .content .chip { min-height: 34px; border: 1px solid #d8e9f5; border-radius: 18px; background: #f3f9fe; color: #386685; box-shadow: none; }
.workspace-page:not(.dashboard-page) .content .chip.active,
.workspace-page:not(.dashboard-page) .content .chip:hover { border-color: #8acef2; background: #e0f3ff; color: #087acb; }
.workspace-page:not(.dashboard-page) .content table { margin-top: 4px; }
.workspace-page:not(.dashboard-page) .content th,
.workspace-page:not(.dashboard-page) .content .sales-table th { padding: 14px; border-bottom: 1px solid #e4edf5; background: #f6fafe; color: #667c98; font-size: 0.8125rem; font-weight: 650; }
.workspace-page:not(.dashboard-page) .content td,
.workspace-page:not(.dashboard-page) .content .sales-table td { padding: 15px 14px; border-bottom: 1px solid #edf2f8; color: #233959; }
.workspace-page:not(.dashboard-page) .content tbody tr:hover { background: #fafdff; }
.workspace-page:not(.dashboard-page) .status,
.workspace-page:not(.dashboard-page) .stock-pill,
.workspace-page:not(.dashboard-page) .report-status { border-radius: 9px; }
.workspace-page:not(.dashboard-page) .pagination { border-top-color: var(--dashboard-line); color: var(--dashboard-muted); }
.workspace-page:not(.dashboard-page) .pagination a { color: #167fc3; }
.workspace-page:not(.dashboard-page) .modal { border-color: var(--dashboard-line); border-radius: 20px; box-shadow: 0 24px 70px #1b3d6630; }
.workspace-page:not(.dashboard-page) .modal-header { border-bottom-color: var(--dashboard-line); }
.workspace-page:not(.dashboard-page) .modal-header h2 { color: #102449; }
.workspace-page:not(.dashboard-page) .modal-actions button:not(.secondary) { border: 1px solid #168ddc; border-radius: 11px; background: linear-gradient(135deg, #0988e5, #30bce8); color: #fff; }
.workspace-page:not(.dashboard-page) .modal-actions button:not(.secondary):hover { background: #087acb; }
.workspace-page:not(.dashboard-page) .modal-actions button.secondary { border: 1px solid #c9e1f3; border-radius: 11px; background: #edf7ff; color: #256794; }
.workspace-page:not(.dashboard-page) .modal-actions button.secondary:hover { background: #dff1fd; color: #135a91; }
.workspace-page:not(.dashboard-page) .image-upload-preview,
.workspace-page:not(.dashboard-page) .product-image-preview { border-color: #dce7f2; border-radius: 11px; background: #f4faff; }
.workspace-page:not(.dashboard-page) .catalog .item { background: #f8fbfe; border-color: #e6eef7; border-radius: 16px; }
.workspace-page:not(.dashboard-page) .catalog .item:hover { border-color: #a8daf6; }
.workspace-page:not(.dashboard-page) .catalog .price { color: #087acb; }
.workspace-page:not(.dashboard-page) .catalog .product-image { border-radius: 11px; background: #e8f4fc; }
.workspace-page:not(.dashboard-page) .pos-layout > .panel:last-child { top: 96px; }
.workspace-page:not(.dashboard-page) .material-page-links a,
.workspace-page:not(.dashboard-page) .material-page-links .current-page { border-radius: 10px; }

@media (max-width: 1100px) {
    .workspace-page:not(.dashboard-page) .stat-grid,
    .workspace-page:not(.dashboard-page) .stats,
    .workspace-page:not(.dashboard-page) .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .workspace-page:not(.dashboard-page) .content .topbar { min-height: 45px; margin-bottom: 20px; }
    .workspace-page:not(.dashboard-page) .topbar .account-menu,
    .workspace-page:not(.dashboard-page) .topbar .admin { position: absolute; top: -66px; right: 0; }
    .workspace-page:not(.dashboard-page) .content .panel,
    .workspace-page:not(.dashboard-page) .content .sales-card { padding: 17px; }
    .workspace-page:not(.dashboard-page) .content .container { padding: 19px; }
    .workspace-page:not(.dashboard-page) .pos-layout > .panel:last-child { top: auto; }
}
@media (max-width: 600px) {
    .workspace-page:not(.dashboard-page) .stat-grid,
    .workspace-page:not(.dashboard-page) .stats,
    .workspace-page:not(.dashboard-page) .report-summary { gap: 10px; }
    .workspace-page:not(.dashboard-page) .stat-grid .stat-card,
    .workspace-page:not(.dashboard-page) .stats .stat-card,
    .workspace-page:not(.dashboard-page) .report-summary .report-metric { min-height: 100px; padding: 15px; }
    .workspace-page:not(.dashboard-page) .content .topbar { gap: 8px; }
    .workspace-page:not(.dashboard-page) .content .toolbar { flex-wrap: wrap; }
}

/* Keep Product Inventory inside the viewport; reflow content instead of panning. */
body.products-page { max-width:100%; overflow-x:clip; overscroll-behavior-x:none; }
.products-page .sidebar { overflow-x:hidden; }
.products-page main.content { min-width:0; }
.products-page .content > .panel,
.products-page .content > .stat-grid,
.products-page .content > .topbar { min-width:0; max-width:100%; }
.products-page .content > .panel { overflow-x:visible; }
.products-page .toolbar { flex-wrap:wrap; }
.products-page .toolbar > *,
.products-page .toolbar .search { min-width:0; max-width:100%; }
.products-page .toolbar input { min-width:0; }
.products-page .products-table { width:100%; min-width:0; max-width:100%; }
.products-page .products-table th,
.products-page .products-table td { min-width:0; overflow-wrap:anywhere; }
.products-page .products-table .stock-pill { max-width:100%; white-space:normal; text-align:center; justify-content:center; }
.products-page .product-actions { min-width:0; }
.products-page .product-actions .button { min-width:0; white-space:normal; overflow-wrap:anywhere; }
.products-page .chip-list,
.products-page .material-page-links { max-width:100%; flex-wrap:wrap; }
@media(min-width:801px) {
    .products-page .products-table { table-layout:fixed; }
    .products-page .products-table th:nth-child(1) { width:43%; }
    .products-page .products-table th:nth-child(2) { width:14%; }
    .products-page .products-table th:nth-child(3) { width:23%; }
    .products-page .products-table th:nth-child(4) { width:20%; }
}
@media(min-width:801px) and (max-width:1100px) {
    .products-page .product-actions { grid-template-columns:1fr; }
}
@media(max-width:800px) {
    .products-page .products-table th,
    .products-page .products-table td { width:auto; }
    .products-page .products-table td:first-child > div { width:100%; }
}

/* Overview totals use simple summary tiles, distinct from the charts below. */
.dashboard-metrics .dashboard-metric {
    --metric-accent: #1689db;
    --metric-tint: #edf7ff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-rows: minmax(36px, auto) auto auto;
    align-content: start;
    column-gap: 8px;
    min-height: 164px;
    padding: 18px;
    border: 1px solid #e0e9f2;
    border-top: 3px solid var(--metric-accent);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--metric-tint), #fff 85%);
    box-shadow: 0 3px 10px #203f6505;
}
.dashboard-metrics .metric-materials { --metric-accent: #8054d9; --metric-tint: #f5f0ff; }
.dashboard-metrics .metric-sales { --metric-accent: #099b84; --metric-tint: #edf9f5; }
.dashboard-metrics .metric-orders { --metric-accent: #d68a16; --metric-tint: #fff8eb; }
.dashboard-metrics .dashboard-metric .metric-icon {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    background: #fff;
    color: var(--metric-accent);
    border: 1px solid #e0e9f2;
    border-radius: 10px;
}
.dashboard-metrics .dashboard-metric .metric-label {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}
.dashboard-metrics .dashboard-metric strong {
    grid-column: 1 / -1;
    margin-top: 16px;
    font-size: clamp(22px, 1.9vw, 32px);
    overflow-wrap: anywhere;
}
.dashboard-metrics .dashboard-metric small { grid-column: 1 / -1; margin-top: 8px; }
.dashboard-metrics a.dashboard-metric:hover { border-color: var(--metric-accent); box-shadow: 0 5px 16px #203f6510; }
.dashboard-metrics a.dashboard-metric:focus-visible { outline: 2px solid var(--metric-accent); outline-offset: 3px; }
