:root {
    color-scheme: dark;
    --canvas: #080b12;
    --canvas-soft: #0c1019;
    --surface: #111722;
    --surface-raised: #161e2c;
    --surface-hover: #1b2535;
    --text: #f5f7fb;
    --text-soft: #c6ccda;
    --muted: #7f899d;
    --line: rgba(188, 201, 224, 0.12);
    --line-strong: rgba(188, 201, 224, 0.22);
    --accent: #7c8cff;
    --accent-bright: #a8b2ff;
    --accent-soft: rgba(124, 140, 255, 0.12);
    --positive: #4fe3b1;
    --positive-soft: rgba(79, 227, 177, 0.12);
    --warning: #f5b85a;
    --danger: #ff6b7a;
    --danger-soft: rgba(255, 107, 122, 0.12);
    --sidebar-width: 248px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { overflow-y: scroll; background: var(--canvas); scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 78% -10%, rgba(124, 140, 255, 0.12), transparent 28rem),
        var(--canvas);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: rgba(124, 140, 255, 0.14);
    touch-action: manipulation;
}

/* Privacy veil: hide the operational interface after a quiet period. */
body.privacy-blurred .app-shell {
    filter: blur(15px);
    opacity: .72;
    transform: scale(1.012);
    pointer-events: none;
    user-select: none;
    transition: filter 700ms ease, opacity 700ms ease, transform 700ms ease;
}
body.privacy-blurred::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    background: radial-gradient(circle at 50% 40%, rgba(124,140,255,.05), rgba(3,5,9,.18));
    backdrop-filter: blur(2px);
    animation: privacyVeilIn 700ms ease both;
}
@keyframes privacyVeilIn { from { opacity: 0; } to { opacity: 1; } }
body:not(.privacy-blurred) .app-shell { transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select { touch-action: manipulation; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 10000;
    transform: translateY(-160%);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--canvas);
    font-weight: 700;
    transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
html:has(body.auth-pending), html:has(body.auth-locked) { overflow: hidden; scrollbar-gutter: auto; }
body.auth-pending, body.auth-locked { height: 100dvh; min-height: 0; overflow: hidden; }
body.auth-pending .app-shell, body.auth-locked .app-shell { visibility: hidden; }

.login-screen { position: fixed; inset: 0; z-index: 5000; display: grid; min-height: 100dvh; place-items: center; overflow: hidden; padding: max(22px,env(safe-area-inset-top)) 18px max(22px,env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 42%,rgba(124,140,255,.11),transparent 30rem),#080b12; }
.login-screen[hidden] { display: none; }.login-ambient { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }.login-ambient-one { top: -19rem; left: 50%; width: 42rem; height: 42rem; border: 1px solid rgba(124,140,255,.12); box-shadow: 0 0 0 90px rgba(124,140,255,.018),0 0 0 180px rgba(124,140,255,.012); transform: translateX(-50%); }.login-ambient-two { right: -8rem; bottom: -10rem; width: 24rem; height: 24rem; background: radial-gradient(circle,rgba(79,227,177,.08),transparent 68%); }
.login-card { position: relative; width: min(100%,480px); padding: 42px 40px 34px; border: 1px solid rgba(188,201,224,.16); border-radius: 22px; background: linear-gradient(145deg,rgba(22,30,44,.97),rgba(14,19,29,.97)); box-shadow: 0 35px 100px rgba(0,0,0,.5),inset 0 1px rgba(255,255,255,.035); text-align: center; backdrop-filter: blur(20px); animation: login-enter 420ms cubic-bezier(.2,.8,.2,1) both; }
.login-brand-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 20px; place-items: center; border: 1px solid rgba(168,178,255,.35); border-radius: 16px; background: linear-gradient(145deg,#8998ff,#5e6fe5); box-shadow: 0 14px 36px rgba(92,108,224,.32); }.login-brand-mark svg { width: 30px; height: 30px; fill: none; stroke: white; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.login-eyebrow { color: var(--accent-bright); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }.login-card h1 { margin: 7px 0 6px; font-size: 30px; letter-spacing: -.045em; }.login-card > p { max-width: 330px; margin: 0 auto 26px; color: var(--muted); font-size: 11px; }
.login-field { display: block; text-align: left; }.login-field > span:first-child { display: block; margin: 0 0 7px 2px; color: var(--text-soft); font-size: 10px; font-weight: 700; }.login-input-wrap { position: relative; display: block; }.login-input-wrap input { width: 100%; min-height: 52px; padding: 0 48px 0 15px; border: 1px solid var(--line-strong); border-radius: 12px; outline: none; background: rgba(7,10,16,.56); color: var(--text); font-size: 16px; transition: border-color 160ms ease,box-shadow 160ms ease,background 160ms ease; }.login-input-wrap input:focus { border-color: rgba(124,140,255,.72); background: rgba(7,10,16,.78); box-shadow: 0 0 0 4px rgba(124,140,255,.1); }.login-eye { position: absolute; top: 50%; right: 8px; display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transform: translateY(-50%); }.login-eye:hover { background: rgba(255,255,255,.05); color: var(--text); }.login-eye svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-error { min-height: 22px; padding: 6px 2px 0; color: var(--danger); font-size: 10px; text-align: left; }.login-submit { width: 100%; min-height: 50px; justify-content: center; margin-top: 5px; gap: 8px; font-weight: 800; }.login-submit svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }.login-submit.is-loading { cursor: wait; opacity: .72; }.login-card > small { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; color: var(--muted); font-size: 9px; }.login-card > small .system-dot { width: 6px; height: 6px; }
@keyframes login-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 22px 16px 18px;
    border-right: 1px solid var(--line);
    background: rgba(9, 13, 21, 0.94);
    backdrop-filter: blur(22px);
}

.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 8px 0 6px; }
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(168, 178, 255, 0.34);
    border-radius: 12px;
    background: linear-gradient(145deg, #7184ff, #5264d8);
    box-shadow: 0 10px 25px rgba(83, 101, 216, 0.28), inset 0 1px rgba(255,255,255,.2);
    color: white;
    font-size: 17px;
    font-weight: 800;
}
.brand-mark svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }.brand-mark circle { fill: currentColor; stroke: none; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; }
.brand-copy strong { font-size: 15px; letter-spacing: -0.02em; }
.brand-copy span { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

.primary-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 4px; margin-top: 24px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.primary-nav [data-route="overview"] { order: 1; }
.primary-nav [data-route="operations"] { order: 2; }
.primary-nav [data-route="inventory"] { order: 3; }
.primary-nav [data-route="history"] { order: 4; }
.primary-nav [data-route="reconciliation"] { order: 5; }
.primary-nav [data-route="batches"] { order: 6; }
.primary-nav [data-route="debts"] { order: 7; }
.primary-nav [data-route="transfers"] { order: 8; }
.primary-nav [data-route="analytics"] { order: 9; }
.primary-nav .photo-nav { order: 10; text-decoration: none; }
.primary-nav [data-route="sim"] { order: 11; }
.primary-nav [data-route="calculator"] { order: 13; }
.primary-nav [data-route="catalogs"] { order: 14; }
.primary-nav .nav-divider { order: 12; }
.nav-item {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; }
.nav-item:hover { background: rgba(255,255,255,.045); color: var(--text-soft); transform: translateX(2px); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-bright); }
.nav-item.active::before {
    position: absolute;
    left: -16px;
    width: 3px;
    height: 26px;
    border-radius: 0 8px 8px 0;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(124,140,255,.9);
    content: "";
}
.nav-divider { height: 1px; margin: 12px 9px; background: var(--line); }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    margin-top: 12px;
}
.sidebar-footer div { display: flex; min-width: 0; flex-direction: column; }
.sidebar-footer strong { font-size: 11px; font-weight: 700; }
.sidebar-footer span:last-child { overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.system-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--positive); box-shadow: 0 0 12px rgba(79,227,177,.75); }
.sidebar-audit-button { display: grid; width: 30px; height: 30px; flex: 0 0 auto; margin-left: auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: color 160ms ease, border-color 160ms ease, background 160ms ease; }
.sidebar-audit-button:hover { border-color: rgba(124,140,255,.45); background: var(--accent-soft); color: var(--accent-bright); }
.sidebar-audit-button svg { width: 16px; height: 16px; fill: currentColor; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.time-travel-bar { position: sticky; top: 104px; z-index: 70; display: grid; gap: 12px; margin: 0 24px; padding: 14px 16px 12px; border: 1px solid rgba(124,140,255,.36); border-radius: 0 0 14px 14px; background: rgba(17,23,36,.96); box-shadow: 0 16px 35px rgba(0,0,0,.22); backdrop-filter: blur(14px); }.time-travel-bar[hidden] { display: none; }.time-travel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }.time-travel-heading strong, .time-travel-heading small { display: block; }.time-travel-heading strong { margin-top: 2px; color: var(--accent-bright); font-size: 13px; }.time-travel-heading small { margin-top: 3px; color: var(--muted); font-size: 9px; }.time-travel-timeline { display: flex; min-width: 0; gap: 7px; padding: 5px 2px 3px; overflow-x: auto; scrollbar-width: thin; }.time-travel-point { position: relative; display: grid; min-width: 112px; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,11,18,.65); color: var(--text-soft); cursor: pointer; text-align: left; }.time-travel-point:hover, .time-travel-point.is-active { border-color: var(--accent); background: var(--accent-soft); color: white; }.time-travel-point time { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }.time-travel-point span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    height: 104px;
    min-height: 104px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px clamp(22px, 3vw, 46px);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 11, 18, 0.84);
    backdrop-filter: blur(20px);
}
.page-context { display: grid; min-width: 0; flex: 1 1 auto; align-content: center; }
.page-context > span { color: var(--accent-bright); font-size: 11px; font-weight: 700; }
.page-context h1 { margin: 2px 0 1px; overflow: hidden; font-size: clamp(22px, 2.2vw, 29px); font-weight: 750; letter-spacing: -0.045em; text-overflow: ellipsis; white-space: nowrap; }
.page-context p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.icon-button,
.export-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.icon-button { width: 42px; padding: 0; }
.icon-button svg, .export-button svg { width: 18px; height: 18px; fill: currentColor; }
.export-button { gap: 8px; padding: 0 15px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.icon-button:hover, .export-button:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); }

main { width: min(100%, 1500px); min-height: calc(100vh - 104px); margin: 0 auto; padding: 28px clamp(18px, 3vw, 46px) 60px; }
.page { display: none; width: 100%; }
.page.active { display: block; animation: page-fade 220ms ease; }
.workspace-section { display: none; width: 100%; }
.workspace-section.active { display: block; animation: page-fade 220ms ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }

.signal-banner {
    position: relative;
    display: flex;
    min-height: 194px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    overflow: hidden;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(124, 140, 255, 0.22);
    border-radius: var(--radius-lg);
    background: linear-gradient(115deg, rgba(124,140,255,.17), rgba(17,23,34,.88) 46%, rgba(72,220,203,.06));
    box-shadow: var(--shadow);
}
.signal-copy { position: relative; z-index: 2; max-width: 680px; }
.signal-label { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-bright); font-size: 11px; font-weight: 700; }
.signal-copy h2 { margin: 12px 0 8px; font-size: clamp(28px, 4vw, 46px); line-height: 1.03; letter-spacing: -0.055em; text-wrap: balance; }
.signal-copy p { max-width: 610px; margin: 0; color: var(--text-soft); font-size: 13px; }
.signal-actions { position: relative; z-index: 2; display: grid; width: 260px; max-width: 100%; justify-items: stretch; gap: 9px; }
.signal-actions > .button { width: 100%; }
.overview-sheet-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.overview-sheet-links a { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(8,11,18,.52); color: var(--text-soft); font-size: 9px; font-weight: 750; text-align: center; text-decoration: none; white-space: nowrap; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease; }
.overview-sheet-links a:hover { border-color: rgba(124,140,255,.55); background: var(--accent-soft); color: var(--accent-bright); transform: translateY(-1px); }
.signal-orbit { position: absolute; top: -90px; right: 10%; width: 300px; height: 300px; border: 1px solid rgba(124,140,255,.13); border-radius: 50%; }
.signal-orbit::before, .signal-orbit::after { position: absolute; inset: 38px; border: 1px solid rgba(124,140,255,.1); border-radius: inherit; content: ""; }
.signal-orbit::after { inset: 86px; }
.signal-orbit span { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px var(--accent); }
.signal-orbit span:nth-child(1) { top: 20%; left: 8%; }.signal-orbit span:nth-child(2) { top: 66%; right: 2%; background: var(--positive); }.signal-orbit span:nth-child(3) { bottom: 5%; left: 42%; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-head svg { width: 17px; height: 17px; fill: currentColor; }
.metric-val { margin-top: 13px; font-size: clamp(22px, 2.8vw, 34px); font-weight: 750; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.metric-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.metric-expense .metric-head svg { color: var(--warning); }.metric-revenue .metric-head svg { color: var(--positive); }.metric-balance .metric-head svg { color: var(--accent-bright); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 16px 45px rgba(0,0,0,.12); }
.command-card, .pulse-card, .operation-card, .catalog-form-card { padding: 22px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-heading h3 { margin: 3px 0 0; font-size: 17px; letter-spacing: -0.025em; }
.section-index { color: var(--muted); font-size: 10px; font-weight: 700; }
.status-pill, .entity-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; background: var(--positive-soft); color: var(--positive); font-size: 9px; font-weight: 800; }
.entity-badge { background: var(--accent-soft); color: var(--accent-bright); }

.command-list { display: grid; }
.command-list > button { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 12px; min-height: 65px; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.command-list > button:first-child { border-top: 0; }
.command-list > button:hover .command-icon { border-color: rgba(124,140,255,.35); background: var(--accent-soft); color: var(--accent-bright); }
.command-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--text-soft); transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease; }
.command-icon svg, .chevron { width: 17px; height: 17px; fill: currentColor; }
.command-list strong, .command-list small { display: block; }.command-list strong { font-size: 12px; }.command-list small { margin-top: 2px; color: var(--muted); font-size: 10px; }.chevron { color: var(--muted); }

.pulse-card { display: flex; flex-direction: column; }
.pulse-visual { display: flex; min-height: 104px; align-items: flex-end; gap: 6px; padding: 20px 0 10px; }
.pulse-visual i { width: 100%; border-radius: 4px 4px 1px 1px; background: linear-gradient(to top, rgba(124,140,255,.08), rgba(124,140,255,.75)); }
.pulse-visual i:nth-child(1){height:28%}.pulse-visual i:nth-child(2){height:48%}.pulse-visual i:nth-child(3){height:38%}.pulse-visual i:nth-child(4){height:76%}.pulse-visual i:nth-child(5){height:58%}.pulse-visual i:nth-child(6){height:84%}.pulse-visual i:nth-child(7){height:66%}.pulse-visual i:nth-child(8){height:96%;background:linear-gradient(to top,rgba(79,227,177,.08),rgba(79,227,177,.82))}
.pulse-visual i.is-current { background: linear-gradient(to top, rgba(79,227,177,.08), rgba(79,227,177,.82)); }
.debt-location { display: grid; gap: 3px; }.debt-location small,.debt-original { display: block; color: var(--muted); font-size: 9px; }
.debt-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 170px; }
.debt-actions .action-btn { width: 100%; min-width: 0; min-height: 32px; height: 32px; padding: 0 8px; white-space: nowrap; }
.debt-actions .action-btn + .action-btn { margin-left: 0; }
.pulse-card > p { margin: auto 0 0; color: var(--muted); font-size: 11px; }

.content-heading { display: flex; min-height: 74px; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 22px; }
.content-heading h2 { margin: 4px 0 5px; font-size: clamp(25px, 3.2vw, 38px); line-height: 1.08; letter-spacing: -0.045em; text-wrap: balance; }
.content-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 12px; }
.flow-heading { align-items: flex-end; }
.flow-period { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas-soft); }
.flow-period button { min-height: 33px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 800; transition: background 160ms ease, color 160ms ease; }
.flow-period button.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 5px 14px rgba(0,0,0,.22); }
.flow-map-card { position: relative; overflow: hidden; padding: 22px; background: radial-gradient(circle at 50% 45%,rgba(124,140,255,.1),transparent 34%),var(--surface); }
.flow-map-card::before { position: absolute; inset: 0; background-image: linear-gradient(rgba(124,140,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(124,140,255,.035) 1px,transparent 1px); background-size: 34px 34px; content: ""; pointer-events: none; mask-image: linear-gradient(to bottom,black,transparent 88%); }
.flow-map-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.flow-map-top h3 { margin: 3px 0 0; font-size: 18px; }
.flow-health { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: rgba(8,11,18,.5); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.flow-health span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.flow-health-ok { border-color: rgba(79,227,177,.24); color: var(--positive); }.flow-health-warning { border-color: rgba(255,184,92,.24); color: var(--warning); }.flow-health-critical { border-color: rgba(255,107,122,.28); color: var(--danger); }
.flow-map { position: relative; z-index: 1; display: grid; min-height: 350px; grid-template-columns: minmax(230px,1fr) minmax(210px,.72fr) minmax(230px,1fr); align-items: center; gap: clamp(18px,3vw,44px); padding: 26px 4px 8px; }
.flow-network-svg { position: absolute; inset: 20px 0 4px; z-index: -1; width: 100%; height: calc(100% - 24px); overflow: visible; pointer-events: none; }.flow-network-svg path { fill: none; stroke: rgba(118,137,166,.2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }.flow-network-svg path:nth-of-type(odd) { stroke: rgba(79,227,177,.22); }.flow-network-svg path:nth-of-type(even) { stroke: rgba(200,155,104,.22); }.flow-particle.is-mint { fill: #4fe3b1; filter: drop-shadow(0 0 5px rgba(79,227,177,.9)); }.flow-particle.is-walnut { fill: #c89b68; filter: drop-shadow(0 0 5px rgba(200,155,104,.9)); }
.flow-column-label { display: block; margin-bottom: 9px; color: var(--text-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flow-node-list { display: grid; gap: 9px; }
.flow-node { display: grid; min-width: 0; min-height: 72px; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(14,19,29,.9); box-shadow: 0 10px 24px rgba(0,0,0,.16); transition: border-color 160ms ease, transform 160ms ease; }
.flow-node:hover { border-color: rgba(124,140,255,.38); transform: translateY(-2px); }
.flow-node-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(124,140,255,.22); border-radius: 11px; background: var(--accent-soft); color: var(--accent-bright); }.flow-node-point .flow-node-icon { border-color: rgba(79,227,177,.2); background: var(--positive-soft); color: var(--positive); }
.flow-node-icon svg { width: 20px; height: 20px; fill: currentColor; }.flow-node-copy,.flow-node-value { min-width: 0; }.flow-node-copy strong,.flow-node-copy small,.flow-node-value b,.flow-node-value small { display: block; }.flow-node-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.flow-node-copy small,.flow-node-value small { margin-top: 4px; color: var(--text-soft); font-size: 9px; line-height: 1.35; }.flow-node-value { text-align: right; }.flow-node-value b { color: var(--text); font-size: 12px; white-space: nowrap; }.flow-node-value small { max-width: 150px; color: var(--muted); white-space: normal; }
.flow-hub { position: relative; display: grid; min-height: 255px; place-items: center; }
.flow-core { position: relative; z-index: 2; display: grid; width: 158px; min-height: 104px; place-items: center; align-content: center; padding: 14px; border: 1px solid rgba(124,140,255,.3); border-radius: 20px; background: linear-gradient(145deg,rgba(29,38,61,.97),rgba(10,14,22,.98)); box-shadow: 0 18px 46px rgba(0,0,0,.35),0 0 34px rgba(124,140,255,.11),inset 0 1px rgba(255,255,255,.05); text-align: center; }
.flow-core svg { width: 24px; height: 24px; margin-bottom: 7px; fill: var(--accent-bright); }.flow-core strong,.flow-core small { display: block; }.flow-core strong { font-size: 20px; letter-spacing: -.035em; }.flow-core small { max-width: 105px; margin-top: 3px; color: var(--text-soft); font-size: 9px; line-height: 1.3; }
.flow-hub-stats { position: absolute; bottom: 0; display: flex; gap: 18px; color: var(--text-soft); font-size: 9px; }.flow-hub-stats b { color: var(--text); font-size: 10px; }
.flow-skeleton { height: 72px; border-radius: 13px; background: linear-gradient(90deg,var(--canvas-soft),var(--surface-hover),var(--canvas-soft)); background-size: 200% 100%; animation: market-shimmer 1.2s linear infinite; }
.flow-business-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.flow-stock-audit-card { margin-top: 14px; padding: 20px; }
.flow-stock-audit-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 10px; margin-top: 16px; }
.flow-stock-audit-actions { display: flex; align-items: stretch; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }.flow-stock-audit-actions .button { min-width: 190px; }
.flow-stock-audit-form label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.flow-stock-audit-form select, .flow-stock-audit-form input { min-height: 40px; width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas-soft); color: var(--text); font: inherit; }
.flow-stock-audit-form .button { min-height: 40px; white-space: nowrap; }
.flow-stock-audit-result { min-height: 42px; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; }
.flow-audit-summary { display: grid; gap: 4px; }.flow-audit-summary strong { font-size: 12px; }.flow-audit-summary span { color: var(--muted); }.flow-audit-summary.is-warning strong { color: var(--warning); }.flow-audit-summary.is-info strong { color: var(--accent-bright); }.flow-audit-summary.is-ok strong { color: var(--positive); }.flow-audit-error { color: var(--danger); }
.statement-period { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 12px 0 14px; color: var(--muted); font-size: 9px; font-weight: 700; }.statement-period button { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas-soft); color: var(--muted); cursor: pointer; font: inherit; }.statement-period button.active { border-color: rgba(124,140,255,.45); background: var(--accent-soft); color: var(--accent-bright); }
.flow-business-card { position: relative; display: grid; min-width: 0; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 12px; overflow: hidden; padding: 16px; }
.flow-business-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(124,140,255,.22); border-radius: 12px; background: var(--accent-soft); color: var(--accent-bright); }.flow-business-icon svg { width: 20px; height: 20px; fill: currentColor; }.flow-debt-card .flow-business-icon { border-color: rgba(255,184,92,.22); background: rgba(255,184,92,.08); color: var(--warning); }.flow-history-card .flow-business-icon { border-color: rgba(79,227,177,.2); background: var(--positive-soft); color: var(--positive); }
.flow-business-card span,.flow-business-card strong,.flow-business-card small { display: block; }.flow-business-card > div:nth-child(2) > span { color: var(--text-soft); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }.flow-business-card strong { margin-top: 3px; font-size: 18px; letter-spacing: -.025em; }.flow-business-card small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.flow-business-card > i { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--canvas-soft); }.flow-business-card > i span { height: 100%; border-radius: 0 3px 3px 0; background: linear-gradient(90deg,var(--accent),var(--positive)); transition: width 500ms cubic-bezier(.2,.8,.2,1); }.flow-debt-card > i span { background: linear-gradient(90deg,var(--warning),var(--danger)); }.flow-history-card > i span { background: linear-gradient(90deg,var(--positive),var(--accent)); }
.flow-timeline-card { position: relative; margin-top: 16px; padding: 20px; }.flow-timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }.flow-timeline-head h3 { margin: 3px 0 4px; font-size: 18px; }.flow-timeline-head p { margin: 0; color: var(--muted); font-size: 10px; }.flow-chart-period-note { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; }.flow-chart-legend { display: flex; gap: 18px; margin: 17px 42px 7px 48px; color: var(--text-soft); font-size: 9px; }.flow-chart-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; content: ""; }.flow-chart-legend .is-revenue::before { background: linear-gradient(135deg,var(--accent),var(--positive)); }.flow-chart-legend .is-operations::before { border-radius: 50%; background: var(--warning); box-shadow: 0 0 7px rgba(255,184,92,.5); }.flow-timeline-chart { display: grid; min-height: 250px; grid-template-columns: 48px minmax(0,1fr) 34px; gap: 10px; }.flow-chart-scale { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0 27px; color: var(--text-soft); font-size: 9px; font-variant-numeric: tabular-nums; }.flow-chart-scale.is-left { text-align: right; }.flow-chart-scale.is-right { color: var(--warning); text-align: left; }.flow-chart-plot { position: relative; min-width: 0; overflow-x: auto; overflow-y: hidden; }.flow-chart-grid { position: absolute; inset: 4px 0 27px; display: grid; grid-template-rows: repeat(5,1fr); }.flow-chart-grid i { border-top: 1px dashed rgba(142,151,184,.18); }.flow-chart-columns { position: relative; z-index: 1; display: grid; min-width: 100%; height: 100%; gap: 7px; }.flow-chart-column { display: grid; min-width: 0; grid-template-rows: minmax(0,1fr) 23px; gap: 5px; cursor: crosshair; }.flow-chart-bars { position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); transition: background-color 100ms ease; }.flow-chart-bars > i { width: min(18px,55%); border-radius: 5px 5px 1px 1px; background: linear-gradient(to top,rgba(124,140,255,.24),var(--positive)); }.flow-chart-bars > b { position: absolute; left: 50%; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--warning); box-shadow: 0 0 8px rgba(255,184,92,.55); transform: translate(-50%,50%); }.flow-chart-bars > b span { display: none; }.flow-chart-column small { overflow: hidden; color: var(--muted); font-size: 8px; text-align: center; white-space: nowrap; }.flow-chart-column:hover .flow-chart-bars { background: rgba(124,140,255,.055); }.flow-chart-tooltip { position: absolute; z-index: 15; display: grid; min-width: 180px; gap: 7px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(13,18,28,.98); box-shadow: 0 14px 38px rgba(0,0,0,.46); pointer-events: none; }.flow-chart-tooltip[hidden] { display: none; }.flow-chart-tooltip strong { font-size: 11px; }.flow-chart-tooltip span { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 7px; color: var(--text-soft); font-size: 9px; }.flow-chart-tooltip span i { width: 7px; height: 7px; border-radius: 2px; background: var(--positive); }.flow-chart-tooltip span i.is-operations { border-radius: 50%; background: var(--warning); }.flow-chart-tooltip span b { color: var(--text); }
.flow-details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }.flow-detail-card { min-width: 0; padding: 20px; }.flow-detail-card .card-heading { margin-bottom: 13px; }
.flow-route-list,.flow-activity-list { display: grid; }.flow-route { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 14px; padding: 13px 0; border-top: 1px solid var(--line); }.flow-route:first-child,.flow-activity:first-child { border-top: 0; }.flow-route strong,.flow-route small { display: block; }.flow-route strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.flow-route strong span { color: var(--accent-bright); }.flow-route small { margin-top: 4px; color: var(--text-soft); font-size: 10px; }.flow-route > b { font-size: 11px; white-space: nowrap; }.flow-route > i { grid-column: 1/-1; height: 5px; overflow: hidden; border-radius: 99px; background: var(--canvas-soft); }.flow-route > i span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--positive)); }
.flow-activity { display: grid; min-width: 0; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }.flow-activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(124,140,255,.7); }.flow-activity-dot.is-sale { background: var(--positive); box-shadow: 0 0 9px rgba(79,227,177,.65); }.flow-activity div { min-width: 0; }.flow-activity strong,.flow-activity small,.flow-activity b { display: block; }.flow-activity strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.flow-activity small { margin-top: 4px; color: var(--text-soft); font-size: 10px; }.flow-activity > div:last-child { text-align: right; }.flow-activity > div:last-child small { color: var(--text-soft); font-size: 10px; font-variant-numeric: tabular-nums; }.flow-activity b { color: var(--text); font-size: 11px; white-space: nowrap; }
.flow-health-panel { width: min(100%,760px); max-height: min(92vh,900px); overflow-y: auto; }.flow-health-summary { display: grid; gap: 5px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas-soft); }.flow-health-summary strong { font-size: 14px; }.flow-health-summary span { color: var(--text-soft); font-size: 11px; }.flow-health-summary small { color: var(--muted); font-size: 9px; }.flow-health-summary.is-ok { border-color: rgba(79,227,177,.25); }.flow-health-summary.is-warning { border-color: rgba(255,184,92,.28); }.flow-health-summary.is-critical { border-color: rgba(255,107,122,.3); }
.flow-health-evidence { margin-top: 12px; padding: 16px; border: 1px solid rgba(124,140,255,.2); border-radius: 14px; background: linear-gradient(145deg,rgba(124,140,255,.07),rgba(8,11,18,.45)); }.flow-evidence-placeholder { padding: 14px; color: var(--muted); font-size: 10px; text-align: center; }.flow-evidence-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }.flow-evidence-head h3 { margin: 3px 0 0; font-size: 15px; }.flow-evidence-category { padding: 5px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; text-transform: uppercase; }.flow-evidence-explanation { margin: 10px 0 12px; color: var(--text-soft); font-size: 10px; line-height: 1.55; }.flow-evidence-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 8px; }.flow-evidence-metric { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,11,18,.55); }.flow-evidence-metric > span,.flow-evidence-metric > strong { display: block; }.flow-evidence-metric > span { color: var(--muted); font-size: 8px; }.flow-evidence-metric > strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 11px; }.flow-evidence-metric > i { display: block; height: 3px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--canvas-soft); }.flow-evidence-metric > i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--positive)); }.flow-evidence-table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }.flow-evidence-table { width: 100%; border-collapse: collapse; font-size: 9px; }.flow-evidence-table th,.flow-evidence-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }.flow-evidence-table th { background: var(--canvas-soft); color: var(--muted); }.flow-evidence-table td { color: var(--text-soft); }.flow-evidence-table tr:last-child td { border-bottom: 0; }
.flow-health-issue-list { display: grid; max-height: min(35vh,330px); gap: 8px; margin-top: 12px; overflow-y: auto; }.flow-health-issue { display: grid; width: 100%; grid-template-columns: 76px minmax(0,1fr) 16px; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,18,.4); color: inherit; cursor: pointer; font: inherit; text-align: left; transition: border-color 160ms ease,background-color 160ms ease,transform 160ms ease; }.flow-health-issue:hover,.flow-health-issue.active { border-color: rgba(124,140,255,.4); background: rgba(124,140,255,.07); transform: translateY(-1px); }.flow-health-issue > span { align-self: start; padding: 5px 7px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-bright); font-size: 8px; font-weight: 800; text-align: center; }.flow-health-issue > b { align-self: center; color: var(--muted); font-size: 19px; }.flow-health-issue.is-warning > span { background: rgba(255,184,92,.1); color: var(--warning); }.flow-health-issue.is-critical > span { background: var(--danger-soft); color: var(--danger); }.flow-health-issue strong { font-size: 11px; }.flow-health-issue p { margin: 4px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }.flow-health-issue small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }.flow-health-empty { display: grid; gap: 4px; padding: 22px; border: 1px dashed rgba(79,227,177,.3); border-radius: 12px; color: var(--positive); text-align: center; }.flow-health-empty span { color: var(--text-soft); font-size: 10px; }
.compact-heading { max-width: 760px; }

.operation-card, .calculator-card { width: 100%; max-width: none; }
.spoilage-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-health-evidence { margin-bottom: 20px; }
.flow-health-issue-list { margin-top: 20px; padding-top: 1px; }
.op-tabs { display: flex; gap: 6px; margin-bottom: 22px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas-soft); }
.op-tab { min-height: 42px; flex: 1; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.op-tab:hover { color: var(--text-soft); }.op-tab.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 8px 22px rgba(0,0,0,.24); }.danger-tab.active { color: var(--danger); }
.op-form { display: none; }.op-form.active { display: block; animation: page-in 220ms ease both; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px 14px; }
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group { position: relative; min-width: 0; }
.form-group.full-width, .full-width { grid-column: 1 / -1; }
label { display: block; margin: 0 0 7px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.input-wrapper { position: relative; }
input, select, textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas-soft); color: var(--text); font-size: 13px; font-weight: 550; transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
textarea { min-height: 84px; padding-block: 12px; line-height: 1.5; resize: vertical; }
select { appearance: none; padding-right: 38px; }
input::placeholder { color: #596276; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: rgba(124,140,255,.68); background: #0e1420; box-shadow: 0 0 0 3px rgba(124,140,255,.11); outline: 0; }
input:disabled, input[readonly] { color: var(--text-soft); cursor: not-allowed; }
.select-wrapper::after { position: absolute; top: 50%; right: 15px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); content: ""; pointer-events: none; transform: translateY(-72%) rotate(45deg); }
.result-field input { border-color: rgba(79,227,177,.18); background: rgba(79,227,177,.045); }
.calculator-card #p2pSumUsdt { border-color: rgba(124,140,255,.34); background: rgba(124,140,255,.08); box-shadow: inset 0 0 0 1px rgba(124,140,255,.05); }
.calculator-card #p2pSumUsdt:focus { border-color: rgba(124,140,255,.72); box-shadow: 0 0 0 3px rgba(124,140,255,.12); }
.calculator-card #p2pWillSettle { border-color: var(--line-strong); background: rgba(8,11,18,.28); }
.calculator-card #p2pFinalBalance { border-color: rgba(79,227,177,.72); background: rgba(79,227,177,.13); box-shadow: inset 0 0 0 1px rgba(79,227,177,.12), 0 0 18px rgba(79,227,177,.08); color: var(--positive); }
.calculator-card .form-group:has(#p2pFinalBalance) label { color: var(--positive); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }

.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 750; transition: transform 150ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.button:hover { transform: translateY(-1px); }.button:active { transform: translateY(0) scale(.985); }.button:disabled { cursor: wait; opacity: .58; }
.button svg { width: 17px; height: 17px; fill: currentColor; }
.button-primary { background: var(--accent); color: #090c14; box-shadow: 0 9px 22px rgba(124,140,255,.2); }.button-primary:hover { background: #909eff; }
.button-secondary { border-color: var(--line); background: var(--surface-raised); color: var(--text-soft); }.button-secondary:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.sale-debt-button { min-height: 46px; }
.button-danger { background: var(--danger); color: #160509; }.button-compact { min-height: 41px; padding-inline: 14px; white-space: nowrap; }
.submit-btn { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 11px; background: var(--accent); color: #090c14; cursor: pointer; font-size: 12px; font-weight: 750; }

.table-card { overflow: hidden; }
.table-card > .card-heading { padding: 20px 20px 0; }
.table-responsive { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; overscroll-behavior-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.data-table th { height: 42px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); color: var(--muted); font-size: 9px; font-weight: 750; text-align: left; white-space: nowrap; }
.data-table td { height: 54px; max-width: 360px; padding: 10px 18px; border-bottom: 1px solid var(--line); color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr:last-child td { border-bottom: 0; }.data-table tbody tr { transition: background-color 150ms ease; }.data-table tbody tr:hover { background: rgba(124,140,255,.035); }
.data-table b { color: var(--text); }.actions-column { width: 112px; text-align: right !important; }
.debts-table .actions-column { width: 188px; }
.debts-table tbody tr > td { height: 48px; padding-top: 8px; padding-bottom: 8px; }
.action-btn { display: inline-grid; min-width: 34px; min-height: 34px; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); color: var(--text-soft); cursor: pointer; font-size: 10px; font-weight: 700; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.action-btn + .action-btn { margin-left: 5px; }.action-btn svg { width: 15px; height: 15px; fill: currentColor; }.action-btn:hover { border-color: var(--line-strong); color: var(--text); }.delete-btn:hover { border-color: rgba(255,107,122,.35); background: var(--danger-soft); color: var(--danger); }.edit-btn:hover { border-color: rgba(124,140,255,.35); background: var(--accent-soft); color: var(--accent-bright); }
.debt-close-btn:hover { border-color: var(--line-strong); background: var(--surface-hover); color: var(--text); }
.debts-overview { display:grid; gap:16px; margin-bottom:16px; }.debts-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }.debts-summary-grid article { min-width:0; padding:16px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }.debts-summary-grid span,.debts-summary-grid small { display:block; color:var(--muted); font-size:10px; }.debts-summary-grid strong { display:block; margin:7px 0 4px; overflow:hidden; font-size:22px; letter-spacing:-.035em; text-overflow:ellipsis; white-space:nowrap; }.debts-overview-grid { display:grid; grid-template-columns:minmax(250px,.72fr) minmax(0,1.28fr); align-items:start; gap:16px; }.debts-overview-card { min-width:0; padding:18px; }.debts-overview-card .card-heading { margin-bottom:10px; }.debts-overview-card h3 { margin:2px 0 0; font-size:16px; }.debts-overview-card .card-heading p { margin:4px 0 0; color:var(--muted); font-size:9px; }.debts-group-list { display:grid; }.debt-group-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; padding:11px 0; border-top:1px solid var(--line); }.debt-group-row:first-child { border-top:0; }.debt-group-row strong,.debt-group-row small { display:block; }.debt-group-row strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }.debt-group-row small { margin-top:3px; overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }.debt-group-row b { color:var(--warning); font-size:11px; white-space:nowrap; }
.debt-group-row .debt-debtor-aliases { overflow:visible; margin-top:5px; color:var(--text-soft); line-height:1.45; text-overflow:clip; white-space:normal; }
.settle-btn { border-color: rgba(79,227,177,.3); background: var(--positive-soft); color: var(--positive); }
.settle-btn:hover { border-color: rgba(79,227,177,.55); background: rgba(79,227,177,.16); color: #82f3ce; }
.loading-line { color: var(--muted); }
.table-note { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.history-locked { color: var(--muted); font-size: 9px; }
.history-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:34px; margin:0 0 10px; }
.history-filter-toggle { display:inline-flex; align-items:center; gap:7px; min-height:32px; padding:0 11px; border-radius:9px; font-size:10px; }
.history-filter-toggle svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }
.history-filter-toggle[aria-expanded="true"] { border-color:rgba(124,140,255,.55); background:var(--accent-soft); color:var(--accent-bright); }
.history-toolbar #historyFilterSummary { display:inline-flex; min-height:28px; align-items:center; padding:0 9px; border:1px solid var(--line); border-radius:8px; background:rgba(8,11,18,.36); color:var(--muted); font-size:9px; line-height:1; text-align:right; white-space:nowrap; }
.history-filter-summary { color:var(--muted); font-size:10px; }
.history-filters { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:12px; margin:0 0 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.history-filters[hidden] { display:none !important; }
.history-filters label { display:grid; gap:5px; color:var(--muted); font-size:9px; }
.history-filters input, .history-filters select { min-width:130px; height:34px; padding:0 9px; border:1px solid var(--line-strong); border-radius:8px; background:var(--canvas-soft); color:var(--text); font:inherit; }
.history-filters .button { min-height:34px; align-self:center; margin-top:14px; }
.history-route { display:grid; gap:3px; min-width:130px; }
.history-route b { color:var(--text); font-size:10px; }
.history-route span, .history-muted { color:var(--muted); font-size:9px; }

.batches-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.batch-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.batch-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.batch-title { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }.batch-date { margin-top: 3px; color: var(--muted); font-size: 9px; }.batch-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-bright); font-size: 9px; font-weight: 700; }
.batch-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 9px; }.batch-progress-head strong { color: var(--text-soft); font-weight: 700; }.batch-progress { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--canvas-soft); }.batch-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--positive)); }.batch-location-breakdown { display:grid; gap:5px; margin-top:11px; padding:9px 10px; border:1px solid rgba(124,140,255,.18); border-radius:9px; background:rgba(124,140,255,.045); }.batch-location-breakdown > span { color:var(--muted); font-size:8px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }.batch-location-breakdown > div { display:flex; flex-wrap:wrap; gap:5px; }.batch-location-breakdown div span { padding:4px 6px; border-radius:6px; background:var(--canvas-soft); color:var(--text-soft); font-size:9px; }.batch-location-breakdown div b { margin-left:3px; color:var(--text); font-variant-numeric:tabular-nums; }
.batch-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 14px; }.batch-stat { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas-soft); }.batch-stat span, .batch-stat strong { display: block; }.batch-stat span { color: var(--muted); font-size: 8px; font-weight: 700; }.batch-stat strong { margin-top: 3px; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.batch-stat-loss strong { color: var(--danger); }
.batch-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 10px; }.batch-row span:last-child { color: var(--text-soft); font-weight: 600; text-align: right; }.batch-forecast { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid rgba(124,140,255,.18); border-radius: 11px; background: linear-gradient(135deg, rgba(124,140,255,.09), rgba(79,227,177,.04)); }.batch-forecast div { min-width: 0; }.batch-forecast span, .batch-forecast strong { display: block; }.batch-forecast span { color: var(--muted); font-size: 8px; font-weight: 700; }.batch-forecast strong { margin-top: 4px; font-size: 11px; }.batch-forecast small { color: inherit; font-size: 8px; }.batch-profit { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--line-strong); font-size: 11px; font-weight: 700; }.profit-positive { color: var(--positive); }.profit-negative, .type-writeoff { color: var(--danger); }.type-sale { color: var(--positive); }.type-purchase { color: var(--accent-bright); }.type-move { color: var(--warning); }
.batch-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; }.batch-edit-button { display: flex; width: 100%; min-height: 38px; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas-soft); color: var(--text-soft); cursor: pointer; font-size: 10px; font-weight: 700; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease; }.batch-edit-button svg { width: 14px; height: 14px; fill: currentColor; }.batch-edit-button:hover { border-color: rgba(124,140,255,.4); background: var(--accent-soft); color: var(--accent-bright); }
.empty-state { display: grid; min-height: 180px; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255,255,255,.015); }
.error-state { color: var(--danger); }

.inventory-summary, .insight-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }.inventory-summary > div, .insight-metrics > article { display: flex; min-height: 82px; flex-direction: column; justify-content: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }.inventory-summary span, .insight-metrics span { color: var(--muted); font-size: 9px; font-weight: 700; }.inventory-summary strong, .insight-metrics strong { margin-top: 4px; font-size: 21px; letter-spacing: -.035em; }.insight-metrics small { margin-top: 1px; color: var(--muted); font-size: 9px; }

.reconciliation-hero { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 20px 22px; border-left: 3px solid var(--muted); }.reconciliation-hero > div { display: flex; min-width: 0; align-items: center; gap: 14px; }.reconciliation-hero h3 { margin: 3px 0 2px; font-size: 19px; }.reconciliation-hero p, .reconciliation-hero > small { margin: 0; color: var(--muted); font-size: 10px; }.reconciliation-status-dot { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); box-shadow: 0 0 18px currentColor; }.reconciliation-state-ok { border-left-color: var(--positive); }.reconciliation-state-ok .reconciliation-status-dot { background: var(--positive); color: var(--positive); }.reconciliation-state-warning { border-left-color: var(--warning); }.reconciliation-state-warning .reconciliation-status-dot { background: var(--warning); color: var(--warning); }.reconciliation-state-critical { border-left-color: var(--danger); }.reconciliation-state-critical .reconciliation-status-dot { background: var(--danger); color: var(--danger); }
.reconciliation-checks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }.reconciliation-check { min-width: 0; padding: 16px 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }.reconciliation-check span, .reconciliation-check strong, .reconciliation-check small { display: block; }.reconciliation-check span { color: var(--muted); font-size: 9px; font-weight: 700; }.reconciliation-check strong { margin-top: 7px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }.reconciliation-check small { margin-top: 2px; color: var(--muted); font-size: 9px; }.reconciliation-check-ok { border-color: rgba(79,227,177,.2); }.reconciliation-check-warning { border-color: rgba(245,184,90,.3); }.reconciliation-check-critical { border-color: rgba(255,107,122,.34); }.reconciliation-severity { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 99px; font-size: 8px; font-weight: 800; }.severity-critical { background: var(--danger-soft); color: var(--danger); }.severity-warning { background: rgba(245,184,90,.12); color: var(--warning); }.severity-info { background: var(--accent-soft); color: var(--accent-bright); }.reconciliation-note { margin: 12px 2px 0; color: var(--muted); font-size: 9px; }

.transfer-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); gap: 16px; margin-bottom: 16px; }.transfer-composer, .custody-card { padding: 22px; }.custody-card { position: relative; overflow: hidden; }.custody-card h3 { margin: 4px 0 10px; font-size: 18px; }.custody-card p { position: relative; z-index: 2; margin: 0; color: var(--muted); font-size: 11px; }.custody-mark { position: absolute; right: -18px; bottom: -22px; color: rgba(124,140,255,.1); }.custody-mark svg { width: 150px; height: 150px; fill: currentColor; }.transfer-history-card { margin-top: 16px; }.route-chip { display: inline-flex; min-height: 25px; align-items: center; padding: 0 8px; border-radius: 7px; background: var(--surface-raised); color: var(--text-soft); font-size: 9px; }.route-arrow { margin-inline: 7px; color: var(--accent-bright); }

.analytics-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 16px; }.chart-card { min-width: 0; padding: 22px; }.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 9px; }.chart-legend span::before { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px; content: ""; }.legend-sales::before { background: var(--positive); }.legend-purchases::before { background: var(--accent); }.cashflow-chart { display: grid; height: 260px; grid-template-columns: 52px minmax(0,1fr); gap: 10px; padding-top: 18px; }.chart-y-axis { display: grid; height: 240px; grid-template-rows: repeat(5,1fr); color: var(--muted); font-size: 8px; text-align: right; }.chart-y-axis span { transform: translateY(-5px); }.cashflow-plot { position: relative; min-width: 0; height: 260px; }.chart-gridlines { position: absolute; inset: 0 0 20px; display: grid; grid-template-rows: repeat(5,1fr); pointer-events: none; }.chart-gridlines i { border-top: 1px dashed rgba(142,151,184,.16); }.cashflow-columns { position: relative; z-index: 1; display: grid; height: 100%; grid-template-columns: repeat(14,minmax(18px,1fr)); align-items: end; gap: 7px; }.cashflow-day { display: grid; height: 100%; grid-template-rows: minmax(0,1fr) 20px; gap: 7px; }.cashflow-bars { display: flex; min-height: 0; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }.cashflow-bars i { width: min(9px,42%); border-radius: 4px 4px 1px 1px; transition: filter 160ms ease, transform 160ms ease; }.cashflow-bars:hover i { filter: brightness(1.25); transform: scaleX(1.08); }.sales-bar { background: linear-gradient(to top, rgba(79,227,177,.18), var(--positive)); }.purchase-bar { background: linear-gradient(to top, rgba(124,140,255,.18), var(--accent)); }.cashflow-day > span { color: var(--muted); font-size: 8px; text-align: center; transform: rotate(-38deg); }.location-bars { display: grid; gap: 16px; }.location-bar-row { position: relative; display: grid; grid-template-columns: minmax(100px,1fr) minmax(90px,1.2fr) auto; align-items: center; gap: 10px; }.location-bar-row > div > strong, .location-bar-row > div > span { display: block; }.location-bar-row > div > strong { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }.location-bar-row > div > span { margin-top: 2px; color: var(--muted); font-size: 8px; }.location-bar-row > b { min-width: 48px; font-size: 10px; text-align: right; }.location-bar-visual { position: relative; outline: none; }.location-bar-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--canvas-soft); }.location-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--positive)); }.location-tooltip { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 12; display: none; width: max-content; min-width: 210px; max-width: 290px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: #151a27; box-shadow: var(--shadow-lg); }.location-tooltip::after { position: absolute; right: 18px; bottom: -5px; width: 9px; height: 9px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: #151a27; content: ""; transform: rotate(45deg); }.location-tooltip strong { margin-bottom: 7px; font-size: 10px; }.location-tooltip span { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 5px; color: var(--text-soft); font-size: 9px; }.location-tooltip span b { min-width: auto; color: white; font-size: 9px; }.location-bar-visual:hover .location-tooltip, .location-bar-visual:focus .location-tooltip, .location-bar-visual:focus-visible .location-tooltip { display: block; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; }

.catalog-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.catalog-layout:has(.catalog-account-card) { grid-template-columns: repeat(3, minmax(0,1fr)); }.catalog-tables { margin-top: 16px; }.catalog-tables .accounts-table-card { grid-column: 1 / -1; }.catalog-form-card { min-width: 0; }
.catalog-add-button { min-height: 32px; padding-inline: 12px; font-size: 10px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.45fr); align-items: stretch; gap: 16px; }.calculator-card, .market-card { height: 100%; box-sizing: border-box; }.calculator-card { max-width: none; padding: 24px; }.calculator-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.market-card { padding: 20px; }.market-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }.market-card-head h3 { margin: 3px 0 0; font-size: 17px; }.icon-button-small { width: 36px; min-height: 36px; }.market-rates { display: grid; gap: 8px; }.market-rate { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,18,.42); }.market-rate > span > strong,.market-rate > span > small { display: block; }.market-rate > span > strong { font-size: 11px; }.market-rate > span > small { margin-top: 1px; color: var(--muted); font-size: 8px; }.market-symbol { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 800; box-shadow: inset 0 0 0 3px rgba(255,255,255,.05); }.market-symbol svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }.market-symbol svg circle { fill: currentColor; stroke: none; opacity: .14; }.market-symbol svg path { stroke: currentColor; }.market-rate:nth-child(1) .market-symbol { color: #f7931a; }.market-rate:nth-child(2) .market-symbol { color: #4fe3b1; }.market-rate:nth-child(3) .market-symbol { color: #ff8a52; }.market-price { min-width: 122px; text-align: right; }.market-price > strong { white-space: nowrap; }.market-subquote { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 3px; }.market-subquote > small { white-space: nowrap; }.market-change.up { color: var(--positive); }.market-change.down { color: var(--danger); }.market-change.flat { color: var(--muted); }.market-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 8px; }.market-rate-skeleton { height: 58px; border-radius: 12px; background: linear-gradient(90deg,var(--canvas-soft),var(--surface-hover),var(--canvas-soft)); background-size: 200% 100%; animation: market-shimmer 1.2s linear infinite; }.market-error { display: grid; gap: 5px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 9px; text-align: center; }.market-error strong { color: var(--text); font-size: 11px; }.market-error button { justify-self: center; margin-top: 5px; border: 0; background: none; color: var(--accent-bright); cursor: pointer; font-size: 9px; font-weight: 800; }.market-rates.is-loading { opacity: .65; }.market-rates.is-loading .market-rate { pointer-events: none; }@keyframes market-shimmer { to { background-position: -200% 0; } }

.modal { position: fixed; inset: 0; z-index: 1000; display: grid; width: 100vw; height: 100dvh; align-items: center; justify-items: center; padding: 24px; overflow: hidden; overscroll-behavior: contain; background: rgba(3,5,9,.76); backdrop-filter: blur(10px); }
.modal[hidden] { display: none; }.modal-panel { width: min(100%, 480px); max-height: calc(100dvh - 48px); padding: 22px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.55); }.modal-panel-small { width: min(100%, 420px); }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }.modal-header h2 { margin: 3px 0 0; font-size: 20px; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.audit-log-panel { width: min(100%, 860px); }.audit-log-intro { margin: -8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.45; }.audit-log-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; gap: 10px; margin-bottom: 16px; }.audit-log-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }.audit-log-filters input { min-height: 36px; }.audit-log-list { display: grid; gap: 8px; }.audit-log-entry { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,18,.34); }.audit-log-time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }.audit-log-body { min-width: 0; }.audit-log-body strong { display: block; font-size: 11px; }.audit-log-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }.audit-log-details { margin-top: 8px; color: var(--text-soft); font-size: 9px; }.audit-log-details summary { color: var(--accent-bright); cursor: pointer; }.audit-log-details pre { max-height: 180px; margin: 7px 0 0; padding: 9px; overflow: auto; border-radius: 8px; background: rgba(0,0,0,.2); color: var(--muted); font: 9px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; }

#toast-container { position: fixed; top: 18px; right: 18px; z-index: 3000; display: flex; width: min(390px, calc(100vw - 36px)); flex-direction: column; gap: 10px; pointer-events: none; }
.toast { position: relative; display: grid; min-height: 68px; grid-template-columns: 34px minmax(0,1fr) 28px; align-items: center; gap: 11px; overflow: hidden; padding: 12px 10px 13px 13px; border: 1px solid var(--line-strong); border-radius: 15px; background: linear-gradient(135deg,rgba(27,35,51,.98),rgba(15,20,30,.98)); box-shadow: 0 20px 54px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.035); color: var(--text); opacity: 0; pointer-events: auto; transform: translate3d(12px,-8px,0) scale(.98); transition: opacity 220ms ease, transform 220ms cubic-bezier(.2,.8,.2,1); backdrop-filter: blur(18px); }
.toast.show { opacity: 1; transform: translate3d(0,0,0) scale(1); }.toast.is-leaving { transform: translate3d(12px,-5px,0) scale(.98); }
.toast::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--toast-accent,var(--accent)); content: ""; }
.toast-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid color-mix(in srgb,var(--toast-accent,var(--accent)) 28%,transparent); border-radius: 11px; background: color-mix(in srgb,var(--toast-accent,var(--accent)) 13%,transparent); color: var(--toast-accent,var(--accent)); }.toast-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.toast-content { display: block; min-width: 0; }.toast-content strong, .toast-content > span { display: block; }.toast-content strong { margin-bottom: 2px; font-size: 11px; font-weight: 800; letter-spacing: .01em; }.toast-content > span { color: var(--text-soft); font-size: 10px; line-height: 1.4; }
.toast-close { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background 160ms ease,color 160ms ease; }.toast-close:hover { background: rgba(255,255,255,.06); color: var(--text); }.toast-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.toast-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--toast-accent,var(--accent)); opacity: .7; transform-origin: left; animation: toast-countdown var(--toast-duration,3000ms) linear forwards; }
.toast-success { --toast-accent: var(--positive); }.toast-error { --toast-accent: var(--danger); }.toast-info { --toast-accent: var(--accent); }
@keyframes toast-countdown { to { transform: scaleX(0); } }
.mobile-type { display: none; }

@media (max-width: 980px) {
    :root { --sidebar-width: 0px; }
    .sidebar { inset: 0 0 auto; width: 100%; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { display: none; }.sidebar-footer, .nav-divider { display: none; }
    .primary-nav { flex: none; flex-direction: row; gap: 5px; margin: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }.primary-nav::-webkit-scrollbar { display: none; }
    .nav-item { width: auto; min-width: max-content; min-height: 42px; padding: 0 13px; }.nav-item:hover { transform: none; }.nav-item.active::before { inset: auto 16px -10px; width: auto; height: 2px; border-radius: 8px 8px 0 0; }
    .workspace { margin-left: 0; padding-top: 63px; }.topbar { height: 92px; min-height: 92px; padding: 16px 20px; }.time-travel-bar { top: 92px; margin: 0 12px; }.workspace main { min-height: calc(100vh - 155px); padding-top: 22px; }
    .overview-grid, .analytics-grid, .transfer-layout, .calculator-layout { grid-template-columns: 1fr; }.pulse-card { min-height: 290px; }
    .flow-map { grid-template-columns: minmax(210px,1fr) minmax(170px,.65fr) minmax(210px,1fr); gap: 16px; }.flow-core { width: 140px; min-height: 98px; }
    .catalog-layout:has(.catalog-account-card) { grid-template-columns: 1fr 1fr; }.catalog-account-card { grid-column: 1 / -1; }.reconciliation-checks { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* iOS Safari zooms the viewport when a focused form control is below 16px. */
@media (hover: none) and (pointer: coarse), (max-width: 980px) {
    input, select, textarea { font-size: 16px; }
}

@media (max-width: 720px) {
    .login-screen { align-items: center; padding-inline: 14px; }.login-card { width: min(100%,430px); padding: 32px 22px 27px; border-radius: 19px; }.login-brand-mark { width: 48px; height: 48px; margin-bottom: 17px; }.login-card h1 { font-size: 27px; }.login-card > p { margin-bottom: 22px; }.login-input-wrap input { min-height: 54px; }
    .topbar { position: relative; align-items: center; }.page-context p { display: none; }.export-button span { display: none; }.export-button { width: 42px; padding: 0; }
    main { padding: 18px 12px calc(36px + env(safe-area-inset-bottom)); }
    .signal-banner { min-height: 220px; align-items: flex-start; flex-direction: column; padding: 24px; }.signal-copy h2 { font-size: 31px; }.signal-actions { width: 100%; justify-items: stretch; margin-top: auto; }.signal-actions > .button { width: 100%; }.overview-sheet-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }.overview-sheet-links a { justify-content: center; }.signal-orbit { right: -90px; }
    .metrics-grid { grid-template-columns: 1fr; gap: 9px; }.metric-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 16px; }.metric-head { grid-column: 1; }.metric-head svg { display: none; }.metric-val { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 22px; text-align: right; }.metric-card p { grid-column: 1; }
    .content-heading { min-height: 0; align-items: flex-start; flex-direction: column; gap: 14px; }.content-heading h2 { font-size: 29px; }
    .flow-heading .flow-period { width: 100%; }.flow-period button { flex: 1; }.flow-map-card { padding: 17px; }.flow-map { grid-template-columns: 1fr; gap: 18px; padding-top: 22px; }.flow-network-svg { display: none; }.flow-hub { min-height: 170px; order: -1; }.flow-node-list { gap: 7px; }.flow-details-grid { grid-template-columns: 1fr; gap: 10px; }.flow-detail-card { padding: 16px; }
    .flow-business-grid { grid-template-columns: 1fr; gap: 8px; }.flow-business-card { min-height: 76px; }.flow-stock-audit-form { grid-template-columns: 1fr; }.flow-stock-audit-form .button { width: 100%; }
    .flow-timeline-card { padding: 16px; }.flow-timeline-head { flex-direction: column; }.flow-timeline-chart { grid-template-columns: 40px minmax(560px,1fr) 32px; overflow-x: auto; }.flow-chart-scale.is-left { position: sticky; left: 0; z-index: 3; background: var(--surface); }.flow-chart-legend { margin-right: 0; margin-left: 0; }.flow-chart-period-note { align-self: stretch; text-align: center; }
    .operation-card, .command-card, .pulse-card, .catalog-form-card, .calculator-card { padding: 16px; }.op-tabs { display: grid; grid-template-columns: repeat(2,1fr); }.form-grid, .compact-grid, .calculator-card .form-grid { grid-template-columns: 1fr; }.form-group.full-width, .full-width { grid-column: 1; }.form-actions { flex-direction: column; }.form-actions .button { width: 100%; }
    .catalog-layout, .catalog-layout:has(.catalog-account-card) { grid-template-columns: 1fr; }.catalog-account-card { grid-column: auto; }.catalog-tables { margin-top: 12px; }
    .audit-log-panel { width: min(100%, 560px); }.audit-log-filters { grid-template-columns: 1fr 1fr; }.audit-log-filters .button { grid-column: 1 / -1; justify-self: start; }.audit-log-entry { grid-template-columns: 1fr; gap: 6px; }
    .inventory-summary, .insight-metrics, .reconciliation-checks { grid-template-columns: 1fr; gap: 8px; }.inventory-summary > div, .insight-metrics > article { min-height: 66px; }.reconciliation-hero { align-items: flex-start; flex-direction: column; }.reconciliation-hero > small { padding-left: 26px; }
    .cashflow-chart { height: 220px; grid-template-columns: 45px minmax(360px,1fr); gap: 6px; overflow-x: auto; }.chart-y-axis { position: sticky; left: 0; z-index: 3; height: 200px; padding-right: 4px; background: var(--panel); }.cashflow-plot { height: 220px; }.cashflow-day { min-width: 20px; }.chart-card { padding: 16px; }.location-bar-row { grid-template-columns: minmax(90px,1fr) minmax(70px,1fr) auto; }
    .data-table th, .data-table td { padding-inline: 13px; }.data-table td { max-width: 220px; }
    .history-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:10px; margin-bottom:10px; }.history-filters label:first-child { grid-column:1 / -1; }.history-filters input, .history-filters select { width:100%; min-width:0; }.history-filters .button { width:auto; justify-self:start; align-self:center; margin-top:0; }
    .batch-forecast { grid-template-columns: 1fr; }
    .desktop-type { display: none; }.mobile-type { display: inline; }
    #toast-container { top: calc(10px + env(safe-area-inset-top)); right: 12px; bottom: auto; left: 12px; width: auto; }
    .toast { min-height: 72px; grid-template-columns: 38px minmax(0,1fr) 30px; padding: 13px 10px 14px 14px; border-radius: 16px; transform: translate3d(0,-18px,0) scale(.98); }.toast.is-leaving { transform: translate3d(0,-12px,0) scale(.98); }.toast-icon { width: 38px; height: 38px; }.toast-content strong { font-size: 13px; }.toast-content > span { font-size: 12px; }
    .modal-actions { flex-direction: column-reverse; }.modal-actions .button { width: 100%; }
}

@media (max-width: 430px) {
    .sidebar { padding-inline: 8px; }.nav-item { padding-inline: 11px; }.nav-item svg { width: 17px; height: 17px; }.nav-item span { font-size: 11px; }
    .topbar { height: 84px; min-height: 84px; padding-inline: 14px; }.page-context > span { display: none; }.page-context h1 { font-size: 21px; }.topbar-actions { gap: 6px; }.icon-button, .export-button { width: 40px; min-height: 40px; }
    .history-filter-toggle { width: auto; }.history-toolbar #historyFilterSummary { font-size: 8px; }
    .signal-copy p { font-size: 11px; }.button-compact { width: 100%; }
    .command-list > button { grid-template-columns: 36px minmax(0,1fr) 15px; }.pulse-card { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card { animation: none; }
    .market-rate-skeleton { animation: none; }
    .toast-progress { animation: none; }
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* На широких 2K-мониторах интерфейс должен ощущаться как браузерный масштаб 125%. */
@media (min-width: 2200px) and (min-height: 1000px) {
    .app-shell { zoom: 1.25; }
}

/* Compact paired columns: revenue is primary, operation count is intentionally half-scale. */
.flow-chart-bars { gap: 3px; }
.flow-chart-bars > i { width: min(16px,42%); }
.flow-chart-bars > b { position: static; display: block; width: min(10px,28%); min-height: 1px; border: 0; border-radius: 4px 4px 1px 1px; background: linear-gradient(to top,#805c35,var(--warning)); box-shadow: 0 0 7px rgba(255,184,92,.22); transform: none; }
.flow-chart-legend .is-operations::before,.flow-chart-tooltip span i.is-operations { border-radius: 2px; background: linear-gradient(to top,#805c35,var(--warning)); }
.flow-chart-tooltip { min-width: 250px; max-width: min(380px,calc(100vw - 24px)); }
.flow-tooltip-products { display: grid; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line); }
.flow-tooltip-products > small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.flow-tooltip-products em { display: flex; justify-content: space-between; gap: 14px; color: var(--text-soft); font-size: 9px; font-style: normal; }
.flow-tooltip-products em span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-tooltip-products em b { flex: 0 0 auto; color: var(--text); }
.flow-tooltip-empty { padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }

/* Chart hint is attached to the viewport, avoiding offset errors in the 2K zoomed layout. */
.flow-chart-tooltip { position: fixed; z-index: 6000; }

/* Expand timeline points on hover/focus so the full snapshot description is readable. */
.time-travel-point { transition: min-width 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.time-travel-point:hover, .time-travel-point:focus-visible, .time-travel-point.is-active { z-index: 4; min-width: 220px; box-shadow: 0 10px 22px rgba(0,0,0,.28); transform: translateY(-2px); }
.time-travel-point:hover span, .time-travel-point:focus-visible span, .time-travel-point.is-active span { overflow: visible; font-size: 10px; line-height: 1.35; text-overflow: clip; white-space: normal; }

/* Give reconciliation copy and the trailing disclosure arrow their own breathing room. */
.flow-health-issue { grid-template-columns: 76px minmax(0,1fr) 24px; column-gap: 14px; padding: 14px 16px; }
.flow-health-issue > div { min-width: 0; padding-right: 4px; }
.flow-health-issue strong { display: block; line-height: 1.35; }
.flow-health-issue p { margin-top: 6px; }
.flow-health-issue small { margin-top: 7px; line-height: 1.35; }
.flow-health-issue > b { display: grid; width: 24px; height: 32px; place-items: center; border-radius: 7px; background: rgba(124,140,255,.12); color: var(--accent-bright); }
@media (max-width: 760px) {
    .spoilage-form .form-grid { grid-template-columns: 1fr; }
}

.p2p-ledger-card { margin-top: 16px; padding: 22px; }
.p2p-ledger-heading { align-items: flex-start; margin-bottom: 16px; }
.p2p-ledger-heading h3 { margin: 4px 0 0; font-size: 18px; }
.p2p-ledger-heading p { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.button-compact { min-height: 36px; padding: 0 14px; font-size: 9px; }
.p2p-ledger-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.ledger-total { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,18,.42); }
.ledger-total span,.ledger-total strong { display: block; }.ledger-total span { color: var(--muted); font-size: 8px; }.ledger-total strong { margin-top: 5px; color: var(--text); font-size: 15px; }.ledger-total.is-positive strong { color: var(--positive); }.ledger-total.is-negative strong { color: var(--danger); }
.p2p-ledger-entry { display: grid; grid-template-columns: 204px minmax(180px,.82fr) minmax(260px,1.18fr) 122px; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas-soft); }
.p2p-ledger-kind { display: grid; height: 48px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }.ledger-kind { min-height: 40px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 9px; font-weight: 700; white-space: nowrap; }.ledger-kind b { margin-left: 4px; color: currentColor; font-size: 13px; }.ledger-kind.active { background: var(--accent-soft); color: var(--accent-bright); }
.p2p-ledger-amount,.p2p-ledger-note { display: grid; gap: 6px; }.p2p-ledger-amount > span,.p2p-ledger-note > span { color: var(--muted); font-size: 8px; }.p2p-ledger-note em { color: var(--muted); font-style: normal; }.p2p-ledger-entry input { width: 100%; min-height: 48px; }.p2p-ledger-entry > .button { width: 100%; min-height: 48px; }
.p2p-ledger-kind,.p2p-ledger-entry > .button { margin-bottom: 10px; }
.p2p-ledger-list { display: grid; gap: 7px; margin-top: 14px; }.p2p-ledger-empty { padding: 22px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 10px; text-align: center; }.ledger-entry-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(8,11,18,.34); }.ledger-entry-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; font-size: 17px; font-weight: 800; }.ledger-entry-icon.is-deposit { background: var(--positive-soft); color: var(--positive); }.ledger-entry-icon.is-withdrawal { background: var(--accent-soft); color: var(--accent-bright); }.ledger-entry-main strong,.ledger-entry-main small { display: block; }.ledger-entry-main strong { font-size: 10px; }.ledger-entry-main small { margin-top: 3px; color: var(--muted); font-size: 8px; }.ledger-entry-balance { min-width: 120px; text-align: right; }.ledger-entry-balance strong { display: block; font-size: 11px; }.ledger-entry-balance small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
@media (max-width: 760px) {
    .p2p-ledger-card { padding: 16px; }.p2p-ledger-heading { gap: 10px; }.p2p-ledger-heading h3 { font-size: 16px; }.p2p-ledger-heading p { font-size: 9px; }.p2p-ledger-summary { grid-template-columns: 1fr; }.p2p-ledger-entry { grid-template-columns: 1fr 1fr; }.p2p-ledger-kind { grid-column: 1 / -1; margin-bottom: 0; }.p2p-ledger-note { grid-column: 1 / -1; }.p2p-ledger-entry > .button { width: 100%; margin-bottom: 0; }.ledger-entry-row { grid-template-columns: 30px minmax(0,1fr); }.ledger-entry-balance { grid-column: 2; min-width: 0; text-align: left; }.ledger-entry-balance small { display: inline; margin-left: 6px; }
}

.statement-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }.statement-supported { display: flex; flex-wrap: wrap; gap: 6px; margin: -5px 0 14px; }.statement-supported span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8,11,18,.35); color: var(--text-soft); font-size: 8px; font-weight: 700; }.statement-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }.statement-summary article { position: relative; min-height: 82px; overflow: hidden; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }.statement-summary article::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: linear-gradient(90deg,var(--accent),var(--positive)); content: ''; }.statement-summary article.is-warning::after { background: var(--warning); }.statement-summary article.is-danger::after { background: var(--danger); }.statement-summary span,.statement-summary strong,.statement-summary small { display: block; }.statement-summary span { color: var(--muted); font-size: 8px; font-weight: 700; }.statement-summary strong { margin-top: 5px; font-size: 19px; }.statement-summary small { margin-top: 3px; color: var(--muted); font-size: 8px; }.statement-chart-card { margin-bottom: 14px; padding: 20px; }.statement-chart-card h3 { margin: 3px 0 2px; font-size: 17px; }.statement-chart-card p { margin: 0; color: var(--muted); font-size: 9px; }.statement-daily-chart { display: grid; min-height: 210px; grid-template-columns: repeat(14,minmax(24px,1fr)); align-items: end; gap: 7px; margin-top: 16px; padding: 12px 4px 0; border-top: 1px solid var(--line); }.statement-day { display: grid; height: 180px; grid-template-rows: minmax(0,1fr) 18px; gap: 6px; }.statement-day > div { display: flex; min-height: 0; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }.statement-day i,.statement-day b { display: block; width: min(15px,42%); min-height: 2px; border-radius: 4px 4px 1px 1px; }.statement-day i { background: linear-gradient(to top,rgba(79,227,177,.16),var(--positive)); }.statement-day b { background: linear-gradient(to top,rgba(124,140,255,.18),var(--accent)); }.statement-day > span { color: var(--muted); font-size: 8px; text-align: center; }.statement-review-card { margin-bottom: 14px; }.statement-filters { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas-soft); }.statement-filter { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 8px; font-weight: 800; }.statement-filter.active { background: var(--accent-soft); color: var(--accent-bright); }.statement-table td { vertical-align: top; }.statement-table td:nth-child(3) { max-width: 250px; }.statement-sale { display: grid; gap: 2px; min-width: 150px; }.statement-sale strong { font-size: 10px; }.statement-sale span,.statement-sale small { color: var(--muted); font-size: 8px; }.statement-status { display: inline-flex; min-height: 25px; align-items: center; padding: 0 8px; border-radius: 8px; background: var(--canvas-soft); color: var(--muted); font-size: 8px; font-weight: 800; white-space: nowrap; }.statement-status.is-confirmed { background: var(--positive-soft); color: var(--positive); }.statement-status.is-suggested { background: var(--accent-soft); color: var(--accent-bright); }.statement-status.is-warning { background: rgba(245,184,90,.1); color: var(--warning); }.statement-status.is-danger { background: var(--danger-soft); color: var(--danger); }.statement-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 150px; }.statement-confirm { border-color: rgba(79,227,177,.25); color: var(--positive); }.statement-bottom-grid { display: grid; grid-template-columns: minmax(340px,.75fr) minmax(520px,1.25fr); gap: 14px; }.amount-positive { color: var(--positive); }.amount-negative { color: var(--danger); }
@media (max-width: 1080px) { .statement-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }.statement-bottom-grid { grid-template-columns: 1fr; }.statement-daily-chart { overflow-x: auto; grid-template-columns: repeat(14,minmax(36px,1fr)); } }
@media (max-width: 760px) { .statement-heading { align-items: stretch; }.statement-upload-actions .button { flex: 1; }.statement-summary { grid-template-columns: 1fr 1fr; gap: 7px; }.statement-summary article { min-height: 72px; padding: 12px; }.statement-summary strong { font-size: 16px; }.statement-chart-card { padding: 16px; }.statement-review-card .table-heading { align-items: flex-start; flex-direction: column; }.statement-filters { width: 100%; }.statement-filter { flex: 1; }.statement-bottom-grid { grid-template-columns: minmax(0,1fr); } }
.statement-daily-chart > .empty-state { grid-column: 1 / -1; align-self: center; }
.form-help { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; line-height: 1.5; }

/* Decision-first reconciliation details */
.statement-sale-title { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.statement-history-link { padding:0; border:0; background:transparent; color:var(--accent-bright); cursor:pointer; font:inherit; font-size:8px; font-weight:800; white-space:nowrap; }
.statement-history-link:hover { color:#b8c2ff; }
.statement-operation-details { display:grid; width:100%; max-width:none; gap:5px; }.statement-operation-details strong { color:var(--text-soft); font-size:9px; font-weight:600; line-height:1.45; white-space:normal; overflow-wrap:anywhere; }.statement-operation-details .statement-history-link { justify-self:start; }
.statement-sale em { max-width:250px; margin-top:5px; color:var(--text-soft); font-size:8px; font-style:normal; line-height:1.45; }
.statement-no-match { display:grid; max-width:240px; gap:4px; }
.statement-no-match strong { color:var(--text-soft); font-size:9px; }
.statement-no-match small { color:var(--muted); font-size:8px; line-height:1.45; }

.inventory-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:12px; }
.inventory-cards + .table-card { display:none; }
.inventory-card { position:relative; display:grid; min-height:180px; padding:18px; overflow:hidden; border:1px solid var(--line); border-radius:var(--radius-lg); background:linear-gradient(145deg,rgba(20,27,41,.98),rgba(13,18,29,.96)); }
.inventory-card::after { position:absolute; right:0; bottom:0; left:0; height:3px; background:linear-gradient(90deg,#8e9ff0,#64d9b8); content:''; opacity:.8; }
.inventory-card.is-partner::after { background:linear-gradient(90deg,#8c7960,#b49a73); }
.inventory-card-head,.inventory-card-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.inventory-card-head > span:last-child { color:var(--muted); font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.inventory-location { color:var(--text-soft); font-size:9px; font-weight:800; }
.inventory-card.is-own .inventory-location { color:#edf1ff; }
.inventory-card.is-partner .inventory-location { color:#aaa49b; }
.inventory-card h3 { margin:16px 0 8px; color:var(--text); font-size:15px; }
.inventory-quantity { display:flex; align-items:baseline; gap:6px; }
.inventory-quantity strong { font-size:34px; line-height:1; letter-spacing:-.05em; }
.inventory-quantity span { color:var(--muted); font-size:11px; font-weight:800; }
.inventory-card-foot { align-self:end; margin-top:18px; }
.inventory-card-foot small { color:var(--muted); font-size:8px; }
.inventory-card-foot > div { display:flex; gap:6px; }

.history-product { color:var(--text); font-weight:700; }
.history-product.product-silver-haze,.history-product.product-xxl,.history-product.product-xl { color:#91d8b8; }
.history-product.product-afghan { color:#c9aa7c; }
.history-product.product-xolamax { color:#91b9e8; }
.history-description,.history-debt-comment { display:block; margin-top:4px; color:var(--muted); font-size:8px; line-height:1.4; }
.history-debt-comment { color:#c9b68e; }
.history-route .warehouse-own { color:#e2e7f2; }
.history-route .warehouse-partner { color:#898e98; }
.history-focus-row { position:relative; animation:history-focus-pulse 1.4s ease-in-out 3; background:rgba(124,140,255,.09); box-shadow:inset 3px 0 0 rgba(124,140,255,.72); }
@keyframes history-focus-pulse { 50% { background:rgba(124,140,255,.17); } }

@media (max-width:700px) {
    .inventory-cards { grid-template-columns:1fr; gap:9px; }
    .inventory-card { min-height:155px; padding:15px; }
    .inventory-quantity strong { font-size:29px; }
    .statement-sale-title { align-items:flex-start; }
}
.statement-table { table-layout: fixed; }
.statement-table th:nth-child(1) { width: 9%; }.statement-table th:nth-child(2) { width: 13%; }.statement-table th:nth-child(3) { width: 11%; }.statement-table th:nth-child(4) { width: 39%; }.statement-table th:nth-child(5) { width: 13%; }.statement-table th:nth-child(6) { width: 15%; }
.statement-table td { padding: 9px 12px; white-space: normal; }
.statement-table tbody tr > td { vertical-align: middle; }
.statement-row-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-width: 0; gap: 5px; }
.statement-row-actions .action-btn { width: 100%; min-width: 0; min-height: 30px; padding: 0 7px; justify-content: center; font-size: 8px; white-space: nowrap; }
.statement-row-actions .action-btn + .action-btn { margin-left: 0; }
.statement-history-action { border-color: rgba(124,140,255,.28); color: var(--accent-bright); }
.statement-document { border-color: rgba(124,140,255,.28); color: var(--accent-bright); }
.statement-document-modal { z-index: 1100; }
.statement-document-panel { width: min(100%,1120px); height: min(100%,760px); max-height: calc(100dvh - 48px); padding: 18px; overflow: hidden; display: flex; flex-direction: column; }
.statement-document-panel .modal-header { flex: 0 0 auto; margin-bottom: 14px; }.statement-document-meta { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.statement-document-frame { width: 100%; min-height: 0; flex: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
@media (max-width: 760px) { .statement-table { table-layout: auto; }.statement-table th { width: auto !important; }.statement-table td { padding: 9px 11px; }.statement-row-actions { min-width: 180px; }.statement-document-modal { padding: 10px; }.statement-document-panel { height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); padding: 14px; border-radius: 14px; } }

/* Payment reconciliation: full-width uploads and a three-way comparison. */
.statement-bottom-grid { grid-template-columns: minmax(0, 1fr); }
.statement-bottom-grid > .card { min-width: 0; width: 100%; }
.statement-filters { flex-wrap: wrap; justify-content: flex-end; }
.statement-filter { white-space: nowrap; }
.statement-daily-chart { overflow-x: auto; grid-template-columns: repeat(var(--statement-day-count, 14), minmax(42px, 1fr)); }
.statement-day i,.statement-day b,.statement-day em { display: block; width: min(10px, 28%); min-height: 0; border-radius: 4px 4px 1px 1px; font-style: normal; }
.statement-day i.is-receipts { background: linear-gradient(to top, rgba(79,227,177,.16), var(--positive)); }
.statement-day b.is-sales { background: linear-gradient(to top, rgba(124,140,255,.18), var(--accent)); }
.statement-day em.is-debt { background: linear-gradient(to top, rgba(255,184,92,.18), var(--warning)); }
.statement-chart-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 10px; color: var(--text-soft); font-size: 9px; }
.statement-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.statement-chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--positive); }
.statement-chart-legend i.is-sales { background: var(--accent); }
.statement-chart-legend i.is-debt { background: var(--warning); }
.statement-comparison-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.statement-comparison-note { display: grid; gap: 3px; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,11,18,.34); }
.statement-comparison-note span { color: var(--text-soft); font-size: 9px; font-weight: 700; }
.statement-comparison-note strong { font-size: 14px; }
.statement-comparison-note small { color: var(--muted); font-size: 8px; }
.statement-comparison-note.is-danger { border-color: rgba(255,107,122,.25); }.statement-comparison-note.is-danger strong { color: var(--danger); }
.statement-comparison-note.is-warning { border-color: rgba(255,184,92,.25); }.statement-comparison-note.is-warning strong { color: var(--warning); }
.statement-comparison-note.is-debt { border-color: rgba(201,170,124,.25); }.statement-comparison-note.is-debt strong { color: #c9aa7c; }
.statement-review-tools { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.statement-browser-trigger { border:1px solid var(--line); background:var(--canvas-soft); color:var(--text-soft); }
.statement-browser-trigger:hover { background:var(--surface-hover); color:var(--text); }
.statement-note-action { margin-top:5px; padding:0; border:0; background:transparent; color:var(--accent-bright); cursor:pointer; font:inherit; font-size:8px; font-weight:800; text-align:left; }
.statement-note-action:hover { color:#b8c2ff; }
.statement-browser-modal { z-index:1120; }
.statement-browser-panel { width:min(100%,1280px); max-width:calc(100vw - 48px); max-height:calc(100dvh - 48px); padding:20px; overflow:hidden; display:flex; flex-direction:column; }
.statement-browser-controls { display:grid; grid-template-columns:minmax(190px,1.2fr) minmax(150px,.7fr) minmax(150px,.7fr) auto; align-items:end; gap:10px; margin-bottom:10px; }
.statement-browser-controls label { min-width:0; margin:0; }
.statement-browser-controls input,.statement-browser-controls select { min-height:42px; }
.statement-browser-meta { margin:0 0 10px; color:var(--muted); font-size:9px; }
.statement-browser-table-wrap { min-height:0; overflow:auto; border:1px solid var(--line); border-radius:12px; }
.statement-browser-table { min-width:900px; }
.statement-browser-table td { vertical-align:top; }
.statement-browser-table th,.statement-browser-table td { padding:11px 13px; }
.statement-browser-description { max-width:460px; color:var(--text-soft); line-height:1.45; overflow-wrap:anywhere; }
.statement-browser-row-actions { display:flex; flex-wrap:wrap; gap:5px; min-width:170px; }
.statement-browser-day-highlight td { background:rgba(166,117,74,.2); border-top-color:rgba(196,143,93,.42); border-bottom-color:rgba(196,143,93,.42); }
.statement-browser-day-highlight td:first-child { box-shadow:inset 3px 0 0 #b77c4d; }
.history-payment-account { display:block; margin-top:4px; color:var(--muted); font-size:8px; font-weight:600; line-height:1.3; white-space:normal; }
@media (max-width:760px) {
    .statement-review-tools { width:100%; justify-content:stretch; }
    .statement-review-tools > .statement-browser-trigger { flex:0 0 auto; }
    .statement-review-tools > .statement-filters { flex:1 1 240px; justify-content:stretch; }
    .statement-browser-panel { max-width:calc(100vw - 20px); max-height:calc(100dvh - 20px); padding:14px; border-radius:14px; }
    .statement-browser-controls { grid-template-columns:1fr 1fr; }
    .statement-browser-controls label:first-child { grid-column:1 / -1; }
    .statement-browser-controls .button { width:100%; }
}
@media (max-width: 760px) { .statement-comparison-notes { grid-template-columns: 1fr; }.statement-filters { justify-content: stretch; }.statement-filter { flex: 1 1 auto; } }

/* A deliberately separate, calendar-day-only reconciliation view. */
.statement-view-tabs { display:inline-flex; gap:3px; margin:0 0 14px; padding:3px; border:1px solid var(--line); border-radius:10px; background:var(--canvas-soft); }
.statement-view-tabs button { min-height:31px; padding:0 11px; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; font:inherit; font-size:9px; font-weight:800; }
.statement-view-tabs button.active { background:var(--accent-soft); color:var(--accent-bright); }
.statement-daily-test { margin-bottom:14px; padding:20px; }
.statement-daily-test-heading { align-items:flex-start; }
.statement-daily-test-heading h3 { margin:3px 0 2px; font-size:17px; }
.statement-daily-test-heading p { max-width:650px; margin:0; color:var(--muted); font-size:9px; }
.statement-daily-controls { display:flex; flex-wrap:wrap; align-items:end; justify-content:flex-end; gap:7px; }
.statement-daily-controls label { display:grid; gap:3px; color:var(--muted); font-size:8px; font-weight:800; }
.statement-daily-controls input { min-height:32px; padding:0 8px; border:1px solid var(--line); border-radius:8px; outline:none; background:var(--canvas-soft); color:var(--text-soft); font:inherit; font-size:10px; }
.statement-daily-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; margin:17px 0 10px; }
.statement-daily-summary article { position:relative; min-height:70px; overflow:hidden; padding:11px 13px; border:1px solid var(--line); border-radius:11px; background:rgba(8,11,18,.38); }
.statement-daily-summary article::after { position:absolute; right:0; bottom:0; left:0; height:2px; background:var(--accent); content:''; }
.statement-daily-summary article:nth-child(1)::after { background:var(--positive); }.statement-daily-summary article:nth-child(3)::after { background:var(--warning); }.statement-daily-summary article.is-negative::after { background:var(--danger); }
.statement-daily-summary span,.statement-daily-summary strong,.statement-daily-summary small { display:block; }.statement-daily-summary span,.statement-daily-summary small { color:var(--muted); font-size:8px; }.statement-daily-summary span { font-weight:800; }.statement-daily-summary strong { margin-top:5px; font-size:17px; }
.statement-daily-formula { margin:0 0 13px; color:var(--muted); font-size:9px; }
.statement-daily-table td { vertical-align:middle; }.statement-daily-difference.is-positive { color:var(--positive); }.statement-daily-difference.is-negative { color:var(--danger); }.statement-daily-difference.is-even { color:var(--accent-bright); }.statement-daily-actions { display:flex; flex-wrap:wrap; gap:5px; }
@media (max-width:1080px) { .statement-daily-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .statement-daily-test { padding:15px; }.statement-daily-test-heading { gap:13px; }.statement-daily-controls { justify-content:stretch; width:100%; }.statement-daily-controls label { flex:1 1 122px; }.statement-daily-controls .button { flex:1 1 100%; }.statement-daily-summary { grid-template-columns:1fr 1fr; gap:7px; } }
@media (max-width:960px) { .debts-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.debts-overview-grid { grid-template-columns:1fr; } }
@media (max-width:560px) { .debts-summary-grid { grid-template-columns:1fr; }.debts-summary-grid strong { font-size:20px; } }
.market-rate:nth-child(4) .market-symbol { color: #9b8cff; }.market-rate:nth-child(5) .market-symbol { color: #8b9cff; }.market-rate:nth-child(6) .market-symbol { color: #39b8ff; }
.p2p-ledger-summary { grid-template-columns: repeat(3, minmax(150px, .72fr)); justify-content: start; }.ledger-entry-main strong em { margin-left: 6px; font-style: normal; }
.debts-overview-grid { align-items: stretch; }.debts-overview-card { height: 100%; box-sizing: border-box; }
.transfer-adjustments-card { margin-top: 16px; }
@media (max-width: 760px) { .flow-stock-audit-actions { display: grid; grid-template-columns: 1fr; }.flow-stock-audit-actions .button { width: 100%; min-width: 0; }.p2p-ledger-summary { grid-template-columns: 1fr; } }

/* SIM subscriptions: a quiet operational view that reuses the dashboard system. */
.sim-heading { align-items: center; }
.sim-live-note { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(79,227,177,.18); border-radius: 999px; background: rgba(79,227,177,.055); color: var(--text-soft); font-size: 9px; font-weight: 750; white-space: nowrap; }
.sim-summary-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.sim-summary-card { position: relative; min-width: 0; overflow: hidden; padding: 17px 18px; }
.sim-summary-card::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--accent); content: ''; opacity: .75; }
.sim-summary-card.is-positive::after { background: var(--positive); }.sim-summary-card.is-warning::after { background: var(--warning); }
.sim-summary-card span,.sim-summary-card small { display: block; color: var(--muted); font-size: 9px; }
.sim-summary-card span { font-weight: 780; }.sim-summary-card strong { display: block; margin: 7px 0 3px; overflow: hidden; font-size: clamp(17px,2vw,23px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.sim-subscriptions-card { overflow: hidden; margin-bottom: 16px; }
.sim-table-heading { align-items: flex-end; margin: 0; padding: 20px 20px 15px; }
.sim-table-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.sim-table-tools { display: flex; align-items: center; gap: 7px; }
.sim-table-tools input,.sim-table-tools select { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--canvas-soft); color: var(--text); font: inherit; font-size: 10px; }
.sim-table-tools input { width: 210px; }.sim-table-tools select { width: 140px; }
.sim-table-tools input:focus,.sim-table-tools select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,140,255,.1); }
.sim-table td { height: 60px; }.sim-table td:first-child { min-width: 180px; }.sim-table td:nth-child(4) { min-width: 150px; }
.sim-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; }
.sim-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sim-status.active { border-color: rgba(79,227,177,.2); background: rgba(79,227,177,.06); color: var(--positive); }.sim-status.active i { background: var(--positive); box-shadow: 0 0 10px rgba(79,227,177,.5); }
.sim-lower-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(290px,.6fr); gap: 16px; margin-bottom: 16px; }
.sim-activity-card { min-width: 0; overflow: hidden; }.sim-activity-card > .card-heading { margin: 0; padding: 19px 20px 13px; }
.sim-compact-table td { height: 48px; padding-block: 8px; }
.sim-ticket-status { display: inline-flex; padding: 4px 7px; border-radius: 7px; background: rgba(124,140,255,.08); color: var(--accent-bright); font-size: 8px; font-weight: 800; white-space: nowrap; }
.sim-ticket-status.paid { background: rgba(79,227,177,.08); color: var(--positive); }.sim-ticket-status.cancelled,.sim-ticket-status.failed { background: rgba(255,107,122,.08); color: var(--danger); }.sim-ticket-status.issued { background: rgba(255,184,92,.08); color: var(--warning); }
.sim-event-list { max-height: 416px; padding: 0 20px 10px; overflow: auto; }
.sim-event { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.sim-event:first-child { border-top: 0; }.sim-event-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(79,227,177,.08); color: var(--positive); font-size: 9px; font-weight: 850; }
.sim-event strong,.sim-event span { display: block; }.sim-event div span,.sim-event time { color: var(--muted); font-size: 8px; }.sim-event div span { margin-top: 3px; }.sim-event time { white-space: nowrap; }
.sim-empty { display: grid; justify-items: center; gap: 5px; padding: 32px 18px; color: var(--muted); text-align: center; }.sim-empty strong { color: var(--text-soft); }.sim-empty span { font-size: 9px; }
.sim-tariff-note { display: grid; grid-template-columns: minmax(190px,.34fr) minmax(0,1fr); align-items: center; gap: 24px; padding: 19px 20px; }
.sim-tariff-note h3 { margin: 3px 0 0; font-size: 16px; }.sim-tariff-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
@media (max-width: 1180px) { .sim-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }.sim-lower-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .sim-live-note { display: none; }.sim-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.sim-table-heading { align-items: stretch; flex-direction: column; }.sim-table-tools { width: 100%; }.sim-table-tools input,.sim-table-tools select { width: auto; min-width: 0; flex: 1; }.sim-tariff-note { grid-template-columns: 1fr; gap: 10px; }.sim-event { grid-template-columns: 38px minmax(0,1fr); }.sim-event time { grid-column: 2; } }
@media (max-width: 430px) { .sim-summary-grid { grid-template-columns: 1fr; }.sim-table-tools { align-items: stretch; flex-direction: column; }.sim-table-tools input,.sim-table-tools select { width: 100%; } }
