:root {
    --ink: #17201d;
    --muted: #68766f;
    --line: #dfe7df;
    --paper: #f7faf7;
    --panel: #ffffff;
    --brand: #0f766e;
    --teal: #0f766e;
    --teal-dark: #0b4f49;
    --brass: #b9924b;
    --brass-dark: #6f4f19;
    --ivory: #fffaf0;
    --night: #071b18;
    --danger: #b42318;
    --success: #157347;
    --warning: #a15c07;
    --shadow: 0 18px 55px rgba(23, 32, 29, .12);
    --auth-shadow: 0 34px 90px rgba(7, 27, 24, .22);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .08), transparent 34%),
        radial-gradient(circle at top right, rgba(185, 146, 75, .16), transparent 30%),
        var(--paper);
    font-family: "Segoe UI", "Aptos", "Trebuchet MS", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.auth-body,
.error-body {
    display: grid;
    place-items: center;
    padding: 28px;
}
.auth-body {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: clamp(14px, 2.2vw, 24px);
    background:
        radial-gradient(circle at 8% 12%, rgba(185, 146, 75, .22), transparent 30%),
        radial-gradient(circle at 92% 20%, rgba(15, 118, 110, .26), transparent 34%),
        linear-gradient(135deg, #fff8e8 0%, #eef7f2 46%, #e5f0ea 100%);
}
.auth-body::before,
.auth-body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
}
.auth-body::before {
    inset: 0;
    opacity: .45;
    background-image:
        linear-gradient(rgba(15, 118, 110, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 118, 110, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, #000, transparent 72%);
}
.auth-body::after {
    width: 520px;
    height: 520px;
    right: -190px;
    bottom: -230px;
    border-radius: 50%;
    background: rgba(185, 146, 75, .18);
    border: 1px solid rgba(185, 146, 75, .22);
}
.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    height: 100%;
    max-height: 700px;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(370px, .82fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 34px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(20px);
}
.twofa-auth-shell {
    width: min(760px, 100%);
    max-height: calc(100dvh - 28px);
    grid-template-columns: minmax(0, 1fr);
}
.twofa-auth-shell .auth-brand-panel {
    display: none;
}
.twofa-auth-shell .auth-card {
    padding: clamp(16px, 2.6vw, 28px);
}
.auth-brand-panel {
    position: relative;
    isolation: isolate;
    min-width: 0;
    padding: clamp(24px, 4vw, 48px);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,.14), transparent 24%),
        radial-gradient(circle at 82% 16%, rgba(185, 146, 75, .28), transparent 30%),
        linear-gradient(135deg, #061916 0%, #0b4f49 54%, #071b18 100%);
}
.auth-brand-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    left: -140px;
    bottom: -150px;
    z-index: -1;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(185, 146, 75, .18);
}
.auth-brand-content {
    position: relative;
    display: grid;
    gap: 13px;
    max-width: 540px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
}
.auth-brand-content::before {
    content: "";
    width: 76px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brass), rgba(255,255,255,.58));
}
.auth-brand-content::after {
    display: none;
}
.auth-logo-card {
    width: max-content;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px 8px 8px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 22px;
    background: rgba(255,255,255,.13);
    box-shadow: 0 20px 48px rgba(0,0,0,.18);
    backdrop-filter: blur(14px);
}
.auth-brand-kicker {
    display: grid;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.auth-brand-kicker strong {
    color: #fff;
    font-size: .98rem;
    letter-spacing: .01em;
}
.auth-logo-card strong {
    display: block;
    margin-top: 2px;
    color: #fff;
    font-size: .9rem;
    letter-spacing: .01em;
}
.auth-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    padding: 7px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
.auth-brand-panel h1 {
    max-width: 520px;
    margin: 4px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.72rem, 2.65vw, 2.72rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.auth-copy {
    max-width: 500px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: .9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.auth-proof { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.auth-proof span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    border: 1px solid rgba(255,255,255,.24);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.11);
    color: rgba(255,255,255,.92);
    font-size: .78rem;
    font-weight: 800;
}
.brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    background: var(--brass);
    color: #1d1608;
    font-weight: 900;
    border-radius: 8px;
}
.brand-mark.small { width: 42px; height: 42px; font-size: .9rem; }
.auth-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(18px, 2.8vw, 36px);
    background:
        radial-gradient(circle at top right, rgba(185, 146, 75, .14), transparent 38%),
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,250,240,.92));
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 34px;
    right: 34px;
    width: 86px;
    height: 86px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 28px;
    transform: rotate(12deg);
    background: rgba(15, 118, 110, .04);
}
.auth-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    width: min(400px, 100%);
    min-width: 0;
    margin: 0 auto;
}
.login-logo-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 18px;
    border-bottom: 1px solid rgba(15, 118, 110, .14);
}
.login-logo-lockup > div {
    position: relative;
    display: grid;
    gap: 8px;
    min-width: 0;
}
.login-logo-lockup > div::after {
    content: "";
    width: 92px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brass), rgba(15, 118, 110, .28));
}
.login-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    flex: 0 0 auto;
    padding: 7px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(223, 231, 223, .9);
    box-shadow: 0 18px 38px rgba(23, 32, 29, .14);
}
.login-logo-lockup strong {
    display: block;
}
.login-logo-lockup strong {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.25rem, 2vw, 1.62rem);
    line-height: 1.02;
    letter-spacing: -.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.form-heading h2 {
    margin: 6px 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 2.35vw, 2.05rem);
    line-height: 1;
    letter-spacing: -.04em;
}
.form-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.eyebrow {
    margin: 0;
    color: var(--brass);
    text-transform: uppercase;
    font-size: .75rem;
    font-weight: 800;
}
label { display: grid; gap: 8px; font-weight: 700; }
label span { font-size: .88rem; }
.auth-security-note {
    display: grid;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-left: 4px solid var(--teal);
    border-radius: 14px;
    background: #f7fbf8;
}
.auth-security-note span,
.login-assurance {
    color: var(--muted);
    font-size: .82rem;
}
.auth-security-note span {
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.auth-security-note strong {
    color: var(--teal-dark);
    line-height: 1.38;
    font-size: .9rem;
}
.input-field span {
    color: #26342f;
    font-weight: 900;
}
input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(15, 118, 110, .22);
    border-left: 4px solid rgba(185, 146, 75, .72);
    border-radius: 16px;
    padding: 0 16px 0 14px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(185, 146, 75, .45), rgba(15, 118, 110, .22)) border-box;
    color: var(--ink);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.95),
        0 10px 24px rgba(23, 32, 29, .055);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:hover {
    border-color: rgba(15, 118, 110, .38);
    border-left-color: var(--brass);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.95),
        0 14px 30px rgba(23, 32, 29, .075);
}
input:focus {
    outline: 3px solid rgba(15, 118, 110, .16);
    border-color: var(--teal);
    border-left-color: var(--teal);
    box-shadow:
        0 0 0 1px rgba(15, 118, 110, .16),
        0 18px 34px rgba(15, 118, 110, .14);
}
.btn {
    border: 0;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn.primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    box-shadow: 0 18px 34px rgba(15, 118, 110, .24);
}
.btn.primary:hover {
    background: linear-gradient(135deg, #128178, #073f3a);
    transform: translateY(-1px);
    box-shadow: 0 22px 40px rgba(15, 118, 110, .28);
}
.btn.secondary { background: #edf4ef; color: var(--ink); }
.btn.full { width: 100%; }
.auth-submit {
    min-height: 48px;
    margin-top: 2px;
    font-size: .98rem;
}
.login-assurance {
    margin: 0;
    text-align: center;
    line-height: 1.5;
}
.flash {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.flash.success { color: var(--success); background: #edf8f2; border-color: #bde5cd; }
.flash.error { color: var(--danger); background: #fff1f0; border-color: #f4c7c3; }
.flash.info { color: var(--teal-dark); background: #eefaf8; border-color: #bfe5df; }
.flash.warning { color: #855607; background: #fff7e5; border-color: #ead19c; }
.secret-box {
    border: 1px dashed var(--teal);
    border-radius: 8px;
    padding: 16px;
    background: #f1fbf9;
    display: grid;
    gap: 6px;
    min-width: 0;
}
.secret-box span,
.micro-copy { color: var(--muted); font-size: .86rem; }
.secret-box strong,
.backup-grid code {
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: "Cascadia Mono", "Consolas", monospace;
}
.twofa-modal-form {
    width: min(680px, 100%);
    max-height: min(610px, calc(100dvh - 56px));
    overflow: auto;
    gap: 10px;
    padding: clamp(14px, 2vw, 20px);
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 26px;
    background:
        radial-gradient(circle at 88% 4%, rgba(185, 146, 75, .16), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,252,249,.96));
    box-shadow:
        0 26px 70px rgba(7, 27, 24, .18),
        inset 0 1px 0 rgba(255,255,255,.88);
    scrollbar-width: thin;
}
.twofa-modal-form .eyebrow {
    font-size: .66rem;
}
.twofa-modal-form .input-field span {
    font-size: .78rem;
}
.twofa-modal-form input {
    min-height: 42px;
    border-radius: 13px;
    font-size: .88rem;
}
.twofa-modal-form .btn {
    min-height: 44px;
    font-size: .88rem;
}
.twofa-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.twofa-modal-head h2 {
    margin: 4px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.16rem, 1.65vw, 1.42rem);
    line-height: 1.04;
    letter-spacing: -.035em;
}
.twofa-issuer-pill {
    flex: 0 0 auto;
    max-width: 220px;
    padding: 7px 10px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 999px;
    background: #eef9f6;
    color: var(--teal-dark);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.twofa-scan-panel {
    display: grid;
    grid-template-columns: minmax(280px, 280px) minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .08), transparent 48%),
        #ffffff;
}
.twofa-qr-card {
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px solid rgba(185, 146, 75, .35);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(23, 32, 29, .08);
}
.twofa-qr-card img {
    display: block;
    width: 260px;
    max-width: 260px;
    aspect-ratio: 1;
    object-fit: contain;
    image-rendering: pixelated;
}
.twofa-qr-fallback {
    width: 176px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}
.twofa-setup-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.twofa-setup-copy strong {
    color: var(--ink);
    font-size: .86rem;
    line-height: 1.25;
}
.twofa-setup-copy p {
    margin: 0;
    color: var(--muted);
    font-size: .74rem;
    line-height: 1.36;
}
.twofa-secret-box {
    padding: 10px 12px;
    border-radius: 16px;
    background: #f7fbf8;
}
.twofa-secret-box span {
    font-size: .76rem;
}
.twofa-secret-box strong {
    color: var(--teal-dark);
    font-size: .7rem;
    letter-spacing: .08em;
}
.twofa-help {
    margin: 0;
    text-align: center;
    font-size: .76rem;
    line-height: 1.35;
}
.twofa-account-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vw, 36px);
}
.twofa-account-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 22, .66);
    backdrop-filter: blur(8px);
}
.twofa-account-dialog {
    position: relative;
    z-index: 1;
    width: min(700px, 100%);
    max-height: calc(100dvh - clamp(32px, 6vw, 72px));
}
.twofa-modal-form.is-account-modal {
    width: 100%;
    max-height: inherit;
    border-color: rgba(185, 146, 75, .34);
    box-shadow: 0 34px 90px rgba(4, 20, 18, .34), inset 0 1px 0 rgba(255,255,255,.9);
}
.twofa-modal-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.twofa-modal-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(15, 118, 110, .15);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    box-shadow: 0 8px 18px rgba(23, 32, 29, .08);
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.twofa-modal-close:hover,
.twofa-modal-close:focus-visible {
    border-color: rgba(15, 118, 110, .36);
    background: #eef9f6;
    color: var(--teal-dark);
    transform: translateY(-1px);
}
.twofa-modal-close svg {
    width: 18px;
    height: 18px;
}
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.backup-grid code { padding: 12px; background: #f4f7f4; border: 1px solid var(--line); border-radius: 8px; text-align: center; }

.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #13231f;
    color: #f4fbf8;
}
.side-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.side-brand small { display: block; color: rgba(244,251,248,.65); margin-top: 2px; }
.side-nav,
.dynamic-nav { display: grid; gap: 7px; }
.side-nav a,
.dynamic-nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: rgba(244,251,248,.78);
}
.side-nav a:hover,
.side-nav a.active,
.dynamic-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.dynamic-nav { border-top: 1px solid rgba(255,255,255,.13); margin-top: 22px; padding-top: 18px; }
.dynamic-nav p { margin: 0 0 4px; color: rgba(244,251,248,.55); font-size: .8rem; text-transform: uppercase; font-weight: 800; }
.workspace { min-width: 0; }
.topbar {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px clamp(18px, 4vw, 38px);
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
}
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.2rem, 3vw, 1.7rem); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.quiet-link { color: var(--teal-dark); font-weight: 800; }
.sync-pill {
    border: 1px solid rgba(15, 118, 110, .25);
    border-radius: 999px;
    min-height: 38px;
    padding: 0 13px;
    background: #eefaf8;
    color: var(--teal-dark);
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.sync-pill[data-state="offline"] {
    border-color: rgba(161, 92, 7, .35);
    background: #fff7ed;
    color: var(--warning);
}
.sync-pill[data-state="syncing"],
.sync-pill[data-state="queued"] {
    border-color: rgba(185, 146, 75, .45);
    background: #fff8e8;
    color: #7a561b;
}
.sync-pill[data-state="attention"] {
    border-color: rgba(180, 35, 24, .35);
    background: #fff1f0;
    color: var(--danger);
}
.icon-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.content-surface { padding: clamp(18px, 4vw, 38px); }
.dashboard-hero,
.work-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(23, 32, 29, .06);
}
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(22px, 4vw, 34px);
}
.dashboard-hero h2 { margin: 8px 0; font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.06; }
.dashboard-hero p { max-width: 650px; color: var(--muted); line-height: 1.55; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.metric-card span { display: block; color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; margin-top: 10px; font-size: 1.9rem; }
.metric-card.warning strong { color: var(--warning); }
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.work-panel { padding: 22px; }
.work-panel h3 { margin: 0 0 14px; }
.action-list,
.status-list { display: grid; gap: 10px; }
.action-list a,
.status-list span {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfb;
}
.offline-ribbon {
    position: fixed;
    inset: auto 16px 16px auto;
    z-index: 20;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    box-shadow: var(--shadow);
}
.error-panel {
    width: min(560px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 34px;
    box-shadow: var(--shadow);
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, .82fr) minmax(0, 1.18fr);
        height: 100%;
        max-height: none;
        min-height: 0;
        border-radius: 28px;
    }
    .auth-brand-panel { min-height: 0; justify-content: center; padding: 22px; }
    .auth-card { min-height: 0; padding: 28px 24px; }
    .auth-brand-content { max-width: 100%; }
    .twofa-modal-form { width: min(680px, 100%); }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-102%);
        transition: transform .2s ease;
        z-index: 10;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .icon-btn { display: inline-grid; place-items: center; }
    .metric-grid,
    .work-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .auth-body { padding: 0; }
    .auth-shell {
        height: 100%;
        min-height: 0;
        grid-template-rows: 1fr;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .auth-brand-panel { display: none; }
    .auth-brand-panel h1 { font-size: clamp(1.26rem, 6.1vw, 1.78rem); line-height: 1.08; }
    .auth-brand-content { padding: 0; border-radius: 0; gap: 10px; }
    .auth-copy { font-size: .78rem; line-height: 1.36; }
    .auth-proof { gap: 7px; }
    .auth-proof span { min-width: auto; padding: 6px 9px; font-size: .68rem; }
    .auth-logo-card { width: 100%; align-items: center; }
    .auth-logo { width: 52px; height: 52px; border-radius: 14px; }
    .auth-logo-card strong { font-size: .78rem; }
    .auth-brand-kicker { width: 100%; }
    .login-logo-lockup { gap: 11px; padding: 0 0 12px; }
    .login-logo { width: 58px; height: 58px; border-radius: 15px; }
    .login-logo-lockup strong { font-size: 1.08rem; }
    .login-logo-lockup > div::after { width: 70px; height: 2px; }
    .auth-card { min-height: 0; padding: 18px 16px; overflow: hidden; }
    .auth-card::before { display: none; }
    .auth-form { gap: 12px; }
    .twofa-auth-body .auth-card {
        padding: 10px;
    }
    .twofa-modal-form {
        width: 100%;
        max-height: calc(100dvh - 20px);
        gap: 9px;
        padding: 10px;
        border-radius: 20px;
    }
    .twofa-modal-head {
        display: grid;
        gap: 7px;
    }
    .twofa-modal-head-actions {
        justify-content: space-between;
    }
    .twofa-modal-head h2 { font-size: 1.22rem; }
    .twofa-issuer-pill {
        width: max-content;
        max-width: 100%;
        padding: 6px 9px;
        font-size: .62rem;
    }
    .twofa-scan-panel {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 8px;
    }
    .twofa-qr-card {
        width: max-content;
        justify-self: center;
        padding: 6px;
    }
    .twofa-qr-card img {
        width: 260px;
        max-width: calc(100vw - 68px);
    }
    .twofa-setup-copy { gap: 5px; }
    .twofa-setup-copy strong { font-size: .84rem; }
    .twofa-setup-copy p { font-size: .73rem; line-height: 1.3; }
    .twofa-secret-box { padding: 9px 10px; }
    .twofa-secret-box span,
    .twofa-modal-form .input-field span,
    .twofa-help { font-size: .72rem; }
    .twofa-secret-box strong { font-size: .67rem; letter-spacing: .06em; }
    .twofa-modal-form input { min-height: 40px; font-size: .84rem; }
    .twofa-modal-form .btn { min-height: 42px; font-size: .84rem; }
    .twofa-account-modal { padding: 10px; }
    .twofa-account-dialog { max-height: calc(100dvh - 20px); }
    .twofa-modal-form.is-account-modal { max-height: calc(100dvh - 20px); }
    .form-heading h2 { font-size: clamp(1.42rem, 7vw, 1.82rem); }
    .form-heading p,
    .login-assurance { font-size: .82rem; line-height: 1.42; }
    .auth-security-note { padding: 10px 12px; border-radius: 14px; }
    input { min-height: 46px; border-radius: 13px; }
    .auth-submit { min-height: 48px; }
    .dashboard-hero,
    .topbar,
    .top-actions { align-items: stretch; flex-direction: column; }
    .metric-grid,
    .work-grid,
    .backup-grid { grid-template-columns: 1fr; }
}

.reports-page {
    display: grid;
    gap: 18px;
}
.reports-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: stretch;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 82% 18%, rgba(201, 151, 43, .20), transparent 32%),
        linear-gradient(135deg, #f8fbf3, #eef6ef 48%, #fbfaf4);
    box-shadow: var(--shadow);
}
.reports-hero h2 {
    margin: 8px 0;
    max-width: 760px;
    font-size: clamp(1.9rem, 4vw, 3.2rem);
    line-height: 1.04;
    letter-spacing: -.04em;
}
.reports-hero p {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.6;
}
.report-brand-card {
    display: grid;
    align-content: center;
    gap: 8px;
    min-height: 180px;
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(145deg, #0b5139, #153226);
    color: #fff;
    overflow: hidden;
    position: relative;
}
.report-brand-card::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -60px;
    top: -50px;
    border-radius: 999px;
    background: rgba(201, 151, 43, .32);
}
.report-brand-card .brand-mark {
    width: 58px;
    height: 58px;
    z-index: 1;
}
.report-brand-card strong,
.report-brand-card small {
    position: relative;
    z-index: 1;
}
.report-brand-card small {
    color: rgba(255,255,255,.78);
}
.report-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}
.report-filters label {
    display: grid;
    gap: 6px;
}
.report-filters label span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.report-filters input,
.report-filters select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 10px;
    background: #fbfdfb;
    color: var(--ink);
    font: inherit;
}
.report-filters input:focus,
.report-filters select:focus {
    outline: 3px solid rgba(12, 91, 63, .16);
    border-color: var(--brand);
}
.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    grid-column: span 2;
}
.report-status {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f8fbf3;
    color: var(--muted);
    font-weight: 700;
}
.report-status[data-state="success"] {
    border-color: rgba(12, 91, 63, .26);
    color: #0c5b3f;
}
.report-status[data-state="warning"] {
    border-color: rgba(201, 151, 43, .42);
    background: #fff8e7;
    color: #7a5914;
}
.report-status[data-state="error"] {
    border-color: rgba(168, 63, 50, .35);
    background: #fff1ee;
    color: #8f3025;
}
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
.report-kpi {
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}
.report-kpi span {
    display: block;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.report-kpi strong {
    display: block;
    margin-top: 14px;
    color: var(--ink);
    font-size: clamp(1.25rem, 2vw, 1.85rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}
.report-kpi.warning strong {
    color: #a66300;
}
.report-table-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.report-table-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fbf6);
}
.report-table-heading h3 {
    margin: 4px 0 0;
}
.report-table-heading span {
    color: var(--muted);
    font-size: .86rem;
}
.table-scroll {
    overflow-x: auto;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.report-table th,
.report-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: .9rem;
}
.report-table th {
    background: #f2f7ef;
    color: var(--brand);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.report-table tr:hover td {
    background: #fbfdf8;
}
.empty-cell {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}
.report-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}
.report-pagination button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    color: var(--brand);
    font-weight: 800;
    cursor: pointer;
}
.report-pagination button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 1180px) {
    .report-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .reports-hero { grid-template-columns: 1fr; }
    .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-actions { grid-column: 1 / -1; }
    .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-table-heading { flex-direction: column; }
}

@media (max-width: 560px) {
    .report-filters,
    .report-summary-grid { grid-template-columns: 1fr; }
    .report-actions .btn { width: 100%; justify-content: center; }
}

.ops-readiness-page {
    display: grid;
    gap: 18px;
}
.ops-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: stretch;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(circle at 12% 15%, rgba(201, 151, 43, .18), transparent 28%),
        linear-gradient(135deg, #f8fbf5, #eef5ec 48%, #fbfaf4);
    box-shadow: var(--shadow);
}
.ops-hero h2 {
    margin: 8px 0;
    max-width: 760px;
    font-size: clamp(1.9rem, 4vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -.04em;
}
.ops-hero p {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.6;
}
.ops-session {
    display: inline-grid;
    gap: 4px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}
.ops-session span,
.ops-summary-grid span,
.ops-status-card span,
.ops-panel .eyebrow,
.ops-form span {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.ops-session strong {
    overflow-wrap: anywhere;
}
.ops-status-card {
    display: grid;
    align-content: center;
    gap: 10px;
    min-height: 210px;
    padding: 24px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, #6f5a1d, #2f2a1c);
    position: relative;
    overflow: hidden;
}
.ops-status-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -60px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
}
.ops-status-card.pass {
    background: linear-gradient(145deg, #0c5b3f, #153226);
}
.ops-status-card.warn {
    background: linear-gradient(145deg, #9f6a12, #3c2f14);
}
.ops-status-card.fail {
    background: linear-gradient(145deg, #8f3025, #351714);
}
.ops-status-card strong {
    position: relative;
    z-index: 1;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}
.ops-status-card span,
.ops-status-card small {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.78);
}
.ops-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
.ops-summary-grid article,
.ops-panel,
.ops-form {
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
}
.ops-summary-grid article {
    min-height: 110px;
    padding: 16px;
    border-radius: 16px;
}
.ops-summary-grid strong {
    display: block;
    margin-top: 14px;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}
.ops-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.ops-feedback {
    padding: 10px 12px;
    border-radius: 999px;
    background: #f5f8f2;
    color: var(--muted);
    font-weight: 800;
}
.ops-feedback[data-state="success"] {
    background: #eaf7ed;
    color: #0c5b3f;
}
.ops-feedback[data-state="warning"] {
    background: #fff8e4;
    color: #7a5914;
}
.ops-feedback[data-state="error"] {
    background: #fff0ed;
    color: #8f3025;
}
.ops-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}
.ops-panel,
.ops-form {
    border-radius: 18px;
    overflow: hidden;
}
.ops-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fbf6);
}
.ops-panel-head h3,
.ops-form h3 {
    margin: 4px 0 0;
}
.ops-check-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}
.ops-check {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 14px;
    background: #fbfdf9;
}
.ops-check p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.45;
}
.ops-check span,
.ops-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.ops-check.pass,
.ops-badge.pass,
.ops-approval.pass {
    border-color: rgba(12, 91, 63, .34);
}
.ops-check.pass span,
.ops-badge.pass,
.ops-approval.pass strong {
    background: #e9f7ef;
    color: #0c5b3f;
}
.ops-check.warn,
.ops-badge.warn,
.ops-approval.warn {
    border-color: rgba(201, 151, 43, .50);
}
.ops-check.warn span,
.ops-badge.warn,
.ops-approval.warn strong {
    background: #fff5d8;
    color: #7a5914;
}
.ops-check.fail,
.ops-badge.fail,
.ops-approval.fail {
    border-color: rgba(168, 63, 50, .42);
}
.ops-check.fail span,
.ops-badge.fail,
.ops-approval.fail strong {
    background: #fff0ed;
    color: #8f3025;
}
.ops-check.pending span,
.ops-badge.pending,
.ops-approval.pending strong {
    background: #eef2f4;
    color: #47545d;
}
.ops-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}
.ops-table th,
.ops-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: .9rem;
}
.ops-table th {
    background: #f2f7ef;
    color: var(--brand);
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.ops-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}
.ops-approval-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}
.ops-approval {
    display: grid;
    gap: 8px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdf9;
}
.ops-approval span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}
.ops-approval strong {
    width: max-content;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .78rem;
    text-transform: uppercase;
}
.ops-approval small {
    color: var(--muted);
}
.ops-meta {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 16px;
}
.ops-meta div {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.ops-meta dt {
    color: var(--muted);
    font-weight: 800;
}
.ops-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.ops-forms {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}
.ops-form {
    display: grid;
    gap: 12px;
    padding: 18px;
}
.ops-form label {
    display: grid;
    gap: 6px;
}
.ops-form input,
.ops-form select,
.ops-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 11px;
    background: #fbfdfb;
    color: var(--ink);
    font: inherit;
}
.ops-form textarea {
    resize: vertical;
}
.ops-snapshot-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}
.ops-snapshot {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdf9;
}
.ops-snapshot span,
.ops-snapshot small {
    color: var(--muted);
    overflow-wrap: anywhere;
}
.ops-snapshot.empty {
    color: var(--muted);
}

@media (max-width: 1180px) {
    .ops-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ops-panels,
    .ops-forms { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
    .ops-hero { grid-template-columns: 1fr; }
    .ops-summary-grid,
    .ops-approval-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-meta div { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
    .ops-summary-grid,
    .ops-approval-grid { grid-template-columns: 1fr; }
    .ops-action-row .btn { width: 100%; justify-content: center; }
}

/* ALADDIN-PC admin interface refinement */
:root {
    --admin-bg: #eef4ef;
    --admin-surface: rgba(255, 255, 255, .88);
    --admin-border: rgba(23, 32, 29, .1);
    --admin-strong: #0b312d;
    --admin-sidebar: #071b18;
    --admin-sidebar-soft: #0d2b26;
    --admin-gold: #c59b45;
    --admin-teal: #0f766e;
    --admin-teal-dark: #0b4f49;
    --admin-red: #b42318;
}

.ui-icon {
    width: 1.08rem;
    height: 1.08rem;
    flex: 0 0 auto;
}

.app-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(197, 155, 69, .18), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(15, 118, 110, .18), transparent 28%),
        linear-gradient(135deg, #f9fbf7 0%, var(--admin-bg) 48%, #e4eee7 100%);
}

.app-shell {
    grid-template-columns: 272px minmax(0, 1fr);
    background: transparent;
}

.workspace {
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0)),
        transparent;
}

.sidebar {
    position: sticky;
    isolation: isolate;
    overflow: hidden auto;
    padding: 18px 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(197, 155, 69, .22), transparent 34%),
        linear-gradient(180deg, var(--admin-sidebar) 0%, var(--admin-sidebar-soft) 100%);
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 18px 0 50px rgba(7, 27, 24, .12);
}

.sidebar-glow {
    position: absolute;
    width: 170px;
    height: 170px;
    right: -80px;
    top: 80px;
    z-index: -1;
    border-radius: 999px;
    background: rgba(197, 155, 69, .16);
    filter: blur(2px);
}

.side-brand {
    position: relative;
    min-height: 70px;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 22px;
    background: rgba(255,255,255,.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.side-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    padding: 5px;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 14px 26px rgba(0,0,0,.24);
}

.side-brand strong {
    display: block;
    color: #fff;
    font-size: .95rem;
    letter-spacing: .02em;
}

.side-brand small {
    color: rgba(244,251,248,.64);
    font-size: .72rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.side-nav,
.dynamic-nav {
    gap: 6px;
}

.side-nav-link,
.side-nav a,
.dynamic-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: rgba(244,251,248,.72);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: -.01em;
    transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.side-nav-link:hover,
.side-nav a:hover,
.dynamic-nav a:hover,
.side-nav-link.active,
.side-nav a.active,
.dynamic-nav a.active {
    transform: translateX(2px);
    border-color: rgba(255,255,255,.12);
    background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
    color: #fff;
}

.side-nav-link.active::before,
.side-nav a.active::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 999px;
    background: var(--admin-gold);
    box-shadow: 0 0 18px rgba(197, 155, 69, .55);
}

.dynamic-nav {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.dynamic-nav p {
    padding: 0 12px;
    color: rgba(244,251,248,.48);
    font-size: .68rem;
    letter-spacing: .12em;
}

.nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9;
    border: 0;
    background: rgba(7, 27, 24, .5);
    backdrop-filter: blur(2px);
}

.topbar {
    min-height: 78px;
    align-items: center;
    border-bottom: 1px solid rgba(23, 32, 29, .08);
    background: rgba(255,255,255,.78);
    box-shadow: 0 14px 34px rgba(23, 32, 29, .05);
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-title h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(1.12rem, 2.4vw, 1.58rem);
    letter-spacing: -.035em;
}

.icon-btn {
    flex: 0 0 auto;
    border-radius: 14px;
    border-color: rgba(15, 118, 110, .16);
    background: #fff;
    color: var(--admin-teal-dark);
    box-shadow: 0 12px 24px rgba(23, 32, 29, .08);
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.top-action,
.top-icon-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(15, 118, 110, .14);
    background: rgba(255,255,255,.82);
    color: var(--admin-teal-dark);
    font-size: .82rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(23, 32, 29, .06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.top-icon-action {
    min-width: 42px;
    padding: 0 13px;
}

.top-icon-action:hover,
.top-action:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, .28);
    background: #fff;
    box-shadow: 0 16px 28px rgba(23, 32, 29, .09);
}

.top-icon-danger {
    color: var(--admin-red);
}

.top-signout-form {
    margin: 0;
}

.sync-pill {
    min-width: 118px;
    padding: 0 14px;
}

.sync-pill .ui-icon {
    width: 1rem;
    height: 1rem;
}

.top-user-chip {
    min-height: 44px;
    max-width: 230px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 10px 24px rgba(23, 32, 29, .05);
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--admin-teal), var(--admin-teal-dark));
    color: #fff;
    font-size: .74rem;
    font-weight: 900;
}

.user-meta {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.user-meta strong,
.user-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta strong {
    color: var(--admin-strong);
    font-size: .78rem;
}

.user-meta small {
    color: var(--muted);
    font-size: .68rem;
}

.flash-stack {
    position: fixed;
    top: 82px;
    right: clamp(12px, 2.5vw, 28px);
    z-index: 12000;
    width: min(380px, calc(100vw - 24px));
    display: grid;
    gap: 8px;
    padding: 0;
    pointer-events: none;
}

.flash-stack .flash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 10px 11px 13px;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(23, 32, 29, .14);
    pointer-events: auto;
    animation: flash-enter .18s ease-out both;
}

.flash-message {
    min-width: 0;
    font-size: .76rem;
    line-height: 1.45;
}

.flash-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: currentColor;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
}

.flash-close:hover,
.flash-close:focus-visible {
    background: rgba(255, 255, 255, .72);
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.flash-stack .flash.is-leaving {
    pointer-events: none;
    animation: flash-leave .16s ease-in both;
}

@keyframes flash-enter {
    from { opacity: 0; transform: translateY(-8px); }
}

@keyframes flash-leave {
    to { opacity: 0; transform: translateY(-6px); }
}

.content-surface {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.enterprise-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(23, 32, 29, .08);
    background:
        radial-gradient(circle at 82% 15%, rgba(197, 155, 69, .28), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f3f8f4 48%, #edf6f1 100%);
    box-shadow: 0 24px 70px rgba(23, 32, 29, .09);
}

.enterprise-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    bottom: -120px;
    border-radius: 999px;
    background: rgba(15, 118, 110, .12);
}

.hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.enterprise-hero h2 {
    max-width: 760px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4.4vw, 3.8rem);
    letter-spacing: -.06em;
}

.enterprise-hero p {
    max-width: 720px;
}

.hero-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-action-row .btn {
    padding-inline: 18px;
}

.hero-status-card {
    position: relative;
    z-index: 1;
    min-width: 260px;
    align-self: stretch;
    display: grid;
    align-content: end;
    gap: 7px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(145deg, #071b18, #0e4f48);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.hero-status-card p,
.hero-status-card small {
    margin: 0;
    color: rgba(255,255,255,.72);
}

.hero-status-card strong {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    letter-spacing: -.04em;
}

.status-orb {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #f7df9c 0 28%, transparent 30%),
        rgba(197, 155, 69, .22);
    box-shadow: 0 0 34px rgba(197, 155, 69, .38);
}

.dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card-polished {
    min-height: 132px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-radius: 22px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 18px 48px rgba(23, 32, 29, .07);
}

.metric-card-polished .metric-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #eef9f6;
    color: var(--admin-teal-dark);
}

.metric-card-polished.warning .metric-icon {
    background: #fff5df;
    color: #9a5d07;
}

.metric-card-polished strong {
    font-size: clamp(1.55rem, 2.8vw, 2.25rem);
    letter-spacing: -.045em;
}

.dashboard-work-grid {
    align-items: stretch;
}

.command-panel {
    border-radius: 24px;
    padding: 20px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 18px 48px rgba(23, 32, 29, .07);
}

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

.panel-heading-row h3 {
    margin: 3px 0 0;
    font-size: 1.12rem;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #eef9f6;
    color: var(--admin-teal-dark);
    font-size: .72rem;
    font-weight: 900;
}

.action-tile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-tile-list a,
.status-chip-list span {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 17px;
    background: linear-gradient(180deg, #fff, #f8fbf7);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.action-tile-list a:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, .2);
    box-shadow: 0 14px 30px rgba(23, 32, 29, .08);
}

.status-chip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-chip-list span {
    line-height: 1.32;
}

.aems-btn,
.btn {
    border-radius: 14px;
    font-weight: 900;
}

.aems-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid rgba(15, 118, 110, .16);
    background: #fff;
    color: var(--admin-teal-dark);
    box-shadow: 0 10px 24px rgba(23, 32, 29, .055);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.aems-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(23, 32, 29, .08);
}

.aems-btn-primary,
.aems-btn.aems-btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--admin-teal), var(--admin-teal-dark));
    color: #fff;
}

.aems-btn-secondary,
.aems-btn.aems-btn-secondary {
    background: #f8fbf8;
    color: var(--admin-teal-dark);
}

.aems-btn-danger,
.aems-btn.aems-btn-danger {
    border-color: rgba(180, 35, 24, .25);
    background: #fff1f0;
    color: var(--admin-red);
}

.aems-card,
#export-filters,
#module-content > .bg-white,
#data-container > .bg-white {
    border: 1px solid rgba(23, 32, 29, .08) !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 18px 48px rgba(23, 32, 29, .07) !important;
}

.inventory-products-page-header,
.flex.items-center.justify-between.mb-6,
.mb-4.flex.items-start.justify-between.flex-wrap,
.flex.justify-end.mb-3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 22px;
    background:
        radial-gradient(circle at 95% 8%, rgba(197, 155, 69, .14), transparent 24%),
        rgba(255,255,255,.9);
    box-shadow: 0 16px 40px rgba(23, 32, 29, .065);
}

.inventory-products-page-header h1,
.flex.items-center.justify-between.mb-6 h1,
.mb-4.flex.items-start.justify-between.flex-wrap h1 {
    margin: 0;
    color: var(--admin-strong) !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.6vw, 2rem) !important;
    line-height: 1.05;
    letter-spacing: -.04em;
}

.inventory-products-page-header p,
.flex.items-center.justify-between.mb-6 p,
.mb-4.flex.items-start.justify-between.flex-wrap p {
    color: var(--muted) !important;
    line-height: 1.45;
}

.inventory-products-actions,
.flex.items-center.gap-2,
.flex.items-center.gap-2.flex-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

#module-content,
#data-container {
    min-width: 0;
}

#module-content table,
#data-container table,
.aems-card table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

#module-content th,
#module-content td,
#data-container th,
#data-container td,
.aems-card th,
.aems-card td {
    border-color: rgba(23, 32, 29, .08) !important;
}

#module-content th,
#data-container th,
.aems-card th {
    background: #f0f7f4 !important;
    color: var(--admin-teal-dark) !important;
    font-size: .72rem !important;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#module-content td,
#data-container td,
.aems-card td {
    color: #25342f;
}

#module-content input,
#module-content select,
#module-content textarea,
#data-container input,
#data-container select,
#data-container textarea,
.aems-input,
input.aems-input,
select.aems-input,
textarea.aems-input {
    border: 1px solid rgba(15, 118, 110, .18) !important;
    border-radius: 13px !important;
    background: #fff !important;
    color: var(--ink) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(23, 32, 29, .045) !important;
}

#module-content input:focus,
#module-content select:focus,
#module-content textarea:focus,
#data-container input:focus,
#data-container select:focus,
#data-container textarea:focus,
.aems-input:focus {
    outline: 3px solid rgba(15, 118, 110, .14) !important;
    border-color: var(--admin-teal) !important;
}

.hidden { display: none !important; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 800; }
.font-semibold { font-weight: 750; }
.font-medium { font-weight: 700; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.rounded-lg { border-radius: 14px; }
.shadow-sm { box-shadow: 0 8px 20px rgba(23, 32, 29, .045); }

@media (max-width: 1180px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: min(300px, calc(100vw - 48px));
        padding: 16px 12px;
        transform: translateX(-106%);
        box-shadow: 24px 0 70px rgba(7, 27, 24, .28);
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    body.nav-open .nav-scrim {
        display: block;
    }

    .topbar {
        min-height: 70px;
        flex-direction: row;
        align-items: center;
    }

    .top-actions {
        gap: 7px;
    }

    .top-user-chip {
        max-width: 46px;
        padding: 5px;
    }

    .user-meta {
        display: none;
    }

    .enterprise-hero {
        grid-template-columns: 1fr;
    }

    .hero-status-card {
        min-width: 0;
        min-height: 170px;
    }
}

@media (max-width: 720px) {
    .content-surface {
        padding: 16px;
    }

    .topbar {
        gap: 10px;
        padding: 12px 14px;
    }

    .topbar-title h1 {
        font-size: 1.05rem;
    }

    .topbar-title .eyebrow {
        font-size: .62rem;
    }

    .sync-pill {
        min-width: 42px;
        width: 42px;
        padding: 0;
    }

    .sync-pill span,
    .top-icon-action span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .top-icon-action {
        width: 42px;
        padding: 0;
    }

    .enterprise-hero {
        padding: 20px;
        border-radius: 22px;
    }

    .enterprise-hero h2 {
        font-size: clamp(1.65rem, 8vw, 2.35rem);
    }

    .dashboard-metrics,
    .dashboard-work-grid,
    .action-tile-list,
    .status-chip-list {
        grid-template-columns: 1fr;
    }

    .inventory-products-page-header,
    .flex.items-center.justify-between.mb-6,
    .mb-4.flex.items-start.justify-between.flex-wrap,
    .flex.justify-end.mb-3 {
        align-items: stretch;
        padding: 15px;
    }

    .inventory-products-actions,
    .flex.items-center.gap-2,
    .flex.items-center.gap-2.flex-wrap {
        justify-content: stretch;
    }

    .inventory-products-actions .aems-btn,
    .flex.items-center.gap-2 .aems-btn,
    .flex.items-center.gap-2.flex-wrap .aems-btn,
    .inventory-products-actions button,
    .inventory-products-actions a {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .content-surface {
        padding: 12px;
    }

    .top-actions {
        gap: 5px;
    }

    .topbar-title h1 {
        max-width: 42vw;
    }

    .metric-card-polished {
        min-height: 112px;
        padding: 15px;
    }

    .command-panel {
        padding: 15px;
        border-radius: 20px;
    }

    .hero-action-row .btn {
        width: 100%;
    }
}

/* Compact business dashboard metrics */
.business-dashboard {
    display: grid;
    gap: 16px;
}

.business-dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 10%, rgba(197, 155, 69, .14), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,.95), rgba(246,250,246,.92));
    box-shadow: 0 18px 45px rgba(23, 32, 29, .065);
}

.business-dashboard-head h2 {
    margin: 4px 0 3px;
    color: var(--admin-strong, #0b312d);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.4vw, 1.95rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.business-dashboard-head p:not(.eyebrow) {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}

.business-branch-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 999px;
    background: #eef9f6;
    color: var(--admin-teal-dark, #0b4f49);
    font-size: .78rem;
    font-weight: 900;
}

.business-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.business-kpi {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    display: grid;
    align-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 42px rgba(23, 32, 29, .065);
}

.business-kpi::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -58px;
    top: -58px;
    border-radius: 999px;
    background: rgba(15, 118, 110, .08);
}

.business-kpi-icon {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef9f6;
    color: var(--admin-teal-dark, #0b4f49);
}

.business-kpi-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.business-kpi-copy span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.business-kpi-copy strong {
    color: var(--admin-strong, #0b312d);
    font-size: clamp(1.42rem, 2.5vw, 1.92rem);
    line-height: 1.02;
    letter-spacing: -.045em;
    overflow-wrap: anywhere;
}

.business-kpi-copy small {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.35;
}

.business-kpi.amber .business-kpi-icon,
.business-kpi.amber::after {
    background: #fff4dc;
    color: #955b08;
}

.business-kpi.green .business-kpi-icon,
.business-kpi.green::after {
    background: #eaf7ed;
    color: #126b3d;
}

.business-kpi.blue .business-kpi-icon,
.business-kpi.blue::after {
    background: #eef5ff;
    color: #1d4f8f;
}

.business-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 14px;
}

.business-panel {
    padding: 16px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 22px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 18px 42px rgba(23, 32, 29, .06);
}

.business-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.business-panel-head h3 {
    margin: 3px 0 0;
    color: var(--admin-strong, #0b312d);
    font-size: 1rem;
    line-height: 1.15;
}

.business-shortcuts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.business-shortcuts a {
    min-height: 70px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 12px 10px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 17px;
    background: linear-gradient(180deg, #fff, #f8fbf7);
    color: var(--admin-teal-dark, #0b4f49);
    font-size: .78rem;
    font-weight: 900;
    text-align: center;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.business-shortcuts a:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, .26);
    box-shadow: 0 14px 28px rgba(23, 32, 29, .075);
}

.business-shortcuts .ui-icon {
    width: 1.22rem;
    height: 1.22rem;
}

.business-signal-list {
    display: grid;
    gap: 8px;
}

.business-signal-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 15px;
    background: #f8fbf8;
}

.business-signal-list span {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.business-signal-list strong {
    color: var(--admin-strong, #0b312d);
    font-size: .94rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-align: right;
}

.business-panel-link {
    flex: 0 0 auto;
    color: #0f766e;
    font-size: .7rem;
    font-weight: 850;
    text-decoration: none;
}

.business-panel-link:hover,
.business-panel-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

.business-attention-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 11px;
}

.business-attention-metrics > div {
    min-width: 0;
    padding: 11px;
    border: 1px solid #e0e9e5;
    border-radius: 14px;
    background: #f8fbf9;
}

.business-attention-metrics span,
.business-attention-metrics strong,
.business-attention-metrics small {
    display: block;
}

.business-attention-metrics span {
    overflow: hidden;
    color: #687a74;
    font-size: .61rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.business-attention-metrics strong {
    margin: 6px 0 3px;
    color: #203d36;
    font-size: 1.08rem;
    line-height: 1;
}

.business-attention-metrics small {
    color: #788883;
    font-size: .59rem;
    line-height: 1.3;
}

.business-attention-metrics .warning { border-color: #ead7ad; background: #fff9ec; }
.business-attention-metrics .warning strong { color: #956311; }
.business-attention-metrics .critical { border-color: #ebc7c3; background: #fff4f2; }
.business-attention-metrics .critical strong { color: #a53d34; }
.business-attention-metrics .unassigned { border-color: #cedceb; background: #f3f7fc; }
.business-attention-metrics .unassigned strong { color: #355f8c; }
.business-attention-metrics .reorder { border-color: #bfe1d8; background: #f0faf6; }
.business-attention-metrics .reorder strong { color: #087d6b; }

.business-attention-list {
    display: grid;
    gap: 7px;
}

.business-attention-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 47px;
    padding: 8px 10px;
    border: 1px solid #e4ebe8;
    border-radius: 13px;
    color: inherit;
    background: #fff;
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease;
}

.business-attention-row:hover,
.business-attention-row:focus-visible {
    border-color: #acd2c8;
    background: #f8fcfa;
    outline: none;
}

.business-attention-status {
    width: 7px;
    height: 28px;
    border-radius: 999px;
    background: #d3942d;
}

.business-attention-status.critical { background: #bf4d44; }
.business-attention-status.unassigned { background: #477aaa; }

.business-attention-product,
.business-attention-quantity {
    min-width: 0;
}

.business-attention-product strong,
.business-attention-product small,
.business-attention-quantity strong,
.business-attention-quantity small {
    display: block;
}

.business-attention-product strong {
    overflow: hidden;
    color: #29433d;
    font-size: .73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-attention-product small,
.business-attention-quantity small {
    margin-top: 2px;
    color: #778782;
    font-size: .6rem;
}

.business-attention-quantity {
    text-align: right;
}

.business-attention-quantity strong {
    color: #233f38;
    font-size: .76rem;
}

.business-attention-empty {
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    border: 1px dashed #cfddd8;
    border-radius: 15px;
    background: #fafcfb;
}

.business-attention-empty > span {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #087d6b;
    background: #e7f6f1;
}

.business-attention-empty .ui-icon { width: 19px; height: 19px; }
.business-attention-empty strong { color: #29443d; font-size: .76rem; }
.business-attention-empty p { margin: 3px 0 0; color: #768681; font-size: .65rem; }

.business-branch-sales-panel {
    min-width: 0;
}

.business-branch-sales-panel .business-panel-head {
    align-items: center;
}

.business-branch-sales-total {
    flex: 0 0 auto;
    text-align: right;
}

.business-branch-sales-total span,
.business-branch-sales-total strong {
    display: block;
}

.business-branch-sales-total span {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.business-branch-sales-total strong {
    color: #0b5d52;
    font-size: 1rem;
    line-height: 1.15;
}

.business-branch-sales-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 11px;
}

.business-branch-sales-meta span,
.business-branch-sales-meta time {
    padding: 5px 8px;
    border: 1px solid #dfe9e5;
    border-radius: 999px;
    color: #677873;
    background: #f8faf9;
    font-size: .62rem;
    font-weight: 750;
}

.business-branch-sales-list {
    display: grid;
    gap: 8px;
    max-height: 322px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-gutter: stable;
}

.business-branch-sale-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    padding: 11px 12px;
    border: 1px solid #e1e9e6;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff 0%, #f8fbf9 100%);
}

.business-branch-sale-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.business-branch-sale-main > div {
    min-width: 0;
}

.business-branch-sale-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: #0f766e;
    background: #e8f6f1;
}

.business-branch-sale-icon .ui-icon {
    width: 17px;
    height: 17px;
}

.business-branch-sale-main strong,
.business-branch-sale-main small,
.business-branch-sale-value strong,
.business-branch-sale-value small {
    display: block;
}

.business-branch-sale-main strong {
    overflow: hidden;
    color: #263f39;
    font-size: .78rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-branch-sale-main small,
.business-branch-sale-value small {
    margin-top: 3px;
    color: #74847f;
    font-size: .63rem;
    line-height: 1.3;
}

.business-branch-sale-value {
    min-width: 94px;
    text-align: right;
}

.business-branch-sale-value strong {
    color: #173c34;
    font-size: .8rem;
    line-height: 1.3;
}

.business-branch-sale-track {
    grid-column: 1 / -1;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eeeb;
}

.business-branch-sale-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #49a98f);
}

.business-branch-sales-empty {
    min-height: 178px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 24px;
    border: 1px dashed #cfddd8;
    border-radius: 16px;
    color: #61736d;
    background: #fafcfb;
    text-align: center;
}

.business-branch-sales-empty > span {
    width: 40px;
    height: 40px;
    display: grid;
    margin-bottom: 9px;
    place-items: center;
    border-radius: 13px;
    color: #0f766e;
    background: #e8f6f1;
}

.business-branch-sales-empty .ui-icon {
    width: 20px;
    height: 20px;
}

.business-branch-sales-empty strong {
    color: #29453e;
    font-size: .8rem;
}

.business-branch-sales-empty p {
    max-width: 330px;
    margin: 5px 0 0;
    font-size: .7rem;
    line-height: 1.45;
}

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

    .business-shortcuts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .business-attention-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .business-dashboard-head,
    .business-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .business-dashboard-grid {
        display: grid;
    }

    .business-dashboard-head {
        align-items: flex-start;
    }

    .business-branch-pill {
        width: max-content;
        max-width: 100%;
    }
}

@media (max-width: 620px) {
    .business-dashboard {
        gap: 12px;
    }

    .business-dashboard-head,
    .business-panel,
    .business-kpi {
        border-radius: 18px;
    }

    .business-dashboard-head {
        padding: 15px;
    }

    .business-dashboard-head h2 {
        font-size: 1.28rem;
    }

    .business-dashboard-head p:not(.eyebrow) {
        font-size: .78rem;
    }

    .business-kpi-grid,
    .business-dashboard-grid,
    .business-shortcuts {
        grid-template-columns: 1fr;
    }

    .business-attention-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .business-kpi {
        min-height: 104px;
        grid-template-columns: 38px minmax(0, 1fr);
        align-content: center;
        align-items: center;
        gap: 12px;
        padding: 14px;
    }

    .business-kpi-copy strong {
        font-size: 1.38rem;
    }

    .business-shortcuts a {
        min-height: 52px;
        grid-template-columns: 22px minmax(0, 1fr);
        justify-items: start;
        text-align: left;
    }
}

/* Refined admin header and account dropdown */
.topbar {
    min-height: 82px;
    padding: 14px clamp(16px, 3vw, 34px);
    background:
        radial-gradient(circle at 84% 0%, rgba(197, 155, 69, .13), transparent 30%),
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(247,251,248,.84));
    border-bottom: 1px solid rgba(23, 32, 29, .08);
    box-shadow: 0 14px 34px rgba(23, 32, 29, .055);
}

.topbar-title {
    display: grid;
    gap: 3px;
}

.topbar-title .eyebrow {
    font-size: .68rem;
    letter-spacing: .12em;
}

.topbar-title h1 {
    margin: 0;
    color: var(--admin-strong, #0b312d);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.18rem, 2.1vw, 1.56rem);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.top-actions {
    position: relative;
}

.account-menu {
    position: relative;
    flex: 0 0 auto;
}

.account-menu[open] {
    z-index: 30;
}

.account-menu-trigger {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    padding: 5px 11px 5px 5px;
    border: 1px solid rgba(15, 118, 110, .14);
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: var(--admin-strong, #0b312d);
    box-shadow: 0 12px 28px rgba(23, 32, 29, .065);
    cursor: pointer;
    list-style: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.account-menu-trigger::-webkit-details-marker {
    display: none;
}

.account-menu-trigger:hover,
.account-menu[open] .account-menu-trigger {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, .28);
    box-shadow: 0 16px 34px rgba(23, 32, 29, .09);
}

.account-chevron {
    width: .9rem;
    height: .9rem;
    color: var(--muted);
    transition: transform .18s ease;
}

.account-menu[open] .account-chevron {
    transform: rotate(180deg);
}

.account-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(310px, calc(100vw - 28px));
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(23, 32, 29, .1);
    border-radius: 22px;
    background:
        radial-gradient(circle at 90% 8%, rgba(197, 155, 69, .13), transparent 28%),
        rgba(255,255,255,.98);
    box-shadow: 0 26px 70px rgba(7, 27, 24, .18);
    backdrop-filter: blur(18px);
}

.account-menu-profile {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 17px;
    background: #f4faf7;
}

.account-menu-profile div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.account-menu-profile strong,
.account-menu-profile small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-profile strong {
    color: var(--admin-strong, #0b312d);
    font-size: .9rem;
    line-height: 1.1;
}

.account-menu-profile small {
    color: var(--muted);
    font-size: .74rem;
}

.user-avatar.large {
    width: 42px;
    height: 42px;
    font-size: .82rem;
}

.account-menu-item {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: #26342f;
    font-size: .84rem;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.account-menu-item:hover {
    border-color: rgba(15, 118, 110, .14);
    background: #eef9f6;
    color: var(--admin-teal-dark, #0b4f49);
}

.account-menu-item.danger {
    color: var(--admin-red, #b42318);
}

.account-menu-item.danger:hover {
    border-color: rgba(180, 35, 24, .16);
    background: #fff1f0;
}

.account-menu-form {
    margin: 2px 0 0;
    padding-top: 6px;
    border-top: 1px solid rgba(23, 32, 29, .08);
}

@media (max-width: 720px) {
    .topbar {
        min-height: 68px;
        padding: 10px 12px;
    }

    .topbar-title h1 {
        max-width: 46vw;
        font-size: .98rem;
    }

    .account-menu-trigger {
        width: 46px;
        min-width: 46px;
        padding: 5px;
        justify-content: center;
    }

    .account-menu-trigger .user-meta,
    .account-menu-trigger .account-chevron {
        display: none;
    }

    .account-menu-panel {
        position: fixed;
        top: 76px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (max-width: 420px) {
    .topbar-title h1 {
        max-width: 38vw;
    }

    .account-menu-panel {
        top: 70px;
    }
}

/* Icon-only sync control */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sync-icon-only,
.sync-pill.sync-icon-only {
    width: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
}

.sync-icon-only .ui-icon {
    width: 1.08rem;
    height: 1.08rem;
}

@media (max-width: 720px) {
    .sync-pill.sync-icon-only {
        width: 42px;
        min-width: 42px;
    }
}

/* Force header sync status to remain icon-only even after JS state text updates */
.sync-pill.sync-icon-only {
    position: relative;
    font-size: 0 !important;
    line-height: 0;
    color: var(--admin-teal-dark, #0b4f49);
}

.sync-pill.sync-icon-only > * {
    display: none !important;
}

.sync-pill.sync-icon-only::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-5a4 4 0 0 0-7.5-1.8M4 17h5a4 4 0 0 0 7.5 1.8M4 17l3-3m-3 3 3 3M20 7l-3-3m3 3-3 3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-5a4 4 0 0 0-7.5-1.8M4 17h5a4 4 0 0 0 7.5 1.8M4 17l3-3m-3 3 3 3M20 7l-3-3m3 3-3 3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tighten space between admin header and page content */
.workspace .content-surface {
    padding-top: clamp(8px, 1.3vw, 14px) !important;
}

.flash-stack:empty + .content-surface {
    padding-top: clamp(6px, 1vw, 12px) !important;
}

@media (max-width: 720px) {
    .workspace .content-surface {
        padding-top: 8px !important;
    }
}

/* Professional operations readiness console */
.ops-console {
    gap: 14px;
}

.ops-console-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 14px;
    align-items: stretch;
    padding: 18px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 24px;
    background:
        radial-gradient(circle at 96% 0%, rgba(197, 155, 69, .16), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,250,247,.94));
    box-shadow: 0 18px 44px rgba(23, 32, 29, .065);
}

.ops-console-title {
    display: grid;
    align-content: center;
    gap: 5px;
    min-width: 0;
}

.ops-console-title h2 {
    margin: 0;
    color: var(--admin-strong, #0b312d);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.ops-console-title p:not(.eyebrow) {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}

.ops-launch-card {
    min-height: 132px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(145deg, #0b312d, #0f766e);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.ops-launch-card.warn,
.ops-launch-card.pending {
    background: linear-gradient(145deg, #6f4f19, #a15c07);
}

.ops-launch-card.fail {
    background: linear-gradient(145deg, #7b2119, #b42318);
}

.ops-launch-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,.13);
}

.ops-launch-card small,
.ops-launch-card em {
    color: rgba(255,255,255,.72);
    font-style: normal;
    font-size: .72rem;
    line-height: 1.35;
}

.ops-launch-card strong {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.ops-metric-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.ops-metric-grid article {
    min-height: 92px;
    padding: 13px;
    border-radius: 18px;
    background: rgba(255,255,255,.93);
}

.ops-metric-grid span {
    font-size: .68rem;
}

.ops-metric-grid strong {
    margin-top: 9px;
    font-size: clamp(1.05rem, 1.8vw, 1.42rem);
    line-height: 1.05;
}

.ops-command-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 20px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 14px 32px rgba(23, 32, 29, .055);
}

.ops-command-strip > div:first-child {
    display: grid;
    gap: 2px;
}

.ops-command-strip strong {
    color: var(--admin-strong, #0b312d);
    font-size: .92rem;
}

.ops-command-strip span {
    color: var(--muted);
    font-size: .76rem;
}

.ops-command-strip .ops-action-row {
    margin: 0;
    justify-content: flex-end;
}

.ops-command-strip .btn {
    min-height: 40px;
    padding-inline: 13px;
    font-size: .82rem;
}

.ops-command-strip .ops-feedback {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
}

.ops-panel {
    border-radius: 22px;
    border-color: rgba(23, 32, 29, .08);
    background: rgba(255,255,255,.92);
    box-shadow: 0 18px 42px rgba(23, 32, 29, .06);
}

.ops-panel-head {
    padding: 15px 16px;
    background: linear-gradient(180deg, #ffffff, #f7fbf8);
}

.ops-panel-head.compact {
    padding: 14px 15px;
}

.ops-panel-head h3 {
    margin-top: 3px;
    color: var(--admin-strong, #0b312d);
    font-size: 1rem;
    line-height: 1.15;
}

.ops-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
}

.ops-health-grid .ops-check {
    min-height: 112px;
    border-radius: 17px;
    background: #fbfdf9;
}

.ops-check strong {
    color: var(--admin-strong, #0b312d);
    font-size: .9rem;
}

.ops-check p {
    font-size: .78rem;
    line-height: 1.4;
}

.ops-badge,
.ops-check span {
    font-size: .66rem;
}

.ops-console-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
    gap: 14px;
    align-items: start;
}

.ops-console-grid.secondary {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .65fr);
}

.ops-side-stack {
    display: grid;
    gap: 14px;
}

.ops-table-wrap {
    padding: 0;
    border-radius: 0 0 22px 22px;
}

.ops-table {
    min-width: 760px;
}

.ops-table th,
.ops-table td {
    padding: 11px 13px;
    font-size: .8rem;
}

.ops-table td strong {
    display: block;
    color: var(--admin-strong, #0b312d);
    font-size: .84rem;
    line-height: 1.25;
}

.ops-table td small {
    color: var(--muted);
    font-size: .7rem;
}

.ops-approval-grid {
    grid-template-columns: 1fr;
    padding: 14px;
}

.ops-approval {
    min-height: 82px;
    border-radius: 15px;
}

.ops-approval span {
    font-size: .76rem;
}

.ops-approval strong {
    font-size: .7rem;
}

.compact-meta {
    padding: 14px;
}

.compact-meta div {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 8px;
}

.compact-meta dt,
.compact-meta dd {
    font-size: .78rem;
}

.ops-admin-drawer {
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 22px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 18px 42px rgba(23, 32, 29, .055);
    overflow: hidden;
}

.ops-admin-drawer summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.ops-admin-drawer summary::-webkit-details-marker {
    display: none;
}

.ops-admin-drawer summary > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #eef9f6;
    color: var(--admin-teal-dark, #0b4f49);
}

.ops-admin-drawer summary strong {
    color: var(--admin-strong, #0b312d);
    font-size: .92rem;
}

.ops-admin-drawer summary small {
    color: var(--muted);
    font-size: .76rem;
}

.ops-admin-drawer .ops-forms {
    padding: 0 14px 14px;
}

.ops-form {
    border-radius: 18px;
    box-shadow: none;
}

.ops-form h3 {
    font-size: .98rem;
}

.ops-form select,
.ops-form input,
.ops-form textarea {
    min-height: 42px;
    border-radius: 13px;
    font-size: .84rem;
}

.ops-snapshot-list {
    padding: 14px;
}

.ops-snapshot {
    border-radius: 15px;
}

.ops-snapshot span,
.ops-snapshot small,
.ops-snapshot.empty {
    font-size: .78rem;
}

.empty-cell {
    color: var(--muted);
    font-size: .82rem;
}

@media (max-width: 1180px) {
    .ops-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-console-grid,
    .ops-console-grid.secondary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .ops-console-hero,
    .ops-command-strip,
    .ops-health-grid,
    .ops-metric-grid {
        grid-template-columns: 1fr;
    }

    .ops-command-strip .ops-action-row {
        justify-content: stretch;
    }

    .ops-command-strip .btn {
        flex: 1 1 100%;
    }

    .ops-launch-card {
        min-height: 112px;
    }

    .ops-admin-drawer summary {
        align-items: flex-start;
    }

    .ops-admin-drawer summary small {
        display: none;
    }
}

@media (max-width: 520px) {
    .ops-console {
        gap: 12px;
    }

    .ops-console-hero,
    .ops-command-strip,
    .ops-panel,
    .ops-admin-drawer {
        border-radius: 18px;
    }

    .ops-console-hero {
        padding: 14px;
    }

    .ops-console-title h2 {
        font-size: 1.28rem;
    }

    .ops-console-title p:not(.eyebrow) {
        font-size: .78rem;
    }

    .ops-metric-grid article {
        min-height: 78px;
        padding: 12px;
    }

    .ops-metric-grid strong {
        font-size: 1.16rem;
    }

    .ops-health-grid {
        padding: 10px;
    }

    .ops-check-list {
        gap: 9px;
    }

    .ops-check {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   ALADDIN-PC enterprise inner inventory module refinement
   Scope: Products, Stock, Reports, Purchases, Sales, POS, Users & Roles
   ============================================================================ */
:root {
    --apc-surface: #ffffff;
    --apc-surface-soft: #f8fafc;
    --apc-surface-warm: #fbf7ed;
    --apc-ink: #172033;
    --apc-muted: #667085;
    --apc-faint: #94a3b8;
    --apc-line: rgba(15, 23, 42, 0.11);
    --apc-line-strong: rgba(15, 23, 42, 0.18);
    --apc-brand: #0f766e;
    --apc-brand-strong: #115e59;
    --apc-brand-soft: #ccfbf1;
    --apc-gold: #b7791f;
    --apc-gold-soft: #fef3c7;
    --apc-danger: #be123c;
    --apc-danger-soft: #ffe4e6;
    --apc-info: #1d4ed8;
    --apc-info-soft: #dbeafe;
    --apc-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --apc-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --apc-radius: 22px;
    --apc-radius-sm: 14px;
}

/* Lightweight utility support for inventory/POS views that use utility classes. */
.hidden { display: none !important; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.inline-block { display: inline-block; }
.grid { display: grid; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.whitespace-nowrap { white-space: nowrap; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.disabled\:opacity-50:disabled { opacity: .5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: .25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: .5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: .75rem; }
.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: .25rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: .5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: .75rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.ml-2 { margin-left: .5rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-1 { padding: .25rem; }
.p-2 { padding: .5rem; }
.p-3 { padding: .75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-1\.5 { padding-top: .375rem; padding-bottom: .375rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-2\.5 { padding-top: .625rem; padding-bottom: .625rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pb-2 { padding-bottom: .5rem; }
.pb-3 { padding-bottom: .75rem; }
.pb-4 { padding-bottom: 1rem; }
.pt-2 { padding-top: .5rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-56 { width: 14rem; }
.w-96 { width: 24rem; }
.w-full { width: 100%; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-\[140px\] { max-width: 140px; }
.max-h-24 { max-height: 6rem; }
.max-h-64 { max-height: 16rem; }
.max-h-80 { max-height: 20rem; }
.max-h-\[70vh\] { max-height: 70vh; }
.max-h-\[90vh\] { max-height: 90vh; }
.max-h-\[92vh\] { max-height: 92vh; }
.min-w-0 { min-width: 0; }
.rounded { border-radius: .55rem; }
.rounded-lg { border-radius: .75rem; }
.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.35rem; }
.rounded-full { border-radius: 999px; }
.border { border: 1px solid var(--apc-line); }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top: 1px solid var(--apc-line); }
.border-b { border-bottom: 1px solid var(--apc-line); }
.border-l { border-left: 1px solid var(--apc-line); }
.border-gray-100 { border-color: rgba(226, 232, 240, .95); }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-600 { border-color: #2563eb; }
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f8fafc; }
.bg-gray-100 { background-color: #f1f5f9; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-300 { background-color: #d1d5db; }
.bg-gray-800 { background-color: #1f2937; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-800 { background-color: #1e293b; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-50 { background-color: #ecfdf5; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-amber-600 { background-color: #d97706; }
.bg-red-600 { background-color: #dc2626; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-black { background-color: #020617; }
.bg-opacity-50 { background-color: rgba(2, 6, 23, .62); }
.text-xs { font-size: .76rem; line-height: 1.15rem; }
.text-sm { font-size: .86rem; line-height: 1.35rem; }
.text-lg { font-size: 1.03rem; line-height: 1.55rem; }
.text-xl { font-size: 1.15rem; line-height: 1.65rem; }
.text-2xl { font-size: 1.35rem; line-height: 1.85rem; }
.font-medium { font-weight: 600; }
.font-semibold { font-weight: 700; }
.font-bold { font-weight: 800; }
.text-white { color: #fff; }
.text-gray-300 { color: #cbd5e1; }
.text-gray-400 { color: #94a3b8; }
.text-gray-500 { color: #64748b; }
.text-gray-600 { color: #475569; }
.text-gray-700 { color: #334155; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #0f172a; }
.text-blue-200 { color: #bfdbfe; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-green-700 { color: #047857; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-rose-600 { color: #e11d48; }
.text-rose-700 { color: #be123c; }
.text-purple-700 { color: #6d28d9; }
.text-amber-700 { color: #b45309; }
.text-indigo-700 { color: #4338ca; }
.text-slate-300 { color: #cbd5e1; }
.shadow-sm { box-shadow: var(--apc-shadow-soft); }
.shadow-lg { box-shadow: 0 18px 38px rgba(15, 23, 42, .12); }
.shadow-2xl { box-shadow: 0 35px 75px rgba(15, 23, 42, .22); }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top: 1px solid var(--apc-line); }
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-top-color: rgba(226, 232, 240, .9); }
.hover\:bg-gray-50:hover { background: #f8fafc; }
.hover\:bg-gray-100:hover { background: #f1f5f9; }
.hover\:bg-gray-200:hover { background: #e5e7eb; }
.hover\:bg-gray-300:hover { background: #d1d5db; }
.hover\:bg-blue-50:hover { background: #eff6ff; }
.hover\:bg-blue-700:hover { background: #1d4ed8; }
.hover\:bg-green-700:hover { background: #15803d; }
.hover\:bg-red-700:hover { background: #b91c1c; }
.hover\:bg-slate-900:hover { background: #0f172a; }
.hover\:text-white:hover { color: #fff; }
.hover\:text-red-700:hover { color: #b91c1c; }
.hover\:underline:hover { text-decoration: underline; }

@media (min-width: 768px) {
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Inventory module page headers. */
.inventory-products-page-header,
.inventory-stock-page-header,
.inventory-purchases-page-header,
.inventory-sales-page-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    margin-bottom: 1rem !important;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: var(--apc-radius);
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, .18), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 48%, #effcf8 100%);
    box-shadow: var(--apc-shadow-soft);
}
.inventory-products-page-header::before,
.inventory-stock-page-header::before,
.inventory-purchases-page-header::before,
.inventory-sales-page-header::before {
    content: "";
    position: absolute;
    inset: auto -5rem -6rem auto;
    width: 14rem;
    height: 14rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, .08);
    pointer-events: none;
}
.inventory-products-page-header h1,
.inventory-stock-page-header h1,
.inventory-purchases-page-header h1,
.inventory-sales-page-header h1 {
    margin: 0;
    color: var(--apc-ink);
    font-size: clamp(1.25rem, 2.1vw, 1.75rem);
    letter-spacing: -.035em;
}
.inventory-products-page-header p,
.inventory-stock-page-header p,
.inventory-purchases-page-header p,
.inventory-sales-page-header p {
    max-width: 58rem;
    margin: .35rem 0 0;
    color: var(--apc-muted);
    font-size: .88rem;
    line-height: 1.5;
}
.inventory-products-page-header > div:last-child,
.inventory-stock-page-header > div:last-child,
.inventory-purchases-page-header > div:last-child,
.inventory-sales-page-header > div:last-child {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .55rem;
}

/* Shared module action language. */
.aems-btn,
.btn,
.inventory-products-page-header button,
.inventory-stock-page-header button,
.inventory-purchases-page-header button,
.inventory-sales-page-header button,
.inventory-products-page-header a,
.inventory-stock-page-header a,
.inventory-purchases-page-header a,
.inventory-sales-page-header a,
.report-actions .btn,
#module-content button,
#data-container button,
#module-content .button,
#data-container .button {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .62rem .9rem;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    background: #fff;
    color: var(--apc-ink);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 8px 18px rgba(15,23,42,.06);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.aems-btn:hover,
.btn:hover,
.inventory-products-page-header button:hover,
.inventory-stock-page-header button:hover,
.inventory-purchases-page-header button:hover,
.inventory-sales-page-header button:hover,
.inventory-products-page-header a:hover,
.inventory-stock-page-header a:hover,
.inventory-purchases-page-header a:hover,
.inventory-sales-page-header a:hover,
#module-content button:hover,
#data-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15,23,42,.09);
}
.aems-btn-primary,
.btn.primary,
#btn-add-product,
#btn-add-purchase,
#btn-new-sale,
#btn-checkout,
#btn-do-export,
#btn-add-split,
#confirm-btn,
#btn-export-daily-sales-pdf {
    border-color: rgba(15, 118, 110, .25) !important;
    background: linear-gradient(135deg, var(--apc-brand), var(--apc-brand-strong)) !important;
    color: #fff !important;
}
.aems-btn-secondary,
.btn.secondary,
#btn-export-purchases,
#btn-cancel-export,
#sh-btn-filter,
#sh-btn-today,
#sh-btn-export-pdf,
#sh-btn-reset,
#sh-btn-export-back {
    background: #fff !important;
    color: var(--apc-ink) !important;
    border-color: rgba(15,23,42,.13) !important;
}
button:disabled,
.aems-btn:disabled,
.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}

/* AJAX generated inventory content. */
#module-content,
#data-container {
    display: block;
    min-width: 0;
}
#module-content > .bg-white,
#module-content > .aems-card,
#module-content > section,
#module-content > article,
#data-container > .bg-white,
#data-container > .aems-card,
#data-container > section,
#data-container > article {
    border: 1px solid var(--apc-line) !important;
    border-radius: var(--apc-radius) !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: var(--apc-shadow-soft) !important;
}
#module-content .aems-card,
#data-container .aems-card,
.aems-card {
    border: 1px solid var(--apc-line);
    border-radius: var(--apc-radius-sm);
    background: #fff;
    box-shadow: var(--apc-shadow-soft);
}
#module-content table,
#data-container table,
.report-table,
#sh-summary + .bg-white table,
#pos-daily-sales-modal table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--apc-ink);
}
#module-content thead th,
#data-container thead th,
.report-table thead th,
#sh-summary + .bg-white thead th,
#pos-daily-sales-modal thead th {
    padding: .78rem .9rem;
    border-bottom: 1px solid var(--apc-line);
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
#module-content tbody td,
#data-container tbody td,
.report-table tbody td,
#sh-summary + .bg-white tbody td,
#pos-daily-sales-modal tbody td {
    padding: .85rem .9rem;
    border-bottom: 1px solid rgba(226,232,240,.86);
    color: #334155;
    vertical-align: middle;
}
#module-content tbody tr:hover,
#data-container tbody tr:hover,
.report-table tbody tr:hover,
#sh-summary + .bg-white tbody tr:hover {
    background: rgba(15, 118, 110, .035);
}
#module-content input:not([type="checkbox"]):not([type="radio"]),
#module-content select,
#module-content textarea,
#data-container input:not([type="checkbox"]):not([type="radio"]),
#data-container select,
#data-container textarea,
.report-filters input,
.report-filters select,
#export-filters input,
#export-filters select,
#export-filters textarea,
#sh-search,
#sh-status,
#sh-payment,
#pos-app input:not([type="checkbox"]):not([type="radio"]),
#pos-app select,
#pos-app textarea,
#sh-refund-modal textarea {
    width: 100%;
    min-height: 2.45rem;
    border: 1px solid rgba(100,116,139,.32) !important;
    border-radius: .85rem !important;
    background: #fff !important;
    color: var(--apc-ink) !important;
    font-size: .86rem !important;
    outline: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.75) inset;
}
#module-content input:focus,
#module-content select:focus,
#module-content textarea:focus,
#data-container input:focus,
#data-container select:focus,
#data-container textarea:focus,
.report-filters input:focus,
.report-filters select:focus,
#export-filters input:focus,
#export-filters select:focus,
#sh-search:focus,
#sh-status:focus,
#sh-payment:focus,
#pos-app input:focus,
#pos-app select:focus,
#pos-app textarea:focus {
    border-color: rgba(15,118,110,.58) !important;
    box-shadow: 0 0 0 4px rgba(20,184,166,.13) !important;
}
#module-content label,
#data-container label,
#export-filters label,
.report-filters label {
    color: #334155;
    font-size: .8rem;
    font-weight: 800;
}
#module-content .empty-cell,
#data-container .empty-cell,
.empty-cell {
    padding: 2rem !important;
    color: var(--apc-muted) !important;
    text-align: center !important;
}

/* Report console. */
.report-console {
    display: grid;
    gap: 1rem;
}
.report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
    padding: 1.15rem;
    border: 1px solid rgba(15,118,110,.16);
    border-radius: var(--apc-radius);
    background:
        linear-gradient(135deg, rgba(15,118,110,.09), rgba(255,255,255,.9)),
        radial-gradient(circle at 88% 0%, rgba(183,121,31,.16), transparent 30%);
    box-shadow: var(--apc-shadow-soft);
}
.report-hero h1,
.report-hero h2 {
    margin: .2rem 0;
    color: var(--apc-ink);
    font-size: clamp(1.3rem, 2.2vw, 1.85rem);
    letter-spacing: -.04em;
}
.report-hero p {
    max-width: 66rem;
    margin: .35rem 0 0;
    color: var(--apc-muted);
    font-size: .9rem;
    line-height: 1.55;
}
.report-brand-card {
    min-width: 230px;
    display: grid;
    align-content: center;
    gap: .25rem;
    padding: 1rem;
    border: 1px solid rgba(15,118,110,.13);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--apc-shadow-soft);
}
.report-brand-card .brand-mark {
    width: 2.45rem;
    height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--apc-brand), #0f172a);
    color: #fff;
    font-weight: 900;
}
.report-brand-card small { color: var(--apc-muted); }
.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--apc-line);
    border-radius: var(--apc-radius);
    background: #fff;
    box-shadow: var(--apc-shadow-soft);
}
.report-filters label span {
    display: block;
    margin-bottom: .35rem;
    color: #475569;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .5rem;
}
.report-status {
    padding: .8rem 1rem;
    border: 1px solid rgba(29,78,216,.18);
    border-radius: 16px;
    background: var(--apc-info-soft);
    color: #1e3a8a;
    font-size: .86rem;
    font-weight: 700;
}
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: .85rem;
}
.report-kpi {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid var(--apc-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: var(--apc-shadow-soft);
}
.report-kpi::after {
    content: "";
    position: absolute;
    top: .8rem;
    right: .8rem;
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: var(--apc-brand);
    box-shadow: 0 0 0 5px rgba(15,118,110,.1);
}
.report-kpi.warning::after { background: var(--apc-gold); box-shadow: 0 0 0 5px rgba(183,121,31,.13); }
.report-kpi span {
    display: block;
    color: var(--apc-muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.report-kpi strong {
    display: block;
    margin-top: .45rem;
    color: var(--apc-ink);
    font-size: clamp(1.15rem, 2.4vw, 1.55rem);
    letter-spacing: -.035em;
}
.report-table-card {
    overflow: hidden;
    border: 1px solid var(--apc-line);
    border-radius: var(--apc-radius);
    background: #fff;
    box-shadow: var(--apc-shadow-soft);
}
.report-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--apc-line);
    background: #f8fafc;
}
.report-table-heading h3 { margin: .15rem 0 0; color: var(--apc-ink); font-size: 1.05rem; }
.report-table-heading span { color: var(--apc-muted); font-size: .78rem; }
.report-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    padding: .85rem 1rem;
    border-top: 1px solid var(--apc-line);
    background: #f8fafc;
}

/* Purchases export workspace. */
#export-filters {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(183,121,31,.22);
    border-radius: var(--apc-radius);
    background: linear-gradient(135deg, #fff, #fffbeb);
    box-shadow: var(--apc-shadow-soft);
}
#export-status {
    color: var(--apc-muted);
    font-size: .82rem;
    font-weight: 700;
}

/* POS terminal and sales history. */
#pos-app {
    min-height: calc(100vh - 9rem);
    overflow: hidden;
    border: 1px solid var(--apc-line);
    border-radius: var(--apc-radius);
    background: #eef5f3;
    box-shadow: var(--apc-shadow);
}
#pos-app > .flex-1 {
    min-width: 0;
    background:
        radial-gradient(circle at 0% 0%, rgba(20,184,166,.11), transparent 32%),
        #f8fafc;
}
#pos-app > .w-96 {
    width: min(25rem, 38vw);
    min-width: 22rem;
    background: #fff;
}
#pos-categories {
    gap: .45rem;
    scrollbar-width: thin;
    background: rgba(255,255,255,.92) !important;
}
.pos-category-btn {
    border: 1px solid rgba(15,23,42,.1) !important;
    background: #fff !important;
    color: #334155 !important;
}
.pos-category-btn.active,
.pos-category-btn[aria-selected="true"] {
    border-color: rgba(15,118,110,.25) !important;
    background: linear-gradient(135deg, var(--apc-brand), var(--apc-brand-strong)) !important;
    color: #fff !important;
}
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: .85rem;
}
#pos-products > * {
    border-radius: 18px;
}
#pos-cart {
    background: linear-gradient(180deg, #fff, #f8fafc);
}
#cart-empty {
    color: var(--apc-muted) !important;
}
#single-payment-section .pos-pay-method,
.pos-pay-method {
    border-radius: .85rem !important;
    background: #fff !important;
    border-color: rgba(100,116,139,.28) !important;
    color: #334155 !important;
}
#single-payment-section .pos-pay-method.border-blue-600,
.pos-pay-method.border-blue-600 {
    border-color: rgba(15,118,110,.5) !important;
    background: var(--apc-brand-soft) !important;
    color: var(--apc-brand-strong) !important;
}
#btn-checkout {
    min-height: 3rem;
    border-radius: 1rem !important;
    font-size: .98rem !important;
}
#sh-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: .85rem;
}
#sh-summary > div,
#pos-daily-sales-modal .grid > div {
    border: 1px solid var(--apc-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--apc-shadow-soft);
}
#sh-table-body tr td:last-child,
#module-content tr td:last-child,
#data-container tr td:last-child {
    white-space: nowrap;
}
#sh-detail-modal:not(.hidden),
#sh-refund-modal:not(.hidden),
#sh-exchange-modal:not(.hidden),
#sh-receipt-modal:not(.hidden),
#pos-confirm-modal:not(.hidden),
#pos-receipt-modal:not(.hidden),
#pos-register-summary-modal:not(.hidden),
#pos-daily-sales-modal:not(.hidden) {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
#sh-detail-modal > div,
#sh-refund-modal > div,
#sh-exchange-modal > div,
#sh-receipt-modal > div,
#pos-confirm-modal > div,
#pos-receipt-modal > div,
#pos-register-summary-modal > div,
#pos-daily-sales-modal > div {
    border: 1px solid rgba(255,255,255,.4);
    box-shadow: 0 28px 80px rgba(2,6,23,.28);
}

/* Users and roles workspace. */
#role-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .9rem;
}
#role-cards > * {
    border: 1px solid var(--apc-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--apc-shadow-soft) !important;
}
.user-modal__panel {
    border: 1px solid rgba(255,255,255,.52) !important;
    border-radius: 24px !important;
    box-shadow: 0 35px 90px rgba(2,6,23,.32) !important;
}
.user-modal__header {
    background: linear-gradient(135deg, var(--apc-brand), #0f172a) !important;
    color: #fff !important;
}
.user-search-dropdown {
    border: 1px solid var(--apc-line) !important;
    border-radius: 16px !important;
    box-shadow: var(--apc-shadow) !important;
}

/* Status badges and operational chips. */
.aems-badge,
.status-badge,
[class*="badge"],
[class*="Badge"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 1.65rem;
    padding: .25rem .58rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .01em;
}

/* Responsive fit for all inventory inner pages. */
@media (max-width: 1100px) {
    #pos-app {
        min-height: auto;
        flex-direction: column;
    }
    #pos-app > .w-96 {
        width: 100%;
        min-width: 0;
        border-left: 0;
        border-top: 1px solid var(--apc-line);
    }
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    }
}
@media (max-width: 760px) {
    .inventory-products-page-header,
    .inventory-stock-page-header,
    .inventory-purchases-page-header,
    .inventory-sales-page-header,
    .report-hero,
    .report-table-heading {
        grid-template-columns: 1fr;
    }
    .inventory-products-page-header > div:last-child,
    .inventory-stock-page-header > div:last-child,
    .inventory-purchases-page-header > div:last-child,
    .inventory-sales-page-header > div:last-child,
    .report-actions {
        justify-content: stretch;
    }
    .inventory-products-page-header button,
    .inventory-stock-page-header button,
    .inventory-purchases-page-header button,
    .inventory-sales-page-header button,
    .inventory-products-page-header a,
    .inventory-stock-page-header a,
    .inventory-purchases-page-header a,
    .inventory-sales-page-header a,
    .report-actions .btn {
        width: 100%;
    }
    .report-brand-card {
        min-width: 0;
    }
    .report-summary-grid,
    #sh-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #module-content table,
    #data-container table,
    .report-table,
    #sh-summary + .bg-white table,
    #pos-daily-sales-modal table {
        min-width: 680px;
    }
    .px-6 { padding-left: 1rem; padding-right: 1rem; }
    .p-6 { padding: 1rem; }
    .w-56 { width: 100%; }
    #pos-app {
        border-radius: 18px;
    }
    .pos-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .report-summary-grid,
    #sh-summary {
        grid-template-columns: 1fr;
    }
    .pos-product-grid {
        grid-template-columns: 1fr;
    }
    .text-2xl { font-size: 1.18rem; }
    .text-xl { font-size: 1.05rem; }
}
