:root {
    --wh-font: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
    --wh-sidebar-width: 276px;
    --wh-sidebar-collapsed: 88px;
    --wh-sidebar-bg: #111827;
    --wh-sidebar-bg-soft: #172033;
    --wh-canvas: #f4f6fb;
    --wh-surface: #ffffff;
    --wh-surface-soft: #f8fafc;
    --wh-border: #e5e9f2;
    --wh-text: #172033;
    --wh-muted: #697386;
    --wh-primary: #5b5ce2;
    --wh-primary-dark: #4949c8;
    --wh-primary-soft: #eeeeff;
    --wh-accent: #0f9f91;
    --wh-danger: #dc4960;
    --wh-shadow-sm: 0 4px 16px rgba(30, 41, 59, .06);
    --wh-shadow-md: 0 14px 38px rgba(30, 41, 59, .09);
    --wh-radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; min-height: 100%; }
html[data-font-size="small"] { font-size: 14px; }
html[data-font-size="normal"] { font-size: 16px; }
html[data-font-size="large"] { font-size: 18px; }

body.app-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--wh-text);
    background:
        radial-gradient(circle at 92% 4%, rgba(91, 92, 226, .08), transparent 26rem),
        var(--wh-canvas);
    font-family: var(--wh-font);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: color .3s ease-out, background-color .3s ease-out;
}

a { color: var(--wh-primary); text-decoration: none; }
a:hover { color: var(--wh-primary-dark); }

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    padding: .7rem 1rem;
    color: #fff;
    background: var(--wh-primary);
    border-radius: 10px;
    transform: translateY(-160%);
    transition: transform .2s ease-out;
}

.skip-link:focus { color: #fff; transform: translateY(0); }

.app-shell { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--wh-sidebar-width);
    color: #d9dfeb;
    background:
        radial-gradient(circle at 20% 0, rgba(99, 102, 241, .22), transparent 18rem),
        linear-gradient(180deg, var(--wh-sidebar-bg-soft), var(--wh-sidebar-bg));
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 12px 0 40px rgba(15, 23, 42, .12);
    transition: width .3s ease-out, transform .3s ease-out;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 82px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    flex: 1;
    color: #fff;
}

.brand-link:hover { color: #fff; }

.brand-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #7778f5, #4f46e5);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 13px;
    box-shadow: 0 8px 22px rgba(79, 70, 229, .35);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.brand-copy,
.profile-copy,
.sidebar-footer .sidebar-menu-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand-copy { overflow: hidden; white-space: nowrap; }
.brand-copy strong { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.brand-copy small { color: #8f9bb0; font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }

.sidebar-collapse-button,
.mobile-menu-button {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 11px;
    transition: background-color .25s ease-out, color .25s ease-out, transform .3s ease-out;
}

.sidebar-collapse-button {
    color: #9aa6ba;
    background: rgba(255, 255, 255, .06);
}

.sidebar-collapse-button:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.sidebar-collapse-button svg,
.mobile-menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-navigation {
    min-height: 0;
    padding: 18px 12px 28px;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
    scrollbar-width: thin;
}

.sidebar-navigation::-webkit-scrollbar { width: 5px; }
.sidebar-navigation::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 10px; }

.sidebar-nav-label {
    margin: 0 12px 10px;
    overflow: hidden;
    color: #727f94;
    font-size: .67rem;
    font-weight: 600;
    letter-spacing: .11em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-group { margin-top: 4px; }

.sidebar-link,
.sidebar-group-toggle {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    align-items: center;
    gap: 12px;
    color: #b9c2d2;
    background: transparent;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    transition: color .25s ease-out, background-color .25s ease-out, transform .25s ease-out;
}

.sidebar-link:hover,
.sidebar-group-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, .30), rgba(99, 102, 241, .12));
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .14);
}

.sidebar-link.active::before {
    position: absolute;
    inset: 11px auto 11px -12px;
    width: 3px;
    content: "";
    background: #818cf8;
    border-radius: 0 4px 4px 0;
}

.sidebar-group-toggle.section-active { color: #eef0ff; }

.sidebar-icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
}

.sidebar-icon svg,
.sidebar-chevron {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-menu-text { overflow: hidden; text-overflow: ellipsis; }

.sidebar-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: #758198;
    transition: transform .25s ease-out;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron { transform: rotate(90deg); }

.sidebar-submenu {
    position: relative;
    display: grid;
    gap: 2px;
    margin: 3px 0 8px 22px;
    padding: 4px 0 4px 23px;
}

.sidebar-submenu::before {
    position: absolute;
    inset: 5px auto 5px 0;
    width: 1px;
    content: "";
    background: rgba(148, 163, 184, .22);
}

.sidebar-sublink {
    position: relative;
    padding: 8px 10px;
    overflow: hidden;
    color: #8f9bb0;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .22s ease-out, background-color .22s ease-out, padding-left .22s ease-out;
}

.sidebar-sublink::before {
    position: absolute;
    top: 50%;
    left: -26px;
    width: 7px;
    height: 7px;
    content: "";
    background: #4a5568;
    border: 2px solid var(--wh-sidebar-bg);
    border-radius: 50%;
    transform: translateY(-50%);
}

.sidebar-sublink:hover { padding-left: 14px; color: #fff; background: rgba(255, 255, 255, .05); }
.sidebar-sublink.active { color: #fff; background: rgba(99, 102, 241, .18); }
.sidebar-sublink.active::before { background: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, .15); }

.sidebar-footer {
    display: flex;
    min-height: 72px;
    margin: 0 12px 14px;
    padding: 12px;
    align-items: center;
    gap: 11px;
    color: #a7b1c2;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 13px;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-footer strong { color: #dce2ed; font-size: .78rem; font-weight: 600; }
.sidebar-footer small { color: #758198; font-size: .68rem; }
.connection-dot { width: 9px; height: 9px; flex: 0 0 9px; background: #2dd4bf; border-radius: 50%; box-shadow: 0 0 0 4px rgba(45, 212, 191, .12); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: none;
    padding: 0;
    background: rgba(15, 23, 42, .52);
    border: 0;
    opacity: 0;
    backdrop-filter: blur(2px);
    transition: opacity .25s ease-out;
}

.app-main {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--wh-sidebar-width);
    flex-direction: column;
    transition: margin-left .3s ease-out;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    min-height: 82px;
    padding: 0 30px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(226, 232, 240, .88);
    backdrop-filter: blur(16px);
    transition: background-color .3s ease-out, border-color .3s ease-out;
}

.topbar-left { display: flex; min-width: 0; align-items: center; gap: 13px; }
.topbar-right {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.topbar-preferences {
    display: flex;
    align-items: center;
    gap: 7px;
}

.topbar-action-button {
    display: grid;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    color: #69778d;
    background: rgba(248, 250, 252, .88);
    border: 1px solid var(--wh-border);
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(30, 41, 59, .035);
    transition: color .3s ease-out, background-color .3s ease-out, border-color .3s ease-out, transform .3s ease-out;
}

.topbar-action-button:hover,
.topbar-action-button[aria-expanded="true"] {
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
    border-color: rgba(91, 92, 226, .28);
    transform: translateY(-1px);
}

.topbar-action-button svg {
    position: absolute;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: opacity .3s ease-out, transform .3s ease-out;
}

.theme-icon-moon {
    opacity: 0;
    transform: scale(.65) rotate(-20deg);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
    transform: scale(.65) rotate(35deg);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.font-size-control { position: relative; }

.font-size-icon {
    position: relative;
    top: -1px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.font-size-icon::after {
    position: absolute;
    right: -5px;
    bottom: -4px;
    content: "±";
    font-size: .46rem;
    font-weight: 700;
}

.font-size-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1080;
    width: 220px;
    padding: .85rem;
    color: var(--wh-text);
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--wh-border);
    border-radius: 13px;
    box-shadow: 0 18px 42px rgba(30, 41, 59, .15);
    backdrop-filter: blur(14px);
}

.font-size-panel[hidden] { display: none; }

.font-size-panel-heading {
    display: flex;
    margin-bottom: .65rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.font-size-panel-heading strong { color: #344054; font-size: .74rem; }
.font-size-panel-heading span { color: var(--wh-muted); font-size: .65rem; }

.font-size-buttons {
    display: grid;
    padding: 3px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    background: #f1f4f8;
    border-radius: 9px;
}

.font-size-buttons button {
    min-height: 34px;
    padding: .3rem;
    color: #536176;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: .68rem;
    font-weight: 700;
    transition: color .2s ease-out, background-color .2s ease-out, box-shadow .2s ease-out;
}

.font-size-buttons button:hover:not(:disabled),
.font-size-buttons button:focus-visible {
    color: var(--wh-primary);
    background: #fff;
    box-shadow: 0 3px 9px rgba(30, 41, 59, .08);
}

.font-size-buttons button:disabled { cursor: not-allowed; opacity: .38; }

.mobile-menu-button {
    display: none;
    color: var(--wh-text);
    background: var(--wh-surface-soft);
    border: 1px solid var(--wh-border);
}

.mobile-menu-button:hover { color: var(--wh-primary); background: var(--wh-primary-soft); }

.topbar-heading { display: flex; min-width: 0; flex-direction: column; }
.topbar-heading span { color: var(--wh-muted); font-size: .72rem; font-weight: 500; }
.topbar-heading strong { overflow: hidden; font-size: 1rem; font-weight: 650; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }

.topbar-profile {
    display: flex;
    min-width: 0;
    padding: 7px 10px 7px 7px;
    align-items: center;
    gap: 10px;
    background: rgba(248, 250, 252, .88);
    border: 1px solid var(--wh-border);
    border-radius: 13px;
    transition: background-color .3s ease-out, border-color .3s ease-out;
}

.profile-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--wh-primary), #7374ed);
    border-radius: 11px;
    font-size: .72rem;
    font-weight: 700;
}

.profile-copy strong { font-size: .76rem; font-weight: 600; }
.profile-copy small { color: var(--wh-muted); font-size: .66rem; }
.topbar-logout-form { margin-left: 2px; }
.topbar-logout-button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #718096;
    background: transparent;
    border: 0;
    border-radius: 9px;
    place-items: center;
}
.topbar-logout-button:hover { color: var(--wh-danger); background: rgba(220, 73, 96, .08); }
.topbar-logout-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-content {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 28px 30px 38px;
    flex: 1;
}

.app-content:focus { outline: 0; }

.app-footer {
    display: flex;
    padding: 16px 30px;
    justify-content: space-between;
    gap: 20px;
    color: #8490a3;
    background: rgba(255, 255, 255, .56);
    border-top: 1px solid var(--wh-border);
    font-size: .72rem;
}

/* Desktop collapsed sidebar */
body.sidebar-collapsed .app-sidebar { width: var(--wh-sidebar-collapsed); }
body.sidebar-collapsed .app-main { margin-left: var(--wh-sidebar-collapsed); }
body.sidebar-collapsed .sidebar-brand { padding-inline: 15px; justify-content: center; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-menu-text,
body.sidebar-collapsed .sidebar-nav-label,
body.sidebar-collapsed .sidebar-chevron,
body.sidebar-collapsed .sidebar-submenu,
body.sidebar-collapsed .sidebar-group > .collapse { display: none !important; }
body.sidebar-collapsed .brand-link { flex: 0 0 auto; }
body.sidebar-collapsed .sidebar-collapse-button { position: absolute; right: -13px; width: 28px; height: 28px; color: #d8deea; background: #273248; border: 2px solid var(--wh-canvas); border-radius: 50%; }
body.sidebar-collapsed .sidebar-collapse-button svg { width: 15px; height: 15px; transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-group-toggle { padding-inline: 0; justify-content: center; }
body.sidebar-collapsed .sidebar-link.active::before { left: -12px; }
body.sidebar-collapsed .sidebar-footer { justify-content: center; }

/* Bootstrap and content surface refinements */
.page-header {
    display: flex;
    margin-bottom: 1.35rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-header h1 { color: #182034; font-weight: 700; letter-spacing: -.035em; }
.page-header p { color: var(--wh-muted) !important; }

.card {
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: var(--wh-radius);
    box-shadow: var(--wh-shadow-sm);
    transition: transform .3s ease-out, color .3s ease-out, background-color .3s ease-out, border-color .3s ease-out;
}

.card-header,
.card-footer { border-color: var(--wh-border); }
.card-header { padding: 1rem 1.15rem; color: #30394c; }
.card-body { padding: 1.2rem; }

.metric-card { position: relative; overflow: hidden; }
.metric-card::after { position: absolute; right: -24px; bottom: -32px; width: 94px; height: 94px; content: ""; background: radial-gradient(circle, rgba(91, 92, 226, .12), transparent 70%); }
.metric-card:hover { transform: translateY(-3px); border-color: rgba(91, 92, 226, .20); }
.metric-card .metric-label { color: var(--wh-muted); font-size: .76rem; font-weight: 500; }
.metric-card .metric-value { margin-top: .22rem; color: #1e293b; font-size: 1.48rem; font-weight: 700; letter-spacing: -.035em; }

/* Dashboard */
.dashboard-page {
    display: grid;
    gap: 1.15rem;
}

.dashboard-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.dashboard-eyebrow,
.dashboard-panel-kicker {
    display: block;
    margin-bottom: .25rem;
    color: var(--wh-primary);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-intro h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    font-weight: 700;
    letter-spacing: -.04em;
}

.dashboard-intro p {
    margin: .35rem 0 0;
    color: var(--wh-muted);
}

.dashboard-intro p strong {
    color: #475569;
    font-weight: 600;
}

.dashboard-quick-actions {
    display: flex;
    flex: 0 0 auto;
    gap: .65rem;
}

.dashboard-period {
    overflow: hidden;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 13px;
    box-shadow: 0 3px 12px rgba(30, 41, 59, .04);
}

.dashboard-period summary {
    display: flex;
    min-height: 58px;
    padding: .75rem 1rem;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    list-style: none;
}

.dashboard-period summary::-webkit-details-marker { display: none; }

.dashboard-period-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
    border-radius: 9px;
}

.dashboard-period-icon svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.dashboard-period summary > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-period summary strong {
    color: #30394c;
    font-size: .82rem;
}

.dashboard-period summary small {
    color: var(--wh-muted);
    font-size: .7rem;
}

.dashboard-period-action {
    margin-left: auto;
    color: var(--wh-primary);
    font-size: .76rem;
    font-weight: 600;
}

.dashboard-period-action::after {
    display: inline-block;
    margin-left: .45rem;
    content: "⌄";
    transition: transform .3s ease-out;
}

.dashboard-period[open] .dashboard-period-action::after { transform: rotate(180deg); }

.dashboard-period-form {
    display: flex;
    padding: .9rem 1rem 1rem;
    align-items: flex-end;
    gap: .75rem;
    background: #f8fafc;
    border-top: 1px solid var(--wh-border);
}

.dashboard-period-form > div { flex: 0 1 210px; }
.dashboard-period-form .form-label { margin-bottom: .3rem; font-size: .72rem; }

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.08fr) minmax(250px, .84fr);
    gap: 1rem;
}

.dashboard-summary-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 1.25rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .94);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(30, 41, 59, .065);
    transition: transform .3s ease-out, border-color .3s ease-out;
}

.dashboard-summary-card::after {
    position: absolute;
    right: -36px;
    bottom: -48px;
    width: 150px;
    height: 150px;
    content: "";
    background: radial-gradient(circle, rgba(91, 92, 226, .09), transparent 68%);
    pointer-events: none;
}

.dashboard-summary-card:hover {
    border-color: rgba(91, 92, 226, .22);
    transform: translateY(-2px);
}

.dashboard-summary-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
}

.dashboard-summary-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
    border-radius: 9px;
}

.dashboard-summary-icon svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.dashboard-primary-metric {
    display: flex;
    min-height: 92px;
    padding: 1rem 0 .85rem;
    flex-wrap: wrap;
    align-content: center;
    align-items: baseline;
    gap: 0 .45rem;
}

.dashboard-primary-metric > span {
    flex-basis: 100%;
    margin-bottom: .1rem;
    color: var(--wh-muted);
    font-size: .72rem;
}

.dashboard-primary-metric strong {
    color: #172033;
    font-size: clamp(1.65rem, 2.45vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.055em;
    line-height: 1.15;
}

.dashboard-primary-metric small {
    color: var(--wh-muted);
    font-size: .72rem;
}

.dashboard-metric-list {
    display: grid;
    position: relative;
    z-index: 1;
    padding-top: .85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    border-top: 1px solid var(--wh-border);
}

.dashboard-metric-list > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .12rem;
}

.dashboard-metric-list span,
.dashboard-movement-pair span,
.dashboard-net-movement span {
    color: var(--wh-muted);
    font-size: .68rem;
}

.dashboard-metric-list strong,
.dashboard-net-movement strong {
    color: #334155;
    font-size: .87rem;
    font-weight: 700;
}

.dashboard-metric-list .is-positive strong { color: #087f73; }
.dashboard-metric-list .is-warning strong { color: #b77900; }

.dashboard-summary-sales .dashboard-summary-icon {
    color: #087f73;
    background: #e8f8f5;
}

.dashboard-summary-movement .dashboard-summary-icon {
    color: #b77900;
    background: #fff7df;
}

.dashboard-movement-pair {
    display: grid;
    min-height: 92px;
    padding: 1rem 0 .85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.dashboard-movement-pair > div {
    display: flex;
    padding: .75rem;
    flex-direction: column;
    justify-content: center;
    background: #f8fafc;
    border-radius: 12px;
}

.dashboard-movement-pair strong {
    margin-top: .1rem;
    color: #172033;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.045em;
}

.dashboard-movement-pair .movement-import strong { color: #087f73; }
.dashboard-movement-pair .movement-export strong { color: #d43f58; }

.dashboard-net-movement {
    display: flex;
    position: relative;
    z-index: 1;
    padding-top: .85rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-top: 1px solid var(--wh-border);
}

.dashboard-net-movement .is-negative { color: var(--wh-danger); }

.dashboard-attention {
    display: flex;
    padding: .9rem 1rem;
    align-items: center;
    gap: .85rem;
    color: #6b4d00;
    background: linear-gradient(90deg, #fff9e8, rgba(255, 255, 255, .94));
    border: 1px solid #f1d995;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(180, 127, 0, .06);
    transition: transform .3s ease-out, border-color .3s ease-out;
}

.dashboard-attention:hover {
    color: #5c4200;
    border-color: #dfbd5d;
    transform: translateY(-1px);
}

.dashboard-attention-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #b77900;
    background: #fff0bf;
    border-radius: 10px;
}

.dashboard-attention-icon svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.dashboard-attention-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-attention-copy strong { color: #6b4d00; font-size: .82rem; }
.dashboard-attention-copy small { color: #8a6b20; font-size: .7rem; }

.dashboard-attention-link {
    margin-left: auto;
    white-space: nowrap;
    color: #9b7000;
    font-size: .75rem;
    font-weight: 700;
}

.dashboard-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.dashboard-panel {
    min-width: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .94);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(30, 41, 59, .06);
}

.dashboard-panel-header {
    display: flex;
    min-height: 76px;
    padding: 1rem 1.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--wh-border);
}

.dashboard-panel-header h2 {
    margin: 0;
    color: #253047;
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-panel-header a { font-size: .72rem; font-weight: 600; }
.dashboard-panel-kicker { margin-bottom: .12rem; font-size: .62rem; }

.dashboard-table { font-size: .76rem; }
.dashboard-table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; }
.dashboard-table thead th { white-space: nowrap; color: #64748b; font-size: .65rem; letter-spacing: .025em; }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }

.dashboard-rank-column { width: 46px; text-align: center; }

.dashboard-rank {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    color: #5b5ce2;
    background: #eeeeff;
    border-radius: 8px;
    font-size: .66rem;
    font-weight: 700;
}

.dashboard-product {
    display: flex;
    min-width: 140px;
    flex-direction: column;
}

.dashboard-product strong { color: #253047; font-size: .76rem; }
.dashboard-product small { color: #8791a3; font-size: .65rem; }
.dashboard-document-number { color: #303c56; font-weight: 600; white-space: nowrap; }

.dashboard-document-type,
.dashboard-status {
    display: inline-flex;
    padding: .28rem .55rem;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 600;
}

.document-type-in { color: #087f73; background: #e8f8f5; }
.document-type-out { color: #b3344b; background: #fff0f3; }
.document-type-transfer { color: #4e4fc4; background: #eeeeff; }
.document-type-adjust { color: #946c00; background: #fff7df; }
.dashboard-status-completed { color: #087f73; background: #e8f8f5; }
.dashboard-status-cancelled { color: #b3344b; background: #fff0f3; }
.dashboard-status-draft { color: #58657b; background: #eef1f6; }
.dashboard-document-date { white-space: nowrap; color: #5c687c; }

.dashboard-empty {
    display: flex;
    min-height: 145px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .2rem;
    color: var(--wh-muted);
    text-align: center;
}

.dashboard-empty strong { color: #475569; font-size: .8rem; }
.dashboard-empty span { font-size: .68rem; }

/* Product guide */
.guide-page {
    display: grid;
    gap: 1.25rem;
}

.guide-hero {
    display: grid;
    position: relative;
    min-height: 310px;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 2rem;
    color: #fff;
    background:
        radial-gradient(circle at 82% 15%, rgba(129, 140, 248, .42), transparent 17rem),
        linear-gradient(135deg, #242c4d, #36388f 62%, #4f46e5);
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(44, 51, 105, .2);
}

.guide-hero::after {
    position: absolute;
    right: -85px;
    bottom: -145px;
    width: 360px;
    height: 360px;
    content: "";
    border: 55px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
    pointer-events: none;
}

.guide-hero-copy,
.guide-hero-summary {
    position: relative;
    z-index: 1;
}

.guide-eyebrow {
    display: block;
    margin-bottom: .55rem;
    color: #c7d2fe;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.guide-hero h1 {
    max-width: 740px;
    margin: 0;
    color: #fff;
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1.15;
}

.guide-hero p {
    max-width: 720px;
    margin: 1rem 0 0;
    color: #dce3ff;
}

.guide-hero-actions {
    display: flex;
    margin-top: 1.35rem;
    flex-wrap: wrap;
    gap: .7rem;
}

.guide-hero .btn-primary {
    color: #35369d;
    background: #fff;
    border-color: #fff;
}

.guide-hero .btn-primary:hover {
    color: #24257c;
    background: #eef0ff;
}

.guide-hero .btn-outline-primary {
    color: #fff;
    border-color: rgba(255, 255, 255, .46);
}

.guide-hero .btn-outline-primary:hover {
    color: #303195;
    background: #fff;
}

.guide-hero-summary {
    display: grid;
    padding: 1rem;
    gap: .55rem;
    background: rgba(19, 26, 59, .3);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 17px;
    backdrop-filter: blur(10px);
}

.guide-hero-summary div {
    display: flex;
    padding: .65rem .7rem;
    align-items: center;
    gap: .75rem;
    border-radius: 11px;
}

.guide-hero-summary div + div { border-top: 1px solid rgba(255, 255, 255, .1); }

.guide-hero-summary span {
    display: grid;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    place-items: center;
    color: #312e81;
    background: #fff;
    border-radius: 9px;
    font-size: .65rem;
    font-weight: 700;
}

.guide-hero-summary strong { font-size: .78rem; font-weight: 600; }

.guide-layout {
    display: grid;
    align-items: start;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
}

.guide-toc {
    position: sticky;
    top: 98px;
    padding: 1rem;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--wh-border);
    border-radius: 16px;
    box-shadow: var(--wh-shadow-sm);
}

.guide-toc > strong {
    display: block;
    padding: 0 .55rem .65rem;
    color: #30394c;
    font-size: .78rem;
}

.guide-toc nav {
    display: grid;
    gap: .15rem;
}

.guide-toc a {
    padding: .48rem .55rem;
    color: #667085;
    border-radius: 8px;
    font-size: .7rem;
    transition: color .2s ease-out, background .2s ease-out;
}

.guide-toc a:hover {
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
}

.guide-content {
    display: grid;
    min-width: 0;
    gap: 1.1rem;
}

.guide-section {
    scroll-margin-top: 96px;
    padding: clamp(1.15rem, 2.4vw, 1.75rem);
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--wh-border);
    border-radius: 18px;
    box-shadow: var(--wh-shadow-sm);
}

.guide-section-heading {
    display: flex;
    margin-bottom: 1.2rem;
    align-items: flex-start;
    gap: .85rem;
}

.guide-section-heading > span {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
    border-radius: 10px;
    font-size: .68rem;
    font-weight: 700;
}

.guide-section-heading h2 {
    margin: 0;
    color: #253047;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -.025em;
}

.guide-section-heading p {
    margin: .2rem 0 0;
    color: var(--wh-muted);
    font-size: .76rem;
}

.guide-feature-grid,
.guide-role-grid,
.guide-report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.guide-feature-grid article,
.guide-role-grid article,
.guide-report-grid article {
    min-width: 0;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 13px;
}

.guide-feature-icon {
    display: grid;
    width: 34px;
    height: 34px;
    margin-bottom: .7rem;
    place-items: center;
    color: var(--wh-primary);
    background: var(--wh-primary-soft);
    border-radius: 9px;
    font-size: .65rem;
    font-weight: 700;
}

.guide-feature-grid h3,
.guide-role-grid h3,
.guide-report-grid h3,
.guide-steps h3 {
    margin: 0;
    color: #344054;
    font-size: .82rem;
    font-weight: 700;
}

.guide-feature-grid p,
.guide-role-grid li,
.guide-report-grid p,
.guide-steps p {
    color: #697386;
    font-size: .7rem;
    line-height: 1.6;
}

.guide-feature-grid p,
.guide-report-grid p { margin: .35rem 0 .65rem; }
.guide-feature-grid a { font-size: .68rem; font-weight: 600; }
.guide-role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-role-grid article > span {
    display: inline-flex;
    padding: .25rem .5rem;
    margin-bottom: .65rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
}

.guide-role-grid ul {
    padding-left: 1rem;
    margin: .65rem 0 0;
}

.guide-role-admin > span { color: #4e4fc4; background: #eeeeff; }
.guide-role-manager > span { color: #087f73; background: #e8f8f5; }
.guide-role-sale > span { color: #946c00; background: #fff7df; }

.guide-inline-action {
    display: flex;
    padding: .85rem 1rem;
    margin-top: .85rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f6f5ff;
    border: 1px solid #e4e2ff;
    border-radius: 12px;
}

.guide-inline-action > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.guide-inline-action strong { color: #35365f; font-size: .75rem; }
.guide-inline-action span { color: #73768a; font-size: .68rem; }

.guide-steps {
    display: grid;
    padding: 0;
    margin: 0;
    gap: .75rem;
    list-style: none;
}

.guide-steps li {
    display: grid;
    padding: .9rem;
    align-items: start;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: .8rem;
    background: #fafbfc;
    border: 1px solid #edf0f5;
    border-radius: 12px;
}

.guide-steps li > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: var(--wh-primary);
    border-radius: 9px;
    font-size: .7rem;
    font-weight: 700;
}

.guide-steps p { margin: .2rem 0; }
.guide-steps a { font-size: .67rem; font-weight: 600; }

.guide-decision-table {
    overflow: hidden;
    border: 1px solid var(--wh-border);
    border-radius: 13px;
}

.guide-decision-table .table { font-size: .72rem; }
.guide-decision-table .table > :not(caption) > * > * { padding: .78rem .85rem; vertical-align: middle; }
.guide-decision-table tbody td:first-child { color: #344054; }
.guide-decision-table tbody td:nth-child(2) { white-space: nowrap; color: var(--wh-primary); }
.guide-decision-table tbody td:last-child { color: #697386; }

.guide-workflow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
    gap: 1rem;
}

.guide-workflow ol {
    padding-left: 1.3rem;
    margin: 0;
}

.guide-workflow ol li {
    padding: .22rem 0 .55rem .25rem;
    color: #596579;
    font-size: .74rem;
    line-height: 1.65;
}

.guide-workflow ol li::marker { color: var(--wh-primary); font-weight: 700; }

.guide-result {
    display: flex;
    padding: 1rem;
    align-self: start;
    flex-direction: column;
    gap: .45rem;
    color: #49615d;
    background: #effaf8;
    border: 1px solid #cfede7;
    border-radius: 13px;
}

.guide-result strong { color: #087f73; font-size: .75rem; }
.guide-result span { font-size: .69rem; line-height: 1.55; }

.guide-open-link {
    display: inline-flex;
    margin-top: .85rem;
    font-size: .7rem;
    font-weight: 700;
}

.guide-note {
    padding: .8rem .9rem;
    margin-top: .85rem;
    color: #6f5613;
    background: #fff9e8;
    border: 1px solid #f1d995;
    border-radius: 11px;
    font-size: .7rem;
    line-height: 1.6;
}

.guide-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-report-grid p { margin-bottom: 0; }

.guide-link-row {
    display: flex;
    margin-top: .85rem;
    flex-wrap: wrap;
    gap: .55rem;
}

.guide-link-row a {
    padding: .45rem .65rem;
    color: #4e4fc4;
    background: #f2f1ff;
    border-radius: 8px;
    font-size: .67rem;
    font-weight: 600;
}

.guide-rules {
    display: grid;
    gap: .65rem;
}

.guide-rules > div {
    display: grid;
    padding: .8rem .9rem;
    grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
    gap: .85rem;
    background: #fafbfc;
    border-left: 3px solid #a5b4fc;
    border-radius: 0 10px 10px 0;
}

.guide-rules strong { color: #344054; font-size: .72rem; }
.guide-rules span { color: #697386; font-size: .69rem; }

.guide-finish {
    display: flex;
    padding: 1.25rem 1.4rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #202946, #4243a5);
    border-radius: 17px;
    box-shadow: 0 12px 28px rgba(42, 47, 102, .16);
}

.guide-finish span { color: #c7d2fe; font-size: .67rem; }
.guide-finish h2 { margin: .2rem 0 0; color: #fff; font-size: 1rem; }

.filter-bar {
    padding: 1.05rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: var(--wh-radius);
    box-shadow: var(--wh-shadow-sm);
}

.form-label { margin-bottom: .42rem; color: #4b5567; font-size: .76rem; font-weight: 600; }
.form-control,
.form-select {
    min-height: 42px;
    color: var(--wh-text);
    background-color: #fff;
    border-color: #dfe4ed;
    border-radius: 10px;
    font-size: .82rem;
}

.form-control::placeholder { color: #9aa4b4; }
.form-control:focus,
.form-select:focus {
    border-color: rgba(91, 92, 226, .58);
    box-shadow: 0 0 0 .22rem rgba(91, 92, 226, .11);
}

.form-check-input:checked { background-color: var(--wh-primary); border-color: var(--wh-primary); }
.input-validation-error { border-color: rgba(220, 73, 96, .72); }

.btn {
    min-height: 40px;
    padding: .55rem .95rem;
    border-radius: 10px;
    font-size: .79rem;
    font-weight: 600;
    transition: transform .2s ease-out, box-shadow .2s ease-out, background-color .2s ease-out, border-color .2s ease-out;
}

.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 32px; padding: .34rem .66rem; border-radius: 8px; font-size: .72rem; }
.btn-primary { --bs-btn-bg: var(--wh-primary); --bs-btn-border-color: var(--wh-primary); --bs-btn-hover-bg: var(--wh-primary-dark); --bs-btn-hover-border-color: var(--wh-primary-dark); --bs-btn-active-bg: var(--wh-primary-dark); --bs-btn-active-border-color: var(--wh-primary-dark); box-shadow: 0 6px 16px rgba(91, 92, 226, .18); }
.btn-outline-primary { --bs-btn-color: var(--wh-primary); --bs-btn-border-color: rgba(91, 92, 226, .38); --bs-btn-hover-bg: var(--wh-primary); --bs-btn-hover-border-color: var(--wh-primary); }
.btn-light { --bs-btn-bg: #f6f7fa; --bs-btn-border-color: #e7eaf0; --bs-btn-hover-bg: #eceff4; --bs-btn-hover-border-color: #dde2ea; }

.table-responsive { scrollbar-color: #c9cfda transparent; scrollbar-width: thin; }
.table { margin-bottom: 0; color: #344054; font-size: .79rem; }
.table > :not(caption) > * > * { padding: .82rem .9rem; vertical-align: middle; border-bottom-color: #edf0f5; }
.table thead th { color: #596579; background: #f7f8fb; border-bottom: 1px solid var(--wh-border); font-size: .7rem; font-weight: 650; letter-spacing: .015em; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fafaff; }
.table tbody tr:last-child td { border-bottom: 0; }
.money, .quantity { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { padding: .43em .68em; border-radius: 7px; font-size: .66rem; font-weight: 600; }
.bg-success { background-color: #159b7f !important; }
.bg-danger { background-color: var(--wh-danger) !important; }
.bg-secondary { background-color: #7a8598 !important; }
.text-success { color: #0b8d73 !important; }
.text-danger { color: #d43f57 !important; }
.text-warning { color: #c17b0d !important; }

.alert { border: 0; border-radius: 12px; box-shadow: var(--wh-shadow-sm); }
.pagination { gap: 4px; }
.page-link { display: grid; min-width: 34px; min-height: 34px; padding: .35rem .55rem; place-items: center; color: var(--wh-muted); border: 1px solid var(--wh-border); border-radius: 9px !important; font-size: .74rem; }
.page-link:hover { color: var(--wh-primary); background: var(--wh-primary-soft); border-color: rgba(91, 92, 226, .25); }
.active > .page-link { color: #fff; background: var(--wh-primary); border-color: var(--wh-primary); }

.status-draft { background: #7a8598; }
.status-completed { background: #159b7f; }
.status-cancelled { background: var(--wh-danger); }
.document-total { font-size: 1.05rem; font-weight: 700; }
.print-sheet { max-width: 900px; margin: auto; background: #fff; }

.role-help-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
.role-help-grid > div {
    display: flex;
    min-height: 78px;
    padding: .85rem;
    flex-direction: column;
    gap: .25rem;
    background: #f8f9fc;
    border: 1px solid var(--wh-border);
    border-radius: 11px;
}
.role-help-grid strong { color: #30394c; font-size: .78rem; }
.role-help-grid span { color: var(--wh-muted); font-size: .72rem; line-height: 1.55; }

.auth-body {
    min-height: 100vh;
    color: var(--wh-text);
    background:
        radial-gradient(circle at 12% 15%, rgba(91, 92, 226, .18), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(18, 183, 166, .13), transparent 26%),
        #f3f5fa;
}
.auth-shell {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}
.auth-card {
    width: min(100%, 430px);
    padding: 2rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(27, 38, 63, .13);
}
.auth-brand {
    display: flex;
    margin-bottom: 2rem;
    align-items: center;
    gap: .8rem;
}
.auth-brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    color: #fff;
    background: linear-gradient(145deg, var(--wh-primary), #7778f0);
    border-radius: 14px;
    font-size: .86rem;
    font-weight: 700;
    place-items: center;
    box-shadow: 0 10px 24px rgba(91, 92, 226, .26);
}
.auth-brand > div { display: flex; flex-direction: column; }
.auth-brand strong { color: #20283a; font-size: 1.02rem; letter-spacing: -.025em; }
.auth-brand small { color: var(--wh-muted); font-size: .68rem; }
.auth-heading { margin-bottom: 1.4rem; }
.auth-heading h1 { margin-bottom: .45rem; color: #182034; font-size: 1.55rem; font-weight: 700; letter-spacing: -.04em; }
.auth-heading p { margin: 0; color: var(--wh-muted); font-size: .8rem; line-height: 1.6; }
.auth-form { display: grid; gap: 1rem; }
.auth-security-note { margin: 1.3rem 0 0; color: #8a94a6; font-size: .68rem; line-height: 1.5; text-align: center; }
.auth-denied-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 1.25rem;
    color: #fff;
    background: var(--wh-danger);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    place-items: center;
    box-shadow: 0 12px 28px rgba(220, 73, 96, .22);
}

/* Readable typography scale
   Normal mode uses a 16px root. Primary working content stays at 1rem,
   while supporting labels stay at .875rem so the hierarchy remains clear. */
body.app-body,
body.auth-body {
    font-size: 1rem;
}

.sidebar-link,
.sidebar-group-toggle,
.form-control,
.form-select,
.btn,
.table,
.dashboard-table,
.guide-decision-table .table,
.auth-heading p {
    font-size: 1rem;
}

.profile-copy strong,
.dashboard-period summary strong,
.dashboard-summary-header,
.dashboard-metric-list strong,
.dashboard-net-movement strong,
.dashboard-attention-copy strong,
.dashboard-product strong,
.dashboard-empty strong,
.guide-hero-summary strong,
.guide-toc > strong,
.guide-feature-grid h3,
.guide-role-grid h3,
.guide-report-grid h3,
.guide-steps h3,
.guide-inline-action strong,
.guide-result strong,
.guide-rules strong,
.role-help-grid strong {
    font-size: 1rem;
}

.brand-copy small,
.sidebar-nav-label,
.sidebar-sublink,
.sidebar-footer strong,
.sidebar-footer small,
.font-size-panel-heading strong,
.font-size-panel-heading span,
.font-size-buttons button,
.topbar-heading span,
.profile-copy small,
.app-footer,
.metric-card .metric-label,
.dashboard-eyebrow,
.dashboard-panel-kicker,
.dashboard-period summary small,
.dashboard-period-action,
.dashboard-period-form .form-label,
.dashboard-primary-metric > span,
.dashboard-primary-metric small,
.dashboard-metric-list span,
.dashboard-movement-pair span,
.dashboard-net-movement span,
.dashboard-attention-copy small,
.dashboard-attention-link,
.dashboard-panel-header a,
.dashboard-table thead th,
.dashboard-rank,
.dashboard-product small,
.dashboard-document-type,
.dashboard-status,
.dashboard-empty span,
.guide-eyebrow,
.guide-hero-summary span,
.guide-toc a,
.guide-section-heading > span,
.guide-section-heading p,
.guide-feature-icon,
.guide-feature-grid p,
.guide-role-grid li,
.guide-report-grid p,
.guide-steps p,
.guide-feature-grid a,
.guide-role-grid article > span,
.guide-inline-action span,
.guide-steps li > span,
.guide-steps a,
.guide-workflow ol li,
.guide-result span,
.guide-open-link,
.guide-note,
.guide-link-row a,
.guide-rules span,
.guide-finish span,
.form-label,
.btn-sm,
.table thead th,
.badge,
.page-link,
.role-help-grid span,
.auth-brand small,
.auth-security-note {
    font-size: .875rem;
}

/* Dark theme */
html[data-theme="dark"] {
    color-scheme: dark;
    --wh-sidebar-bg: #080d16;
    --wh-sidebar-bg-soft: #111a2b;
    --wh-canvas: #0b1220;
    --wh-surface: #121c2c;
    --wh-surface-soft: #182335;
    --wh-border: #29374b;
    --wh-text: #e6edf7;
    --wh-muted: #9ba8bb;
    --wh-primary: #8587ff;
    --wh-primary-dark: #a1a3ff;
    --wh-primary-soft: rgba(133, 135, 255, .14);
    --wh-accent: #36c6b3;
    --wh-danger: #f1667c;
    --wh-shadow-sm: 0 5px 18px rgba(0, 0, 0, .22);
    --wh-shadow-md: 0 16px 42px rgba(0, 0, 0, .3);
    --bs-body-color: var(--wh-text);
    --bs-body-bg: var(--wh-canvas);
    --bs-border-color: var(--wh-border);
}

html[data-theme="dark"] body.app-body {
    color: var(--wh-text);
    background:
        radial-gradient(circle at 90% 4%, rgba(91, 92, 226, .14), transparent 28rem),
        radial-gradient(circle at 40% 95%, rgba(15, 159, 145, .07), transparent 24rem),
        var(--wh-canvas);
}

html[data-theme="dark"] .app-sidebar {
    background:
        radial-gradient(circle at 20% 0, rgba(99, 102, 241, .2), transparent 18rem),
        linear-gradient(180deg, var(--wh-sidebar-bg-soft), var(--wh-sidebar-bg));
    box-shadow: 12px 0 40px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .app-topbar {
    background: rgba(11, 18, 32, .86);
    border-bottom-color: rgba(41, 55, 75, .92);
}

html[data-theme="dark"] .topbar-profile,
html[data-theme="dark"] .topbar-action-button {
    color: #a8b5c7;
    background: rgba(24, 35, 53, .9);
    border-color: var(--wh-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

html[data-theme="dark"] .topbar-action-button:hover,
html[data-theme="dark"] .topbar-action-button[aria-expanded="true"] {
    color: #b9baff;
    background: rgba(133, 135, 255, .14);
    border-color: rgba(133, 135, 255, .34);
}

html[data-theme="dark"] .font-size-panel {
    color: var(--wh-text);
    background: rgba(18, 28, 44, .98);
    border-color: var(--wh-border);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .36);
}

html[data-theme="dark"] .font-size-panel-heading strong { color: #e2e8f0; }
html[data-theme="dark"] .font-size-buttons { background: #0d1625; }
html[data-theme="dark"] .font-size-buttons button { color: #aeb9c9; }
html[data-theme="dark"] .font-size-buttons button:hover:not(:disabled),
html[data-theme="dark"] .font-size-buttons button:focus-visible {
    color: #b9baff;
    background: #202c40;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .app-footer {
    color: #7f8ca0;
    background: rgba(11, 18, 32, .66);
}

html[data-theme="dark"] body.sidebar-collapsed .sidebar-collapse-button {
    background: #202c40;
    border-color: var(--wh-canvas);
}

html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .dashboard-intro h1,
html[data-theme="dark"] .dashboard-primary-metric strong,
html[data-theme="dark"] .dashboard-movement-pair strong,
html[data-theme="dark"] .dashboard-panel-header h2,
html[data-theme="dark"] .dashboard-product strong,
html[data-theme="dark"] .dashboard-empty strong,
html[data-theme="dark"] .guide-section-heading h2,
html[data-theme="dark"] .guide-feature-grid h3,
html[data-theme="dark"] .guide-role-grid h3,
html[data-theme="dark"] .guide-report-grid h3,
html[data-theme="dark"] .guide-steps h3,
html[data-theme="dark"] .guide-rules strong,
html[data-theme="dark"] .role-help-grid strong,
html[data-theme="dark"] .auth-brand strong,
html[data-theme="dark"] .auth-heading h1 {
    color: #e7edf7;
}

html[data-theme="dark"] .dashboard-intro p strong,
html[data-theme="dark"] .dashboard-summary-header,
html[data-theme="dark"] .dashboard-metric-list strong,
html[data-theme="dark"] .dashboard-net-movement strong,
html[data-theme="dark"] .dashboard-document-number,
html[data-theme="dark"] .guide-toc > strong,
html[data-theme="dark"] .guide-decision-table tbody td:first-child,
html[data-theme="dark"] .guide-inline-action strong {
    color: #cbd5e1;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .dashboard-period,
html[data-theme="dark"] .dashboard-summary-card,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .guide-toc,
html[data-theme="dark"] .guide-section,
html[data-theme="dark"] .auth-card {
    background: rgba(18, 28, 44, .96);
    border-color: var(--wh-border);
    box-shadow: var(--wh-shadow-sm);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
    color: var(--wh-text) !important;
    background-color: var(--wh-surface) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
    color: #cbd5e1;
    border-color: var(--wh-border);
}

html[data-theme="dark"] .text-muted {
    color: var(--wh-muted) !important;
}

html[data-theme="dark"] .form-label { color: #bdc7d5; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    color: var(--wh-text);
    background-color: #0f1928;
    border-color: #344359;
}

html[data-theme="dark"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aab6c7' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled {
    color: #77859a;
    background-color: #111a28;
}

html[data-theme="dark"] .form-control::placeholder { color: #6f7d91; }

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    color: #fff;
    background-color: #121e2f;
    border-color: rgba(133, 135, 255, .68);
    box-shadow: 0 0 0 .22rem rgba(133, 135, 255, .13);
}

html[data-theme="dark"] .form-text { color: #8492a6; }

html[data-theme="dark"] .btn-light {
    --bs-btn-color: #d7deea;
    --bs-btn-bg: #1a2638;
    --bs-btn-border-color: #314057;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #233149;
    --bs-btn-hover-border-color: #3b4a62;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #293750;
    --bs-btn-active-border-color: #43526a;
}

html[data-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #b4bfce;
    --bs-btn-border-color: #46556c;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #344359;
    --bs-btn-hover-border-color: #526078;
}

html[data-theme="dark"] .table {
    --bs-table-color: #d9e1ec;
    --bs-table-bg: transparent;
    --bs-table-border-color: #29374b;
    --bs-table-striped-color: #d9e1ec;
    --bs-table-striped-bg: rgba(255, 255, 255, .018);
    --bs-table-hover-color: #f3f6fb;
    --bs-table-hover-bg: rgba(133, 135, 255, .07);
    color: #d9e1ec;
}

html[data-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: #29374b; }

html[data-theme="dark"] .table thead th {
    color: #aeb9c9;
    background: #162132;
    border-bottom-color: var(--wh-border);
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(133, 135, 255, .07);
}

html[data-theme="dark"] .table-light {
    --bs-table-color: #dce4ee;
    --bs-table-bg: #172234;
    --bs-table-border-color: #2d3a4f;
}

html[data-theme="dark"] .page-link {
    color: #aab6c7;
    background: #141f30;
    border-color: var(--wh-border);
}

html[data-theme="dark"] .page-link:hover {
    color: #c7c8ff;
    background: rgba(133, 135, 255, .13);
    border-color: rgba(133, 135, 255, .34);
}

html[data-theme="dark"] .alert-success {
    color: #a7eadf;
    background: #12332f;
}

html[data-theme="dark"] .alert-danger {
    color: #ffc0ca;
    background: #3a1a24;
}

html[data-theme="dark"] .dashboard-period-form,
html[data-theme="dark"] .dashboard-movement-pair > div,
html[data-theme="dark"] .guide-feature-grid article,
html[data-theme="dark"] .guide-role-grid article,
html[data-theme="dark"] .guide-report-grid article,
html[data-theme="dark"] .guide-steps li,
html[data-theme="dark"] .guide-rules > div,
html[data-theme="dark"] .role-help-grid > div {
    background: #111c2b;
    border-color: #263449;
}

html[data-theme="dark"] .dashboard-period summary strong { color: #d8e0eb; }
html[data-theme="dark"] .dashboard-summary-card::after { background: radial-gradient(circle, rgba(133, 135, 255, .11), transparent 68%); }

html[data-theme="dark"] .dashboard-summary-icon,
html[data-theme="dark"] .dashboard-period-icon {
    color: #a5a7ff;
    background: rgba(133, 135, 255, .14);
}

html[data-theme="dark"] .dashboard-summary-sales .dashboard-summary-icon {
    color: #62d8c8;
    background: rgba(54, 198, 179, .12);
}

html[data-theme="dark"] .dashboard-summary-movement .dashboard-summary-icon {
    color: #f5c65d;
    background: rgba(245, 198, 93, .12);
}

html[data-theme="dark"] .dashboard-attention {
    color: #f0d38c;
    background: linear-gradient(90deg, rgba(90, 64, 9, .4), rgba(18, 28, 44, .96));
    border-color: #685523;
}

html[data-theme="dark"] .dashboard-attention:hover {
    color: #ffe2a0;
    border-color: #8b7333;
}

html[data-theme="dark"] .dashboard-attention-copy strong { color: #f6d77f; }
html[data-theme="dark"] .dashboard-attention-copy small { color: #c8ad6c; }
html[data-theme="dark"] .dashboard-attention-link { color: #e8c76e; }
html[data-theme="dark"] .dashboard-attention-icon { color: #f4c95f; background: rgba(244, 201, 95, .13); }
html[data-theme="dark"] .dashboard-table thead th { color: #9facbd; }
html[data-theme="dark"] .dashboard-product small,
html[data-theme="dark"] .dashboard-document-date { color: #8f9db0; }

html[data-theme="dark"] .document-type-in,
html[data-theme="dark"] .dashboard-status-completed,
html[data-theme="dark"] .guide-role-manager > span {
    color: #72dfcf;
    background: rgba(54, 198, 179, .13);
}

html[data-theme="dark"] .document-type-out,
html[data-theme="dark"] .dashboard-status-cancelled {
    color: #ff9aab;
    background: rgba(241, 102, 124, .13);
}

html[data-theme="dark"] .document-type-transfer,
html[data-theme="dark"] .guide-role-admin > span {
    color: #b4b5ff;
    background: rgba(133, 135, 255, .14);
}

html[data-theme="dark"] .document-type-adjust,
html[data-theme="dark"] .guide-role-sale > span {
    color: #f2cb72;
    background: rgba(242, 203, 114, .13);
}

html[data-theme="dark"] .dashboard-status-draft {
    color: #b6c0cf;
    background: rgba(155, 168, 187, .12);
}

html[data-theme="dark"] .guide-inline-action {
    background: rgba(133, 135, 255, .08);
    border-color: rgba(133, 135, 255, .23);
}

html[data-theme="dark"] .guide-inline-action span,
html[data-theme="dark"] .guide-feature-grid p,
html[data-theme="dark"] .guide-role-grid li,
html[data-theme="dark"] .guide-report-grid p,
html[data-theme="dark"] .guide-steps p,
html[data-theme="dark"] .guide-decision-table tbody td:last-child,
html[data-theme="dark"] .guide-workflow ol li,
html[data-theme="dark"] .guide-rules span {
    color: #9ba8bb;
}

html[data-theme="dark"] .guide-decision-table { border-color: var(--wh-border); }

html[data-theme="dark"] .guide-result {
    color: #b2ded7;
    background: rgba(22, 91, 81, .25);
    border-color: rgba(54, 198, 179, .24);
}

html[data-theme="dark"] .guide-result strong { color: #72dfcf; }

html[data-theme="dark"] .guide-note {
    color: #e1c57c;
    background: rgba(91, 67, 11, .3);
    border-color: #665524;
}

html[data-theme="dark"] .guide-link-row a {
    color: #b9baff;
    background: rgba(133, 135, 255, .12);
}

html[data-theme="dark"] .auth-body {
    color: var(--wh-text);
    background:
        radial-gradient(circle at 12% 15%, rgba(91, 92, 226, .2), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(18, 183, 166, .1), transparent 26%),
        #0b1220;
}

html[data-theme="dark"] .auth-security-note { color: #7f8da1; }

:focus-visible { outline: 3px solid rgba(91, 92, 226, .28); outline-offset: 2px; }

@media (max-width: 1199.98px) {
    .app-topbar { padding-inline: 24px; }
    .app-content { padding: 24px; }
    .app-footer { padding-inline: 24px; }
    .table > :not(caption) > * > * { padding-inline: .75rem; }
    .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-summary-movement { grid-column: 1 / -1; }
    .dashboard-summary-movement .dashboard-movement-pair { min-height: auto; }
    .guide-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .app-sidebar { width: min(86vw, 292px); transform: translateX(-105%); }
    .app-main,
    body.sidebar-collapsed .app-main { margin-left: 0; }
    .mobile-menu-button { display: grid; }
    .sidebar-collapse-button svg { transform: rotate(0); }
    body.sidebar-mobile-open { overflow: hidden; }
    body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; opacity: 1; }
    body.sidebar-collapsed .app-sidebar { width: min(86vw, 292px); }
    body.sidebar-collapsed .sidebar-brand { padding-inline: 18px; justify-content: initial; }
    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .sidebar-menu-text,
    body.sidebar-collapsed .sidebar-nav-label,
    body.sidebar-collapsed .sidebar-chevron { display: initial; }
    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .sidebar-footer .sidebar-menu-text { display: flex; }
    body.sidebar-collapsed .sidebar-group > .collapse { display: block; }
    body.sidebar-collapsed .sidebar-group > .collapse:not(.show) { display: none; }
    body.sidebar-collapsed .sidebar-submenu { display: grid; }
    body.sidebar-collapsed .brand-link { flex: 1; }
    body.sidebar-collapsed .sidebar-collapse-button { position: static; width: 38px; height: 38px; color: #9aa6ba; background: rgba(255, 255, 255, .06); border: 0; border-radius: 11px; }
    body.sidebar-collapsed .sidebar-collapse-button svg { width: 20px; height: 20px; transform: none; }
    body.sidebar-collapsed .sidebar-link,
    body.sidebar-collapsed .sidebar-group-toggle { padding-inline: 12px; justify-content: flex-start; }
    body.sidebar-collapsed .sidebar-footer { justify-content: flex-start; }
    .app-topbar { min-height: 72px; }
    .dashboard-detail-grid { grid-template-columns: 1fr; }
    .guide-hero { grid-template-columns: 1fr; }
    .guide-hero-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guide-layout { grid-template-columns: 1fr; }
    .guide-toc { position: static; }
    .guide-toc nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    html { font-size: 16px; }
    html[data-font-size="small"] { font-size: 14px; }
    html[data-font-size="normal"] { font-size: 16px; }
    html[data-font-size="large"] { font-size: 18px; }
    .app-topbar { min-height: 66px; padding-inline: 14px; }
    .topbar-heading span { display: none; }
    .profile-copy { display: none; }
    .topbar-profile { padding: 5px; background: transparent; border: 0; }
    .profile-avatar { width: 34px; height: 34px; flex-basis: 34px; }
    .topbar-right { gap: 5px; }
    .topbar-preferences { gap: 4px; }
    .topbar-action-button { width: 34px; height: 34px; border-radius: 9px; }
    .topbar-action-button svg { width: 17px; height: 17px; }
    .font-size-panel { right: -40px; width: min(220px, calc(100vw - 28px)); }
    .app-content { padding: 18px 14px 26px; }
    .app-footer { padding: 14px; justify-content: center; text-align: center; }
    .app-footer span:last-child { display: none; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header > div:last-child { display: flex; width: 100%; flex-wrap: wrap; gap: .5rem; }
    .page-header > div:last-child > .btn { flex: 1 1 auto; }
    .page-header > .btn { width: 100%; }
    .page-header form.d-inline { display: inline-flex !important; flex: 1 1 auto; }
    .page-header form.d-inline .btn { width: 100%; }
    .filter-bar { padding: .85rem; border-radius: 13px; }
    .card { border-radius: 13px; }
    .card-body { padding: 1rem; }
    .table { font-size: 1rem; }
    .table > :not(caption) > * > * { padding: .72rem .65rem; }
    .metric-card .metric-value { font-size: 1.28rem; }
    .role-help-grid { grid-template-columns: 1fr; }
    .dashboard-intro { align-items: flex-start; flex-direction: column; }
    .dashboard-quick-actions { width: 100%; }
    .dashboard-quick-actions .btn { flex: 1 1 0; }
    .dashboard-period-form { align-items: stretch; flex-direction: column; }
    .dashboard-period-form > div { flex: 1 1 auto; }
    .dashboard-period-form .btn { width: 100%; }
    .dashboard-summary-grid { grid-template-columns: 1fr; }
    .dashboard-summary-movement { grid-column: auto; }
    .dashboard-attention { align-items: flex-start; }
    .dashboard-attention-link { display: none; }
    .guide-role-grid,
    .guide-feature-grid,
    .guide-report-grid { grid-template-columns: 1fr; }
    .guide-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guide-workflow-grid { grid-template-columns: 1fr; }
    .guide-rules > div { grid-template-columns: 1fr; gap: .2rem; }
    .guide-finish { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 479.98px) {
    .brand-copy strong { font-size: 1rem; }
    .app-topbar { gap: 8px; }
    .topbar-left { gap: 7px; }
    .topbar-heading strong { max-width: 105px; }
    .topbar-profile .profile-avatar { display: none; }
    .topbar-profile { padding: 0; }
    .topbar-logout-button { width: 34px; height: 34px; }
    .btn { padding-inline: .75rem; }
    .document-total { font-size: 1rem; }
    .auth-shell { padding: 14px; }
    .auth-card { padding: 1.4rem; border-radius: 17px; }
    .dashboard-intro h1 { font-size: 1.35rem; }
    .dashboard-summary-card,
    .dashboard-panel { border-radius: 14px; }
    .dashboard-summary-card { padding: 1rem; }
    .dashboard-primary-metric strong { font-size: 1.7rem; }
    .dashboard-panel-header { min-height: 68px; padding: .85rem 1rem; }
    .dashboard-document-table th:nth-child(3),
    .dashboard-document-table td:nth-child(3) { display: none; }
    .guide-hero { min-height: auto; padding: 1.35rem; border-radius: 16px; }
    .guide-hero-summary { grid-template-columns: 1fr; }
    .guide-hero-actions { flex-direction: column; }
    .guide-hero-actions .btn { width: 100%; }
    .guide-toc nav { grid-template-columns: 1fr; }
    .guide-section { border-radius: 14px; }
    .guide-inline-action { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .app-footer,
    .sidebar-backdrop,
    .d-print-none { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { max-width: none; padding: 0; }
    body.app-body { background: #fff !important; }
    html[data-theme="dark"] body.app-body,
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .filter-bar,
    html[data-theme="dark"] .print-sheet {
        color: #111827 !important;
        background: #fff !important;
        border-color: #d1d5db !important;
    }
    html[data-theme="dark"] .table {
        --bs-table-color: #111827;
        --bs-table-bg: #fff;
        --bs-table-border-color: #d1d5db;
    }
    .card, .filter-bar, .print-sheet { max-width: none; box-shadow: none !important; }
    tr, td, th { break-inside: avoid; }
}
