/* Professional UI layer — loaded last so the legacy screens keep their behavior. */
:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --card-soft: #f8fafc;
    --text: #172033;
    --muted: #687386;
    --line: #e3e8ef;
    --line-strong: #d2d9e4;
    --primary: #0f766e;
    --primary-dark: #0b5e58;
    --primary-soft: #e7f5f2;
    --danger: #c9363e;
    --success: #16805d;
    --warning: #b7791f;
    --navy: #101827;
    --navy-soft: #182235;
    --shadow: 0 1px 2px rgba(16, 24, 39, .03), 0 10px 28px rgba(16, 24, 39, .055);
    --shadow-raised: 0 14px 38px rgba(16, 24, 39, .12);
    --radius-xl: 18px;
    --radius-lg: 15px;
    --radius-md: 11px;
    --radius-sm: 8px;
}

html {
    background: var(--bg);
}

body {
    color: var(--text);
    font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    color: #fff;
    background: var(--primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #b7c1ce transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b7c1ce;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(15, 118, 110, .22);
    outline-offset: 2px;
}

.sidebar {
    width: 264px;
    gap: 20px;
    padding: 22px 16px 18px;
    color: #e8edf5;
    border-right: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(25, 157, 143, .16), transparent 31%),
        linear-gradient(180deg, #101827 0%, #0c1422 100%);
    box-shadow: 12px 0 32px rgba(16, 24, 39, .09);
}

.page-shell {
    margin-left: 264px;
}

.sidebar-brand {
    align-items: center;
    min-height: 48px;
    padding: 0 8px 4px;
}

.brand {
    gap: 11px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 11px;
    background: linear-gradient(145deg, #17a397, #0f766e);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
    font-size: 18px;
    font-weight: 900;
}

.brand strong {
    color: #fff;
    font-size: 15px;
    letter-spacing: .08em;
}

.brand span {
    color: #8fa0b7;
    font-size: 11px;
    letter-spacing: .02em;
}

.sidebar-label {
    padding: 0 10px;
    color: #718197;
    font-size: 10px;
    letter-spacing: .16em;
}

.sidebar-nav {
    gap: 4px;
}

.sidebar-nav a,
.sidebar-logout {
    position: relative;
    min-height: 43px;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 9px;
    color: #b8c3d2;
    font-size: 13.5px;
    font-weight: 650;
}

.sidebar-nav a::before {
    content: "";
    position: absolute;
    inset: 8px auto 8px -16px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: transparent;
}

.sidebar-nav a:hover,
.sidebar-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
    transform: none;
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(26, 158, 145, .24), rgba(26, 158, 145, .11));
    box-shadow: inset 0 0 0 1px rgba(57, 190, 176, .13);
}

.sidebar-nav a.active::before {
    background: #2dd4bf;
}

.nav-mark {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    color: #8998ac;
    background: transparent;
}

.nav-mark svg,
.sidebar-toggle svg,
.topbar-quick svg {
    width: 19px;
    height: 19px;
}

.sidebar-nav a:hover .nav-mark,
.sidebar-nav a.active .nav-mark {
    color: #5eead4;
    background: rgba(45, 212, 191, .09);
}

.sidebar-user {
    gap: 9px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .075);
}

.user-box {
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
}

.user-box strong {
    color: #f3f6fa;
    font-size: 13px;
}

.user-box span:last-child {
    color: #8190a4;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: #a7f3d0;
    background: rgba(16, 185, 129, .13);
}

.sidebar-account {
    color: #92a3b8;
    font-size: 11.5px;
}

.sidebar-account:hover {
    color: #fff;
}

.sidebar-logout {
    justify-content: center;
    color: #da8e94;
    border: 1px solid rgba(218, 142, 148, .12);
    background: rgba(201, 54, 62, .055);
}

.sidebar-close {
    color: #cbd5e1;
    background: rgba(255, 255, 255, .08);
}

.app-topbar.mobile-topbar {
    position: sticky;
    inset: 0 auto auto 0;
    z-index: 18;
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 30px;
    border-bottom: 1px solid rgba(226, 232, 240, .92);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 2px rgba(16, 24, 39, .025);
    backdrop-filter: blur(16px);
}

.app-topbar .sidebar-toggle {
    display: none;
}

.topbar-context {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.topbar-context > span {
    color: #8993a4;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.topbar-context > strong {
    max-width: 44vw;
    overflow: hidden;
    color: #253047;
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.cash-status,
.topbar-quick {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #5c677a;
    background: #fff;
    font-size: 12px;
    font-weight: 750;
}

.cash-status > span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c94b52;
    box-shadow: 0 0 0 3px rgba(201, 75, 82, .11);
}

.cash-status.is-open > span {
    background: #1a9b70;
    box-shadow: 0 0 0 3px rgba(26, 155, 112, .12);
}

.topbar-quick {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.topbar-quick:hover {
    background: var(--primary-dark);
}

.container {
    width: min(1420px, calc(100% - 56px));
    padding: 30px 0 54px;
}

.hero,
.page-head,
.sale-head,
.lookup-head {
    margin-bottom: 22px;
}

.hero h1,
.page-head h1,
.sale-head h1,
.lookup-head h1 {
    color: #182238;
    font-size: clamp(29px, 3vw, 38px);
    font-weight: 780;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.page-head h1 .pill {
    vertical-align: middle;
    margin-left: 7px;
    letter-spacing: .03em;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}

.hero p:not(.eyebrow),
.page-head p:not(.eyebrow),
.sale-head p:not(.eyebrow),
.lookup-head p:not(.eyebrow) {
    margin-top: 7px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.search-panel,
.form-card,
.table-card,
.quote-card,
.stat-card,
.chart-card,
.summary-card,
.documents-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

.form-card,
.chart-card,
.summary-card {
    padding: 22px;
}

.form-card h2,
.chart-card h2,
.summary-card h2,
.table-head h2 {
    color: #202a3d;
    font-weight: 760;
    letter-spacing: -.018em;
}

.stats-grid,
.stats-grid.three {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 13px;
}

.stat-card {
    position: relative;
    min-height: 112px;
    gap: 13px;
    align-content: space-between;
    padding: 18px 18px 17px;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #5eead4);
    opacity: .78;
}

.stat-card span {
    color: #758094;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.stat-card strong {
    color: #1d273a;
    font-size: clamp(23px, 2.3vw, 30px);
    font-variant-numeric: tabular-nums;
}

.stat-card strong.price,
.price {
    color: var(--success);
}

.stat-card strong.money-out,
.money-out {
    color: var(--danger);
}

.search-panel {
    gap: 12px;
    padding: 15px;
}

label {
    color: #48546a;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .015em;
}

input,
select,
textarea {
    min-height: 42px;
    border-color: var(--line-strong);
    border-radius: 9px;
    padding: 10px 12px;
    color: #202a3d;
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(16, 24, 39, .02);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #b6c0ce;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

input::placeholder,
textarea::placeholder {
    color: #a2aab7;
}

.btn {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 15px;
    color: #3c485c;
    background: #edf1f5;
    font-size: 13px;
    font-weight: 750;
    box-shadow: none;
    transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.btn svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.page-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(16, 24, 39, .08);
}

.btn.primary {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(15, 118, 110, .16);
}

.btn.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.btn.muted {
    color: #596579;
    border-color: var(--line);
    background: #fff;
}

.btn.danger {
    color: #a82730;
    border-color: #f0cdd0;
    background: #fff4f4;
}

.btn.small {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 11.5px;
}

.table-card {
    background: #fff;
}

.table-head {
    min-height: 61px;
    padding: 16px 18px;
    border-bottom-color: var(--line);
    background: linear-gradient(180deg, #fff, #fcfdfe);
}

.table-head h2 {
    font-size: 18px;
}

.table-head > span {
    padding: 4px 8px;
    border-radius: 999px;
    color: #6d788a;
    background: #f0f3f7;
    font-size: 10.5px;
    font-weight: 700;
}

table {
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 12px 14px;
    border-bottom-color: #edf0f4;
}

th {
    color: #6c7789;
    background: #f7f9fb;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .075em;
}

td {
    color: #354055;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: #fafcfb;
}

.pill {
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(15, 118, 110, .1);
    border-radius: 999px;
    color: #0b6963;
    background: #eaf7f4;
    font-size: 9.5px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.pill.ok {
    color: #08724e;
    border-color: #cdeade;
    background: #eaf8f2;
}

.pill.out {
    color: #a32b34;
    border-color: #f1d1d4;
    background: #fff0f1;
}

.alert {
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 14px 12px 16px;
    border: 1px solid #dbe4ec;
    border-left: 4px solid #6a8298;
    border-radius: 10px;
    color: #405166;
    background: #f5f8fb;
    font-size: 12.5px;
    font-weight: 650;
}

.alert.success {
    color: #116244;
    border-color: #cde8dc;
    border-left-color: var(--success);
    background: #edf9f4;
}

.alert.warning {
    color: #79531c;
    border-color: #ecdcbf;
    border-left-color: #d39a36;
    background: #fff9ed;
}

.alert.danger {
    color: #8f2931;
    border-color: #efcfd2;
    border-left-color: var(--danger);
    background: #fff2f3;
}

.alert.info {
    color: #2f5875;
    border-color: #cee1ee;
    border-left-color: #4d91bd;
    background: #f0f8fc;
}

.two-columns,
.dashboard-grid,
.grid-layout {
    gap: 18px;
}

.form-grid {
    gap: 14px;
}

.form-actions {
    padding-top: 17px;
    margin-top: 18px;
    border-top: 1px solid #eef1f4;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: #758094;
    font-size: 12px;
    line-height: 1.45;
}

.stock-editor-card {
    margin-top: 18px;
    scroll-margin-top: 94px;
    border-left: 4px solid var(--primary);
}

.stock-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eef1f4;
}

.stock-editor-head h2 {
    margin: 3px 0 5px;
}

.stock-editor-head .hint {
    max-width: 680px;
    margin: 0;
}

.stock-current {
    min-width: 175px;
    padding: 13px 16px;
    border: 1px solid #cfe8e5;
    border-radius: 12px;
    background: #effaf8;
    text-align: right;
}

.stock-current span {
    display: block;
    margin-bottom: 3px;
    color: #54706d;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.stock-current strong,
.stock-table-value {
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

.stock-current strong {
    font-size: 22px;
}

.stock-editor-grid {
    display: grid;
    grid-template-columns: minmax(210px, .85fr) minmax(270px, 1.25fr) auto;
    gap: 14px;
    align-items: start;
}

.input-with-unit {
    display: flex;
    align-items: stretch;
}

.input-with-unit input {
    min-width: 0;
    border-radius: 10px 0 0 10px;
}

.input-with-unit span {
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid #d7dee7;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    color: #5f6b7c;
    background: #f5f7f9;
    font-size: 13px;
    font-weight: 700;
}

.stock-editor-action {
    padding-top: 25px;
}

.stock-editor-action .btn {
    white-space: nowrap;
}

.btn.stock-action {
    color: #0f766e;
    border-color: #abd8d3;
    background: #effaf8;
}

.btn.stock-action:hover {
    color: #fff;
    border-color: #0f766e;
    background: #0f766e;
}

.quote-card {
    top: 92px;
}

.cart-item,
.document-card,
.lookup-product-card {
    border-color: var(--line);
    border-radius: 11px;
    background: #fbfcfd;
}

.cart-total {
    border-top-color: var(--line);
}

.cart-total strong {
    color: var(--success);
    font-size: 25px;
    font-variant-numeric: tabular-nums;
}

.chart-card,
.summary-card {
    border-radius: var(--radius-lg);
}

.chart-bars {
    border-color: #e9edf2;
    border-radius: 11px;
    background: #f8fafb;
}

.chart-bar-fill {
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, #31b3a6, #0f766e);
    box-shadow: none;
}

.summary-item {
    border-color: #edf0f4;
}

.inline-form {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(90px, .7fr) minmax(90px, .7fr) minmax(160px, 1.4fr) auto;
    gap: 8px;
    align-items: center;
}

.inventory-guide {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(0, 2fr);
    gap: 20px;
    align-items: center;
    padding: 20px 22px;
    border: 1px solid #d9e5e3;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, #f3faf8, #fff 62%);
    box-shadow: var(--shadow);
}

.inventory-guide-intro h2 {
    margin: 0;
    color: #202a3d;
    font-size: 19px;
    letter-spacing: -.018em;
}

.inventory-guide-intro > p:last-child {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.inventory-guide-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.inventory-guide-steps li {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e4ecea;
    border-radius: 10px;
    background: rgba(255, 255, 255, .82);
}

.inventory-guide-steps li > span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 7px;
    color: #fff;
    background: var(--primary);
    font-size: 11px;
    font-weight: 850;
}

.inventory-guide-steps strong,
.inventory-guide-steps small {
    display: block;
}

.inventory-guide-steps strong {
    color: #344056;
    font-size: 12px;
}

.inventory-guide-steps small {
    margin-top: 3px;
    color: #7b8697;
    font-size: 10.5px;
    line-height: 1.4;
}

.inventory-adjustment-table {
    min-width: 980px;
    table-layout: fixed;
}

.inventory-adjustment-table th:first-child {
    width: 25%;
}

.inventory-adjustment-table th:nth-child(2) {
    width: 19%;
}

.inventory-adjustment-table th:nth-child(3) {
    width: 56%;
}

.inventory-adjustment-table td {
    vertical-align: middle;
}

.inventory-product-cell > strong {
    display: block;
    color: #253047;
    font-size: 13px;
    line-height: 1.38;
}

.inventory-product-cell > small {
    margin-top: 6px;
}

.inventory-current-values {
    display: grid;
    gap: 8px;
}

.inventory-current-values > div {
    padding: 8px 10px;
    border: 1px solid #e8edf2;
    border-radius: 8px;
    background: #f8fafb;
}

.inventory-current-values span,
.inventory-current-values strong {
    display: block;
}

.inventory-current-values span {
    color: #7a8596;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.inventory-current-values strong {
    margin-top: 3px;
    color: #273247;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.inventory-adjustment-grid {
    display: grid;
    grid-template-columns: minmax(116px, .8fr) minmax(116px, .8fr) minmax(190px, 1.4fr) auto;
    gap: 8px;
    align-items: end;
}

.inventory-adjustment-grid label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.inventory-adjustment-grid label > span {
    color: #465267;
    font-size: 10px;
    font-weight: 800;
}

.inventory-adjustment-grid label > small {
    min-height: 27px;
    color: #8791a1;
    font-size: 9.5px;
    font-weight: 500;
    line-height: 1.35;
}

.inventory-adjustment-grid input {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 12px;
}

.inventory-save {
    min-height: 62px;
    display: grid;
    align-content: center;
    gap: 1px;
    padding-inline: 13px;
}

.inventory-save strong,
.inventory-save small {
    display: block;
}

.inventory-save small {
    color: rgba(255, 255, 255, .72);
    font-size: 8.5px;
    font-weight: 600;
}

.inventory-no-change {
    margin: 7px 0 0;
    color: #8791a1;
    font-size: 9.5px;
}

@media (max-width: 1350px) and (min-width: 761px) {
    .inventory-adjustment-table {
        min-width: 0;
    }

    .inventory-adjustment-table thead {
        display: none;
    }

    .inventory-adjustment-table tbody {
        display: grid;
        gap: 11px;
        padding: 12px;
    }

    .inventory-adjustment-table tr {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(210px, .8fr);
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #fff;
    }

    .inventory-adjustment-table td {
        border-bottom: 0;
    }

    .inventory-adjustment-table .inventory-adjustment-cell {
        grid-column: 1 / -1;
        padding-top: 13px;
        border-top: 1px solid #edf0f4;
        background: #fbfcfd;
    }

    .inventory-current-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pagination {
    gap: 6px;
}

.pagination .btn {
    min-width: 36px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 30px 24px;
    color: #8a94a5;
    border-top: 1px solid rgba(226, 232, 240, .7);
    font-size: 11px;
}

.footer strong {
    color: #657084;
    letter-spacing: .055em;
}

.scroll-top-button {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #172033;
    box-shadow: var(--shadow-raised);
    font-size: 19px;
}

.sale-modal-dialog {
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.sale-modal-backdrop,
.sidebar-backdrop {
    background: rgba(9, 15, 27, .56);
    backdrop-filter: blur(3px);
}

.login-body {
    position: relative;
    padding: 24px;
    background:
        linear-gradient(120deg, rgba(15, 118, 110, .11), transparent 48%),
        linear-gradient(315deg, rgba(15, 23, 42, .08), transparent 40%),
        #eef2f6;
}

.login-body::before {
    content: "";
    position: fixed;
    inset: 0 0 0 50%;
    background: linear-gradient(145deg, #101827, #172438);
    clip-path: polygon(23% 0, 100% 0, 100% 100%, 0 100%);
    opacity: .98;
}

.login-wrap {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100% - 24px));
}

.login-card {
    padding: 34px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 17px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
}

.login-card .brand strong {
    color: #1e293b;
}

.login-card .brand span {
    color: var(--muted);
}

.login-card h1 {
    color: #172033;
    font-size: 30px;
    font-weight: 780;
    letter-spacing: -.035em;
}

@media (max-width: 1180px) and (min-width: 981px) {
    .sidebar {
        width: 238px;
    }

    .page-shell {
        margin-left: 238px;
    }

    .container {
        width: min(calc(100% - 40px), 1420px);
    }
}

@media (max-width: 980px) {
    .sidebar {
        width: min(86vw, 312px);
        transform: translateX(-100%);
    }

    .page-shell {
        margin-left: 0;
        padding-top: 0;
    }

    .app-topbar.mobile-topbar {
        position: sticky;
        top: 0;
        left: auto;
        width: 100%;
        min-height: 62px;
        padding: 8px 18px;
        opacity: 1;
        transform: none;
    }

    .app-topbar .sidebar-toggle {
        width: 40px;
        height: 40px;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border-radius: 9px;
        background: #172033;
        box-shadow: none;
    }

    .app-topbar .sidebar-toggle span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    body.is-scrolling .mobile-topbar {
        opacity: 1;
        transform: none;
    }

    body.sidebar-open .mobile-topbar {
        opacity: 0;
    }

    .topbar-context > strong {
        max-width: 34vw;
    }

    .container {
        width: min(calc(100% - 32px), 1420px);
        padding-top: 24px;
    }
}

@media (max-width: 760px) {
    .stats-grid,
    .stats-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stats-grid .stat-primary {
        border-top-color: #149b8f;
    }

    .stat-card {
        min-height: 94px;
        gap: 9px;
        padding: 14px;
    }

    .stat-card strong {
        font-size: clamp(18px, 5.4vw, 24px);
        overflow-wrap: anywhere;
    }

    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .btn,
    .btn.small,
    .quick-chip,
    .sidebar-account,
    .sidebar-logout {
        min-height: 44px;
    }

    .app-topbar .sidebar-toggle {
        width: 44px;
        height: 44px;
    }

    .topbar-context {
        flex: 1 1 auto;
    }

    .topbar-context > strong {
        max-width: 100%;
    }

    .stock-editor-head {
        display: grid;
        gap: 14px;
    }

    .stock-current {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .stock-editor-grid {
        grid-template-columns: 1fr;
    }

    .stock-editor-action {
        padding-top: 0;
    }

    .stock-editor-action .btn {
        width: 100%;
    }

    .app-topbar.mobile-topbar {
        padding-inline: 14px;
    }

    .cash-status {
        padding-inline: 9px;
        font-size: 10.5px;
    }

    .topbar-quick {
        display: none;
    }

    .topbar-context > span {
        display: none;
    }

    .topbar-context > strong {
        max-width: 42vw;
        font-size: 13px;
    }

    .container {
        width: min(calc(100% - 24px), 1420px);
        padding: 20px 0 38px;
    }

    .hero,
    .page-head,
    .sale-head,
    .lookup-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-head-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-head-actions .btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    .hero h1,
    .page-head h1,
    .sale-head h1,
    .lookup-head h1 {
        font-size: 28px;
    }

    .form-card,
    .quote-card,
    .search-panel,
    .chart-card,
    .summary-card {
        padding: 17px;
        border-radius: 13px;
    }

    .table-card {
        border-radius: 13px;
    }

    .table-head {
        min-height: 0;
        padding: 14px;
    }

    .stack-table tbody {
        gap: 9px;
        padding: 9px;
    }

    .stack-table tr {
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
    }

    .stack-table td {
        border-bottom-color: #edf0f4;
    }

    .form-actions {
        padding-top: 14px;
    }

    .inline-form {
        grid-template-columns: 1fr 1fr;
    }

    .inline-form input[name="motivo"] {
        grid-column: 1 / -1;
    }

    .inline-form .btn {
        grid-column: 1 / -1;
    }

    .inventory-guide {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 17px;
    }

    .inventory-guide-steps {
        grid-template-columns: 1fr;
    }

    .inventory-guide-steps li {
        padding: 10px;
    }

    .inventory-adjustment-table {
        min-width: 0;
    }

    .inventory-adjustment-table .inventory-product-cell,
    .inventory-adjustment-table .inventory-current-cell,
    .inventory-adjustment-table .inventory-adjustment-cell {
        display: block;
        padding: 13px;
    }

    .inventory-adjustment-table td::before {
        display: block;
        margin-bottom: 8px;
    }

    .inventory-current-values,
    .inventory-adjustment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-reason,
    .inventory-save {
        grid-column: 1 / -1;
    }

    .inventory-save {
        width: 100%;
        min-height: 48px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding-inline: 16px;
    }
}

/* Indicadores compactos del inicio para teléfonos. */
@media (max-width: 760px) {
    .page-shell .stats-grid,
    .page-shell .stats-grid.three {
        gap: 7px;
    }

    .page-shell .stats-grid .stat-card {
        min-height: 68px;
        gap: 4px;
        align-content: space-between;
        padding: 9px 10px 8px;
        border-top-width: 2px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(16, 24, 39, .07);
    }

    .page-shell .stats-grid .stat-card span {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 8.5px;
        line-height: 1.15;
        letter-spacing: .025em;
    }

    .page-shell .stats-grid .stat-card span::before {
        width: 5px;
        height: 5px;
        flex: 0 0 5px;
        border-radius: 50%;
        background: var(--metric-color, #20334c);
        content: "";
    }

    .page-shell .stats-grid .stat-card strong {
        font-size: clamp(16px, 4.9vw, 20px);
        line-height: 1.05;
    }

    .page-shell .stats-grid .stat-card::after {
        height: 2px;
        background: var(--metric-color, #149b8f);
        opacity: .9;
    }

    .page-shell .stats-grid .metric-sales { --metric-color: #0e7490; }
    .page-shell .stats-grid .metric-purchases { --metric-color: #c56a16; }
    .page-shell .stats-grid .metric-cash { --metric-color: #0f766e; }
    .page-shell .stats-grid .metric-receivable { --metric-color: #16845b; }
    .page-shell .stats-grid .metric-payable { --metric-color: #d33f49; }
    .page-shell .stats-grid .metric-status.is-good { --metric-color: #16845b; }
    .page-shell .stats-grid .metric-status.is-alert { --metric-color: #d33f49; }
    .page-shell .stats-grid .metric-products { --metric-color: #405a78; }
    .page-shell .stats-grid .metric-alert { --metric-color: #d18a18; }
}

@media (max-width: 500px) {
    .page-shell .stats-grid .stat-card {
        min-height: 60px;
        padding: 8px 9px 7px;
    }

    .page-shell .stats-grid .stat-card strong {
        font-size: clamp(15px, 5vw, 18px);
    }

    .page-shell .stats-grid .stat-card:last-child:nth-child(odd) {
        min-height: 54px;
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) auto;
        align-content: center;
        align-items: center;
    }
}

@media (max-width: 500px) {
    .stats-grid,
    .stats-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-card {
        min-height: 88px;
        padding: 12px;
    }

    .cash-status {
        width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0;
        overflow: hidden;
        color: transparent;
        font-size: 0;
    }

    .page-head h1,
    .sale-head h1,
    .lookup-head h1 {
        font-size: 25px;
    }

    .cash-status > span {
        flex: 0 0 8px;
    }

    .login-body {
        padding: 12px;
    }

    .login-body::before {
        display: none;
    }

    .login-card {
        padding: 26px 22px;
    }

    .inventory-current-values,
    .inventory-adjustment-grid {
        grid-template-columns: 1fr;
    }

    .inventory-reason,
    .inventory-save {
        grid-column: 1;
    }
}

/* Configuración operativa editable. */
.settings-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.settings-status-grid article {
    display: grid;
    gap: 7px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.settings-status-grid span {
    color: #748094;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.settings-status-grid strong {
    font-size: 19px;
}

.settings-status-grid .is-on {
    color: #0f766e;
}

.settings-status-grid .is-off {
    color: #a14d36;
}

.settings-guard-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.settings-guard-alert div {
    display: grid;
    gap: 3px;
}

.settings-form {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.settings-section {
    margin: 0;
}

.settings-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #edf1f4;
}

.settings-section-head h2 {
    margin: 3px 0 0;
}

.settings-section-head > p,
.settings-number-preview {
    max-width: 420px;
    margin: 4px 0 0;
    color: #748094;
    font-size: 13px;
    text-align: right;
}

.settings-number-preview strong {
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

.settings-switch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-switch-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid #dfe5eb;
    border-radius: 13px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.settings-switch-card:has(input:checked) {
    border-color: #9fd5cf;
    background: #f0faf8;
    box-shadow: inset 3px 0 #0f766e;
}

.settings-switch-card:focus-within {
    outline: 3px solid rgba(15, 118, 110, .18);
    outline-offset: 2px;
}

.settings-switch-card > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.settings-toggle {
    width: 44px;
    height: 24px;
    display: flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    background: #b7c0cc;
    transition: background .16s ease;
}

.settings-toggle span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .2);
    transition: transform .16s ease;
}

.settings-switch-card input:checked + .settings-toggle {
    background: #0f766e;
}

.settings-switch-card input:checked + .settings-toggle span {
    transform: translateX(20px);
}

.settings-switch-card > span:last-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.settings-switch-card strong {
    color: #253047;
    font-size: 14px;
}

.settings-switch-card small {
    color: #748094;
    font-size: 12px;
    line-height: 1.45;
}

.settings-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #b9ddd9;
    border-radius: 14px;
    background: rgba(240, 250, 248, .96);
    box-shadow: 0 16px 36px rgba(15, 41, 55, .14);
    backdrop-filter: blur(10px);
}

.settings-save-bar div {
    display: grid;
    gap: 2px;
}

.settings-save-bar strong {
    color: #174f4b;
}

.settings-save-bar span {
    color: #64748b;
    font-size: 12px;
}

.catalog-business-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.catalog-business-info div {
    display: grid;
    gap: 3px;
}

.catalog-business-info span {
    color: #748094;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.catalog-business-info strong {
    color: #253047;
    font-size: 14px;
}

.readiness-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.readiness-action > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.readiness-action .btn {
    flex: 0 0 auto;
}

.readiness-operational-card .alert.success {
    display: grid;
    gap: 3px;
}

.historical-cost-table td:first-child small {
    display: block;
    margin-top: 6px;
}

.historical-cost-form {
    min-width: 510px;
    display: grid;
    grid-template-columns: minmax(120px, .55fr) minmax(220px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.historical-cost-form label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.historical-cost-form label > span {
    color: #6f7a8d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.historical-cost-form input {
    min-height: 38px;
    padding: 8px 9px;
}

@media (max-width: 900px) {
    .settings-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .settings-switch-grid,
    .settings-fields-grid,
    .settings-status-grid {
        grid-template-columns: 1fr;
    }

    .settings-section-head,
    .settings-guard-alert,
    .settings-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-section-head > p,
    .settings-number-preview {
        max-width: none;
        text-align: left;
    }

    .settings-save-bar .btn,
    .settings-guard-alert .btn {
        width: 100%;
    }

    .readiness-action {
        align-items: stretch;
        flex-direction: column;
    }

    .readiness-action .btn {
        width: 100%;
    }

    .historical-cost-form {
        min-width: 0;
        grid-template-columns: 1fr;
    }
}

/* Compra móvil: los productos quedan visibles y el formulario abre bajo demanda. */
.purchase-modal-backdrop {
    display: none;
}

@media (max-width: 760px) {
    .purchase-modal-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 101;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(15, 29, 43, .56);
        backdrop-filter: blur(3px);
        cursor: pointer;
    }

    body.purchase-panel-open {
        overflow: hidden;
    }

    body[data-page="compras"] .purchase-workspace {
        position: fixed;
        top: 8px;
        left: 50%;
        right: auto;
        bottom: 8px;
        z-index: 102;
        width: min(560px, calc(100vw - 16px));
        height: calc(100dvh - 16px);
        max-height: none;
        padding: 14px;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        border: 1px solid #dfe6ec;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 28px 70px rgba(10, 25, 39, .28);
        transform: translate(-50%, 22px) scale(.98);
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    }

    body.purchase-panel-open[data-page="compras"] .purchase-workspace {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, 0) scale(1);
    }

    .purchase-workspace form {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .purchase-workspace .quote-title {
        position: sticky;
        top: 0;
        z-index: 3;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 2px 0 12px;
        background: #fff;
    }

    .purchase-workspace .quote-title-actions {
        flex: 0 0 auto;
    }

    .purchase-workspace .purchase-modal-close {
        display: inline-flex;
        width: auto;
        min-width: 78px;
        height: 38px;
        gap: 6px;
        padding: 0 11px;
        color: #354254;
        border: 1px solid #dbe3ea;
        background: #f6f8fa;
    }

    .purchase-close-text {
        font-size: 12px;
        font-weight: 750;
    }

    .purchase-workspace .quote-fields,
    .purchase-workspace .cart-total {
        flex: 0 0 auto;
    }

    .purchase-workspace .purchase-cart-items {
        flex: 1 1 auto;
        min-height: 110px;
        max-height: none;
        overflow-y: visible;
    }

    .purchase-workspace .quote-actions {
        position: sticky;
        bottom: 0;
        z-index: 3;
        display: grid !important;
        flex: 0 0 auto;
        padding: 12px 0 2px;
        margin-top: 8px;
        background: #fff;
    }

    .purchase-mobile-bar {
        z-index: 60;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-color: #cfe5e2;
        border-radius: 16px;
    }

    .purchase-mobile-bar[hidden] {
        display: none !important;
    }

    .purchase-mobile-summary {
        min-width: 0;
    }

    .purchase-mobile-summary span,
    .purchase-mobile-summary strong,
    .purchase-mobile-summary small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .purchase-mobile-summary span {
        color: #6d7888;
        font-size: 10px;
        font-weight: 750;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .purchase-mobile-summary strong {
        margin-top: 1px;
        color: #202a3d;
        font-size: 14px;
    }

    .purchase-mobile-summary small {
        margin-top: 1px;
        color: #0f766e;
        font-size: 12px;
        font-weight: 750;
    }

    .purchase-mobile-bar .btn {
        width: auto !important;
        min-width: 112px;
        min-height: 42px;
        padding-inline: 14px;
        white-space: nowrap;
    }
}

@media print {
    .app-topbar {
        display: none !important;
    }
}

/* Tema interno unificado: el azul del sidebar organiza toda la aplicación. */
.app-shell {
    --primary: #17263a;
    --primary-dark: #0c1422;
    --primary-soft: #eaf0f6;
    --line: #dbe3ec;
    --line-strong: #c8d3df;
    --system-navy: #101827;
    --system-navy-soft: #17263a;
    --system-navy-raised: #20334c;
    --system-accent: #149b8f;
    --system-accent-light: #5eead4;
    --shadow: 0 1px 2px rgba(16, 24, 39, .035), 0 12px 30px rgba(16, 24, 39, .07);
    --shadow-raised: 0 18px 44px rgba(16, 24, 39, .16);
    background: #eef2f6;
}

.page-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 96% 2%, rgba(20, 155, 143, .08), transparent 24rem),
        linear-gradient(180deg, #f2f5f8 0, #edf2f6 44%, #f5f7f9 100%);
}

.app-topbar.mobile-topbar {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 88% -90%, rgba(45, 212, 191, .18), transparent 25rem),
        linear-gradient(100deg, #101827 0%, #142238 72%, #15343d 120%);
    box-shadow: 0 9px 28px rgba(16, 24, 39, .13);
    backdrop-filter: blur(18px);
}

.topbar-context > span {
    color: #8294aa;
}

.topbar-context > strong {
    color: #f8fafc;
}

.cash-status {
    color: #d6deea;
    border-color: rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .065);
}

.cash-status:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .23);
    background: rgba(255, 255, 255, .1);
}

.topbar-quick,
.page-shell .page-head .btn.primary,
.page-shell .sale-head .btn.primary,
.page-shell .lookup-head .btn.primary {
    color: #fff;
    border-color: #149b8f;
    background: linear-gradient(135deg, #17a397, #0f766e);
    box-shadow: 0 8px 20px rgba(15, 118, 110, .24);
}

.topbar-quick:hover,
.page-shell .page-head .btn.primary:hover,
.page-shell .sale-head .btn.primary:hover,
.page-shell .lookup-head .btn.primary:hover {
    border-color: #20b3a5;
    background: linear-gradient(135deg, #1bb2a4, #0c6d66);
}

.page-shell .container {
    position: relative;
}

.page-shell .page-head,
.page-shell .sale-head,
.page-shell .lookup-head {
    position: relative;
    isolation: isolate;
    min-height: 132px;
    align-items: center;
    padding: 23px 25px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 17px;
    background:
        radial-gradient(circle at 87% 15%, rgba(45, 212, 191, .15), transparent 18rem),
        linear-gradient(135deg, #101827 0%, #17263a 74%, #16343e 125%);
    box-shadow: 0 18px 42px rgba(16, 24, 39, .14);
}

.page-shell .page-head::after,
.page-shell .sale-head::after,
.page-shell .lookup-head::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -32px -72px auto;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(94, 234, 212, .09);
    border-radius: 50%;
    box-shadow:
        0 0 0 28px rgba(94, 234, 212, .025),
        0 0 0 58px rgba(94, 234, 212, .018);
}

.page-shell .page-head > *,
.page-shell .sale-head > *,
.page-shell .lookup-head > * {
    position: relative;
    z-index: 1;
}

.page-shell .page-head h1,
.page-shell .sale-head h1,
.page-shell .lookup-head h1 {
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}

.page-shell .page-head .eyebrow,
.page-shell .sale-head .eyebrow,
.page-shell .lookup-head .eyebrow {
    color: var(--system-accent-light);
}

.page-shell .page-head p:not(.eyebrow),
.page-shell .sale-head p:not(.eyebrow),
.page-shell .lookup-head p:not(.eyebrow) {
    max-width: 760px;
    color: #b8c4d3;
}

.page-shell .page-head .btn.muted,
.page-shell .sale-head .btn.muted,
.page-shell .lookup-head .btn.muted {
    color: #eef3f8;
    border-color: rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .075);
}

.page-shell .page-head .btn.muted:hover,
.page-shell .sale-head .btn.muted:hover,
.page-shell .lookup-head .btn.muted:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .12);
}

.page-shell .page-head .pill,
.page-shell .sale-head .pill,
.page-shell .lookup-head .pill {
    color: #d9fff8;
    border-color: rgba(94, 234, 212, .2);
    background: rgba(20, 155, 143, .16);
}

.page-shell .page-head .pill.out,
.page-shell .sale-head .pill.out,
.page-shell .lookup-head .pill.out {
    color: #ffc4c8;
    border-color: rgba(248, 113, 113, .23);
    background: rgba(201, 54, 62, .16);
}

.page-shell .lookup-head-stat,
.page-shell .sale-head-stat {
    border-color: rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .075);
    box-shadow: inset 0 1px rgba(255, 255, 255, .035);
}

.page-shell .lookup-head-stat strong,
.page-shell .sale-head-stat strong {
    color: var(--system-accent-light);
}

.page-shell .lookup-head-stat span,
.page-shell .sale-head-stat span {
    color: #aebccd;
}

.page-shell .search-panel {
    border-color: #243950;
    background:
        radial-gradient(circle at 90% -50%, rgba(45, 212, 191, .12), transparent 18rem),
        linear-gradient(135deg, #17263a, #101827);
    box-shadow: 0 14px 32px rgba(16, 24, 39, .12);
}

.page-shell .search-panel label {
    color: #dce5ef;
}

.page-shell .search-panel .hint,
.page-shell .search-panel .field-help {
    color: #9eacbd;
}

.page-shell .search-panel input,
.page-shell .search-panel select,
.page-shell .search-panel textarea {
    border-color: rgba(255, 255, 255, .18);
    background: #fff;
}

.page-shell .search-panel .btn.muted {
    color: #e8eef6;
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
}

.page-shell .search-panel .btn.muted:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .13);
}

.page-shell .form-card,
.page-shell .chart-card,
.page-shell .summary-card,
.page-shell .documents-panel,
.page-shell .quote-card,
.page-shell .table-card,
.page-shell .stat-card {
    border-color: #d8e1ea;
    box-shadow: 0 1px 2px rgba(16, 24, 39, .035), 0 12px 30px rgba(16, 24, 39, .065);
}

.page-shell .form-card,
.page-shell .chart-card,
.page-shell .summary-card,
.page-shell .documents-panel,
.page-shell .quote-card {
    background: linear-gradient(180deg, #fff 0%, #fcfdfe 100%);
}

.page-shell .stat-card {
    border-top: 3px solid #20334c;
    background:
        radial-gradient(circle at 100% 0, rgba(20, 155, 143, .07), transparent 8rem),
        #fff;
}

.page-shell .stat-card::after {
    background: linear-gradient(90deg, #17263a, #149b8f 68%, #5eead4);
}

.page-shell .stat-card span {
    color: #607086;
}

.page-shell .stat-card strong {
    color: #17263a;
}

.page-shell .stat-card strong.price {
    color: var(--success);
}

.page-shell .stat-card strong.money-out {
    color: var(--danger);
}

.page-shell .table-card > .table-head {
    min-height: 64px;
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 92% -80%, rgba(45, 212, 191, .15), transparent 17rem),
        linear-gradient(105deg, #17263a, #101827);
}

.page-shell .table-card > .table-head h2 {
    color: #fff;
}

.page-shell .table-card > .table-head .eyebrow {
    color: var(--system-accent-light);
}

.page-shell .table-card > .table-head > span {
    color: #d7e1ec;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .08);
}

.page-shell th {
    color: #425169;
    border-bottom-color: #d8e1ea;
    background: #edf2f7;
}

.page-shell tr:hover td {
    background: #f5f9fa;
}

.page-shell .btn.primary {
    border-color: #17263a;
    background: linear-gradient(135deg, #20334c, #101827);
    box-shadow: 0 7px 18px rgba(16, 24, 39, .18);
}

.page-shell .btn.primary:hover {
    border-color: #0c1422;
    background: linear-gradient(135deg, #17263a, #0a111d);
    box-shadow: 0 9px 22px rgba(16, 24, 39, .23);
}

.page-shell input:focus,
.page-shell select:focus,
.page-shell textarea:focus {
    border-color: #263d58;
    box-shadow: 0 0 0 3px rgba(23, 38, 58, .13);
}

.page-shell .pagination .btn[aria-current="page"],
.page-shell .pagination .btn.active {
    color: #fff;
    border-color: #17263a;
    background: #17263a;
}

.page-shell .settings-status-grid article {
    border-color: rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 100% 0, rgba(45, 212, 191, .13), transparent 9rem),
        linear-gradient(145deg, #17263a, #101827);
    box-shadow: 0 12px 26px rgba(16, 24, 39, .13);
}

.page-shell .settings-status-grid span {
    color: #94a4b8;
}

.page-shell .settings-status-grid strong {
    color: #f8fafc;
}

.page-shell .settings-status-grid .is-on {
    color: var(--system-accent-light);
}

.page-shell .settings-status-grid .is-off {
    color: #fdba74;
}

.page-shell .settings-switch-card:has(input:checked) {
    border-color: #a8d7d2;
    background: #eff9f7;
    box-shadow: inset 3px 0 #149b8f;
}

.page-shell .settings-switch-card input:checked + .settings-toggle {
    background: #149b8f;
}

.page-shell .settings-save-bar {
    color: #fff;
    border-color: rgba(255, 255, 255, .1);
    background:
        radial-gradient(circle at 85% -100%, rgba(45, 212, 191, .18), transparent 17rem),
        rgba(16, 24, 39, .97);
    box-shadow: 0 18px 42px rgba(16, 24, 39, .24);
}

.page-shell .settings-save-bar strong {
    color: #fff;
}

.page-shell .settings-save-bar span {
    color: #aebccd;
}

.page-shell .settings-save-bar .btn.primary {
    border-color: #149b8f;
    background: linear-gradient(135deg, #17a397, #0f766e);
    box-shadow: 0 8px 20px rgba(15, 118, 110, .24);
}

.page-shell > .footer {
    color: #8fa0b7;
    border-top-color: rgba(255, 255, 255, .07);
    background: #101827;
}

.page-shell > .footer strong {
    color: #f1f5f9;
}

.scroll-top-button {
    background: linear-gradient(145deg, #20334c, #101827);
    box-shadow: 0 12px 28px rgba(16, 24, 39, .25);
}

@media (max-width: 760px) {
    .app-topbar.mobile-topbar {
        border-bottom-color: rgba(255, 255, 255, .08);
        background:
            radial-gradient(circle at 100% -100%, rgba(45, 212, 191, .18), transparent 16rem),
            linear-gradient(105deg, #101827, #17263a);
    }

    .app-topbar .sidebar-toggle {
        color: #fff;
        border-color: rgba(255, 255, 255, .13);
        background: rgba(255, 255, 255, .08);
    }

    .page-shell .page-head,
    .page-shell .sale-head,
    .page-shell .lookup-head {
        min-height: 0;
        padding: 19px;
        border-radius: 15px;
        box-shadow: 0 14px 32px rgba(16, 24, 39, .15);
    }

    .page-shell .page-head::after,
    .page-shell .sale-head::after,
    .page-shell .lookup-head::after {
        right: -92px;
        bottom: -115px;
    }

    .page-shell .lookup-head-stat,
    .page-shell .sale-head-stat {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .page-shell .page-head-actions .btn,
    .page-shell .sale-head-actions .btn {
        justify-content: center;
    }

    .page-shell .settings-save-bar {
        bottom: 10px;
    }

    .page-shell > .footer {
        align-items: flex-start;
        padding: 18px;
    }
}
