:root {
    --navy-950: #07152d;
    --navy-900: #0b1d3a;
    --navy-800: #102953;
    --blue: #258be8;
    --blue-soft: #eaf4ff;
    --red: #d8272f;
    --red-soft: #fff0f1;
    --green: #159b58;
    --green-soft: #eaf9f1;
    --amber: #c47b0a;
    --amber-soft: #fff7e8;
    --ink: #172033;
    --muted: #69758a;
    --line: #e4e9f1;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --shadow: 0 16px 44px rgba(15, 37, 73, .08);
    --radius: 18px;
}

/* Güney Agripark production-stock screens. */
.plant-stock-panel-body { display: grid; gap: 18px; padding: 18px 20px; }
.plant-stock-panel-body .actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.plant-stock-panel-body > p { margin: 0; color: var(--muted); }
.plant-stock-panel-body .form-grid { align-items: end; }
.plant-scope-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.plant-scope-group summary { cursor: pointer; }
.plant-scope-group label { display: inline-flex; align-items: center; gap: 7px; margin: 8px 14px 0 0; font-size: .84rem; }
.plant-scope-varieties { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 6px; }
@media (max-width: 700px) {
    .plant-stock-panel-body { padding: 14px; }
    .plant-scope-varieties { display: grid; }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); font-size: 100%; }
@media screen { body { zoom: var(--ui-scale, 1); } }
body { margin: 0; min-height: var(--ui-viewport-height, 100vh); color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .875rem; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.3rem, 2vw, 1.75rem); letter-spacing: -.035em; }
h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 2.4vw, 2rem); letter-spacing: -.04em; line-height: 1.12; }
h3 { margin-bottom: 3px; font-size: 1rem; letter-spacing: -.015em; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.block { display: block; }
.strong { font-weight: 750; }
.align-right { text-align: right; }
.danger-text { color: var(--red) !important; }
.success-text { color: var(--green) !important; }
.warning-text { color: #a76800 !important; }
.official-text { color: var(--red); }
.optional { color: var(--muted); font-weight: 500; }

.app-shell { min-height: var(--ui-viewport-height, 100vh); display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: var(--ui-viewport-height, 100vh); display: flex; flex-direction: column; padding: 27px 18px 19px; color: #dce8ff; background: radial-gradient(circle at 20% 0, #183f78, transparent 33%), linear-gradient(165deg, var(--navy-900), var(--navy-950)); z-index: 50; }
.brand { display: grid; place-items: center; min-height: 80px; margin: 0 3px 14px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.76); border-radius: 16px; background: linear-gradient(140deg, #fff, #f1f6ff); box-shadow: 0 8px 24px rgba(2, 12, 34, .18); }
.brand img { width: 100%; height: 60px; max-height: none; object-fit: contain; object-position: center; filter: none; }
.brand:focus-visible { outline: 3px solid #9bd0ff; outline-offset: 3px; }
.workspace-label { margin: 10px 12px; color: #8195b8; font-size: .66rem; font-weight: 800; letter-spacing: .16em; }
.nav-list { min-height: 0; flex: 1; display: grid; align-content: start; gap: 2px; overflow-y: auto; }
.nav-category { display: grid; align-content: start; gap: 3px; padding: 3px 0 8px; border-bottom: 1px solid rgba(174,189,221,.13); }
.nav-category:last-child { padding-bottom: 0; border-bottom: 0; }
.nav-category-title { display: block; margin: 5px 12px 2px; color: #829fc5; font-size: .64rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.nav-category:has(.nav-link.active, .nav-sublink.active) > .nav-category-title { color: #b9dcff; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; color: #aebddd; border: 1px solid transparent; border-radius: 12px; font-weight: 650; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.active { color: #fff; background: rgba(49, 143, 236, .2); border-color: rgba(112, 181, 255, .2); box-shadow: inset 3px 0 0 #47a7ff; }
.nav-sublist { display: grid; gap: 2px; margin: -2px 0 5px 26px; padding-left: 12px; border-left: 1px solid rgba(174,189,221,.3); }
.nav-subheading { display: block; padding: 4px 10px 2px; color: #8195b8; font-size: .65rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.nav-sublink { display: block; padding: 7px 10px; color: #aebddd; border-radius: 8px; font-size: .76rem; font-weight: 650; }
.nav-sublink:hover, .nav-sublink.active { color: #fff; background: rgba(49,143,236,.2); }
.nav-sublink.active { box-shadow: inset 2px 0 0 #47a7ff; }
.nav-symbol { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #dfeaff; background: rgba(255,255,255,.08); font-size: .76rem; font-weight: 900; }
.user-panel { margin-top: auto; display: grid; grid-template-columns: 36px minmax(0,1fr) 32px; align-items: center; gap: 9px; padding: 13px 9px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), #4bb9d9); border-radius: 11px; font-weight: 800; }
.user-copy { overflow: hidden; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { color: #fff; font-size: .82rem; }
.user-copy small { color: #8498ba; font-size: .68rem; }
.icon-button { width: 30px; height: 30px; color: #9cb0d2; border: 0; border-radius: 8px; background: transparent; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main-column { min-width: 0; }
.topbar { min-height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px clamp(22px, 3vw, 44px); background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.eyebrow { margin-bottom: 4px; color: var(--blue); font-size: .67rem; font-weight: 900; letter-spacing: .15em; }
.eyebrow.light { color: #9bd0ff; }
.top-actions, .toolbar, .hero-actions { display: flex; align-items: center; gap: 10px; }
.language-switcher { min-height: 40px; display: inline-flex; align-items: center; gap: 3px; padding: 4px; color: var(--navy-800); background: #f2f5f9; border: 1px solid #d9e1ed; border-radius: 11px; white-space: nowrap; }
.language-switcher-label { padding: 0 5px 0 7px; color: #65738a; font-size: .7rem; font-weight: 800; }
.language-option { min-width: 34px; min-height: 30px; padding: 4px 7px; color: #65738a; background: transparent; border: 0; border-radius: 8px; font: inherit; font-size: .72rem; font-weight: 900; cursor: pointer; }
.language-option:hover { color: var(--navy-900); background: #fff; }
.language-option.active { color: #fff; background: var(--navy-800); box-shadow: 0 4px 12px rgba(11,29,58,.2); }
.auth-language-switcher { position: fixed; top: 18px; right: 18px; z-index: 20; background: rgba(255,255,255,.95); box-shadow: 0 8px 28px rgba(11,29,58,.16); }
.notification-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; position: relative; padding: 0; color: var(--navy-800); background: #fff; border: 1px solid #d9e1ed; border-radius: 10px; cursor: pointer; }
.notification-button:hover { background: #f7f9fc; }
.notification-button.is-active { color: #087441; background: var(--green-soft); border-color: #bdebd4; }
.notification-button.is-denied { color: #8d5660; background: #f7f1f2; }
.notification-bell { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-dot { width: 7px; height: 7px; position: absolute; top: 7px; right: 7px; background: #aab5c5; border: 2px solid #fff; border-radius: 50%; }
.notification-button.is-active .notification-dot { background: var(--green); }
.push-permission-reminder { position: fixed; z-index: 1200; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(410px, calc(100vw - 36px)); display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; color: var(--navy-800); background: #fff; border: 1px solid #b9d3ed; border-radius: 16px; box-shadow: 0 16px 42px rgba(15, 35, 70, .2); }
.push-permission-reminder-copy { min-width: 0; display: grid; gap: 5px; }
.push-permission-reminder-copy strong { font-size: .92rem; }
.push-permission-reminder-copy span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.push-permission-reminder-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.push-permission-reminder-actions .button { min-height: 38px; }
.push-permission-reminder-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #edf2f8; color: var(--navy-800); cursor: pointer; font-size: 1.25rem; line-height: 1; }
[data-pwa-install][hidden] { display: none; }
.mobile-menu { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.page-content { max-width: 1600px; margin: 0 auto; padding: clamp(22px, 3vw, 42px); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; white-space: nowrap; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .62; cursor: wait; transform: none; }
.button-primary { color: #fff; background: linear-gradient(135deg, #1587ea, #2469ce); box-shadow: 0 8px 20px rgba(31, 119, 218, .2); }
.button-primary:hover { box-shadow: 0 11px 25px rgba(31, 119, 218, .3); }
.button-secondary { color: var(--navy-800); background: #fff; border-color: #d9e1ed; }
.button-secondary:hover { background: #f7f9fc; }
.button-danger-soft { color: #a51d25; background: var(--red-soft); border-color: #f1c7ca; }
.button-danger-soft:hover { color: #fff; background: var(--red); border-color: var(--red); }
.button-white { color: var(--navy-900); background: #fff; }
.button-ghost-light { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.button-wide { width: 100%; }
.button-large { min-height: 48px; }
.button-small { min-height: 34px; padding: 6px 11px; font-size: .8rem; }
.stack-sm { display: grid; gap: 9px; }

.alert { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.alert button { border: 0; background: transparent; font-size: 1.2rem; color: inherit; }
.alert-success { color: #087441; background: var(--green-soft); border-color: #bdebd4; }
.alert-error { color: #a31c24; background: var(--red-soft); border-color: #fac8cc; }
.alert-warning { color: #8b5a08; background: var(--amber-soft); border-color: #f1d49d; }
.live-data-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border: 1px solid #bed7f4; border-radius: 12px; background: #edf6ff; color: #153b66; font-weight: 650; }
.live-data-notice button { padding: 6px 11px; border: 1px solid #a5c8ee; border-radius: 8px; background: #fff; color: #145398; font-weight: 700; }
.user-preview-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border: 1px solid #99baf0; border-radius: 12px; background: #eaf3ff; color: #123867; font-weight: 700; }
.user-preview-banner form, .user-list-actions form { margin: 0; }
.user-preview-banner button { padding: 7px 12px; border: 1px solid #83a9df; border-radius: 8px; background: #fff; color: #123867; font-weight: 750; }

.hero-panel { min-height: 190px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding: clamp(25px, 4vw, 42px); color: #fff; overflow: hidden; position: relative; border-radius: 24px; background: radial-gradient(circle at 83% 17%, rgba(45, 170, 111, .35), transparent 28%), radial-gradient(circle at 56% 110%, rgba(35, 144, 238, .32), transparent 35%), linear-gradient(125deg, #0b1e3b 0%, #123b71 65%, #0e5c62 130%); box-shadow: 0 25px 60px rgba(7, 29, 58, .16); }
.hero-panel::after { content: "U"; position: absolute; right: 5%; top: -52%; color: rgba(255,255,255,.035); font-size: 22rem; font-weight: 900; line-height: 1; pointer-events: none; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { max-width: 720px; margin-bottom: 10px; font-size: clamp(1.7rem, 3vw, 2.7rem); }
.hero-panel p { max-width: 660px; margin: 0; color: #b9cce6; }

.panel.dashboard-audit-card { --audit-accent: var(--green); margin-bottom: 22px; padding: 20px 22px; border-left: 4px solid var(--audit-accent); background: linear-gradient(115deg, #fff 55%, #f8fcfa); }
.dashboard-audit-card.is-warning { --audit-accent: var(--amber); background: linear-gradient(115deg, #fff 55%, #fffbf3); }
.dashboard-audit-card.is-danger { --audit-accent: var(--red); background: linear-gradient(115deg, #fff 55%, #fff8f8); }
.dashboard-audit-main { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; }
.dashboard-audit-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #087441; background: var(--green-soft); font-size: 1.3rem; font-weight: 900; }
.dashboard-audit-card.is-warning .dashboard-audit-icon { color: #9a6106; background: var(--amber-soft); }
.dashboard-audit-card.is-danger .dashboard-audit-icon { color: #b21820; background: var(--red-soft); }
.dashboard-audit-copy { min-width: 0; }
.dashboard-audit-eyebrow { display: block; color: var(--muted); font-size: .66rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.dashboard-audit-copy h2 { margin: 1px 0 2px; color: var(--ink); font-size: 1.22rem; letter-spacing: -.025em; line-height: 1.2; }
.dashboard-audit-copy p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.dashboard-audit-pill { justify-self: end; padding: 5px 10px; border: 1px solid #bdebd4; border-radius: 999px; color: #087441; background: var(--green-soft); font-size: .67rem; font-weight: 850; white-space: nowrap; }
.dashboard-audit-card.is-warning .dashboard-audit-pill { color: #8a5909; background: var(--amber-soft); border-color: #efd59e; }
.dashboard-audit-card.is-danger .dashboard-audit-pill { color: #a51d25; background: var(--red-soft); border-color: #f5c5c9; }
.dashboard-audit-action { min-height: 38px; padding: 7px 11px; font-size: .72rem; }
.dashboard-audit-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dashboard-audit-detail { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e7edf1; border-radius: 10px; background: rgba(248, 250, 252, .85); }
.dashboard-audit-detail span { min-width: 0; color: var(--muted); font-size: .72rem; font-weight: 700; overflow-wrap: anywhere; }
.dashboard-audit-detail strong { color: var(--ink); font-size: .82rem; font-weight: 850; text-align: right; white-space: nowrap; }
.dashboard-audit-detail.is-warning { border-color: #efd59e; background: #fff8e9; }
.dashboard-audit-detail.is-warning strong { color: #986008; }
.dashboard-audit-warning { margin: 12px 0 0; padding: 9px 11px; color: #8a5909; background: #fff8e9; border-left: 3px solid var(--amber); border-radius: 7px; font-size: .72rem; line-height: 1.4; }
@media (max-width: 900px) {
    .dashboard-audit-main { grid-template-columns: 42px minmax(0, 1fr) auto; }
    .dashboard-audit-action { grid-column: 2 / -1; justify-self: start; }
}
@media (max-width: 620px) {
    .panel.dashboard-audit-card { padding: 16px; }
    .dashboard-audit-main { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
    .dashboard-audit-icon { width: 38px; height: 38px; }
    .dashboard-audit-pill, .dashboard-audit-action { grid-column: 2; justify-self: start; }
    .dashboard-audit-details { grid-template-columns: 1fr; }
    .dashboard-audit-detail strong { white-space: normal; overflow-wrap: anywhere; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.kpi-card, .summary-card { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(26, 46, 78, .045); position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--blue); }
.kpi-card.accent-green::before { background: var(--green); }
.kpi-card.accent-red::before { background: var(--red); }
.kpi-card.accent-amber::before { background: var(--amber); }
.kpi-label, .summary-card span { display: block; color: var(--muted); font-size: .76rem; font-weight: 750; }
.kpi-card strong, .summary-card strong { display: block; margin: 6px 0 2px; font-size: clamp(1.45rem, 2.4vw, 2.05rem); letter-spacing: -.045em; }
.kpi-card small { font-size: .72rem; }
.summary-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.summary-card { padding: 17px 20px; }
.summary-card strong { font-size: 1.55rem; }
.customer-summary-row { gap: 10px; margin-bottom: 12px; }
.customer-summary-row .summary-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: 14px; }
.customer-summary-row .summary-card span { min-width: 0; font-size: .78rem; line-height: 1.25; }
.customer-summary-row .summary-card strong { min-width: 0; margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.15; text-align: right; overflow-wrap: anywhere; }
html[data-ui-scale="140"] .customer-summary-row .summary-card strong,
html[data-ui-scale="150"] .customer-summary-row .summary-card strong,
html[data-ui-scale="160"] .customer-summary-row .summary-card strong { font-size: 1rem; white-space: nowrap; overflow-wrap: normal; }

.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; align-items: start; }
.span-2 { grid-column: span 2; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(20, 43, 76, .045); overflow: hidden; }
.panel > form, .panel.detail-list, .panel.settings-help { padding: 20px; }
.panel-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-header p { margin: 0; color: var(--muted); font-size: .77rem; }
.panel-header > a { color: var(--blue); font-size: .78rem; font-weight: 750; }
.panel-header + form { padding-top: 18px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tall-table { max-height: 680px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; color: #6f7b90; background: #f9fbfd; border-bottom: 1px solid var(--line); font-size: .68rem; letter-spacing: .045em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.table-link { color: var(--blue); font-weight: 750; }
.row-action { color: var(--blue); font-size: .78rem; font-weight: 750; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.sales-history-table .row-actions { flex-wrap: wrap; gap: 6px 8px; }
.sales-history-table .sales-row-print { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 8px; border: 1px solid #b9d0e8; border-radius: 5px; background: #f3f8ff; white-space: nowrap; }
.sales-history-table .sales-row-print:hover { background: #e7f2ff; text-decoration: none; }
.sales-history-table .sales-row-print:focus-visible { outline: 2px solid #2675d2; outline-offset: 2px; }
.row-actions form { display: inline; margin: 0; }
#customer-edit { scroll-margin-top: 24px; transition: box-shadow .2s ease, border-color .2s ease; }
#customer-edit:target { border-color: #8fc3ff; box-shadow: 0 0 0 4px rgba(35, 131, 226, .12), var(--shadow); }
.row-action.archive-action, .row-action.restore-action { padding: 0; border: 0; background: transparent; }
.row-action.archive-action { color: #a51d25; }
.row-action.restore-action { color: var(--green); }
.row-action:hover { text-decoration: underline; }
.empty-cell { padding: 42px; color: var(--muted); text-align: center; }

/* Reversible spreadsheet presentation for movement tables. */
.sheet-view-controls { display: inline-flex; align-items: center; max-width: 100%; min-height: 30px; padding: 5px 9px; color: #486052; background: #edf4ef; border: 1px solid #cadbce; border-radius: 7px; font-size: .68rem; font-weight: 700; line-height: 1.25; }
.sheet-column-menu { box-sizing: border-box; position: fixed; z-index: 1100; width: min(300px, calc(var(--ui-viewport-width, 100vw) - 16px)); max-height: calc(var(--ui-viewport-height, 100vh) - 16px); overflow: auto; padding: 10px; color: #24392b; background: #fff; border: 1px solid #a8c6b0; border-radius: 10px; box-shadow: 0 18px 48px rgba(11, 35, 18, .24); font-family: Aptos, Calibri, "Segoe UI", sans-serif; }
.sheet-column-menu-eyebrow { overflow: hidden; color: #587263; font-size: .68rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sheet-column-menu-title { margin: 2px 0 8px; color: #153e25; font-size: .85rem; font-weight: 800; }
.sheet-column-menu-list { display: grid; gap: 2px; }
.sheet-column-menu-option { display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 5px 7px; border-radius: 6px; cursor: pointer; font-size: .75rem; }
.sheet-column-menu-option:hover, .sheet-column-menu-option:focus-within { background: #e9f4ec; }
.sheet-column-menu-option input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: #107c41; }
.sheet-column-menu-option span { min-width: 0; overflow-wrap: anywhere; }
.sheet-column-menu-status { min-height: 1.2em; margin: 6px 3px; color: #a32228; font-size: .7rem; }
.sheet-column-menu-reset { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 7px 9px; color: #155f35; background: #f1f7f3; border: 1px solid #bdd6c5; border-radius: 6px; cursor: pointer; font-size: .73rem; font-weight: 750; }
.sheet-column-menu-reset:hover { background: #e2f1e6; }
.sheet-column-menu-reset:focus-visible { outline: 2px solid #107c41; outline-offset: 2px; }
.spreadsheet-panel .spreadsheet-table.is-column-sized { width: max(100%, var(--list-table-width)) !important; min-width: max(100%, var(--list-table-width)) !important; table-layout: fixed; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized th,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized td { white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized th { line-height: 1.3; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized td > * { max-width: 100%; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .entity-link { min-width: 0; max-width: 100%; align-items: flex-start; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .entity-link > span:last-child { min-width: 0; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .entity-link strong,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .entity-link small,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .table-subline,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .cost-source,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .customer-transaction-product strong,
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .customer-transaction-product small { overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized .row-actions { flex-wrap: wrap; white-space: normal; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.is-column-sized :is(.badge, .status, .movement) { white-space: normal; overflow-wrap: anywhere; }
.spreadsheet-panel.is-excel-view .spreadsheet-table thead tr:first-child th { position: sticky; }
.spreadsheet-panel.is-excel-view .spreadsheet-table thead tr:first-child th { cursor: context-menu; }
.spreadsheet-panel.is-excel-view .spreadsheet-table thead tr:first-child th:has(> .list-column-resize) { padding-right: 40px; }
.list-column-resize { display: none; position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: 12px; padding: 0; overflow: visible; border: 0; border-right: 2px solid transparent; background: transparent; cursor: col-resize; touch-action: none; user-select: none; }
.spreadsheet-panel.is-excel-view .list-column-resize { display: block; }
.list-column-resize:hover, .list-column-resize:focus-visible, .is-column-resizing .list-column-resize { border-right-color: #107c41; background: rgba(16, 124, 65, .15); outline: 0; }
.is-column-resizing { user-select: none; }
.sheet-row-number { display: none; }
.spreadsheet-panel.is-excel-view { border-color: #aebdb3; border-radius: 7px; box-shadow: 0 10px 30px rgba(25, 82, 49, .1); }
.spreadsheet-panel.is-excel-view > .panel-header { min-height: 68px; background: linear-gradient(180deg, #f8fcf9, #f1f7f3); border-top: 4px solid #107c41; border-bottom-color: #b9c7bd; }
.spreadsheet-panel.is-excel-view .spreadsheet-wrap { background: #dfe7e1; }
.spreadsheet-panel.is-excel-view .spreadsheet-table { min-width: 820px; border-collapse: separate; border-spacing: 0; color: #202520; font-family: Aptos, Calibri, "Segoe UI", sans-serif; font-size: .76rem; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.compact-spreadsheet { min-width: 680px; }
.spreadsheet-panel.is-excel-view .spreadsheet-table.wide-spreadsheet { min-width: 1040px; }
.spreadsheet-panel.is-excel-view .spreadsheet-table th { position: sticky; top: 0; z-index: 2; padding: 9px 11px; color: #263c2d; background: #e6eee8; border-right: 1px solid #bdc9c0; border-bottom: 1px solid #9faea3; letter-spacing: .025em; }
.product-column-filter-row { display: none; }
.spreadsheet-panel.is-excel-view .product-column-filter-row { display: table-row; }
.spreadsheet-panel.is-excel-view .product-column-filter-row th { top: var(--sheet-header-height, 34px); z-index: 3; padding: 5px 6px; background: #f4f8f5; }
.spreadsheet-panel.is-excel-view .product-column-filter-row input,
.spreadsheet-panel.is-excel-view .product-column-filter-row select { width: 100%; min-width: 74px; height: 30px; padding: 4px 7px; color: #263c2d; background: #fff; border: 1px solid #b7c6bb; border-radius: 4px; font-family: inherit; font-size: .67rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.spreadsheet-panel.is-excel-view .product-column-filter-row input:focus,
.spreadsheet-panel.is-excel-view .product-column-filter-row select:focus { border-color: #107c41; box-shadow: 0 0 0 2px rgba(16,124,65,.14); outline: 0; }
.product-column-filter-with-reset { display: grid; grid-template-columns: minmax(74px,1fr) auto; gap: 4px; align-items: center; }
.product-column-filter-reset { min-height: 30px; padding: 4px 8px; color: #155f35; background: #fff; border: 1px solid #9eb7a6; border-radius: 4px; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.product-column-filter-reset:hover { color: #fff; background: #107c41; border-color: #107c41; }
.spreadsheet-panel.is-excel-view .spreadsheet-table td { padding: 9px 11px; background: #fff; border-right: 1px solid #d3dbd5; border-bottom: 1px solid #d3dbd5; }
.spreadsheet-panel.is-excel-view .spreadsheet-table th:last-child,
.spreadsheet-panel.is-excel-view .spreadsheet-table td:last-child { border-right: 0; }
.spreadsheet-panel.is-excel-view .spreadsheet-table tbody tr:nth-child(even) td { background: #fbfdfb; }
.spreadsheet-panel.is-excel-view .spreadsheet-table tbody tr:hover td { background: #eaf4ed; }
.spreadsheet-panel.is-excel-view .sales-history-table { min-width: 1500px; }
.spreadsheet-panel.is-excel-view .sales-history-table th:nth-child(5) { width: 230px; }
.spreadsheet-panel.is-excel-view .sales-history-table tbody tr.sale-group-row td { background: #edf5ef; border-top: 2px solid #8aaf95; }
.spreadsheet-panel.is-excel-view .sales-history-table tbody tr.sale-line-row td { background: #fff; }
.spreadsheet-panel.is-excel-view .sales-history-table tbody tr.sale-line-row:nth-child(even) td { background: #fbfdfb; }
.spreadsheet-panel.is-excel-view .sales-history-table tbody tr.sale-line-row .sale-line-summary { padding: 0; }
.sale-line-details { display: grid; grid-template-columns: 58px minmax(260px, 1fr) 130px 130px 150px; align-items: stretch; min-width: 0; }
.sale-line-details > span { min-width: 0; padding: 9px 11px; border-right: 1px solid #d3dbd5; }
.sale-line-details > span:last-child { border-right: 0; }
.sale-line-details .sale-line-number { color: #506454; background: #f0f6f1; font-weight: 750; text-align: center; }
.sale-line-details .sale-line-product { padding-left: 18px; border-left: 3px solid #8aaf95; }
.sale-line-details .sale-line-product strong { white-space: normal; overflow-wrap: anywhere; }
.sale-line-details .sale-line-quantity,
.sale-line-details .sale-line-unit-price,
.sale-line-details .sale-line-total { text-align: right; white-space: nowrap; }
.sale-line-details .sale-line-total { font-weight: 750; }
.spreadsheet-panel.is-excel-view .sales-history-table .sale-lines-group[hidden] { display: none !important; }
@media (max-width: 760px) {
    .sale-line-details { grid-template-columns: 48px minmax(170px, 1fr) 108px 108px 118px; }
    .sale-line-details > span { padding: 8px; }
}
.sales-lines-toggle { padding: 0; border: 0; background: transparent; white-space: nowrap; }
.sales-lines-toggle::before { content: '▾'; margin-right: 4px; }
.sales-lines-toggle[aria-expanded="false"]::before { content: '▸'; }
.sales-lines-toggle:focus-visible, .sales-lines-all-toggle:focus-visible { outline: 2px solid #107c41; outline-offset: 3px; }
.sales-history-actions .sales-lines-all-toggle { min-height: 34px; padding: 5px 8px; font-size: .72rem; white-space: nowrap; }
.spreadsheet-panel.is-excel-view .spreadsheet-table tbody tr.is-selected td { background: #d7eadc !important; box-shadow: inset 0 1px #70ad82, inset 0 -1px #70ad82; }
.spreadsheet-panel.is-excel-view .sheet-row-number { width: 42px; display: table-cell; padding-inline: 7px !important; color: #526359; background: #eef2ef !important; font-weight: 700; text-align: center; user-select: none; }
.spreadsheet-panel.is-excel-view .spreadsheet-table tbody tr.is-selected .sheet-row-number { color: #fff; background: #107c41 !important; }
.spreadsheet-panel.is-excel-view .badge,
.spreadsheet-panel.is-excel-view .status,
.spreadsheet-panel.is-excel-view .movement { min-height: 21px; padding: 2px 7px; font-size: .64rem; border-radius: 4px; }
.spreadsheet-panel .toolbar { flex-wrap: wrap; justify-content: flex-end; }
.spreadsheet-panel .filter-form { justify-content: flex-end; }
.sales-history-header { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 14px; padding: 10px 14px; }
.spreadsheet-panel.is-excel-view > .sales-history-header { min-height: 0; }
.sales-history-copy { min-width: 0; padding-top: 2px; }
.sales-history-copy h3 { margin-bottom: 1px; }
.sales-history-filters { min-width: 0; grid-column: 1 / -1; display: grid; gap: 5px; }
.sales-history-toolbar, .sales-history-date-tools { min-width: 0; display: flex; align-items: center; gap: 8px; }
.sales-history-toolbar { justify-content: stretch; }
.sales-history-date-tools { justify-content: space-between; }
.sales-history-selects, .sales-history-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.sales-history-selects { flex: 1 1 auto; }
.sales-history-actions { flex: 0 0 auto; }
.sales-history-search-control { min-width: 0; display: flex; align-items: center; gap: 5px; flex: 1 1 260px; }
.sales-history-search-control input[type="search"] { width: 100%; min-width: 0; min-height: 34px; flex: 1 1 auto; padding: 5px 9px; border-radius: 8px; font-size: .72rem; }
.sales-history-search-submit { min-height: 34px; flex: 0 0 auto; padding: 5px 8px; border-radius: 8px; font-size: .68rem; }
.sales-history-selects select { width: clamp(150px, 12vw, 190px); min-height: 34px; flex: 0 0 auto; padding: 5px 9px; font-size: .72rem; }
.sales-history-actions .sheet-view-controls { min-height: 34px; padding: 5px 8px; border-radius: 8px; }
.sales-history-new { min-height: 34px; padding: 6px 8px; font-size: .72rem; }
.sales-quick-filters { min-width: 0; display: inline-flex; align-items: center; gap: 2px; overflow-x: auto; padding: 2px; background: #e9eef4; border: 1px solid #d5dde8; border-radius: 9px; scrollbar-width: thin; }
.sales-quick-filter { min-height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 4px 8px; color: #607089; border: 1px solid transparent; border-radius: 6px; font-size: .63rem; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.sales-quick-filter:hover { color: var(--navy-800); background: rgba(255,255,255,.72); }
.sales-quick-filter.is-active { color: #155f35; background: #fff; border-color: #c7d7cc; box-shadow: 0 2px 6px rgba(25, 79, 45, .12); }
.sales-date-range { min-width: 0; display: flex; align-items: end; gap: 5px; padding: 2px 3px 2px 6px; border: 1px solid transparent; border-radius: 9px; }
.sales-date-range.is-active { background: #f0f8f3; border-color: #a9ceb6; box-shadow: inset 0 0 0 1px rgba(21, 155, 88, .06); }
.sales-date-field { min-width: 0; gap: 1px; color: #607089; font-size: .53rem; font-weight: 800; line-height: 1.1; }
.sales-date-field input { width: 122px; min-height: 32px; padding: 4px 6px; border-radius: 7px; font-size: .66rem; }
.sales-date-separator { align-self: end; padding-bottom: 7px; color: #8390a3; }
.sales-date-apply { min-height: 32px; padding: 5px 8px; border-radius: 7px; font-size: .65rem; }
.sales-date-clear { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 5px; color: #607089; border-radius: 6px; font-size: .62rem; font-weight: 800; }
.sales-date-clear:hover { color: #a51d25; background: #fff0f1; }
.spreadsheet-panel.is-excel-view .transaction-row.tx-official td:nth-child(2) { border-left: 3px solid var(--red); }
.spreadsheet-panel.is-excel-view .transaction-row.tx-unofficial td:nth-child(2) { border-left: 3px solid #273142; }

.badge, .status, .movement { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.badge-official { color: #b21820; background: var(--red-soft); border: 1px solid #f5c5c9; }
.badge-unofficial { color: #fff; background: #242d3c; }
.badge-payment { color: #17619d; background: var(--blue-soft); }
.badge-return { color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; }
.badge-reversal { color: #8f2630; background: #fff0f1; border: 1px solid #f4c8cc; }
.sale-list-amount { display: inline-grid; justify-items: end; gap: 2px; }
.sale-list-amount small { color: #087441; font-size: .57rem; font-weight: 800; white-space: nowrap; }
.row-return-note { color: #087441; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.status-paid { color: #087441; background: var(--green-soft); }
.status-unpaid { color: #9b6508; background: var(--amber-soft); }
.status-partial { color: #1d65a6; background: var(--blue-soft); }
.status-overdue { color: #ae2028; background: var(--red-soft); }
.status-legacy { color: #5b6470; background: #eef1f4; }
.status-cancelled { color: #fff; background: #6e7784; }
.status-credit { color: #17619d; background: var(--blue-soft); }
.movement-in { color: #087441; background: var(--green-soft); }
.movement-out { color: #a31c24; background: var(--red-soft); }

.critical-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; padding: 16px 20px 20px; }
.critical-card { min-width: 0; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px; background: #fffafb; border: 1px solid #f3d4d6; border-radius: 13px; }
.critical-card:hover { border-color: #e79ca2; }
.critical-icon, .notice-icon { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 10px; font-weight: 900; }
.critical-card strong, .critical-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.critical-card strong { font-size: .77rem; }
.critical-card small { font-size: .65rem; }
.critical-values { display: grid; justify-items: end; gap: 2px; font-size: .68rem; font-weight: 800; }

.rank-list, .mini-list { display: grid; }
.rank-item, .mini-list-item { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 11px 20px; border-bottom: 1px solid #edf0f5; }
.rank-item:last-child, .mini-list-item:last-child { border-bottom: 0; }
.rank-item:hover, .mini-list-item:hover { background: #fafcff; }
.rank-number { width: 25px; height: 25px; display: grid; place-items: center; color: #60718e; background: #eef3f9; border-radius: 8px; font-size: .7rem; font-weight: 800; }
.rank-name { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-item > strong { font-size: .78rem; }
.mini-list-item { justify-content: space-between; }
.mini-list-item span strong, .mini-list-item span small { display: block; }
.mini-list-item span small { font-size: .68rem; }

.search-form, .filter-form { flex-wrap: wrap; }
.search-form input[type="search"] { min-width: 230px; }
label { display: grid; gap: 6px; color: #37445a; font-size: .76rem; font-weight: 750; }
.field-hint { color: #6f7d91; font-size: .64rem; font-weight: 650; line-height: 1.4; }
[data-customer-name-input] { text-transform: uppercase; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #d8e0eb; border-radius: 9px; outline: none; transition: border .15s ease, box-shadow .15s ease; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #72b3ed; box-shadow: 0 0 0 3px rgba(37,139,232,.11); }
input:disabled { color: #7d899b; background: #f4f6f9; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.three-cols { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.customer-type-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.customer-type-fieldset legend { margin-bottom: 7px; color: #37445a; font-size: .76rem; font-weight: 750; }
.customer-type-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.customer-type-options.single-column { grid-template-columns: 1fr; }
.customer-type-option { min-width: 0; min-height: 66px; display: grid; grid-template-columns: 34px minmax(0,1fr) 20px; align-items: center; gap: 9px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.customer-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.customer-type-option strong, .customer-type-option small { display: block; }
.customer-type-option strong { font-size: .73rem; }
.customer-type-option small { margin-top: 1px; font-size: .61rem; line-height: 1.35; }
.customer-type-symbol { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #273142; border-radius: 9px; font-weight: 900; }
.official-customer-type .customer-type-symbol { background: var(--red); }
.customer-type-check { color: transparent; font-weight: 900; }
.customer-type-option:has(input:checked) { border-color: #89bde9; background: #f8fbff; box-shadow: 0 0 0 3px rgba(37,139,232,.07); }
.official-customer-type:has(input:checked) { border-color: #eba0a5; background: #fffafb; box-shadow: 0 0 0 3px rgba(216,39,47,.06); }
.customer-type-option:has(input:checked) .customer-type-check { color: var(--green); }
.customer-type-text { font-weight: 800; }
.stack { display: grid; gap: 13px; }
.stack-lg { display: grid; gap: 18px; }
hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line); }

/* Supplier-first goods receipt: controls share a baseline and rows stay compact. */
.receipt-entry-panel { overflow: visible; }
.receipt-entry-panel .panel-header { gap: 20px; }
.receipt-entry-panel .panel-header > div { min-width: 0; }
.receipt-entry-form { display: grid; gap: 18px; }
.receipt-entry-fields { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(150px, 1fr)); align-items: start; gap: 16px; }
.receipt-entry-fields > label { min-width: 0; }
.receipt-entry-fields small { color: var(--muted); font-size: .68rem; font-weight: 600; line-height: 1.45; }
.receipt-entry-form :is(select, input[type="text"], input[type="date"], textarea) { box-sizing: border-box; min-width: 0; font-size: .81rem; line-height: 1.25; }
.receipt-entry-fields :is(select, input[type="text"], input[type="date"]),
.receipt-entry-table :is(select, input[type="text"]) { width: 100%; }
.receipt-entry-fields :is(select, input[type="text"], input[type="date"]) { height: 48px; min-height: 48px; padding: 10px 12px; }
.receipt-fx-field[hidden], [data-receipt-review-fx-field][hidden], .receipt-product-suggestions[hidden] { display: none !important; }
.receipt-fx-field { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; background: #f5f9ff; border: 1px solid #cbdcf3; border-radius: 12px; }
.receipt-fx-field strong { display: block; color: var(--navy-800); font-size: .82rem; }
.receipt-fx-field p { margin: 4px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.4; }
.receipt-fx-equation { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--navy-800); font-size: .78rem; font-weight: 800; }
.receipt-fx-equation input { width: 150px; min-width: 110px; height: 44px; min-height: 44px; text-align: right; }
.receipt-entry-table-wrap { overflow: visible; border: 1px solid var(--line); border-radius: 4px; }
.receipt-entry-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.receipt-col-number { width: 28px; }
.receipt-col-quantity { width: 18%; }
.receipt-col-price { width: 22%; }
.receipt-col-actions { width: 36px; }
.receipt-entry-table th { padding: 6px; color: #50627b; background: #edf3f8; border-right: 1px solid #d9e3ec; font-size: .61rem; letter-spacing: .025em; }
.receipt-entry-table td { min-width: 0; padding: 4px 6px; border-right: 1px solid #e3e9f0; border-bottom: 1px solid #e3e9f0; }
.receipt-entry-table :is(th, td):last-child { border-right: 0; }
.receipt-entry-table tbody tr:last-child td { border-bottom: 0; }
.receipt-entry-table tbody tr:nth-child(even) { background: #fafcff; }
.receipt-entry-table :is(select, input[type="text"]) { height: 34px; min-height: 34px; padding: 5px 7px; border-radius: 3px; font-size: .73rem; }
.receipt-line-number { color: var(--muted); font-size: .65rem; font-weight: 800; text-align: center; }
.receipt-line-product select { display: block; text-overflow: ellipsis; }
.receipt-product-picker { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; }
.receipt-product-picker.is-enhanced select.receipt-product-native { display: none; }
.receipt-product-picker .receipt-product-input { min-width: 0; width: 100%; }
.receipt-product-clear { width: 32px; height: 34px; min-height: 34px; padding: 0; color: #6a7890; background: #f7f9fc; border: 1px solid var(--line); border-radius: 3px; font-size: 1rem; cursor: pointer; }
.receipt-product-clear:hover { color: var(--red); border-color: #eabfc3; }
.receipt-product-suggestions { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0; max-height: 285px; overflow: auto; background: #fff; border: 1px solid #b8cbe0; border-radius: 10px; box-shadow: 0 18px 36px rgba(18, 43, 75, .2); }
.receipt-product-suggestion { display: block; width: 100%; min-height: 40px; padding: 8px 10px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid #edf1f6; text-align: left; white-space: normal; cursor: pointer; font-size: .75rem; }
.receipt-product-suggestion:last-child { border-bottom: 0; }
.receipt-product-suggestion:hover, .receipt-product-suggestion:focus { background: #eaf4ff; }
.receipt-line-actions { text-align: center; }
.receipt-line-actions { padding: 0 !important; }
.receipt-line-actions .button { width: 34px; height: 42px; min-height: 42px; padding: 0; background: transparent; border: 0; border-radius: 0; font-size: 1.1rem; }
.receipt-line-actions .button:hover { background: var(--red-soft); }
.receipt-add-row { width: 32px; height: 32px; min-height: 32px; display: grid; place-items: center; justify-self: center; margin-top: -8px; padding: 0; color: #0b8249; background: #effaf4; border: 1px solid #a9ddc1; border-radius: 4px; font-size: 1.35rem; font-weight: 500; line-height: 1; }
.receipt-add-row:hover { color: #fff; background: #0b8249; border-color: #0b8249; }
.receipt-tax-summary { width: min(100%, 440px); justify-self: end; margin: 0; padding: 14px 18px; background: #f5f9ff; border: 1px solid #cbdcf3; border-radius: 12px; }
.receipt-tax-summary p { margin: 0 0 12px; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.receipt-tax-summary dl { margin: 0; }
.receipt-tax-summary > div, .receipt-tax-summary dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.receipt-tax-summary dt { color: var(--muted); font-weight: 700; }
.receipt-tax-summary dd { margin: 0; color: var(--navy-800); font-weight: 800; white-space: nowrap; }
.receipt-tax-summary .receipt-tax-grand { margin-top: 5px; padding-top: 11px; border-top: 1px solid #cbdcf3; }
.receipt-tax-summary .receipt-tax-grand :is(dt, dd) { color: var(--navy-800); font-size: .9rem; font-weight: 900; }
.receipt-tax-readonly { margin: 16px 18px 18px auto; }
.receipt-review .receipt-tax-readonly { margin: 0 0 0 auto; }
.receipt-vat-status { margin: 12px 18px; color: var(--muted); font-size: .73rem; }
.receipt-vat-status strong { color: var(--navy-800); }
.receipt-note-field textarea { min-height: 82px; }
.receipt-entry-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.receipt-cost-hint { max-width: 700px; margin: 0; color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1.45; }
.receipt-submit { min-width: 240px; min-height: 46px; flex: 0 0 auto; }

/* Receipt approvals follow the sales list: one summary row, hidden detail below. */
.receipt-list-intro { border-top: 4px solid #168452; }
.receipt-list-intro .panel-header { min-height: 94px; background: linear-gradient(110deg, #f5fbf7, #fff 65%); }
.receipt-list-intro .panel-header > div, .receipt-batch-card .panel-header > div { min-width: 0; }
.receipt-list-intro .toolbar { flex-wrap: wrap; }
.receipt-empty .empty-cell { margin: 0; padding: 36px 22px; text-align: center; color: var(--muted); }
.receipt-history-panel { border-top: 4px solid #168452; }
.spreadsheet-panel.is-excel-view .receipt-history-table { min-width: 1000px; }
.spreadsheet-panel.is-excel-view .receipt-history-table tbody tr.receipt-group-row td { background: #edf5ef; border-top: 2px solid #8aaf95; }
.spreadsheet-panel.is-excel-view .receipt-history-table tbody tr.receipt-group-row.receipt-batch--pending td { background: #fff8eb; border-top-color: #d5a150; }
.spreadsheet-panel.is-excel-view .receipt-history-table tbody tr.receipt-group-row.receipt-batch--rejected td { background: #fff1f2; border-top-color: #e59398; }
.spreadsheet-panel.is-excel-view .receipt-history-table .receipt-details-group[hidden] { display: none !important; }
.spreadsheet-panel.is-excel-view .receipt-history-table .receipt-detail-row > td { padding: 0; background: #fff; }
.receipt-history-table .receipt-supplier-currency { display: inline-block; margin-left: 4px; color: var(--muted); font-size: .68rem; font-weight: 750; white-space: nowrap; }
.receipt-details-toggle { padding: 0; border: 0; background: transparent; white-space: nowrap; }
.receipt-details-toggle::before { content: '▾'; margin-right: 4px; }
.receipt-details-toggle[aria-expanded="false"]::before { content: '▸'; }
.receipt-details-toggle:focus-visible { outline: 2px solid #107c41; outline-offset: 3px; }
.receipt-batch-card { border-top: 4px solid #168452; background: #fff; box-shadow: inset 0 8px 20px rgba(16, 41, 83, .035); }
.receipt-batch--pending { border-top-color: var(--amber); }
.receipt-batch--rejected { border-top-color: var(--red); }
.receipt-batch-card > .panel-header { min-height: 82px; align-items: flex-start; background: linear-gradient(110deg, #f7fbf8, #fff 70%); }
.receipt-batch--pending > .panel-header { background: linear-gradient(110deg, #fffbf1, #fff 70%); }
.receipt-batch--rejected > .panel-header { background: linear-gradient(110deg, #fff7f7, #fff 70%); }
.receipt-batch-card > .panel-header h3 { margin: 0 0 5px; color: var(--navy-900); font-size: 1rem; line-height: 1.3; }
.receipt-batch-card > .panel-header p { overflow-wrap: anywhere; line-height: 1.5; }
.receipt-batch-status { flex: 0 0 auto; min-height: 29px; padding: 5px 11px; color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; }
.receipt-batch--pending .receipt-batch-status { color: #8b5a08; background: var(--amber-soft); border-color: #f1d49d; }
.receipt-batch--rejected .receipt-batch-status { color: #a31c24; background: var(--red-soft); border-color: #fac8cc; }
.receipt-batch-card > .stock-default-note { margin: 14px 20px 0; overflow-wrap: anywhere; }
.receipt-batch-card > .receipt-vat-status { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 15px 20px; padding: 6px 10px; background: #f2f6fb; border: 1px solid #e2eaf2; border-radius: 8px; }
.receipt-batch-card .receipt-lines-table { min-width: 700px; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.receipt-batch-card .receipt-lines-table th { padding: 10px 13px; color: #263c2d; background: #e6eee8; border-top: 1px solid #c4d2c8; border-right: 1px solid #bdc9c0; border-bottom: 1px solid #9faea3; }
.receipt-batch-card .receipt-lines-table td { padding: 11px 13px; border-right: 1px solid #d3dbd5; border-bottom: 1px solid #d3dbd5; }
.receipt-batch-card .receipt-lines-table :is(th, td):last-child { border-right: 0; }
.receipt-batch-card .receipt-lines-table tbody tr:nth-child(even) { background: #fbfdfb; }
.receipt-batch-card .receipt-lines-table tbody tr:hover { background: #eaf4ed; }
.receipt-batch-card .receipt-lines-table :is(th, td):first-child { width: 56px; text-align: center; }
.receipt-batch-card .receipt-lines-table td:nth-child(3) { min-width: 210px; font-weight: 700; overflow-wrap: anywhere; }
.receipt-batch-card .receipt-lines-table td:nth-child(4) { font-weight: 750; }
.receipt-batch-card > .receipt-tax-readonly { margin: 18px 20px 20px auto; }
.receipt-review { border-top: 1px solid var(--line); background: #fbfcfe; }
.receipt-review > summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; color: var(--navy-800); font-weight: 800; cursor: pointer; list-style: none; }
.receipt-review > summary::-webkit-details-marker { display: none; }
.receipt-review > summary::after { content: '⌄'; display: grid; place-items: center; width: 24px; height: 24px; color: var(--blue); background: var(--blue-soft); border-radius: 7px; font-size: 1rem; line-height: 1; }
.receipt-review[open] > summary { border-bottom: 1px solid var(--line); }
.receipt-review[open] > summary::after { transform: rotate(180deg); }
.receipt-review > form[data-receipt-approval-form] { padding: 20px; }
.receipt-review > form:last-child { display: flex; justify-content: flex-end; padding: 0 20px 20px; }
.receipt-review .spreadsheet-table { min-width: 580px; background: #fff; }
.receipt-review .spreadsheet-table th { background: #e6eee8; border-right: 1px solid #bdc9c0; }
.receipt-review .spreadsheet-table td { border-right: 1px solid #d3dbd5; }
.receipt-review .spreadsheet-table :is(th, td):last-child { border-right: 0; }
.receipt-review .spreadsheet-table input { min-width: 145px; font-variant-numeric: tabular-nums; }
.receipt-review .button[type='submit'] { min-height: 44px; }
@media (max-width: 1100px) {
    .receipt-entry-panel .panel-header { align-items: flex-start; flex-direction: column; }
    .receipt-entry-panel .panel-header > a { align-self: flex-start; }
    .receipt-entry-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-entry-fields > label:first-child { grid-column: 1 / -1; }
    .receipt-tax-summary { width: 100%; }
    .receipt-entry-footer { align-items: stretch; flex-direction: column; }
    .receipt-submit { width: 100%; min-width: 0; }
}
@media (max-width: 700px) {
    .receipt-list-intro .panel-header, .receipt-batch-card > .panel-header { padding: 16px; }
    .receipt-list-intro .toolbar { width: 100%; }
    .receipt-list-intro .toolbar .button { flex: 1 1 auto; }
    .receipt-batch-status { align-self: flex-start; }
    .receipt-batch-card > .receipt-vat-status { margin: 12px 16px; }
    .receipt-batch-card > .receipt-tax-readonly { width: calc(100% - 32px); margin: 16px; }
    .receipt-review > summary { padding: 13px 16px; }
    .receipt-review > form[data-receipt-approval-form] { padding: 16px; }
    .receipt-review > form:last-child { padding: 0 16px 16px; }
    .receipt-review > form:last-child .button { width: 100%; }
    .receipt-entry-fields { grid-template-columns: 1fr; }
    .receipt-entry-fields > label:first-child { grid-column: auto; }
    .receipt-entry-table-wrap { overflow: visible; border: 0; }
    .receipt-entry-table { display: block; min-width: 0; }
    .receipt-entry-table colgroup, .receipt-entry-table thead { display: none; }
    .receipt-entry-table tbody { display: grid; gap: 5px; }
    .receipt-entry-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 5px; padding: 8px; background: #f9fbfe; border: 1px solid var(--line); border-radius: 5px; }
    .receipt-entry-table td { display: block; padding: 0 !important; border: 0; }
    .receipt-entry-table .receipt-line-number { grid-column: 1 / -1; text-align: left; }
    .receipt-entry-table .receipt-line-product { grid-column: 1 / -1; }
    .receipt-line-quantity { grid-column: 1; }
    .receipt-line-price { grid-column: 2; }
    .receipt-line-quantity::before, .receipt-line-price::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: .62rem; font-weight: 800; }
    .receipt-entry-table .receipt-line-actions { grid-column: 3; align-self: end; }
    .receipt-entry-table :is(select, input[type="text"]), .receipt-product-clear { height: 40px; min-height: 40px; }
    .receipt-line-actions .button { width: 34px; height: 40px; min-height: 40px; }
    .receipt-add-row { margin-top: 0; }
    .receipt-fx-field { align-items: flex-start; flex-direction: column; }
    .receipt-fx-equation { width: 100%; }
    .receipt-fx-equation input { flex: 1 1 auto; min-width: 0; }
}

.entity-link { display: inline-flex; align-items: center; gap: 10px; }
.entity-link strong, .entity-link small { display: block; }
.entity-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; color: #1766ad; background: var(--blue-soft); border-radius: 10px; font-size: .75rem; font-weight: 900; }
.entity-avatar.large, .product-mark.large { width: 54px; height: 54px; border-radius: 15px; font-size: 1.1rem; }
.review-note { color: var(--amber); }
.product-mark { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--navy-800), var(--blue)); border-radius: 10px; font-weight: 900; }
.product-mark.archived-mark { background: linear-gradient(145deg, #677386, #343f51); }
.product-name-group { align-items: flex-start; }
.stock-code-list { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.stock-code-badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 6px; color: #59677a; background: #f1f4f8; border: 1px solid #e0e5ec; border-radius: 5px; font-size: .58rem; line-height: 1.3; overflow-wrap: anywhere; }
.stock-code-badge b { color: #273142; }
.stock-code-official { color: #a52a31; background: #fff4f5; border-color: #efd1d4; }
.stock-code-official b { color: var(--red); }
.stock-code-both { color: #315d78; background: #f0f8fb; border-color: #cce1ea; }

.archive-hero { min-height: 170px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 20px; padding: clamp(25px, 4vw, 40px); color: #fff; background: radial-gradient(circle at 80% 10%, rgba(115,139,176,.3), transparent 30%), linear-gradient(125deg, #111d31, #33445f); border-radius: 24px; box-shadow: 0 22px 55px rgba(15, 31, 54, .18); }
.archive-hero h2 { margin-bottom: 8px; }
.archive-hero p { max-width: 720px; margin: 0; color: #c5d0df; }
.archive-count { min-width: 130px; padding: 16px 20px; text-align: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 15px; }
.archive-count strong, .archive-count span { display: block; }
.archive-count strong { font-size: 2rem; }
.archive-count span { color: #c7d2e1; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.archive-banner { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 14px; margin-bottom: 20px; padding: 15px 18px; color: #33445f; background: #f1f4f8; border: 1px solid #dce3ed; border-radius: 14px; }
.archive-banner h3, .archive-banner p { margin: 0; }
.archive-banner p { color: var(--muted); font-size: .78rem; }
.archive-symbol { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: #44536a; border-radius: 11px; font-weight: 900; }
.archived-help-card { padding: 22px; text-align: center; }
.archived-help-card p { color: var(--muted); }

.entity-hero { display: flex; align-items: center; gap: 22px; margin-bottom: 20px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.entity-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.entity-title h2 { margin-bottom: 3px; }
.entity-title p { margin: 0; color: var(--muted); }
.balance-card { margin-left: auto; min-width: 190px; padding: 13px 17px; border-radius: 13px; }
.balance-card span, .balance-card small, .balance-card strong { display: block; }
.balance-card span { font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.balance-card strong { margin: 2px 0; font-size: 1.4rem; }
.balance-due { color: #a91f27; background: var(--red-soft); }
.balance-clear { color: #087441; background: var(--green-soft); }
.customer-grid, .product-detail-grid, .sale-detail-grid { grid-template-columns: minmax(0,2fr) minmax(300px, 1fr); }
.product-detail-grid--no-ledger { grid-template-columns: minmax(0, 1fr); }
.product-detail-grid--no-ledger > .stack-lg { width: 100%; max-width: 1100px; min-width: 0; justify-self: center; }
.product-info-readonly { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 18px 20px 20px; }
.product-info-readonly > div { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.product-info-readonly > div:last-child { grid-column: 1 / -1; }
.product-info-readonly dt { color: var(--muted); font-size: .68rem; font-weight: 800; line-height: 1.3; }
.product-info-readonly dd { min-width: 0; margin: 0; color: var(--navy); font-size: .86rem; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.transaction-row.tx-official { box-shadow: inset 3px 0 0 var(--red); }
.transaction-row.tx-unofficial { box-shadow: inset 3px 0 0 #273142; }
.customer-transaction-products { min-width: 255px; }
.customer-transaction-product { display: grid; gap: 2px; padding: 4px 0; }
.customer-transaction-product + .customer-transaction-product { border-top: 1px dashed #dce3ed; }
.customer-transaction-product strong { max-width: 310px; overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-transaction-product small { color: var(--muted); font-size: .63rem; white-space: nowrap; }
.customer-profit-panel, .supplier-product-performance-panel { margin-bottom: 22px; }
.customer-profit-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.customer-profit-summary > div { min-width: 0; padding: 14px 16px; background: #fff; }
.customer-profit-summary span, .customer-profit-summary strong, .customer-profit-summary small { display: block; }
.customer-profit-summary span { color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.customer-profit-summary strong { margin: 4px 0 1px; font-size: 1.05rem; letter-spacing: -.025em; }
.customer-profit-summary small { color: var(--muted); font-size: .56rem; line-height: 1.4; }
.customer-profit-table, .supplier-product-performance-table { min-width: 1320px; }
.supplier-product-scope-note { margin-block: 14px; }
.supplier-stock-purchase-detail { color: #087441 !important; font-weight: 800; }
.supplier-manual-purchase-note { color: #8a5a08 !important; font-weight: 750; }
.table-subline, .cost-source { display: block; margin-top: 2px; color: var(--muted); font-size: .56rem; font-weight: 750; white-space: nowrap; }
.cost-source-exact { color: #087441; }
.cost-source-estimated { color: #8a5a08; }
.note-box { margin: 18px; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.note-box p { margin: 5px 0 0; color: var(--muted); }
.account-offset-body { padding: 20px; }
.account-offset-body .note-box { margin: 0; }
.account-offset-body > form { padding: 0; }
.account-offset-body .form-action { display: flex; align-items: end; }
.account-offset-body .form-action .button { min-height: 43px; }
.account-offset-body label { min-width: 0; }
.account-offset-body select { width: 100%; }
.account-offset-body input { width: 100%; }
.account-offset-body .form-grid { align-items: end; }
.account-offset-body .form-grid + div { margin-top: 2px; }
.account-offset-history { margin-top: 18px; }
.account-offset-history td details { min-width: 155px; }
.account-offset-history td details > summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.account-offset-history td details > form { display: grid; gap: 8px; min-width: 190px; margin-top: 8px; }
.account-offset-history td details > form label { display: grid; gap: 4px; }
.account-offset-history td details > form input { width: 100%; min-width: 0; }

.stock-type-overview { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.warehouse-stock-overview { grid-template-columns: minmax(0, 1fr); }
.stock-type-link { min-width: 0; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(26,46,78,.045); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.stock-type-link:hover, .stock-type-link.active { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(20,43,76,.1); }
.stock-type-link.unofficial-type.active { border-color: #708096; }
.stock-type-link.official-type.active { border-color: #e5979c; }
.stock-type-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: #273142; border-radius: 13px; font-size: 1rem; font-weight: 900; }
.official-type .stock-type-symbol { background: linear-gradient(145deg, #a91922, var(--red)); }
.stock-type-link small, .stock-type-link strong, .stock-type-link em { display: block; }
.stock-type-link small { color: var(--muted); font-size: .63rem; font-weight: 850; letter-spacing: .09em; }
.stock-type-link strong { margin: 2px 0; font-size: 1rem; }
.stock-type-link em { overflow: hidden; color: var(--muted); font-size: .72rem; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.stock-type-link b { padding: 6px 9px; color: #536178; background: #f2f5f8; border-radius: 999px; font-size: .7rem; white-space: nowrap; }
.product-stock-pair { min-width: 250px; display: grid; grid-template-columns: repeat(2, minmax(118px, 1fr)); gap: 8px; }
.product-stock-value { min-width: 0; display: grid; align-content: center; gap: 4px; padding: 7px 9px; border: 1px solid #d9e0e8; border-radius: 9px; }
.product-stock-value span { min-width: 0; display: flex; align-items: center; gap: 6px; color: #5e6b7d; font-size: .62rem; font-weight: 750; white-space: nowrap; }
.product-stock-value span b { width: 20px; height: 20px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; background: #273142; border-radius: 5px; font-size: .63rem; }
.product-stock-value strong { padding-left: 26px; color: #182235; font-size: .82rem; line-height: 1; white-space: nowrap; }
.product-stock-value > small { padding-left: 26px; color: #778397; font-size: .56rem; font-weight: 750; }
.stock-card-breakdown { display: grid; gap: 2px; margin-top: 2px; padding-top: 4px; border-top: 1px dashed #d8dee6; }
.stock-card-breakdown small { color: #718096; font-size: .53rem; line-height: 1.3; overflow-wrap: anywhere; }
.stock-card-breakdown .is-critical-line { color: #b0242c; font-weight: 850; }
.unofficial-stock-value { background: #f7f9fb; }
.official-stock-value { background: #fff7f7; border-color: #eed4d6; }
.official-stock-value span { color: #9b343a; }
.official-stock-value span b { background: var(--red); }
.official-stock-value strong { color: #af2028; }
.product-stock-value.is-critical { border-color: #e3747b; box-shadow: inset 0 0 0 1px rgba(216,39,47,.12); }
.product-stock-value.not-tracked { opacity: .55; background: #f5f6f8; border-style: dashed; }
.official-type b { color: #a51d25; background: var(--red-soft); }
.grouped-card-actions { min-width: 160px; display: grid; gap: 5px; justify-items: end; }
.grouped-card-action { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.grouped-card-action .row-action { font-size: .64rem; white-space: nowrap; }
.warehouse-stock-table { min-width: 1120px; }
.warehouse-code-list,
.warehouse-value-list { display: grid; gap: 5px; }
.warehouse-code-list span { display: block; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.warehouse-value-list > span { display: grid; justify-items: end; line-height: 1.15; }
.warehouse-value-list strong { font-size: .74rem; white-space: nowrap; }
.warehouse-value-list small { margin-top: 2px; color: var(--muted); font-size: .54rem; white-space: nowrap; }
.spreadsheet-panel.is-excel-view .warehouse-stock-table .stock-actions-column { position: sticky; right: 0; min-width: 104px; width: 104px; text-align: center; border-left: 1px solid #bdc9c0; box-shadow: -4px 0 9px rgba(17, 51, 32, .07); }
.spreadsheet-panel.is-excel-view .warehouse-stock-table thead tr:first-child .stock-actions-column { z-index: 6; background: #e6eee8; }
.spreadsheet-panel.is-excel-view .warehouse-stock-table .product-column-filter-row .stock-actions-column { z-index: 7; background: #f4f8f5; }
.spreadsheet-panel.is-excel-view .warehouse-stock-table tbody .stock-actions-column { z-index: 1; }
.stock-list-actions { display: grid; gap: 7px; justify-items: center; }
.stock-list-card-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
.stock-list-card-actions form { margin: 0; }
.stock-list-action-sku { flex-basis: 100%; color: var(--muted); font-size: .63rem; font-weight: 800; overflow-wrap: anywhere; }
.stock-list-action { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 6px; border: 1px solid #c8d8ec; border-radius: 8px; color: var(--blue); background: #f6faff; font: inherit; line-height: 1; text-decoration: none; cursor: pointer; }
.stock-list-action svg { display: block; width: 18px; height: 18px; flex: none; }
.stock-list-action:hover { border-color: var(--blue); background: #eaf4ff; }
.stock-list-action:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.stock-list-action-archive { border-color: #f1c7ca; color: #a51d25; background: var(--red-soft); }
.stock-list-action-archive:hover { border-color: var(--red); color: #fff; background: var(--red); }
#product-edit { scroll-margin-top: 24px; }
#product-edit:target { border-color: #8fc3ff; box-shadow: 0 0 0 4px rgba(35, 131, 226, .12), var(--shadow); }

.stock-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stock-balance-card { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; border-radius: var(--radius); border: 1px solid; }
.stock-balance-card span, .stock-balance-card strong { display: block; }
.stock-balance-card > div > span { font-size: .75rem; font-weight: 800; }
.stock-balance-card strong { margin-top: 5px; font-size: 1.9rem; letter-spacing: -.04em; }
.stock-balance-card strong small { font-size: .78rem; font-weight: 700; }
.official-card { color: #8e171e; background: linear-gradient(135deg, #fff, #fff2f3); border-color: #f3ced1; }
.unofficial-card { color: #fff; background: linear-gradient(135deg, #1b2534, #0d1521); border-color: #1a2636; }
.threshold-card { color: #155e9e; background: linear-gradient(135deg, #fff, #edf7ff); border-color: #cde3f6; }
.stock-balance-card.is-critical { box-shadow: inset 0 0 0 2px rgba(216,39,47,.2), 0 10px 30px rgba(216,39,47,.09); }
.stock-state { padding: 5px 9px; color: #a51d25; background: rgba(255,255,255,.75); border-radius: 999px; font-size: .68rem; font-weight: 850; }
.stock-state.neutral { color: #17619d; }
.stock-default-note { margin: -2px 0 2px; padding: 10px 12px; color: #56647a; background: #f4f7fa; border-left: 3px solid #273142; border-radius: 8px; font-size: .72rem; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); padding: 4px; background: #eef2f7; border-radius: 11px; }
.segmented.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 35px; display: grid; place-items: center; padding: 6px 9px; border-radius: 8px; color: #657189; font-size: .73rem; font-weight: 800; cursor: pointer; }
.segmented input:checked + span { color: var(--navy-900); background: #fff; box-shadow: 0 3px 10px rgba(18,42,76,.12); }
.segmented input:checked + .official-segment { color: var(--red); }

.notice-banner { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 20px; padding: 22px; color: #fff; background: linear-gradient(120deg, #6c1821, #b3202a); border-radius: var(--radius); box-shadow: 0 16px 34px rgba(139,26,34,.18); }
.notice-icon { width: 52px; height: 52px; background: rgba(255,255,255,.15); font-size: 1.25rem; }
.notice-banner h2 { margin-bottom: 5px; font-size: 1.3rem; }
.notice-banner p { margin: 0; color: #f4cbd0; }
.notice-meta { display: grid; justify-items: end; }
.notice-meta strong { font-size: 1.8rem; }
.notice-meta span, .notice-meta small { color: #f7d6d9; }

.sale-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, .85fr); gap: 20px; align-items: start; }
.sale-layout .panel { overflow: visible; }
.sale-info-panel > .panel-header, .sale-products-panel > .panel-header { min-height: 42px; padding: 8px 14px; }
.sale-info-panel > .panel-header p, .sale-products-panel > .panel-header p { display: none; }
.sale-card-body { padding: 8px 12px; }
.sale-info-sheet { border: 1px solid #b9c9bd; border-radius: 4px; background: #fff; }
.sale-info-sheet-header, .sale-info-sheet-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .85fr) minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, .7fr); }
.sale-info-sheet--edit .sale-info-sheet-header, .sale-info-sheet--edit .sale-info-sheet-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, .85fr) minmax(0, .9fr) minmax(0, 1.25fr); }
.sale-info-sheet-header { color: #31553e; background: #e8f1ea; border-bottom: 1px solid #b9c9bd; border-radius: 3px 3px 0 0; font-size: .62rem; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.sale-info-sheet-header > span { min-width: 0; padding: 6px 8px; border-right: 1px solid #cbd9cf; overflow-wrap: anywhere; }
.sale-info-sheet-header > span:last-child { border-right: 0; }
.sale-info-sheet-row { align-items: stretch; }
.sale-info-cell { min-width: 0; display: grid; align-content: center; gap: 0; margin: 0; padding: 5px 6px; border-right: 1px solid #dce6df; }
.sale-info-cell:last-child { border-right: 0; }
.sale-info-cell:focus-within { background: #f5fbf7; }
.sale-info-cell input, .sale-info-cell select { min-width: 0; min-height: 34px; margin: 0; padding: 5px 7px; border-radius: 3px; font-size: .73rem; }
.sale-info-customer { position: relative; z-index: 2; }
.sale-info-field-name { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sale-info-sheet-hint { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sale-info-reporter strong { min-height: 34px; display: flex; align-items: center; padding: 5px 7px; color: var(--ink); font-size: .73rem; font-weight: 800; overflow-wrap: anywhere; }
.sale-info-sheet .smart-select-toggle, .sale-sheet-wrap .smart-select-toggle { width: 30px; height: 30px; top: 2px; right: 2px; }
.option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.choice-card { min-height: 82px; display: grid; grid-template-columns: 38px minmax(0,1fr) 24px; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: #90bfe9; box-shadow: 0 0 0 3px rgba(37,139,232,.08); }
.official-choice:has(input:checked) { border-color: #ec9aa0; background: #fffafb; box-shadow: 0 0 0 3px rgba(216,39,47,.07); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card strong, .choice-card small { display: block; }
.choice-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.recommended-pill, .segment-recommended { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; color: #087441; background: var(--green-soft); border: 1px solid #c4ead6; border-radius: 999px; font-size: .58rem; font-style: normal; font-weight: 850; white-space: nowrap; }
.choice-icon { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: #202b3b; border-radius: 10px; font-weight: 900; }
.official-choice .choice-icon { background: var(--red); }
.choice-check { color: transparent; }
.choice-card:has(input:checked) .choice-check { color: var(--green); font-weight: 900; }
.sale-sheet-wrap { margin: 8px 12px 0; overflow: visible; border: 1px solid var(--line); border-radius: 4px; }
.sale-sheet-header, .sale-item-row { display: grid; grid-template-columns: 24px minmax(190px, 2.5fr) minmax(130px, 1fr) minmax(105px, .8fr) minmax(95px, .7fr) 34px; }
.sale-sheet-header { align-items: center; min-height: 28px; color: #50627b; background: #edf3f8; border-radius: 3px 3px 0 0; font-size: .61rem; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.sale-sheet-header > span { min-width: 0; padding: 5px 6px; border-right: 1px solid #d9e3ec; }
.sale-sheet-header > span:last-child { border-right: 0; }
.sale-items { display: block; counter-reset: sale-sheet-row; }
.sale-item-row { position: relative; align-items: start; counter-increment: sale-sheet-row; min-height: 48px; gap: 0; background: #fff; border-top: 1px solid #e3e9f0; }
.sale-item-row:first-child { border-top: 0; }
.sale-item-row:nth-child(even) { background: #fafcff; }
.sale-item-row::before { content: counter(sale-sheet-row); display: flex; align-items: center; justify-content: center; min-height: 48px; color: #68788f; font-size: .65rem; font-weight: 800; }
.sale-item-row > label, .sale-item-row > .line-total { min-width: 0; min-height: 48px; margin: 0; padding: 4px 6px; border-left: 1px solid #e3e9f0; }
.sale-item-row > label { display: block; }
.sale-item-row > label > input, .sale-item-row > label > select { width: 100%; min-width: 0; }
.sale-item-row input, .sale-item-row select { min-height: 34px; padding: 5px 7px; border-radius: 3px; font-size: .73rem; }
.sale-item-row [data-line-quantity], .sale-item-row [data-line-price] { max-width: 100%; font-variant-numeric: tabular-nums; }
.sale-item-row .item-unit-price [data-line-price] { width: 100%; min-width: 0; box-sizing: border-box; }
.sale-historical-discount-note { margin: 12px 20px 0; padding: 9px 12px; color: #675317; background: #fff8e5; border: 1px solid #eadcae; border-radius: 8px; font-size: .7rem; }
.sale-sheet-field-name { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sale-compatible-lids { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid #a8c8b3; border-radius: 8px; background: #edf8f0; }
.sale-compatible-lids span { color: #195a32; font-size: .69rem; font-weight: 800; }
.sale-compatible-lids select { width: 100%; min-height: 34px; margin: 0; }
.sale-compatible-lids button { width: 100%; min-height: 34px; }
.stock-lid-links { margin-bottom: 22px; }
.stock-lid-link-list { display: grid; gap: 8px; padding: 0 22px 16px; }
.stock-lid-link-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.stock-lid-link-item a { display: grid; gap: 2px; min-width: 0; }
.stock-lid-link-item small { color: var(--muted); }
.stock-lid-link-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 0 22px 20px; }
.stock-lid-link-form label { flex: 1; min-width: 0; }
.stock-lid-link-form select { width: 100%; }
.stock-lid-used-by { padding: 0 22px 20px; }
.sale-quantity-control { min-width: 0; display: flex; align-items: stretch; gap: 5px; }
.sale-quantity-control [data-line-quantity] { min-width: 0; width: 12ch; max-width: 100%; flex: 1 1 auto; }
.sale-line-unit { min-width: 40px; max-width: 84px; min-height: 34px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 3px 5px; overflow: hidden; color: #31425e; background: #edf3f8; border: 1px solid #cbd7e4; border-radius: 3px; font-size: .66rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.sale-line-unit:empty { display: none; }
.sales-view-tabs { min-width: 0; display: inline-flex; align-items: stretch; justify-self: end; gap: 3px; padding: 3px; background: #e9eef4; border: 1px solid #d5dde8; border-radius: 10px; }
.sales-view-tab { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 11px; color: #53647e; background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: .7rem; font-weight: 800; line-height: 1.15; text-align: center; text-decoration: none; white-space: nowrap; }
.sales-view-tab:hover { color: var(--navy); background: #fff; }
.sales-view-tab.is-active { color: #155f35; background: #fff; border-color: #c7d7cc; box-shadow: 0 2px 6px rgba(25, 79, 45, .12); }
.sale-item-row:has(.smart-select.is-open) { z-index: 8; }
.sale-item-row label small { display: block; min-height: 0; max-height: 12px; margin-top: 1px; color: var(--muted); font-size: .56rem; font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-item-row .item-product:hover small[data-stock-hint], .sale-item-row .item-product:focus-within small[data-stock-hint] { max-height: none; white-space: normal; }
.line-total { display: flex; align-items: flex-start; justify-content: flex-end; }
.line-total strong { min-width: 0; max-width: 100%; min-height: 34px; display: block; padding-top: 8px; font-size: .73rem; line-height: 1.2; text-align: right; overflow-wrap: anywhere; }
.remove-row { width: 34px; height: 48px; margin: 0; border: 0; border-left: 1px solid #e3e9f0; color: #a6454b; background: transparent; border-radius: 0; font-size: 1.1rem; }
.remove-row:hover { background: var(--red-soft); }
.sale-add-row-wrap { display: flex; justify-content: center; padding: 4px 12px 8px; }
.sale-add-row { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: #0b8249; background: #effaf4; border: 1px solid #a9ddc1; border-radius: 4px; box-shadow: 0 3px 8px rgba(11,130,73,.1); font-size: 1.35rem; font-weight: 500; line-height: 1; transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.sale-add-row:hover { color: #fff; background: #0b8249; border-color: #0b8249; box-shadow: 0 8px 18px rgba(11,130,73,.22); transform: translateY(-1px); }
.sale-add-row:focus-visible { outline: 3px solid rgba(11,130,73,.22); outline-offset: 3px; }
.sale-add-row span { display: block; transform: translateY(-1px); }
.sale-totals-wrap { max-width: 430px; margin: 0 12px 12px auto; }
.sale-totals-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: #192c40; font-size: .73rem; font-variant-numeric: tabular-nums; }
.sale-totals-table th, .sale-totals-table td { padding: 7px 10px; border: 1px solid #b9c9d6; line-height: 1.3; }
.sale-totals-table th { width: 64%; background: #f5f8fa; font-weight: 700; text-align: left; }
.sale-totals-table td { width: 36%; font-weight: 800; text-align: right; white-space: nowrap; }
.sale-totals-net { background: #ffe6e6; }
.sale-totals-vat { background: #fff3bd; }
.sale-totals-grand th { font-weight: 850; }
.sale-totals-grand td { background: #dff3d8; font-size: .88rem; }
.sale-totals-note { display: block; margin-top: 5px; color: var(--muted); font-size: .62rem; text-align: right; }
.sticky-panel { position: sticky; top: 112px; }
.payment-panel > .panel-header { min-height: 42px; padding: 8px 14px; }
.payment-panel > .panel-header p { display: none; }
.payment-panel-body { display: grid; gap: 9px; padding: 12px; }
.sale-payment-method { padding: 0; background: #e8f1ea; border: 1px solid #b9c9bd; border-radius: 4px; }
.sale-payment-method span { min-height: 34px; grid-auto-flow: column; gap: 7px; border-radius: 3px; }
.sale-payment-method label:first-child span { border-right: 1px solid #cbd9cf; }
.sale-auto-payment-account.is-ready:not(.is-unavailable):not(.is-legacy-account) { display: none; }
.sale-payment-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
.sale-payment-actions .credit-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 44px; margin: 0; padding: 6px 8px; border-radius: 4px; }
.sale-payment-actions .credit-toggle > span:last-child { min-width: 0; }
.sale-payment-actions .credit-toggle strong { font-size: .7rem; line-height: 1.1; }
.sale-payment-actions .credit-toggle small { font-size: .55rem; line-height: 1.15; }
.sale-payment-actions .sale-note-toggle { width: 100%; justify-content: center; min-width: 0; min-height: 44px; text-align: center; }
.sale-note-toggle { min-height: 34px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; padding: 6px 9px; color: #31553e; background: #f5faf6; border: 1px solid #b9c9bd; border-radius: 4px; font-size: .72rem; font-weight: 800; text-align: left; }
.sale-note-toggle::before { content: '+'; width: 18px; height: 18px; display: grid; place-items: center; color: #fff; background: #14804b; border-radius: 3px; font-size: 1rem; font-weight: 700; line-height: 1; }
.sale-note-toggle[aria-expanded="true"]::before { content: '−'; }
.sale-note-toggle:hover { background: #e8f4eb; border-color: #8dbb9a; }
.sale-note-fields[hidden] { display: none; }
.sale-note-fields label { display: block; }
.segment-recommended { min-height: 17px; padding: 1px 5px; font-size: .52rem; }
.credit-toggle { grid-template-columns: 41px 1fr; align-items: center; margin: 4px 0; padding: 12px; background: var(--amber-soft); border: 1px solid #f1d9ad; border-radius: 12px; cursor: pointer; }
.credit-toggle input { position: absolute; opacity: 0; }
.customer-type-option input,
.segmented input,
.choice-card input,
.credit-toggle input { width: 1px; height: 1px; min-height: 1px; margin: 0; padding: 0; }
.toggle-track { width: 40px; height: 22px; position: relative; background: #c7ced9; border-radius: 99px; transition: .2s; }
.toggle-track::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s; }
.credit-toggle input:checked + .toggle-track { background: var(--amber); }
.credit-toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.credit-toggle strong, .credit-toggle small { display: block; }
.credit-fields { display: grid; gap: 12px; padding: 13px; background: #fffaf0; border-radius: 12px; }
.credit-fields[hidden] { display: none; }
.sale-edit-heading { margin-bottom: 18px; }
.sale-edit-heading p { margin: 6px 0 0; color: var(--muted); }
.sale-edit-payment-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; color: #17619d; background: var(--blue-soft); border: 1px solid #cfe6fb; border-radius: 11px; }
.sale-edit-payment-note span { color: #5d7187; font-size: .68rem; font-weight: 700; text-align: right; }

.selection-help { margin-top: 1px; font-size: .65rem; font-weight: 600; }
.smart-select { min-width: 0; position: relative; }
.smart-select.is-enhanced [data-smart-native] { width: 1px; height: 1px; min-height: 1px; position: absolute; left: 10px; bottom: 0; padding: 0; opacity: 0; pointer-events: none; }
.smart-select-control { min-width: 0; position: relative; }
.smart-select-input { padding-right: 43px; font-weight: 700; }
.smart-select-input::-webkit-search-cancel-button { display: none; }
.smart-select-toggle { width: 38px; height: 38px; position: absolute; top: 2px; right: 2px; display: grid; place-items: center; padding: 0; color: #647188; background: transparent; border: 0; border-radius: 8px; font-size: 1.1rem; transition: transform .15s ease, background .15s ease; }
.smart-select-toggle:hover { color: var(--navy-800); background: #f1f5fa; }
.smart-select.is-open .smart-select-toggle { transform: rotate(180deg); }
.smart-select.is-open .smart-select-input { border-color: #72b3ed; box-shadow: 0 0 0 3px rgba(37,139,232,.11); }
.smart-select.is-invalid .smart-select-input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(216,39,47,.1); }
.smart-select.is-new-entry .smart-select-input { border-color: #3b90e3; box-shadow: 0 0 0 2px rgba(59,144,227,.16); }
.smart-select-new-warning { display: block; width: fit-content; max-width: 100%; margin-top: 4px; padding: 3px 7px; color: #115d9f; background: #e2f2ff; border: 1px solid #8cc7f1; border-radius: 5px; font-size: .62rem; font-weight: 800; line-height: 1.25; }
.smart-select-new-warning[hidden] { display: none; }
.smart-select-quick-create { margin-left: 8px; padding: 2px 7px; border: 1px solid #1b70ba; border-radius: 4px; background: #fff; color: #145994; font: inherit; font-weight: 800; cursor: pointer; }
.smart-select-quick-create:hover, .smart-select-quick-create:focus-visible { background: #c9e8ff; outline: 2px solid #2e84cb; outline-offset: 1px; }
.smart-select-quick-create[hidden] { display: none; }
.sale-info-customer.is-new-entry, .sale-item-row.is-new-entry { animation: sale-new-entry-pulse 1.8s ease-in-out infinite; }
@keyframes sale-new-entry-pulse { 0%, 100% { background-color: #f1f8ff; box-shadow: inset 0 0 0 1px rgba(45,136,221,.14); } 50% { background-color: #d6ebff; box-shadow: inset 0 0 0 2px rgba(45,136,221,.4); } }
@media (prefers-reduced-motion: reduce) { .sale-info-customer.is-new-entry, .sale-item-row.is-new-entry { animation: none; background: #e2f2ff; box-shadow: inset 0 0 0 2px rgba(45,136,221,.35); } }
.smart-select-menu { width: max(100%, 360px); max-width: min(520px, calc(var(--ui-viewport-width, 100vw) - 36px)); position: absolute; top: calc(100% + 7px); left: 0; z-index: 90; padding: 8px; background: #fff; border: 1px solid #dce4ef; border-radius: 13px; box-shadow: 0 20px 48px rgba(11,29,58,.2); }
.smart-select-menu[hidden] { display: none; }
.smart-select-menu-title { padding: 7px 9px 8px; color: #6d7b91; font-size: .61rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.smart-select-options { max-height: 310px; display: grid; gap: 3px; overflow-y: auto; overscroll-behavior: contain; }
.smart-select-option { width: 100%; min-height: 52px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 9px 10px; color: var(--ink); background: transparent; border: 0; border-radius: 9px; text-align: left; }
.smart-select-option:hover, .smart-select-option.is-active { background: #eef6ff; }
.smart-select-option[aria-selected="true"] { background: #eaf4ff; }
.smart-option-copy { min-width: 0; display: block; }
.smart-option-copy strong, .smart-option-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-option-copy strong { font-size: .75rem; }
.smart-option-copy small { margin-top: 2px; color: #738097; font-size: .63rem; font-weight: 650; }
.smart-option-badge { padding: 3px 6px; color: #087441; background: var(--green-soft); border-radius: 999px; font-size: .55rem; font-weight: 850; }
.smart-option-check { color: var(--green); font-weight: 900; }
.smart-select-empty { padding: 22px 14px; color: var(--muted); font-size: .72rem; text-align: center; }
.sale-header-card { min-height: 150px; display: flex; align-items: center; gap: 30px; margin-bottom: 20px; padding: 26px; color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.official-sale { background: linear-gradient(120deg, #75161d, #c42b35); }
.unofficial-sale { background: linear-gradient(120deg, #101a28, #27364b); }
.cancelled-sale { background: linear-gradient(120deg, #3e4651, #687483); }
.sale-header-card p { margin: 0; color: rgba(255,255,255,.72); }
.sale-total-hero { margin-left: auto; text-align: right; }
.sale-total-hero span, .sale-total-hero small, .sale-total-hero strong { display: block; }
.sale-total-hero strong { font-size: 1.8rem; }
.sale-total-hero small { color: rgba(255,255,255,.72); }
.large-status { min-height: 30px; padding: 6px 10px; }
.sale-management-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -4px 0 20px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 26px rgba(20,43,76,.045); }
.sale-management-panel h3, .sale-management-panel p { margin: 0; }
.sale-management-panel p { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.sale-management-actions, .sale-cancel-form { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sale-cancel-form input { width: min(240px, 30vw); min-height: 40px; }
.imported-edit-note { color: var(--muted); font-size: .7rem; font-weight: 700; }
.sale-cancelled-banner { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 13px; margin: -4px 0 20px; padding: 15px 18px; color: #7d2028; background: #fff2f3; border: 1px solid #efc3c7; border-radius: 15px; }
.sale-cancelled-banner > span { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: #9f2932; border-radius: 11px; font-size: 1.35rem; }
.sale-cancelled-banner strong, .sale-cancelled-banner p { display: block; margin: 0; }
.sale-cancelled-banner p { margin-top: 2px; color: #89555a; font-size: .75rem; }
.sale-row-cancelled { opacity: .66; background: #f7f8fa; }
.document-actions-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -4px 0 20px; padding: 15px 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 26px rgba(20,43,76,.045); }
.document-actions-panel > div:first-child { min-width: 0; display: flex; align-items: center; gap: 12px; }
.document-actions-panel h3, .document-actions-panel p { margin: 0; }
.document-actions-panel p { color: var(--muted); font-size: .75rem; }
.document-actions-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: #c32730; border-radius: 11px; font-size: .66rem; font-weight: 900; }
.document-buttons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.document-buttons form { margin: 0; }
.sale-preview-dialog { width: min(920px, calc(var(--ui-viewport-width, 100vw) - 28px)); height: min(calc(var(--ui-viewport-height, 100dvh) * .94), 1020px); max-width: none; max-height: none; padding: 0; color: var(--navy-900); background: #fff; border: 1px solid #d7e1ed; border-radius: 16px; box-shadow: 0 28px 80px rgba(6, 23, 48, .35); }
.sale-preview-dialog::backdrop { background: rgba(7, 23, 49, .7); }
.sale-preview-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.sale-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sale-preview-header h3, .sale-preview-header p { margin: 0; }
.sale-preview-header p { color: var(--muted); font-size: .72rem; }
.sale-preview-close { width: 36px; height: 36px; flex: 0 0 auto; color: var(--navy-900); background: #f0f4f9; border: 1px solid var(--line); border-radius: 9px; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sale-preview-close:hover { background: #e4ebf4; }
.sale-preview-stage { min-height: 0; position: relative; background: #e9eef5; }
.sale-preview-frame { width: 100%; height: 100%; display: block; border: 0; }
.sale-preview-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 30px); padding: 10px 14px; color: #43546c; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-size: .75rem; font-weight: 700; text-align: center; }
.sale-preview-loading[hidden] { display: none; }
.sale-preview-footer { display: grid; gap: 7px; padding: 12px 18px; border-top: 1px solid var(--line); }
.sale-preview-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sale-preview-actions .button { min-width: 0; justify-content: center; text-align: center; }
.sale-preview-footer form { margin: 0; }
.sale-preview-footer .document-share-status { text-align: left; }
@media (max-width: 650px) { .sale-preview-dialog { width: var(--ui-viewport-width, 100vw); height: var(--ui-viewport-height, 100dvh); border: 0; border-radius: 0; } .sale-preview-header { padding: 10px 13px; } .sale-preview-footer { padding: 9px 12px; } .sale-preview-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.document-share-status { flex-basis: 100%; color: var(--muted); font-size: .68rem; line-height: 1.4; text-align: right; }
.document-share-status.is-error { color: var(--red); }
.whatsapp-button { color: #fff; background: #159b58; border-color: #159b58; box-shadow: 0 8px 20px rgba(21,155,88,.2); }
.whatsapp-button:hover { background: #087f45; }
.whatsapp-share-fallback { max-width: 280px; display: grid; gap: 4px; }
.whatsapp-share-fallback small { color: var(--muted); font-size: .62rem; line-height: 1.35; }
.whatsapp-missing { padding: 9px 11px; color: #7c8799; background: #f0f2f5; border-radius: 9px; font-size: .72rem; font-weight: 700; }
.detail-list h3 { margin-bottom: 15px; }
.detail-list dl { margin: 0 0 18px; }
.detail-list dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 750; text-align: right; }

/* Sale returns: keep stock, sale value and customer balance effects visible together. */
.button-return { color: #fff; background: linear-gradient(135deg, #159b58, #087744); border-color: #0d844b; box-shadow: 0 8px 20px rgba(21,155,88,.2); }
.button-return:hover { background: linear-gradient(135deg, #118849, #06683a); box-shadow: 0 11px 25px rgba(21,155,88,.26); }
.button-return:disabled { box-shadow: none; }
.return-page-heading { align-items: flex-end; }
.return-impact-banner { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 14px; margin-bottom: 20px; padding: 16px 18px; color: #0d6840; background: linear-gradient(135deg, #f1fbf6, #e7f7ef); border: 1px solid #bee8d1; border-radius: 15px; }
.return-impact-icon { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 13px; font-size: 1.4rem; font-weight: 900; }
.return-impact-banner strong, .return-impact-banner p { display: block; margin: 0; }
.return-impact-banner p { margin-top: 2px; color: #557064; font-size: .76rem; }
.return-layout { grid-template-columns: minmax(0, 2.2fr) minmax(320px, .8fr); }
.return-stock-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; color: #fff; background: #273142; border-radius: 999px; font-size: .66rem; font-weight: 850; white-space: nowrap; }
.return-stock-badge.is-official { background: var(--red); }
.return-table-wrap { overflow-x: auto; }
.return-items-table { min-width: 920px; }
.return-items-table th { padding-inline: 12px; }
.return-items-table td { padding: 13px 12px; }
.return-items-table tbody tr:has([data-return-quantity]:focus) { background: #f1f9f5; box-shadow: inset 3px 0 0 var(--green); }
.return-items-table .is-complete { color: #818b9b; background: #f7f8fa; }
.return-previous-quantity { color: #8b5a08; }
.returnable-quantity strong { color: var(--green); }
.return-quantity-cell { min-width: 145px; }
.return-quantity-input { min-width: 132px; display: grid; grid-template-columns: minmax(82px,1fr) auto; align-items: center; gap: 7px; }
.return-quantity-input input { min-height: 38px; padding: 7px 9px; font-weight: 800; }
.return-quantity-input span { color: var(--muted); font-size: .68rem; font-weight: 750; }
.return-complete-label { display: inline-flex; padding: 5px 8px; color: #687385; background: #e9edf2; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.return-reason-fields { display: grid; grid-template-columns: minmax(140px,.55fr) repeat(2,minmax(0,1fr)); align-items: start; gap: 14px; padding: 18px 20px 20px; }
.return-reason-fields textarea { min-height: 86px; }
.return-summary-body { display: grid; gap: 14px; padding: 18px; }
.return-summary-primary { padding: 18px; color: #fff; background: linear-gradient(135deg, #0b1d3a, #123866); border-radius: 14px; }
.return-summary-primary span, .return-summary-primary strong, .return-summary-primary small { display: block; }
.return-summary-primary span { color: #b8c9e2; font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.return-summary-primary strong { margin: 3px 0; font-size: 1.75rem; letter-spacing: -.04em; }
.return-summary-primary small { color: #b8c9e2; }
.return-summary-primary small b { color: #fff; }
.return-balance-preview { margin: 0; padding: 3px 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.return-balance-preview div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.return-balance-preview div:last-child { border-bottom: 0; }
.return-balance-preview dt { color: var(--muted); font-size: .7rem; }
.return-balance-preview dd { margin: 0; font-size: .78rem; font-weight: 800; text-align: right; }
.return-credit-row[hidden] { display: none; }
.return-accounting-note { padding: 12px 13px; color: #67501d; background: var(--amber-soft); border: 1px solid #f0d7a8; border-radius: 12px; }
.return-accounting-note strong, .return-accounting-note p { display: block; margin: 0; }
.return-accounting-note strong { font-size: .73rem; }
.return-accounting-note p { margin-top: 3px; color: #76663f; font-size: .65rem; line-height: 1.45; }
.return-submit-help { margin-top: -7px; font-size: .62rem; text-align: center; }
.sale-return-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.sale-return-summary span { display: inline-flex; align-items: center; padding: 3px 7px; color: #f0fbf5; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; font-size: .64rem; font-weight: 750; }
.sale-return-lock-note { max-width: 250px; color: #6d7787; font-size: .68rem; font-weight: 700; line-height: 1.35; }
.return-history-panel { margin-bottom: 20px; }
.return-history-count { min-width: 28px; height: 28px; display: grid; place-items: center; color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; border-radius: 9px; font-size: .72rem; font-weight: 850; }
.return-history-table { min-width: 760px; }
.return-history-reason { max-width: 360px; }
.return-history-reason strong, .return-history-reason small { display: block; }
.return-history-reason small { margin-top: 2px; white-space: normal; }
.return-status { color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; }
.sale-financial-net { padding: 11px 12px; color: #0c6940; background: var(--green-soft); border: 1px solid #c3ead5; border-radius: 11px; }
.sale-financial-net dt { color: #287554 !important; font-weight: 750; }
.sale-financial-net dd { color: #087441; font-size: .95rem; }
.customer-credit-note { margin: 0 0 15px; padding: 10px 11px; color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; border-radius: 10px; font-size: .68rem; }

.form-page-shell { max-width: 720px; margin: 0 auto; }
.form-page-card { padding: 4px 0; }
.form-page-card > form { padding: 22px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px,.7fr); gap: 20px; align-items: start; }
.settings-help { text-align: center; }
.settings-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 13px; color: #fff; background: var(--blue); border-radius: 15px; font-size: 1.3rem; }
.settings-help p { color: var(--muted); }
.whatsapp-settings-icon { background: #159b58; }
.whatsapp-auto-toggle { margin-top: 4px; }
.pwa-settings-card { background: linear-gradient(180deg, #fff, #f7fbff); }
.pwa-settings-icon { background: linear-gradient(145deg, #0b1d3a, #258be8); box-shadow: 0 10px 24px rgba(37,139,232,.2); font-weight: 900; }
.push-status { display: block; margin-top: 12px; color: var(--muted); line-height: 1.45; }
.pwa-installed-state { padding: 10px 12px; color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; border-radius: 10px; font-weight: 750; }
.pwa-ios-hint { display: block; padding: 10px 12px; color: #65501f; background: var(--amber-soft); border: 1px solid #f1d49d; border-radius: 10px; }
.pwa-installed-state[hidden], .pwa-ios-hint[hidden] { display: none; }
.task-push-history-section { margin-top: 20px; }
.task-push-summary-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-push-summary-row .summary-card small { display: block; margin-top: 2px; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.task-push-summary-delivered { box-shadow: inset 0 3px #159b58, 0 8px 24px rgba(26, 46, 78, .045); }
.task-push-summary-attention { box-shadow: inset 0 3px var(--red), 0 8px 24px rgba(164, 36, 43, .08); }
.task-push-summary-date { font-size: clamp(1.05rem, 2vw, 1.35rem) !important; letter-spacing: -.025em !important; }
.task-push-history-table { min-width: 1080px; }
.task-push-task { min-width: 270px; max-width: 400px; }
.task-push-task strong, .task-push-task small, .task-push-delivery strong, .task-push-delivery small { display: block; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.task-push-task small, .task-push-delivery small { margin-top: 3px; color: var(--muted); line-height: 1.4; }
.task-push-requested-by { max-width: 190px; overflow-wrap: anywhere; }
.task-push-error { max-width: 300px; color: #94242c; overflow-wrap: anywhere; white-space: normal; }
.task-push-history-panel .empty-cell strong, .task-push-history-panel .empty-cell small { display: block; }
.task-push-history-panel .empty-cell small { margin-top: 3px; color: var(--muted); }
@media (max-width: 900px) { .task-push-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .task-push-summary-row { grid-template-columns: 1fr; } }
.pwa-toast { min-width: min(340px, calc(var(--ui-viewport-width, 100vw) - 28px)); max-width: 480px; position: fixed; right: 22px; bottom: 86px; z-index: 300; padding: 13px 16px; color: #fff; background: #087441; border-radius: 12px; box-shadow: 0 18px 50px rgba(7,21,45,.25); opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; font-weight: 700; }
.pwa-toast-error { background: #a31c24; }
.pwa-toast.show { opacity: 1; transform: translateY(0); }
.pwa-install-notice { width: min(680px, calc(var(--ui-viewport-width, 100vw) - 32px)); display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 32px; align-items: center; gap: 13px; position: fixed; left: 50%; bottom: 22px; z-index: 295; padding: 13px 13px 13px 15px; color: #fff; background: linear-gradient(135deg, #091a35, #0d3767); border: 1px solid rgba(135,194,255,.28); border-radius: 17px; box-shadow: 0 22px 65px rgba(7,21,45,.38); opacity: 0; transform: translate(-50%, 16px); transition: opacity .2s ease, transform .2s ease; }
.pwa-install-notice.show { opacity: 1; transform: translate(-50%, 0); }
.pwa-install-notice-icon { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #258be8, #1ab178); border: 1px solid rgba(255,255,255,.22); border-radius: 14px; box-shadow: 0 8px 22px rgba(37,139,232,.28); font-size: 1.12rem; font-weight: 900; }
.pwa-install-notice-copy { min-width: 0; }
.pwa-install-notice-copy strong, .pwa-install-notice-copy small { display: block; }
.pwa-install-notice-copy strong { margin-bottom: 3px; font-size: .93rem; }
.pwa-install-notice-copy small { color: #b9cce7; line-height: 1.35; }
.pwa-install-notice-action { min-height: 38px; }
.pwa-install-notice-action[hidden] { display: none; }
.pwa-install-notice-close { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: #b9cce7; background: rgba(255,255,255,.08); border: 0; border-radius: 9px; font-size: 1.2rem; }
.pwa-install-notice-close:hover { color: #fff; background: rgba(255,255,255,.15); }

.dialog { width: min(620px, calc(var(--ui-viewport-width, 100vw) - 28px)); padding: 0; border: 0; border-radius: 19px; box-shadow: 0 30px 90px rgba(7,21,45,.3); }
.dialog::backdrop { background: rgba(5,17,36,.62); backdrop-filter: blur(3px); }
.dialog > form { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-close { width: 34px; height: 34px; color: var(--muted); background: #f1f4f8; border: 0; border-radius: 9px; font-size: 1.25rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.critical-stock-analysis-dialog { width: min(1120px, calc(var(--ui-viewport-width, 100vw) - 28px)); max-height: calc(var(--ui-viewport-height, 100vh) - 36px); padding: 22px; overflow: auto; }
.critical-stock-analysis-dialog .dialog-header p { max-width: 760px; margin: 4px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.critical-analysis-controls { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(190px, .8fr) minmax(190px, .8fr); gap: 12px; padding: 14px; background: #f5f8fb; border: 1px solid var(--line); border-radius: 13px; }
.critical-analysis-controls label { display: grid; gap: 6px; color: var(--muted); font-size: .66rem; font-weight: 850; }
.critical-analysis-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.critical-analysis-summary span { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; font-size: .68rem; font-weight: 800; }
.critical-analysis-summary strong { color: inherit; font-size: 1rem; }
.critical-analysis-table-wrap { max-height: min(52vh, 560px); border: 1px solid var(--line); border-radius: 12px; }
.critical-analysis-table { min-width: 860px; }
.critical-analysis-table thead { position: sticky; top: 0; z-index: 2; }

.empty-state { padding: 35px; color: var(--muted); text-align: center; }
.empty-state.compact { padding: 22px; }
.page-empty { max-width: 620px; margin: 70px auto; }
.page-empty > span { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 15px; color: #fff; background: var(--navy-900); border-radius: 18px; font-size: 1.2rem; font-weight: 900; }

.auth-body, .install-body { background: var(--navy-950); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(380px, .85fr); grid-template-rows: minmax(0, 1fr) auto; position: relative; }
.auth-visual { min-width: 0; display: flex; flex-direction: column; grid-column: 1; grid-row: 1 / 3; padding: clamp(32px, 5vw, 72px); color: #fff; background: radial-gradient(circle at 20% 0, rgba(40,140,232,.4), transparent 32%), radial-gradient(circle at 80% 85%, rgba(22,155,88,.3), transparent 30%), linear-gradient(145deg, #091a35, #0b2f5c 72%, #0c4850); }
.auth-shell.has-auth-credit .auth-visual { padding-bottom: clamp(76px, 7vw, 110px); }
.auth-brand img { width: min(100%, 320px); height: auto; filter: none; }
.auth-message { margin: auto 0; max-width: 680px; }
.auth-message h1 { margin-bottom: 20px; font-size: clamp(2.3rem, 5vw, 4.9rem); line-height: .98; letter-spacing: -.065em; }
.auth-message p { max-width: 570px; color: #b9cce7; font-size: 1.05rem; }
.auth-credit { min-width: 0; grid-column: 1; grid-row: 2; align-self: end; z-index: 2; margin: 0 clamp(32px, 5vw, 72px) clamp(32px, 5vw, 72px); color: #b9cce7; font-size: .72rem; line-height: 1.5; }
.auth-credit a { display: inline-block; max-width: 100%; border-radius: 6px; text-decoration: underline; text-decoration-color: rgba(185,204,231,.5); text-underline-offset: 3px; overflow-wrap: anywhere; transition: color .16s ease, text-decoration-color .16s ease; }
.auth-credit a:hover { color: #fff; text-decoration-color: currentColor; }
.auth-credit a:focus-visible { color: #fff; outline: 3px solid rgba(155,208,255,.42); outline-offset: 4px; text-decoration-color: currentColor; }
.auth-form-side { display: grid; place-items: center; grid-column: 2; grid-row: 1 / 3; padding: 30px; background: #f7f9fc; }
.login-card { width: min(420px, 100%); padding: clamp(25px, 5vw, 42px); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(7,21,45,.14); }
.login-card h2 { margin-top: 5px; }
.password-help-row { display: flex; justify-content: flex-end; margin-top: -8px; }
.forgot-password-link { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); border-radius: 8px; font-size: .83rem; font-weight: 780; }
.forgot-password-link:hover { color: #155eaf; }
.forgot-password-link:focus-visible, .auth-back-link:focus-visible { outline: 3px solid rgba(37,139,232,.24); outline-offset: 4px; }
.forgot-password-fish { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; background: var(--blue-soft); border: 1px solid #cfe6fb; border-radius: 9px; font-size: .92rem; line-height: 1; }
.password-card .muted { line-height: 1.65; }
.password-form { margin-top: 22px; }
.password-security-note { margin: -3px 0 0; padding: 12px 13px; color: #5d6c82; background: #f4f7fb; border: 1px solid #e1e7f0; border-radius: 11px; font-size: .76rem; line-height: 1.55; }
.auth-back-link { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; padding-top: 20px; color: #516179; border-top: 1px solid var(--line); border-radius: 8px; font-size: .82rem; font-weight: 760; }
.auth-back-link:hover { color: var(--blue); }
.password-state-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 17px 0 14px; color: #9a6308; background: var(--amber-soft); border: 1px solid #f1d49d; border-radius: 14px; font-size: 1.3rem; font-weight: 900; }
.password-state-icon + h2 { margin-bottom: 10px; }
.password-card > .button { margin-top: 21px; }
.install-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 50% 0, #173f76, transparent 45%), var(--navy-950); }
.install-card { width: min(760px, 100%); padding: clamp(24px, 5vw, 45px); background: #fff; border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.install-logo { width: min(100%, 320px); height: auto; margin-bottom: 24px; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: 18px; min-height: 18px; }
.checkbox-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.checkbox-group > span { width: 100%; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cron-code { display: block; overflow-wrap: anywhere; padding: 12px; border-radius: 10px; background: #f1f4f7; color: #2d3945; font-size: 12px; }

.text-zoom-control { position: fixed; right: clamp(14px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); z-index: 120; display: flex; align-items: flex-end; gap: clamp(8px, 1vw, 12px); }
.text-zoom-trigger { width: clamp(48px, 3.8vw, 64px); height: clamp(48px, 3.8vw, 64px); display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #fff; background: linear-gradient(145deg, var(--blue), #195eb9); border: 1px solid rgba(255,255,255,.28); border-radius: clamp(14px, 1.2vw, 18px); box-shadow: 0 12px 30px rgba(16, 63, 124, .3); transition: transform .16s ease, box-shadow .16s ease; }
.text-zoom-trigger:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(16, 63, 124, .38); }
.text-zoom-trigger:focus-visible, .text-zoom-panel button:focus-visible { outline: 3px solid rgba(37,139,232,.28); outline-offset: 3px; }
.magnifier-icon { width: clamp(19px, 1.6vw, 24px); height: clamp(19px, 1.6vw, 24px); position: relative; border: 2.5px solid currentColor; border-radius: 50%; }
.magnifier-icon::after { content: ""; width: 9px; height: 2.5px; position: absolute; right: -7px; bottom: -4px; background: currentColor; border-radius: 999px; transform: rotate(45deg); transform-origin: left center; }
.text-zoom-panel { min-width: 205px; padding: 12px; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 18px 48px rgba(12, 35, 72, .2); backdrop-filter: blur(12px); }
.text-zoom-panel[hidden] { display: none; }
.text-zoom-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.text-zoom-actions { display: grid; grid-template-columns: 46px minmax(66px, 1fr) 46px; gap: 6px; }
.text-zoom-actions button { min-height: 38px; padding: 5px; color: var(--navy-800); background: #f4f7fb; border: 1px solid #dfe6f0; border-radius: 9px; font-weight: 850; }
.text-zoom-actions button:hover:not(:disabled) { color: #fff; background: var(--blue); border-color: var(--blue); }
.text-zoom-actions button:disabled { opacity: .38; cursor: not-allowed; }
.text-zoom-actions .text-zoom-value { color: var(--blue); background: var(--blue-soft); font-size: .72rem; }

@media (max-width: 1500px) {
    .sale-layout:has(.sale-sheet-wrap) { grid-template-columns: 1fr; }
    .sale-layout:has(.sale-sheet-wrap) .sticky-panel { position: static; }
}

@media (max-width: 720px) {
    .sale-totals-wrap { max-width: none; margin: 0 12px 12px; }
    .sale-sheet-wrap { margin: 8px 12px 0; border: 0; }
    .sale-sheet-header { display: none; }
    .sale-items { display: grid; gap: 5px; }
    .sale-item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; }
    .sale-item-row:first-child { border-top: 1px solid var(--line); }
    .sale-item-row::before { grid-column: 1 / -1; min-height: 0; justify-content: flex-start; }
    .sale-item-row > label, .sale-item-row > .line-total { min-height: 0; padding: 0; border-left: 0; }
    .sale-item-row .item-product { grid-column: 1 / -1; }
    .sale-sheet-field-name { position: static; display: block; width: auto; height: auto; margin-bottom: 2px; overflow: visible; clip: auto; color: #4d5d74; font-size: .62rem; font-weight: 800; white-space: normal; }
    .sale-item-row input, .sale-item-row select { min-height: 40px; }
    .sale-sheet-wrap .smart-select-toggle { width: 36px; height: 36px; }
    .line-total { grid-column: 1; display: grid; justify-content: start; }
    .remove-row { grid-column: 2; justify-self: end; width: 40px; height: 40px; border: 0; border-radius: 4px; }
}

@media (max-width: 978px) {
    .sale-info-sheet-header { display: none; }
    .sale-info-sheet-row, .sale-info-sheet--edit .sale-info-sheet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sale-info-cell { border-right: 0; border-bottom: 1px solid #dce6df; }
    .sale-info-cell:nth-child(2) { border-right: 1px solid #dce6df; }
    .sale-info-cell:last-child { border-bottom: 0; }
    .sale-info-customer { grid-column: 1 / -1; }
    .sale-vat-mode-field { border-right: 1px solid #dce6df; border-bottom: 0; }
    .sale-info-reporter { border-right: 0; }
    .sale-info-sheet--edit .sale-vat-mode-field { grid-column: 1 / -1; border-right: 0; }
    .sale-info-field-name { position: static; display: block; width: auto; height: auto; margin-bottom: 3px; overflow: visible; clip: auto; color: #31553e; font-size: .63rem; font-weight: 850; white-space: normal; }
    .sale-info-cell input, .sale-info-cell select { min-height: 38px; }
    .sale-info-sheet .smart-select-toggle { width: 34px; height: 34px; }
}

@media screen and (max-width: 1920px) {
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-layout { grid-template-columns: minmax(0, 1fr); }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-layout .sticky-panel { position: static; }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-info-sheet-header { display: none; }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-info-sheet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-info-cell { border-right: 0; border-bottom: 1px solid #dce6df; }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-info-customer { grid-column: 1 / -1; }
    :is(html[data-ui-scale="120"], html[data-ui-scale="130"], html[data-ui-scale="140"], html[data-ui-scale="150"], html[data-ui-scale="160"]) .sale-info-field-name { position: static; display: block; width: auto; height: auto; margin-bottom: 3px; overflow: visible; clip: auto; color: #31553e; font-size: .63rem; font-weight: 850; white-space: normal; }
}

@media screen and (max-width: 600px) {
    html[data-ui-scale="130"] .sale-info-sheet-row,
    html[data-ui-scale="140"] .sale-info-sheet-row,
    html[data-ui-scale="150"] .sale-info-sheet-row,
    html[data-ui-scale="160"] .sale-info-sheet-row,
    html[data-ui-scale="130"] .sale-info-sheet--edit .sale-info-sheet-row,
    html[data-ui-scale="140"] .sale-info-sheet--edit .sale-info-sheet-row,
    html[data-ui-scale="150"] .sale-info-sheet--edit .sale-info-sheet-row,
    html[data-ui-scale="160"] .sale-info-sheet--edit .sale-info-sheet-row { grid-template-columns: minmax(0, 1fr); }
    html[data-ui-scale="130"] .sale-info-cell,
    html[data-ui-scale="140"] .sale-info-cell,
    html[data-ui-scale="150"] .sale-info-cell,
    html[data-ui-scale="160"] .sale-info-cell { grid-column: 1; border-right: 0; border-bottom: 1px solid #dce6df; }
    html[data-ui-scale="130"] .sale-info-cell:last-child,
    html[data-ui-scale="140"] .sale-info-cell:last-child,
    html[data-ui-scale="150"] .sale-info-cell:last-child,
    html[data-ui-scale="160"] .sale-info-cell:last-child { border-bottom: 0; }
}

@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .critical-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .sale-layout { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    .return-layout { grid-template-columns: 1fr; }
    .return-layout .sticky-panel { position: static; }
    .return-reason-fields { grid-template-columns: minmax(140px,.55fr) repeat(2,minmax(0,1fr)); }
    .sales-history-header { grid-template-columns: minmax(0, 1fr) auto; }
    .sales-history-toolbar, .sales-history-date-tools { flex-wrap: wrap; }
    .sales-history-selects { flex: 1 1 480px; flex-wrap: wrap; justify-content: flex-start; }
    .sales-history-search-control { flex: 1 1 250px; }
    .sales-history-selects select { width: auto; min-width: 135px; flex: 1 1 150px; }
    .sales-history-actions { margin-left: auto; }
    .sales-quick-filters { flex: 1 1 420px; justify-content: flex-start; }
    .sales-date-range { margin-left: auto; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -280px; width: 258px; transition: left .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
    .sidebar.open { left: 0; }
    .mobile-menu { display: block; }
    .topbar { padding: 15px 20px; }
    .page-content { padding: 20px; }
    .dashboard-grid, .customer-grid, .product-detail-grid, .sale-detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .entity-hero { flex-wrap: wrap; }
    .balance-card { margin-left: 0; }
    .hero-actions.dark-actions { margin-left: auto; }
    .stock-card-grid { grid-template-columns: 1fr; }
    .stock-type-overview { grid-template-columns: 1fr; }
    .critical-analysis-controls { grid-template-columns: 1fr; }
    .critical-analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
    .auth-visual { min-height: 44vh; grid-column: 1; grid-row: 1; }
    .auth-credit { grid-column: 1; grid-row: 1; }
    .auth-form-side { grid-column: 1; grid-row: 2; }
    .auth-message { margin: 55px 0; }
    .auth-message h1 { font-size: clamp(2.2rem, 9vw, 4rem); }
    .document-actions-panel { align-items: flex-start; flex-direction: column; }
    .document-buttons { justify-content: flex-start; }
    .document-share-status { text-align: left; }
    .sale-management-panel, .sale-management-actions { align-items: flex-start; flex-direction: column; }
    .sale-management-actions { width: 100%; }
    .sale-cancel-form { width: 100%; }
    .sale-cancel-form input { width: 100%; }
    .return-reason-fields { grid-template-columns: 1fr; }
    .customer-profit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .topbar { gap: 8px; padding-inline: 14px; }
    .topbar > div:not(.top-actions) { min-width: 0; flex: 1; }
    .topbar .eyebrow, .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .top-actions { gap: 7px; }
    .top-actions > .button-primary { padding-inline: 11px; }
}

@media (max-width: 650px) {
    .critical-stock-analysis-dialog { padding: 16px; }
    .critical-analysis-summary { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
    .topbar { gap: 8px; padding: 12px 14px; }
    .topbar > div:not(.top-actions) { min-width: 0; flex: 1; }
    .topbar .eyebrow, .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar h1 { font-size: 1.1rem; }
    .top-actions { gap: 7px; }
    .top-actions > .button-primary { padding-inline: 11px; }
    .top-actions .language-switcher { gap: 1px; padding: 3px; }
    .top-actions .language-option { min-width: 29px; min-height: 32px; padding: 3px 5px; }
    .auth-language-switcher { top: 10px; right: 10px; }
    .notification-button { width: 44px; padding: 0; }
    .page-content { padding: 14px; }
    .hero-panel { min-height: 260px; align-items: flex-start; flex-direction: column; }
    .hero-actions { margin-top: auto; width: 100%; }
    .hero-actions .button { flex: 1; }
    .kpi-grid, .summary-row, .critical-strip, .option-grid { grid-template-columns: 1fr; }
    .customer-profit-summary { grid-template-columns: 1fr; }
    .responsive-header { align-items: flex-start; flex-direction: column; }
    .toolbar, .search-form { width: 100%; }
    .spreadsheet-panel .toolbar, .spreadsheet-panel .filter-form { justify-content: flex-start; }
    .sheet-view-controls { width: 100%; }
    .sales-history-header { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px 12px; }
    .product-info-readonly { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .product-info-readonly > div:last-child { grid-column: auto; }
    .sales-history-copy { min-width: 0; flex: none; }
    .sales-view-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-self: stretch; }
    .sales-view-tab { min-width: 0; min-height: 42px; padding: 7px 4px; white-space: normal; }
    .sales-history-filters { width: 100%; gap: 8px; }
    .sales-history-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .sales-history-selects { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .sales-history-actions { width: 100%; gap: 7px; }
    .sales-history-search-control { width: 100%; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .sales-history-search-control input[type="search"], .sales-history-search-submit, .sales-history-selects select { width: 100%; min-width: 0; min-height: 42px; }
    .sales-history-actions { flex-wrap: wrap; margin-left: 0; }
    .sales-history-actions .sales-lines-all-toggle { min-height: 42px; }
    .sales-history-actions .sheet-view-controls { width: auto; min-width: 0; flex: 1 1 205px; }
    .sales-history-new { flex: 1 0 auto; }
    .sales-history-date-tools { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 7px; }
    .sales-quick-filters { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
    .sales-quick-filter { min-width: 0; min-height: 42px; padding-inline: 4px; white-space: normal; text-align: center; }
    .sales-date-range { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 8px minmax(0, 1fr); align-items: end; gap: 4px; margin-left: 0; padding: 5px; }
    .sales-date-field input { width: 100%; min-width: 0; min-height: 42px; }
    .sales-date-separator { text-align: center; }
    .sales-date-apply { min-height: 42px; grid-column: 1 / 3; }
    .sales-date-clear { min-height: 42px; grid-column: 3; }
    .search-form input[type="search"] { min-width: 0; flex: 1; }
    .form-grid, .form-grid.three-cols { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .customer-type-options { grid-template-columns: 1fr; }
    .sale-header-card { align-items: flex-start; flex-direction: column; }
    .sale-cancel-form { align-items: stretch; flex-direction: column; }
    .return-page-heading { align-items: flex-start; }
    .return-impact-banner { grid-template-columns: 42px minmax(0,1fr); padding: 14px; }
    .return-impact-icon { width: 40px; height: 40px; border-radius: 11px; }
    .sale-total-hero { margin-left: 0; text-align: left; }
    .notice-banner { grid-template-columns: 45px 1fr; }
    .notice-meta { grid-column: span 2; justify-items: start; }
    .auth-visual { display: none; }
    .auth-credit { grid-column: 1; grid-row: 1; margin: 0 80px 18px 18px; color: #607089; font-size: .68rem; }
    .auth-credit a:hover, .auth-credit a:focus-visible { color: var(--blue); }
    .auth-credit a:focus-visible { outline-color: rgba(37,139,232,.28); }
    .auth-form-side { min-height: 100vh; grid-column: 1; grid-row: 1; padding: 18px; }
    .auth-shell.has-auth-credit .auth-form-side { padding-bottom: 84px; }
    .install-shell { padding: 12px; }
    .archive-hero { align-items: flex-start; flex-direction: column; }
    .archive-count { min-width: 110px; }
    .archive-banner { grid-template-columns: 42px 1fr; }
    .archive-banner > a { grid-column: span 2; }
    .stock-type-link { grid-template-columns: 44px minmax(0,1fr); }
    .stock-type-link b { grid-column: 2; justify-self: start; }
    .text-zoom-control { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); flex-direction: column; align-items: flex-end; gap: 8px; }
    .text-zoom-trigger { width: clamp(44px, 12vw, 52px); height: clamp(44px, 12vw, 52px); border-radius: 14px; }
    .text-zoom-panel { width: min(240px, calc(var(--ui-viewport-width, 100vw) - 24px)); min-width: 0; max-height: calc(var(--ui-viewport-height, 100dvh) - 84px); overflow-y: auto; }
    .text-zoom-actions { grid-template-columns: 44px minmax(0, 1fr) 44px; }
    .pwa-toast { right: 14px; bottom: 74px; }
    .pwa-install-notice { width: calc(var(--ui-viewport-width, 100vw) - 24px); grid-template-columns: 42px minmax(0, 1fr) 30px; gap: 10px; bottom: 12px; padding: 12px; border-radius: 15px; }
    .pwa-install-notice-icon { width: 42px; height: 42px; border-radius: 12px; }
    .pwa-install-notice-action { grid-column: 2 / 4; width: 100%; }
    .pwa-install-notice-close { grid-column: 3; grid-row: 1; }
}

@media (max-width: 350px) {
    .sales-history-actions .sheet-view-controls { flex-basis: 230px; flex-shrink: 0; }
}

/* Management reports: local, dependency-free charts and accessible data tables. */
.reports-page { display: grid; gap: 22px; }
.report-mode-tabs { display: flex; flex-wrap: wrap; gap: 9px; }
.report-mode-tabs .button { min-width: 135px; }
.report-focus-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.report-filter-panel { overflow: visible; }
.report-filter-summary { max-width: 560px; padding: 7px 11px; color: #42617d; background: var(--blue-soft); border: 1px solid #cfe5fb; border-radius: 999px; font-size: .72rem; font-weight: 750; line-height: 1.35; text-align: right; }
.report-filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); align-items: end; gap: 14px; padding: 18px 20px 20px !important; }
.report-filter-form label { min-width: 0; }
.report-filter-form [hidden] { display: none !important; }
.report-filter-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.report-filter-actions .button { flex: 1; }
.report-filter-warning { margin: 0 20px 18px; padding: 10px 12px; color: #7d520a; background: var(--amber-soft); border: 1px solid #f1d49d; border-radius: 10px; font-size: .7rem; font-weight: 750; }

.report-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-kpi-card { min-height: 150px; display: flex; flex-direction: column; }
.report-kpi-card > small { min-height: 20px; }
.report-kpi-card.accent-blue::before { background: var(--blue); }
.report-kpi-change { width: fit-content; display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding: 4px 7px; border-radius: 7px; font-size: .65rem; font-weight: 800; }
.report-kpi-change.is-positive { color: #087441; background: var(--green-soft); }
.report-kpi-change.is-negative { color: #a31c24; background: var(--red-soft); }
.report-kpi-change.is-neutral { color: #5f6e82; background: #f0f3f7; }

.report-inventory-panel { min-width: 0; overflow: hidden; }
.report-inventory-content { min-width: 0; display: grid; gap: 14px; padding: 18px 20px 20px; }
.report-inventory-cost { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; padding: 18px 20px; color: #fff; background: linear-gradient(110deg, #102441, #17619d); border-radius: 13px; }
.report-inventory-cost > span { width: 100%; color: #cfe5fb; font-size: .75rem; font-weight: 800; }
.report-inventory-cost > strong { min-width: 0; font-size: clamp(1.45rem, 3vw, 2.1rem); letter-spacing: -.035em; overflow-wrap: anywhere; }
.report-inventory-cost > small { color: #e5f2ff; font-size: .7rem; font-weight: 700; }
.report-inventory-tiers { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-inventory-tier { min-width: 0; padding: 15px 16px; background: #f9fbfe; border: 1px solid var(--line); border-radius: 12px; }
.report-inventory-tier h4 { margin: 0 0 12px; font-size: .85rem; }
.report-inventory-tier dl { display: grid; gap: 9px; margin: 0 0 11px; }
.report-inventory-tier dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.report-inventory-tier dt { color: var(--muted); font-size: .7rem; font-weight: 750; }
.report-inventory-tier dd { margin: 0; font-size: .86rem; font-weight: 850; overflow-wrap: anywhere; }
.report-inventory-tier > small { color: var(--muted); font-size: .66rem; font-weight: 700; }
.report-inventory-warning { width: 100%; margin: 4px 0 0; color: #a06109; font-size: .67rem; font-weight: 750; line-height: 1.4; }
.report-inventory-cost .report-inventory-warning { color: #ffe7a8; }
.report-inventory-method { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }

.report-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.report-section-heading h2 { margin-bottom: 2px; font-size: 1.22rem; }
.report-section-heading p { margin: 0; color: var(--muted); font-size: .76rem; }
.report-insights { min-width: 0; }
.report-insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-insight-card { min-width: 0; min-height: 102px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 11px; padding: 15px; background: linear-gradient(145deg, #fff, #f8fbff); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 20px rgba(20, 43, 76, .04); }
.report-insight-number { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--navy-800), #2469ce); border-radius: 10px; font-weight: 850; }
.report-insight-card small, .report-insight-card strong { display: block; }
.report-insight-card small { margin-bottom: 3px; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.report-insight-card strong { overflow-wrap: anywhere; font-size: .88rem; line-height: 1.35; }
.report-insight-card p { margin: 5px 0 0; color: var(--muted); font-size: .7rem; }

.report-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.report-chart-panel { min-width: 0; }
.report-chart-panel > .panel-header { background: linear-gradient(180deg, #fff, #fbfcfe); }
.report-recommended, .report-chart-unit { flex: 0 0 auto; padding: 5px 8px; color: #17619d; background: var(--blue-soft); border: 1px solid #cfe5fb; border-radius: 8px; font-size: .64rem; font-weight: 850; white-space: nowrap; }
.report-chart-unit { color: #59677c; background: #f3f5f8; border-color: #e1e6ed; letter-spacing: .05em; }
.report-empty-state { min-height: 124px; display: grid; place-items: center; }

.report-ranking { margin: 0; padding: 4px 18px 12px; list-style: none; }
.report-rank-item { min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #edf0f5; }
.report-rank-item:last-child { border-bottom: 0; }
.report-rank-number { width: 27px; height: 27px; display: grid; place-items: center; color: #60718e; background: #eef3f9; border-radius: 8px; font-size: .68rem; font-weight: 850; }
.report-rank-content { min-width: 0; display: grid; gap: 5px; }
.report-rank-copy, .report-rank-meta { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-rank-copy a, .report-rank-copy > strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: .78rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.report-rank-copy a:hover { color: var(--blue); text-decoration: underline; }
.report-rank-copy > span { flex: 0 0 auto; font-size: .75rem; font-weight: 850; }
.report-rank-meta { color: var(--muted); font-size: .62rem; font-weight: 700; }
.report-rank-track { height: 7px; overflow: hidden; background: #edf1f6; border-radius: 999px; }
.report-rank-bar { width: var(--bar-size, 0%); height: 100%; display: block; border-radius: inherit; transition: width .25s ease; }
.report-rank-bar.customer-bar { background: linear-gradient(90deg, #2469ce, #3c9bea); }
.report-rank-bar.product-bar { background: linear-gradient(90deg, #087744, #20ad66); }

.report-wide-chart { width: 100%; }
.report-chart-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }
.report-chart-scroll:focus-visible { outline: 3px solid rgba(37,139,232,.22); outline-offset: -3px; }
.report-column-chart { min-width: 760px; height: 265px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(54px, 1fr); align-items: end; gap: 12px; margin: 0; padding: 19px 20px 17px; list-style: none; }
.report-column-chart.compact-chart { min-width: 620px; height: 300px; }
.report-month-column { min-width: 0; height: 100%; display: grid; grid-template-rows: 34px minmax(115px, 1fr) 24px; align-items: end; gap: 6px; text-align: center; }
.report-month-column > strong { overflow: hidden; color: #334158; font-size: .62rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.report-month-column > small { align-self: center; color: #65738a; font-size: .63rem; font-weight: 750; white-space: nowrap; }
.report-column-track { width: min(34px, 72%); height: 100%; display: flex; align-items: flex-end; justify-self: center; overflow: hidden; background: linear-gradient(180deg, #f4f7fa, #edf2f7); border: 1px solid #e2e8ef; border-radius: 8px 8px 3px 3px; }
.report-column-bar { width: 100%; height: var(--bar-size, 0%); min-height: 2px; display: block; background: linear-gradient(180deg, #3ca4f4, #2469ce); border-radius: 7px 7px 2px 2px; }
.report-column-bar.product-column-bar { background: linear-gradient(180deg, #2bbd72, #087744); }
.report-chart-legend { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.report-chart-legend > span { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 800; }
.report-chart-legend i { width: 10px; height: 10px; display: inline-block; background: var(--green); border-radius: 3px; }
.report-chart-legend small { font-size: .65rem; text-align: right; }

.report-cost-coverage { display: grid; gap: 9px; margin: 15px 18px 5px; padding: 12px 13px; border: 1px solid; border-radius: 11px; }
.report-cost-coverage.is-warning { color: #7d520a; background: var(--amber-soft); border-color: #f1d49d; }
.report-cost-coverage.is-complete { color: #087441; background: var(--green-soft); border-color: #bdebd4; }
.report-cost-coverage strong, .report-cost-coverage small { display: block; }
.report-cost-coverage strong { font-size: .72rem; }
.report-cost-coverage small { margin-top: 2px; color: inherit; opacity: .86; font-size: .64rem; }
.report-coverage-track { height: 5px; overflow: hidden; background: rgba(255,255,255,.72); border-radius: 999px; }
.report-coverage-track span { width: var(--coverage-size, 0%); height: 100%; display: block; background: currentColor; border-radius: inherit; }
.report-profit-chart { display: grid; gap: 9px; margin: 0; padding: 15px 18px 18px; list-style: none; }
.report-profit-row { min-width: 0; display: grid; grid-template-columns: 55px minmax(80px, 1fr) minmax(90px, auto); align-items: center; gap: 9px; }
.report-profit-row > span { color: #647188; font-size: .65rem; font-weight: 750; }
.report-profit-row > strong { font-size: .69rem; text-align: right; white-space: nowrap; }
.report-profit-track { height: 8px; overflow: hidden; background: #edf1f5; border-radius: 999px; }
.report-profit-track > span { width: var(--bar-size, 0%); height: 100%; display: block; border-radius: inherit; }
.report-profit-track .is-profit { background: linear-gradient(90deg, #087744, #20ad66); }
.report-profit-track .is-loss { background: linear-gradient(90deg, #b91f28, #e34850); }

.report-data-notices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.report-data-notices-single { grid-template-columns: 1fr; }
.report-data-notices article { min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 11px; padding: 14px 16px; color: #6f4c10; background: var(--amber-soft); border: 1px solid #f1d49d; border-radius: 13px; }
.report-data-notices .notice-icon { width: 36px; height: 36px; background: var(--amber); }
.report-data-notices .report-info-icon { background: var(--blue); }
.report-data-notices article:last-child { color: #27577f; background: var(--blue-soft); border-color: #cfe5fb; }
.report-data-notices strong { display: block; margin-top: 1px; font-size: .76rem; }
.report-data-notices p { margin: 3px 0 0; font-size: .68rem; line-height: 1.45; }

.report-tables { min-width: 0; display: grid; gap: 18px; }
.report-table-panel { min-width: 0; }
.report-table-panel .spreadsheet-table { min-width: 940px; }
.report-table-panel .status { margin-left: 5px; }

@media (max-width: 1180px) {
    .report-focus-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .report-section-grid, .report-data-notices { grid-template-columns: 1fr; }
    .report-inventory-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-summary { max-width: 100%; text-align: left; }
}

@media (max-width: 650px) {
    .reports-page { gap: 16px; }
    .report-focus-summary { grid-template-columns: 1fr; }
    .report-mode-tabs .button { flex: 1 1 145px; }
    .report-filter-form, .report-kpi-grid, .report-insight-grid { grid-template-columns: 1fr; }
    .report-inventory-content { padding: 14px; }
    .report-inventory-tiers { grid-template-columns: 1fr; }
    .report-filter-actions { width: 100%; }
    .report-filter-actions .button { min-width: 0; }
    .report-filter-summary { width: 100%; border-radius: 10px; }
    .report-kpi-card { min-height: 135px; }
    .report-section-heading { align-items: flex-start; flex-direction: column; }
    .report-chart-panel > .panel-header { align-items: flex-start; }
    .report-recommended, .report-chart-unit { margin-left: auto; }
    .report-ranking { padding-inline: 12px; }
    .report-rank-item { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
    .report-rank-copy > span { font-size: .68rem; }
    .report-column-chart { min-width: 680px; }
    .report-analysis-grid .report-column-chart { min-width: 600px; }
    .report-chart-legend { align-items: flex-start; flex-direction: column; }
    .report-chart-legend small { text-align: left; }
    .report-profit-row { grid-template-columns: 46px minmax(70px, 1fr) minmax(82px, auto); gap: 7px; }
    .report-profit-row > strong { font-size: .62rem; }
    .report-data-notices article { padding: 13px; }
}

/* Supplier current-account screens. */
.stock-purchase-fields { display: grid; gap: 13px; padding: 15px; background: linear-gradient(145deg, #fffaf1, #fff); border: 1px solid #efd9ac; border-radius: 13px; }
.stock-purchase-fields[hidden] { display: none; }
.stock-purchase-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; }
.stock-purchase-heading strong, .stock-purchase-heading small { display: block; }
.stock-purchase-heading strong { color: #62430f; font-size: .78rem; }
.stock-purchase-heading small { margin-top: 2px; color: #7b694a; font-size: .65rem; line-height: 1.35; }
.stock-purchase-symbol { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #a56308, #d6931c); border-radius: 11px; font-weight: 900; }
.stock-purchase-summary { display: grid; gap: 8px; padding: 12px 13px; color: #62430f; background: rgba(255,255,255,.86); border: 1px solid #ead9b7; border-radius: 11px; }
.stock-purchase-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stock-purchase-summary span { color: #826b44; font-size: .66rem; font-weight: 750; }
.stock-purchase-summary strong { font-size: .76rem; text-align: right; }
.stock-purchase-summary .stock-purchase-total { padding-top: 8px; border-top: 1px dashed #dfc899; }
.stock-purchase-summary .stock-purchase-total strong { color: #9e252c; font-size: 1.05rem; }
.stock-purchase-summary > small { color: #78684e; font-size: .62rem; line-height: 1.4; }
.stock-purchase-currency-note, .stock-purchase-currency-warning { margin: 0; padding: 9px 10px; border-radius: 9px; font-size: .63rem; font-weight: 700; line-height: 1.4; }
.stock-purchase-currency-note { color: #5f5136; background: #fffdf8; border: 1px dashed #dec99e; }
.stock-purchase-currency-warning { color: #94222a; background: var(--red-soft); border: 1px solid #efc9cc; }
.stock-purchase-currency-warning[hidden] { display: none; }
.stock-out-note { margin: 0; padding: 10px 12px; color: #35617e; background: var(--blue-soft); border: 1px solid #cfe5fb; border-radius: 10px; font-size: .68rem; font-weight: 700; line-height: 1.4; }
.product-movement-purchase-table { min-width: 1420px !important; }
.supplier-movement-link, .movement-debt-values { display: inline-grid; gap: 2px; }
.supplier-movement-link strong, .movement-debt-values strong { font-size: .71rem; }
.supplier-movement-link small, .movement-debt-values small { font-size: .6rem; }
.supplier-movement-link:hover strong { color: var(--blue); text-decoration: underline; }

.supplier-page { min-width: 0; display: grid; gap: 20px; }
.supplier-statement-header { align-items: flex-start; }
.supplier-statement-tools { margin-left: auto; display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.supplier-statement-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 7px; }
.supplier-statement-filter label { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.supplier-statement-filter input[type="date"] { min-height: 34px; width: 145px; padding: 5px 8px; border: 1px solid #d9e1ed; border-radius: 9px; background: #fff; color: var(--ink); }
.supplier-statement-actions { position: relative; z-index: 4; }
.supplier-statement-actions > summary { list-style: none; cursor: pointer; }
.supplier-statement-actions > summary::-webkit-details-marker { display: none; }
.supplier-statement-action-menu { position: absolute; right: 0; top: calc(100% + 6px); width: min(310px, calc(var(--ui-viewport-width, 100vw) * .82)); display: grid; gap: 2px; padding: 7px; border: 1px solid #d9e1ed; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.supplier-statement-action-menu a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--navy-800); font-weight: 700; white-space: nowrap; }
.supplier-statement-action-menu a:hover { background: var(--blue-soft); }
.supplier-statement-action-menu small { padding: 7px 10px; white-space: normal; line-height: 1.35; }
.supplier-statement-filter-note { margin: 0; padding: 8px 18px; color: #9a6200; background: #fff7e8; font-size: .78rem; }
@media (max-width: 900px) { .supplier-statement-tools { width: 100%; justify-content: flex-start; margin-left: 0; } }
.supplier-page .summary-row, .supplier-page .entity-hero, .supplier-page .archive-hero, .supplier-page .archive-banner { margin-bottom: 0; }
.supplier-summary-overview { min-width: 0; display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); align-items: stretch; gap: 13px; }
.supplier-total-card { min-height: 100%; }
.supplier-currency-summary-list { min-width: 0; display: grid; gap: 12px; }
.supplier-currency-summary { min-width: 0; padding: 12px; background: linear-gradient(145deg, #f8fbfa, #fff); border: 1px solid #d7e7df; border-radius: 14px; }
.supplier-currency-summary[data-supplier-currency-summary="USD"] { background: linear-gradient(145deg, #f6faff, #fff); border-color: #d6e4f2; }
.supplier-currency-summary > header { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.supplier-currency-summary > header div { min-width: 0; display: grid; gap: 1px; }
.supplier-currency-summary > header strong { color: #28374c; font-size: .73rem; }
.supplier-currency-summary > header small { color: var(--muted); font-size: .62rem; }
.supplier-summary-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.supplier-summary-row .summary-card small, .supplier-detail-summary .summary-card small, .supplier-archive-summary .summary-card small { display: block; margin-top: 2px; font-size: .67rem; }
.supplier-payable-summary { color: #9e252c; background: linear-gradient(145deg, #fff, #fff7f7); border-color: #f0d5d7; }
.supplier-payable-summary span, .supplier-payable-summary small { color: #8d5660; }
.supplier-overdue-summary { color: #a31c24; background: linear-gradient(145deg, #fff, #fff3f4); border-color: #efd0d3; }
.supplier-overdue-summary span, .supplier-overdue-summary small { color: #8e545b; }
.supplier-today-summary { color: #8b5a08; background: linear-gradient(145deg, #fff, #fff9ec); border-color: #eed9ad; }
.supplier-today-summary span, .supplier-today-summary small { color: #806b43; }
.summary-card.has-due-alert { box-shadow: inset 0 0 0 1px currentColor, 0 9px 24px rgba(164,36,43,.08); }
.supplier-advance-summary { color: #17619d; background: linear-gradient(145deg, #fff, #f4f9ff); border-color: #d4e6f7; }
.supplier-advance-summary span, .supplier-advance-summary small { color: #51708c; }
.supplier-avatar { color: #087744; background: var(--green-soft); }
.supplier-avatar.is-archived { color: #fff; background: linear-gradient(145deg, #69778a, #384456); }
.supplier-currency-badge, .supplier-inline-currency { width: fit-content; display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; color: #0b6f45; background: #e8f8f0; border: 1px solid #bfe8d2; border-radius: 999px; font-size: .58rem; font-weight: 900; line-height: 1; letter-spacing: .03em; vertical-align: middle; white-space: nowrap; }
.supplier-currency-badge.is-hero { margin-left: 5px; transform: translateY(-2px); }
.supplier-inline-currency { margin-left: 4px; color: #17619d; background: var(--blue-soft); border-color: #cfe5fb; }
.supplier-contact, .supplier-count-pair, .supplier-created-by { display: inline-grid; gap: 1px; }
.supplier-contact strong, .supplier-count-pair b, .supplier-created-by strong { font-size: .74rem; }
.supplier-contact small, .supplier-count-pair small, .supplier-created-by small { font-size: .63rem; }
.supplier-count-pair { justify-items: end; }
.supplier-table .supplier-list-actions { gap: 5px; flex-wrap: nowrap; }
.supplier-table .supplier-list-actions > * { flex: none; }
.supplier-table .supplier-list-actions .supplier-list-action-open { color: #12774b; background: #eef9f2; border-color: #c7e6d1; }
.supplier-table .supplier-list-actions .supplier-list-action-open:hover { color: #0b653e; background: #def2e5; border-color: #76bd91; }
.supplier-table .supplier-list-actions .supplier-archive-lock { color: #8a6b35; background: #f8f3e9; border-color: #e7d8b9; cursor: help; }
.spreadsheet-panel.is-excel-view .supplier-table th:last-child { min-width: 140px; }
.supplier-list-due { min-width: 95px; display: inline-grid; gap: 2px; padding: 5px 7px; border: 1px solid; border-radius: 8px; }
.supplier-list-due strong { font-size: .66rem; }
.supplier-list-due small { font-size: .59rem; }
.supplier-list-due.is-overdue { color: #a31c24; background: var(--red-soft); border-color: #efc9cc; }
.supplier-list-due.is-due-today { color: #865909; background: var(--amber-soft); border-color: #efd59e; }
.supplier-list-due.is-upcoming { color: #17619d; background: var(--blue-soft); border-color: #cfe5fb; }
.supplier-page .search-form { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; }
.supplier-page .search-form input[type="search"] { flex: 1 1 230px; }
.supplier-archive-lock { color: #8a6b35; font-size: .66rem; font-weight: 750; cursor: help; }
.supplier-dialog { width: min(700px, calc(var(--ui-viewport-width, 100vw) - 28px)); }
.supplier-dialog .dialog-header p { margin: 3px 0 0; color: var(--muted); font-size: .74rem; }

.supplier-detail-grid { grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); }
.supplier-entity-hero.is-archived { background: linear-gradient(145deg, #fff, #f4f6f9); border-color: #d7dee8; }
.supplier-balance-card { flex: 0 0 auto; }
.supplier-balance-advance { color: #17619d; background: var(--blue-soft); }
.supplier-hero-actions { flex-wrap: wrap; justify-content: flex-end; }
.supplier-hero-actions form { margin: 0; }
.supplier-archive-disabled { max-width: 175px; display: grid; gap: 3px; justify-items: stretch; }
.supplier-archive-disabled .button:disabled { cursor: not-allowed; }
.supplier-archive-disabled small { font-size: .58rem; line-height: 1.25; text-align: center; }
.supplier-archive-banner { margin-bottom: 0; }
.supplier-archive-overview { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.supplier-archive-currency-card > span { display: flex; align-items: center; gap: 6px; }
.supplier-detail-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.supplier-detail-summary .summary-card { min-height: 104px; }
.supplier-due-alert { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid; border-radius: 14px; }
.supplier-due-alert.is-overdue { color: #8f2027; background: #fff4f5; border-color: #efc9cc; }
.supplier-due-alert.is-due-today { color: #7c550d; background: #fff9eb; border-color: #efd59e; }
.supplier-due-alert-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: currentColor; border-radius: 12px; font-size: 1rem; font-weight: 900; }
.supplier-due-alert strong { font-size: .8rem; }
.supplier-due-alert p { margin: 3px 0 0; color: inherit; opacity: .84; font-size: .68rem; line-height: 1.4; }
.supplier-open-purchases-panel { min-width: 0; }
.supplier-open-total { padding: 6px 9px; color: #755213; background: var(--amber-soft); border: 1px solid #efd59e; border-radius: 8px; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.supplier-open-purchase-table { min-width: 1320px !important; }
.supplier-open-purchase-row { box-shadow: inset 3px 0 0 #5f7b9b; }
.supplier-open-purchase-row.is-overdue { box-shadow: inset 3px 0 0 var(--red); }
.supplier-open-purchase-row.is-due-today { box-shadow: inset 3px 0 0 var(--amber); }
.supplier-purchase-source { min-width: 180px; max-width: 330px; display: inline-grid; gap: 2px; }
.supplier-purchase-source strong { overflow-wrap: anywhere; font-size: .71rem; }
.supplier-purchase-source small { color: var(--muted); font-size: .61rem; }
.supplier-due-status, .supplier-payment-state { width: fit-content; display: inline-flex; align-items: center; margin: 1px 3px 1px 0; padding: 4px 7px; border: 1px solid; border-radius: 999px; font-size: .6rem; font-weight: 850; white-space: nowrap; }
.supplier-due-status.is-overdue { color: #a31c24; background: var(--red-soft); border-color: #efc9cc; }
.supplier-due-status.is-due-today { color: #865909; background: var(--amber-soft); border-color: #efd59e; }
.supplier-due-status.is-upcoming, .supplier-due-status.is-open { color: #17619d; background: var(--blue-soft); border-color: #cfe5fb; }
.supplier-due-status.is-no-due { color: #536178; background: #f1f4f8; border-color: #dfe5ec; }
.supplier-due-status.is-partial, .supplier-payment-state.is-partial { color: #7a570e; background: #fff9e9; border-color: #efd9a7; }
.supplier-due-status.is-paid, .supplier-payment-state.is-paid { color: #087441; background: var(--green-soft); border-color: #bdebd4; }
.supplier-payment-state { color: #536178; background: #f1f4f8; border-color: #dfe5ec; }
.supplier-pay-now { color: #087441; border-color: #bdebd4; }
.supplier-side-stack { min-width: 0; }
.supplier-action-card { scroll-margin-top: 110px; }
.supplier-action-card > .panel-header { background: linear-gradient(180deg, #fff, #fafcff); }
.supplier-action-symbol { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; color: #fff; border-radius: 10px; font-size: .78rem; font-weight: 900; }
.supplier-action-symbol.purchase-symbol { background: linear-gradient(145deg, #a56308, #d6931c); }
.supplier-action-symbol.payment-symbol { background: linear-gradient(145deg, #087744, #1cab63); }
.supplier-action-symbol.return-symbol { background: linear-gradient(145deg, #8d2832, #c84b58); }
.supplier-transaction-row.is-return { box-shadow: inset 3px 0 0 #138255; }
.supplier-transaction-row.is-opening { box-shadow: inset 3px 0 0 var(--blue); }
.supplier-action-currency { width: auto; min-width: 40px; padding-inline: 7px; font-size: .6rem; letter-spacing: .02em; }
.supplier-method-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.supplier-method-fieldset legend { margin-bottom: 7px; color: #37445a; font-size: .76rem; font-weight: 750; }
.supplier-form-note { padding: 8px 10px; color: #516276; background: #f5f8fb; border: 1px solid #e1e7ee; border-radius: 9px; font-size: .65rem; line-height: 1.4; }
#supplier-edit { scroll-margin-top: 110px; }
.supplier-transaction-table { min-width: 1620px !important; }
.supplier-transaction-description { min-width: 190px; max-width: 380px; display: grid; gap: 2px; overflow-wrap: anywhere; white-space: normal; line-height: 1.4; }
.supplier-transaction-description strong { font-size: .7rem; }
.supplier-transaction-description small { color: var(--muted); font-size: .6rem; }
.supplier-transaction-date { display: inline-grid; gap: 2px; }
.supplier-transaction-date strong { font-size: .7rem; }
.supplier-transaction-date small { color: #85620e; font-size: .56rem; font-weight: 800; white-space: normal; }
.supplier-transaction-date small.is-future-import { color: #a31c24; }
.supplier-import-provenance { display: grid; justify-items: start; gap: 3px; margin-top: 4px; }
.supplier-import-provenance small { color: #58677b; font-size: .56rem; line-height: 1.3; }
.supplier-import-badge { width: fit-content; display: inline-flex; align-items: center; padding: 3px 6px; color: #17619d; background: var(--blue-soft); border: 1px solid #cfe5fb; border-radius: 999px; font-size: .55rem; font-weight: 850; line-height: 1; }
.supplier-hero-import { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #607086; font-size: .61rem; }
.supplier-transaction-row.is-purchase { box-shadow: inset 3px 0 0 var(--amber); }
.supplier-transaction-row.is-payment { box-shadow: inset 3px 0 0 var(--green); }
.spreadsheet-panel.is-excel-view .supplier-transaction-row.is-purchase td:nth-child(2) { border-left: 3px solid var(--amber); }
.spreadsheet-panel.is-excel-view .supplier-transaction-row.is-payment td:nth-child(2) { border-left: 3px solid var(--green); }
.badge-purchase { color: #8b5a08; background: var(--amber-soft); border: 1px solid #f1d49d; }
.supplier-readonly-card { min-width: 0; }
.supplier-detail-list { display: grid; margin: 0; padding: 18px 20px; }
.supplier-detail-list > div { min-width: 0; display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.supplier-detail-list > div:last-child { border-bottom: 0; }
.supplier-detail-list dt { color: var(--muted); }
.supplier-detail-list dd { max-width: 65%; margin: 0; overflow-wrap: anywhere; font-weight: 750; text-align: right; }
.supplier-readonly-label { font-size: 1.15rem !important; letter-spacing: -.02em !important; }

@media (max-width: 1180px) {
    .supplier-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .supplier-detail-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .supplier-detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
    .supplier-entity-hero { flex-wrap: wrap; }
    .supplier-hero-actions { width: 100%; }
}

@media (max-width: 900px) {
    .supplier-summary-overview { grid-template-columns: 1fr; }
    .supplier-total-card { min-height: 100px; }
    .supplier-detail-grid { grid-template-columns: 1fr; }
    .supplier-detail-grid .span-2 { grid-column: auto; }
    .supplier-side-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .supplier-side-stack > :last-child { grid-column: span 2; }
    .supplier-due-alert { grid-template-columns: 42px minmax(0, 1fr); }
    .supplier-due-alert .button { grid-column: 2; justify-self: start; }
}

@media (max-width: 650px) {
    .supplier-page { gap: 15px; }
    .supplier-summary-row, .supplier-detail-summary, .supplier-archive-summary { grid-template-columns: 1fr; }
    .supplier-currency-summary { padding: 10px; }
    .supplier-currency-summary > header { align-items: flex-start; }
    .supplier-side-stack { grid-template-columns: 1fr; }
    .supplier-side-stack > :last-child { grid-column: auto; }
    .supplier-entity-hero { align-items: flex-start; flex-direction: column; }
    .supplier-balance-card { width: 100%; margin-left: 0; }
    .supplier-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0 !important; }
    .supplier-hero-actions > *, .supplier-hero-actions form, .supplier-hero-actions .button { width: 100%; }
    .supplier-archive-disabled { max-width: none; }
    .supplier-archive-banner { grid-template-columns: 42px minmax(0, 1fr); }
    .supplier-archive-banner > a { grid-column: span 2; width: 100%; }
    .supplier-detail-list > div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .supplier-detail-list dd { max-width: 100%; text-align: left; }
    .stock-purchase-fields { padding: 13px; }
    .stock-purchase-summary > div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .stock-purchase-summary strong { text-align: left; }
    .supplier-due-alert { grid-template-columns: 38px minmax(0, 1fr); padding: 12px; }
    .supplier-due-alert-icon { width: 38px; height: 38px; }
    .supplier-due-alert .button { grid-column: span 2; width: 100%; }
    .supplier-open-purchases-panel .toolbar { align-items: stretch; flex-direction: column; }
    .supplier-open-total { width: 100%; text-align: center; }
}

/* Compact search/filter bars shared only by the primary list screens. */
.spreadsheet-panel > .compact-list-header {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(145px, 215px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
}
.compact-list-copy { min-width: 0; }
.compact-list-copy h3 { margin-bottom: 1px; font-size: .88rem; }
.compact-list-copy p { overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.compact-list-toolbar,
.compact-list-filter,
.compact-list-actions { min-width: 0; display: flex; align-items: center; gap: 6px; }
.spreadsheet-panel .compact-list-toolbar { width: 100%; flex-wrap: nowrap; justify-content: flex-end; }
.compact-list-filter { flex: 0 1 auto; flex-wrap: nowrap; }
.compact-list-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.spreadsheet-panel .compact-list-filter input[type="search"] {
    width: clamp(145px, 13vw, 205px);
    min-width: 0;
    min-height: 34px;
    flex: 0 1 205px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: .7rem;
}
.compact-list-filter select {
    width: clamp(145px, 12vw, 180px);
    min-width: 0;
    min-height: 34px;
    flex: 0 1 180px;
    padding: 5px 26px 5px 9px;
    border-radius: 8px;
    font-size: .7rem;
}
.compact-list-filter .button,
.compact-list-actions > .button {
    min-height: 34px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: .7rem;
}
.compact-list-actions .sheet-view-controls { min-height: 34px; padding: 5px 8px; border-radius: 8px; }

@media (max-width: 1360px) {
    .spreadsheet-panel > .compact-list-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 6px;
        padding-block: 8px;
    }
    .spreadsheet-panel .compact-list-toolbar { flex-wrap: wrap; justify-content: flex-start; }
    .compact-list-filter { flex: 1 1 330px; }
    .compact-list-actions { flex: 0 1 auto; }
}

@media (max-width: 650px) {
    .spreadsheet-panel > .compact-list-header { gap: 7px; padding: 8px; }
    .compact-list-copy p { white-space: normal; }
    .spreadsheet-panel .compact-list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .compact-list-filter {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }
    .compact-list-filter-product { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spreadsheet-panel .compact-list-filter input[type="search"],
    .compact-list-filter select { width: 100%; min-width: 0; min-height: 42px; font-size: .74rem; }
    .compact-list-filter .button,
    .compact-list-actions > .button { min-width: 0; min-height: 42px; font-size: .72rem; line-height: 1.15; text-align: center; white-space: normal; overflow-wrap: anywhere; }
    .compact-list-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
    .compact-list-actions > .button { flex: 1 1 96px; }
    .compact-list-actions .sheet-view-controls { width: auto; min-width: 0; min-height: 42px; flex: 1 1 220px; }
}

@media (max-width: 350px) {
    .compact-list-filter-product { grid-template-columns: minmax(0, 1fr); }
}

/* Treasury: account balances, quick movements and append-only ledger. */
.treasury-page { min-width: 0; display: grid; gap: 22px; }
.treasury-setup-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding: clamp(24px, 4vw, 48px); color: #fff; background: radial-gradient(circle at 10% 10%, rgba(37,139,232,.38), transparent 30%), radial-gradient(circle at 78% 110%, rgba(21,155,88,.32), transparent 38%), linear-gradient(135deg, #07152d, #123b71 72%, #0e5c62); border: 1px solid rgba(130,192,255,.2); border-radius: 24px; box-shadow: 0 25px 60px rgba(7,29,58,.17); }
.treasury-setup-copy { min-width: 0; display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: start; gap: 18px; }
.treasury-setup-copy h2 { margin-bottom: 12px; font-size: clamp(1.7rem, 3.4vw, 2.9rem); }
.treasury-setup-copy p { max-width: 700px; margin-bottom: 14px; color: #c1d2e8; }
.treasury-setup-icon { width: 66px; height: 66px; display: grid; place-items: center; background: linear-gradient(145deg, #258be8, #19a862); border: 1px solid rgba(255,255,255,.24); border-radius: 20px; box-shadow: 0 12px 28px rgba(13,107,183,.28); font-size: 1.55rem; font-weight: 900; }
.treasury-setup-warning { width: fit-content; max-width: 620px; padding: 9px 11px; color: #ffe9b8; background: rgba(147,94,8,.3); border: 1px solid rgba(255,213,125,.28); border-radius: 10px; font-size: .72rem; font-weight: 750; line-height: 1.5; }
.treasury-setup-form { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: clamp(18px, 3vw, 26px); color: var(--ink); background: rgba(255,255,255,.97); border: 1px solid rgba(255,255,255,.7); border-radius: 19px; box-shadow: 0 20px 48px rgba(4,18,39,.22); }
.treasury-setup-form > label:first-of-type, .treasury-setup-form > .button { grid-column: span 2; }
.treasury-maintenance-notice, .treasury-maintenance-confirm { grid-column: span 2; }
.treasury-maintenance-notice { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 9px; padding: 10px 11px; color: #8d2028; background: #fff2f2; border: 1px solid #efc6ca; border-radius: 10px; }
.treasury-maintenance-notice > span { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: #b72932; border-radius: 8px; font-size: .78rem; font-weight: 900; }
.treasury-maintenance-notice p { margin: 0; font-size: .65rem; font-weight: 750; line-height: 1.45; }
.treasury-maintenance-confirm { min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; padding: 9px 10px; color: #27384e; background: #f4f7fa; border: 1px solid #dce4ee; border-radius: 9px; cursor: pointer; }
.treasury-maintenance-confirm input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: var(--green); }
.treasury-maintenance-confirm span { font-size: .65rem; font-weight: 750; line-height: 1.45; }
.treasury-money-input { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.treasury-money-input input { min-width: 0; border-radius: 10px 0 0 10px; }
.treasury-money-input b { min-width: 50px; display: grid; place-items: center; padding: 0 9px; color: #526175; background: #eef2f7; border: 1px solid #d9e1ed; border-left: 0; border-radius: 0 10px 10px 0; font-size: .7rem; }

.treasury-hero { min-height: 155px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(23px, 3.5vw, 38px); color: #fff; overflow: hidden; position: relative; background: radial-gradient(circle at 82% 18%, rgba(21,155,88,.38), transparent 28%), linear-gradient(125deg, #0b1d3a, #123f77 66%, #0d5d61); border-radius: 22px; box-shadow: 0 21px 50px rgba(7,29,58,.14); }
.treasury-hero::after { content: "₼"; position: absolute; right: 8%; top: -48%; color: rgba(255,255,255,.045); font-size: 15rem; font-weight: 900; pointer-events: none; }
.treasury-hero > * { position: relative; z-index: 1; }
.treasury-hero h2 { margin-bottom: 7px; }
.treasury-hero p { max-width: 720px; margin: 0; color: #bfd0e5; }
.treasury-hero-actions { display: flex; align-items: center; gap: 9px; }

.treasury-currency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.treasury-currency-card { min-width: 0; padding: 19px 20px 17px; background: linear-gradient(145deg, #fff, #f8fbff); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 16px; box-shadow: 0 9px 24px rgba(20,43,76,.05); }
.treasury-currency-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.treasury-currency-card > header > span { padding: 4px 7px; color: #17619d; background: var(--blue-soft); border-radius: 7px; font-size: .65rem; font-weight: 900; letter-spacing: .08em; }
.treasury-currency-balance-label { display: block; margin-top: 8px; font-size: .6rem; font-weight: 750; }
.treasury-currency-card > strong { display: block; margin: 9px 0 14px; font-size: clamp(1.55rem, 2.8vw, 2.25rem); letter-spacing: -.05em; }
.treasury-currency-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: -5px 0 10px; }
.treasury-currency-breakdown > span { min-width: 0; display: grid; gap: 2px; padding: 6px 7px; color: var(--muted); background: #f6f8fb; border: 1px solid #e9edf2; border-radius: 7px; }
.treasury-currency-breakdown small { overflow: hidden; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-currency-breakdown b { overflow: hidden; color: var(--ink); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-currency-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.treasury-currency-flows > span { min-width: 0; display: grid; gap: 2px; padding: 7px 8px; background: #f4f7fa; border-radius: 8px; }
.treasury-currency-flows small { overflow: hidden; font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-currency-flows b { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-currency-flows .is-in b { color: #087441; }
.treasury-currency-flows .is-out b { color: #a31c24; }
.treasury-currency-flows .is-in b.is-correction { color: #a31c24; }
.treasury-currency-flows .is-out b.is-correction { color: #087441; }

.treasury-account-section { min-width: 0; }
.treasury-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.treasury-section-heading h2 { margin-bottom: 2px; font-size: 1.22rem; }
.treasury-section-heading p { margin: 0; color: var(--muted); font-size: .75rem; }
.treasury-account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 13px; }
.treasury-account-card { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 26px; align-items: center; gap: 11px; padding: 14px; position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 14px; box-shadow: 0 7px 20px rgba(20,43,76,.04); }
.treasury-account-card.is-bank { border-left-color: var(--blue); }
.treasury-account-card.is-archived { opacity: .62; filter: grayscale(.25); }
.treasury-account-icon { width: 44px; height: 44px; display: grid; place-items: center; color: #087441; background: var(--green-soft); border-radius: 12px; font-weight: 900; }
.treasury-account-card.is-bank .treasury-account-icon { color: #17619d; background: var(--blue-soft); }
.treasury-account-copy { min-width: 0; }
.treasury-account-copy span, .treasury-account-copy strong, .treasury-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treasury-account-copy span { color: var(--muted); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.treasury-account-copy strong { margin: 2px 0; font-size: .82rem; }
.treasury-account-copy small { font-size: .59rem; }
.treasury-account-balance { min-width: 100px; text-align: right; }
.treasury-account-balance span, .treasury-account-balance strong { display: block; white-space: nowrap; }
.treasury-account-balance span { color: var(--muted); font-size: .57rem; }
.treasury-account-balance strong { font-size: .94rem; }
.treasury-account-archive { margin: 0; }
.treasury-account-archive button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; color: #9b4f57; background: var(--red-soft); border: 0; border-radius: 8px; }
.treasury-account-empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #ccd6e3; border-radius: 14px; }

.treasury-action-panel { overflow: visible; }
.treasury-secure-badge { flex: 0 0 auto; padding: 5px 8px; color: #087441; background: var(--green-soft); border: 1px solid #bdebd4; border-radius: 8px; font-size: .63rem; font-weight: 850; }
.treasury-action-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 6px; background: #eef2f6; border-bottom: 1px solid var(--line); }
.treasury-action-tabs button { min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; color: #617087; background: transparent; border: 0; border-radius: 9px; font-size: .73rem; font-weight: 850; }
.treasury-action-tabs button span { width: 22px; height: 22px; display: grid; place-items: center; background: #dfe6ef; border-radius: 7px; }
.treasury-action-tabs button[aria-selected="true"] { color: var(--navy-900); background: #fff; box-shadow: 0 4px 13px rgba(18,42,76,.1); }
.treasury-action-tabs button[aria-selected="true"] span { color: #fff; background: var(--green); }
.treasury-action-tabs button[data-treasury-action-tab="out"][aria-selected="true"] span { background: var(--red); }
.treasury-action-tabs button[data-treasury-action-tab="expense"][aria-selected="true"] span { background: var(--red); }
.treasury-action-tabs button[data-treasury-action-tab="transfer"][aria-selected="true"] span { background: var(--blue); }
.treasury-action-body[hidden] { display: none !important; }
.treasury-action-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 14px; padding: 20px !important; }
.treasury-action-form > label { min-width: 0; align-content: start; }
.treasury-action-form > label > input, .treasury-action-form > label > select { min-height: 46px; }
.treasury-action-form textarea { min-height: 88px; }
.treasury-action-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.treasury-action-form input[type="number"]::-webkit-inner-spin-button,
.treasury-action-form input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.treasury-form-description { grid-column: 1 / -1; }
.treasury-expense-description { grid-column: 2 / -1; }
.treasury-action-footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.treasury-action-footer .button { min-width: 220px; min-height: 46px; }
.treasury-category-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 0 20px 20px; padding: 14px; background: #f7fafc; border: 1px solid var(--line); border-radius: 12px; }
.treasury-category-inline-form label { min-width: 0; }
.treasury-category-inline-form .button { min-width: 200px; min-height: 46px; }
.treasury-transfer-warning { padding: 9px 11px; color: #a31c24; background: var(--red-soft); border: 1px solid #f2c9cc; border-radius: 9px; font-size: .68rem; font-weight: 750; }
.treasury-category-field { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 42px; }
.treasury-category-field select { min-width: 0; border-radius: 10px 0 0 10px; }
.treasury-category-field button { min-width: 42px; color: #087441; background: var(--green-soft); border: 1px solid #cadad1; border-left: 0; border-radius: 0 10px 10px 0; font-size: 1.1rem; font-weight: 900; }
.treasury-expense-note { margin: 0; padding: 8px 10px; color: #72500e; background: var(--amber-soft); border: 1px solid #f1d49d; border-radius: 9px; font-size: .65rem; line-height: 1.45; }

.treasury-analysis-grid { min-width: 0; display: grid; grid-template-columns: minmax(285px, .48fr) minmax(0, 1.52fr); align-items: start; gap: 18px; }
.treasury-analysis-grid.is-ledger-only { grid-template-columns: minmax(0, 1fr); }
.treasury-expense-list { margin: 0; padding: 8px 16px 14px; list-style: none; }
.treasury-expense-groups { display: grid; }
.treasury-expense-group + .treasury-expense-group { border-top: 1px solid var(--line); }
.treasury-expense-group h4 { margin: 0; padding: 11px 16px 0; color: #17619d; font-size: .66rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.treasury-expense-list li { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid #edf0f5; }
.treasury-expense-list li:last-child { border-bottom: 0; }
.treasury-expense-list li > span { width: 27px; height: 27px; display: grid; place-items: center; color: #60718e; background: #eef3f9; border-radius: 8px; font-size: .66rem; font-weight: 850; }
.treasury-expense-list li > div { min-width: 0; display: grid; gap: 4px; }
.treasury-expense-list strong, .treasury-expense-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treasury-expense-list strong { font-size: .72rem; }
.treasury-expense-list small { font-size: .58rem; }
.treasury-expense-list i { height: 5px; display: block; overflow: hidden; background: #edf1f5; border-radius: 999px; }
.treasury-expense-list i b { width: var(--bar-size, 0%); height: 100%; display: block; background: linear-gradient(90deg, #d8272f, #ee714d); border-radius: inherit; }
.treasury-expense-list li > b { font-size: .7rem; white-space: nowrap; }
.treasury-ledger-panel { min-width: 0; }
.treasury-ledger-panel > .compact-list-header { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); align-items: start; }
.treasury-ledger-toolbar { align-items: flex-end; }
.treasury-filter-form { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; }
.treasury-filter-date { width: 122px; min-width: 0; display: grid; gap: 1px; color: #607089; font-size: .53rem; font-weight: 800; }
.treasury-filter-date input { width: 100%; min-width: 0; min-height: 34px; padding: 5px 7px; border-radius: 8px; font-size: .67rem; }
.treasury-ledger-panel .compact-list-filter select { width: auto; min-width: 120px; max-width: 170px; flex: 1 1 125px; }
.treasury-ledger-table { width: 100%; min-width: 720px !important; table-layout: fixed; }
.treasury-ledger-table th:nth-child(1), .treasury-ledger-table td:nth-child(1) { width: 118px; }
.treasury-ledger-table th:nth-child(3), .treasury-ledger-table td:nth-child(3),
.treasury-ledger-table th:nth-child(4), .treasury-ledger-table td:nth-child(4),
.treasury-ledger-table th:nth-child(5), .treasury-ledger-table td:nth-child(5) { width: 145px; }
.treasury-entry-row.is-in { box-shadow: inset 3px 0 0 var(--green); }
.treasury-entry-row.is-out { box-shadow: inset 3px 0 0 var(--red); }
.treasury-entry-row.is-reversed { opacity: .65; }
.spreadsheet-panel.is-excel-view .treasury-entry-row.is-in td:nth-child(2) { border-left: 3px solid var(--green); }
.spreadsheet-panel.is-excel-view .treasury-entry-row.is-out td:nth-child(2) { border-left: 3px solid var(--red); }
.treasury-entry-account, .treasury-reference, .treasury-entry-description, .treasury-entry-user { min-width: 0; display: grid; gap: 2px; }
.treasury-entry-account strong, .treasury-reference strong, .treasury-entry-description strong, .treasury-entry-user strong { max-width: 240px; overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-entry-account small, .treasury-reference small, .treasury-entry-description small, .treasury-entry-user small { max-width: 240px; overflow: hidden; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.treasury-ledger-description { min-width: 0; display: grid; gap: 3px; }
.treasury-ledger-description > strong { overflow-wrap: anywhere; font-size: .72rem; line-height: 1.4; }
.treasury-ledger-description > small { color: var(--muted); font-size: .59rem; line-height: 1.35; }
.treasury-ledger-description .treasury-reverse { margin-top: 2px; }
.treasury-event-badge { display: inline-flex; min-height: 22px; align-items: center; padding: 3px 7px; color: #4e5f74; background: #edf1f5; border-radius: 6px; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.treasury-event-badge.is-non_material_expense, .treasury-event-badge.is-manual_outflow { color: #a31c24; background: var(--red-soft); }
.treasury-event-badge.is-manual_income, .treasury-event-badge.is-customer_payment { color: #087441; background: var(--green-soft); }
.treasury-event-badge.is-transfer { color: #17619d; background: var(--blue-soft); }
.treasury-reverse { position: relative; text-align: left; }
.treasury-reverse summary { color: #a31c24; font-size: .65rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.treasury-reverse form { width: 235px; display: grid; gap: 8px; margin-top: 7px; padding: 10px; background: #fff; border: 1px solid #efc9cc; border-radius: 10px; box-shadow: 0 10px 26px rgba(70,20,25,.12); }
.treasury-reverse label span { font-size: .61rem; }
.treasury-reverse input { min-height: 36px; padding: 6px 8px; font-size: .68rem; }

.treasury-dialog .dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.treasury-dialog .dialog-heading p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.treasury-dialog .dialog-heading > button { width: 34px; height: 34px; flex: 0 0 auto; color: var(--muted); background: #f1f4f8; border: 0; border-radius: 9px; font-size: 1.2rem; }

.treasury-payment-account-field { min-width: 0; position: relative; }
.treasury-payment-account-field > small { display: block; margin-top: 4px; font-size: .62rem; line-height: 1.4; }
.treasury-payment-account-field.is-unavailable select { color: #9f444c; background: var(--red-soft); border-color: #efbdc1; }
.treasury-payment-account-field.is-unavailable > small { color: #a31c24; font-weight: 750; }
.treasury-account-manage-link, .treasury-account-admin-note { width: fit-content; margin-top: 5px; color: var(--blue); font-size: .64rem; font-weight: 800; }
.treasury-account-admin-note { color: #7d520a; }
.treasury-account-manage-link[hidden], .treasury-account-admin-note[hidden] { display: none !important; }

.dashboard-treasury-setup { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 22px; padding: 15px 17px; color: #75500c; background: var(--amber-soft); border: 1px solid #efd094; border-radius: 15px; }
.dashboard-treasury-setup > span { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #b16b08, #d99a25); border-radius: 13px; font-size: 1.05rem; font-weight: 900; }
.dashboard-treasury-setup strong { display: block; font-size: .86rem; }
.dashboard-treasury-setup p { margin: 3px 0 0; font-size: .7rem; line-height: 1.45; }
.dashboard-treasury { min-width: 0; margin-bottom: 22px; }
.dashboard-treasury-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.dashboard-treasury-heading h2 { margin-bottom: 1px; font-size: 1.2rem; }
.dashboard-treasury-heading p { margin: 0; color: var(--muted); font-size: .72rem; }
.dashboard-treasury-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 13px; }
.dashboard-treasury-card { min-width: 0; padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 14px; box-shadow: 0 7px 20px rgba(20,43,76,.04); }
.dashboard-treasury-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dashboard-treasury-card > header > span { padding: 3px 6px; color: #17619d; background: var(--blue-soft); border-radius: 6px; font-size: .61rem; font-weight: 900; letter-spacing: .07em; }
.dashboard-treasury-card > strong { display: block; margin: 7px 0 10px; font-size: 1.45rem; letter-spacing: -.04em; }
.dashboard-treasury-card > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.dashboard-treasury-card > div > span { min-width: 0; display: grid; gap: 2px; padding: 6px 7px; background: #f5f7fa; border-radius: 7px; }
.dashboard-treasury-card b, .dashboard-treasury-card small { overflow: hidden; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-treasury-breakdown { margin-bottom: 7px; }
.dashboard-treasury-breakdown > span { display: flex !important; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); }
.dashboard-treasury-breakdown b { color: var(--ink); }
.dashboard-treasury-empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #ccd6e3; border-radius: 13px; }

.report-section-grid.report-top-grid-with-expenses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-rank-bar.expense-bar { background: linear-gradient(90deg, #d8272f, #ee714d); }
.report-treasury-setup { min-height: 220px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; padding: 22px; text-align: center; }
.report-treasury-setup > span { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #b16b08, #d99a25); border-radius: 12px; font-weight: 900; }
.report-treasury-setup strong { font-size: .78rem; }
.report-treasury-setup p { max-width: 280px; margin: 0 0 4px; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.report-currency-badge { display: inline-flex; padding: 3px 6px; color: #17619d; background: var(--blue-soft); border-radius: 6px; font-size: .62rem; font-weight: 900; letter-spacing: .05em; }
.report-treasury-analysis { min-width: 0; }
.report-treasury-analysis .report-section-heading > a { flex: 0 0 auto; }
.report-treasury-analysis-setup { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px 16px; color: #75500c; background: var(--amber-soft); border: 1px solid #efd094; border-radius: 14px; }
.report-treasury-analysis-setup > span { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #b16b08, #d99a25); border-radius: 12px; font-weight: 900; }
.report-treasury-analysis-setup strong { font-size: .8rem; }
.report-treasury-analysis-setup p { margin: 2px 0 0; font-size: .67rem; }
.report-treasury-currency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 13px; }
.report-treasury-currency-card { min-width: 0; padding: 16px; background: linear-gradient(145deg, #fff, #f8fbff); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 14px; box-shadow: 0 7px 20px rgba(20,43,76,.04); }
.report-treasury-currency-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-treasury-currency-card > header span { padding: 3px 6px; color: #17619d; background: var(--blue-soft); border-radius: 6px; font-size: .62rem; font-weight: 900; letter-spacing: .07em; }
.report-treasury-currency-card > header small { font-size: .58rem; }
.report-treasury-primary { margin: 9px 0 11px; }
.report-treasury-primary small, .report-treasury-primary strong { display: block; }
.report-treasury-primary small { font-size: .59rem; }
.report-treasury-primary strong { margin-top: 2px; font-size: 1.35rem; letter-spacing: -.04em; }
.report-treasury-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.report-treasury-flows > span { min-width: 0; display: grid; gap: 2px; padding: 7px; background: #f3f6f9; border-radius: 7px; }
.report-treasury-flows small, .report-treasury-flows b { overflow: hidden; font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.report-treasury-breakdown { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.report-treasury-breakdown span { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .59rem; }
.report-treasury-breakdown b { color: var(--ink); white-space: nowrap; }
.report-treasury-empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #ccd6e3; border-radius: 13px; }

@media (max-width: 1280px) {
    .treasury-analysis-grid { grid-template-columns: 1fr; }
    .treasury-ledger-panel > .compact-list-header { grid-template-columns: minmax(0, 1fr); }
    .treasury-filter-form { justify-content: flex-start; }
    .report-section-grid.report-top-grid-with-expenses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .treasury-setup-card { grid-template-columns: 1fr; }
    .treasury-action-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-section-grid.report-top-grid-with-expenses { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .treasury-page { gap: 15px; }
    .treasury-setup-card { gap: 20px; padding: 20px 16px; border-radius: 18px; }
    .treasury-setup-copy { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
    .treasury-setup-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.15rem; }
    .treasury-setup-copy h2 { font-size: 1.55rem; }
    .treasury-setup-form { grid-template-columns: 1fr; padding: 15px; }
    .treasury-setup-form > label:first-of-type, .treasury-setup-form > .button, .treasury-maintenance-notice, .treasury-maintenance-confirm { grid-column: auto; }
    .treasury-hero { min-height: 235px; align-items: flex-start; flex-direction: column; padding: 22px 18px; border-radius: 18px; }
    .treasury-hero-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: auto; }
    .treasury-hero-actions .button { min-width: 0; padding-inline: 8px; white-space: normal; text-align: center; }
    .treasury-currency-grid { grid-template-columns: 1fr; }
    .treasury-section-heading { align-items: flex-start; }
    .treasury-section-heading > .button { flex: 0 0 auto; }
    .treasury-account-grid { grid-template-columns: 1fr; }
    .treasury-account-card { grid-template-columns: 40px minmax(0, 1fr) 26px; }
    .treasury-account-icon { width: 40px; height: 40px; }
    .treasury-account-balance { grid-column: 2 / 4; min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); text-align: left; }
    .treasury-account-archive { grid-column: 3; grid-row: 1; }
    .treasury-action-panel > .panel-header { align-items: flex-start; flex-direction: column; }
    .treasury-action-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .treasury-action-tabs button { min-height: 46px; }
    .treasury-action-form { grid-template-columns: 1fr; padding: 14px !important; }
    .treasury-form-description, .treasury-expense-description { grid-column: 1 / -1; }
    .treasury-action-footer .button { width: 100%; }
    .treasury-category-inline-form { grid-template-columns: 1fr; margin: 0 14px 14px; }
    .treasury-category-inline-form .button { width: 100%; }
    .treasury-analysis-grid { gap: 15px; }
    .treasury-ledger-panel > .compact-list-header { padding: 9px; }
    .treasury-ledger-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .treasury-filter-form { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .treasury-filter-date { width: 100%; }
    .treasury-filter-date input { min-height: 42px; }
    .treasury-ledger-panel .compact-list-filter select { width: 100%; max-width: none; min-height: 42px; }
    .treasury-filter-form .button { min-height: 42px; }
    .treasury-ledger-toolbar > .compact-list-actions { width: 100%; }
    .treasury-reverse form { width: 205px; }
    .treasury-dialog > form { padding: 18px 15px; }
    .treasury-dialog .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .treasury-dialog .dialog-actions .button { min-width: 0; }
    .dashboard-treasury-setup { grid-template-columns: 42px minmax(0, 1fr); padding: 13px; }
    .dashboard-treasury-setup > span { width: 42px; height: 42px; }
    .dashboard-treasury-setup > .button { grid-column: span 2; width: 100%; }
    .dashboard-treasury-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-treasury-grid { grid-template-columns: 1fr; }
    .report-treasury-analysis .report-section-heading { align-items: flex-start; flex-direction: column; }
    .report-treasury-analysis-setup { grid-template-columns: 42px minmax(0, 1fr); }
    .report-treasury-analysis-setup > span { width: 42px; height: 42px; }
    .report-treasury-analysis-setup > .button { grid-column: span 2; width: 100%; }
    .report-treasury-currency-grid { grid-template-columns: 1fr; }
    .report-treasury-flows { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .treasury-currency-flows { grid-template-columns: 1fr; }
    .treasury-filter-form { grid-template-columns: 1fr; }
    .treasury-section-heading { flex-direction: column; }
    .treasury-section-heading > .button { width: 100%; }
}

.user-management-panel { overflow: hidden; }
.user-management-panel > .panel-header { margin-bottom: 0; }
.user-management-panel > .panel-header .toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.user-list-table { min-width: 850px; }
.user-list-table td { overflow-wrap: anywhere; }
.user-list-table td:first-child { min-width: 140px; }
.user-list-table td:last-child { white-space: nowrap; }
.user-list-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.user-dialog { width: min(1080px, calc(var(--ui-viewport-width, 100vw) - 28px)); max-height: calc(var(--ui-viewport-height, 100dvh) - 32px); overflow-y: auto; }
.user-dialog-shell { padding: 22px; }
.user-dialog .dialog-header { position: sticky; top: -22px; z-index: 3; margin: -22px -22px 18px; padding: 20px 22px 15px; background: var(--surface); border-bottom: 1px solid var(--line); }
.user-dialog .dialog-header h2, .user-dialog .dialog-header p { margin: 0; }
.user-dialog .dialog-header p { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.user-dialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-dialog .dialog-actions { position: sticky; bottom: -22px; z-index: 2; margin: 0 -22px -22px; padding: 13px 22px; background: var(--surface); border-top: 1px solid var(--line); }
.permission-matrix-wrap { min-width: 0; display: grid; gap: 9px; }
.permission-matrix-wrap > .table-wrap { min-width: 0; max-width: 100%; }
.permission-matrix-hint { margin: 0; color: var(--muted); font-size: .84rem; }
.permission-matrix-table { min-width: 730px; }
.permission-matrix-table th:not(:first-child),
.permission-matrix-table td:not(:first-child) { width: 92px; text-align: center; }
.permission-matrix-table td:first-child { min-width: 220px; }
.permission-matrix-table .permission-module-name small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.25; }
.permission-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; min-width: 30px; cursor: pointer; }
.permission-toggle input { inline-size: 18px; block-size: 18px; accent-color: var(--primary); cursor: pointer; }
.permission-matrix-wrap[data-admin-permissions] .permission-toggle { cursor: not-allowed; opacity: .6; }
.user-treasury-permissions { border-top: 1px solid var(--line); margin-top: 22px; padding: 18px 0 0; display: grid; gap: 9px; }
.user-treasury-permissions h4, .user-treasury-permissions p { margin: 0; }
.user-treasury-permissions p { color: var(--muted); font-size: .86rem; }
.user-treasury-permissions form { display: grid; gap: 12px; min-width: 0; }
.user-treasury-permissions .table-wrap { max-width: 100%; overflow-x: auto; }
.treasury-rights-table { width: 100%; min-width: 560px; table-layout: fixed; }
.treasury-rights-table th:first-child, .treasury-rights-table td:first-child { width: 60%; text-align: left; }
.treasury-rights-table th:not(:first-child), .treasury-rights-table td:not(:first-child) { width: 20%; text-align: center; }
.treasury-rights-table .permission-toggle { display: inline-flex; align-items: center; justify-content: center; }
.user-treasury-permissions .button { justify-self: start; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 650px) {
    .user-management-panel > .panel-header { align-items: stretch; }
    .user-management-panel > .panel-header .toolbar { justify-content: stretch; }
    .user-management-panel > .panel-header .toolbar .button { flex: 1 1 auto; }
    .user-list-wrap { overflow: visible; }
    .user-list-table { min-width: 0; display: block; }
    .user-list-table thead { display: none; }
    .user-list-table tbody { display: grid; gap: 10px; padding: 12px; }
    .user-list-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
    .user-list-table td { min-width: 0 !important; display: grid; gap: 3px; padding: 0; border: 0; white-space: normal !important; }
    .user-list-table td::before { content: attr(data-label); color: var(--muted); font-size: .64rem; font-weight: 750; }
    .user-list-table td:first-child, .user-list-table td:nth-child(2), .user-list-table td:last-child { grid-column: 1 / -1; }
    .user-list-actions { justify-content: flex-start; flex-wrap: wrap; }
    .user-dialog { width: calc(var(--ui-viewport-width, 100vw) - 16px); max-height: calc(var(--ui-viewport-height, 100dvh) - 16px); }
    .user-dialog-shell { padding: 15px; }
    .user-dialog .dialog-header { top: -15px; margin: -15px -15px 15px; padding: 15px; }
    .user-dialog .form-grid { grid-template-columns: 1fr; }
    .user-dialog .dialog-actions { bottom: -15px; margin: 0 -15px -15px; padding: 12px 15px; }
    .permission-matrix-wrap > .table-wrap { overflow: visible; }
    .permission-matrix-table { min-width: 0; display: block; }
    .permission-matrix-table thead { display: none; }
    .permission-matrix-table tbody { display: grid; gap: 10px; }
    .permission-matrix-table tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
    .permission-matrix-table td { min-width: 0 !important; width: auto !important; display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border: 0; }
    .permission-matrix-table .permission-module-name { grid-column: 1 / -1; justify-items: start; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
    .permission-cell::before { content: attr(data-permission-label); min-height: 24px; display: grid; place-items: center; color: var(--muted); font-size: .53rem; font-weight: 800; line-height: 1.1; text-align: center; }
    .permission-toggle { min-width: 42px; min-height: 42px; }
    .permission-toggle input { inline-size: 20px; block-size: 20px; }
}

.monthly-expense-hero { min-height: 174px; }
.monthly-expense-cash-note { margin-top: 12px !important; color: #d2ecf9 !important; font-size: .78rem; font-weight: 700; }
.monthly-expense-summary strong { overflow-wrap: anywhere; }
.monthly-expense-period-panel { margin-bottom: 18px; }
.monthly-expense-period-form { display: flex; align-items: center; gap: 7px; }
.monthly-expense-period-form input[type="month"] { min-width: 160px; }
.monthly-expense-period-form .button { min-width: 40px; padding-inline: 10px; }
.monthly-expense-lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.monthly-expense-table-panel tfoot th { color: var(--navy-900); background: #eef7f2; border-top: 1px solid #b9d9c5; }
.monthly-expense-dialog-note { margin: 15px 0 0; padding: 10px 12px; color: #165d52; background: #eaf7f1; border-radius: 9px; font-size: .75rem; font-weight: 700; }
@media (max-width: 900px) {
    .monthly-expense-lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .monthly-expense-hero { min-height: 230px; }
    .monthly-expense-hero .hero-actions { flex-wrap: wrap; }
    .monthly-expense-hero .hero-actions .button { flex: 1 1 150px; }
    .monthly-expense-period-panel > .panel-header { align-items: stretch; flex-direction: column; }
    .monthly-expense-period-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
    .monthly-expense-period-form input[type="month"] { min-width: 0; }
    .monthly-expense-period-form button { grid-column: 1 / -1; }
}

/* Phone navigation and customer actions must stay usable without page-wide scrolling. */
.sidebar-close, .sidebar-backdrop { display: none; }
.sidebar-backdrop[hidden] { display: none; }
@media (max-width: 900px) {
    body.menu-open { overflow: hidden; }
    body.menu-open .text-zoom-control { visibility: hidden; }
    .sidebar { left: -310px; width: min(310px, calc(var(--ui-viewport-width, 100vw) - 24px)); }
    .sidebar .brand { margin-right: 54px; }
    .topbar { gap: 10px; }
    .topbar > div:not(.top-actions) { min-width: 0; flex: 1; }
    .topbar .eyebrow, .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar .hide-mobile { display: none; }
    .top-actions { gap: 7px; }
    .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; padding: 0; background: rgba(8, 21, 43, .55); border: 0; cursor: pointer; }
    .sidebar-close { display: grid; place-items: center; position: absolute; top: 17px; right: 16px; z-index: 1; width: 44px; height: 44px; padding: 0; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; font-size: 1.7rem; cursor: pointer; }
    .mobile-menu { width: 44px; min-width: 44px; height: 44px; flex: 0 0 44px; }
}
@media (max-width: 650px) {
    .page-content { padding-bottom: max(84px, calc(env(safe-area-inset-bottom) + 80px)); }
    .customer-entity-hero { align-items: stretch; flex-direction: column; }
    .customer-entity-hero .entity-title > div { min-width: 0; }
    .customer-entity-hero .entity-title h2 { overflow-wrap: anywhere; }
    .customer-entity-hero .balance-card { width: 100%; min-width: 0; }
    .customer-entity-hero .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; }
    .customer-entity-hero .hero-actions > .button { min-width: 0; min-height: 44px; padding-inline: 7px; white-space: normal; text-align: center; }
    .customer-entity-hero .hero-actions > .button:first-child:nth-last-child(3),
    .customer-entity-hero .hero-actions > .button:only-child { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 8px; }
    .topbar > div:not(.top-actions) { min-width: 0; flex: initial; }
    .topbar .eyebrow { display: none; }
    .topbar h1 { margin: 0; font-size: 1rem; }
    .top-actions { grid-column: 1 / -1; min-width: 0; justify-content: space-between; flex-wrap: wrap; }
    .top-actions .language-option { min-width: 40px; min-height: 40px; }
    .top-actions .notification-button, .top-actions > .button-primary { min-height: 44px; }
    .topbar.topbar--home { display: flex; flex-wrap: nowrap; gap: 6px; padding-inline: 10px; }
    .topbar--home > div:not(.top-actions) { flex: 1 1 0; min-width: 0; }
    .topbar--home h1 { font-size: clamp(.86rem, 3.8vw, 1rem); }
    .topbar--home .top-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
    .topbar--home .top-actions .language-switcher { flex: 0 0 auto; }
    .topbar--home .top-actions .notification-button { flex: 0 0 44px; }
}

/* Keep sales pickers inside a phone viewport and make key controls touch-friendly. */
@media (max-width: 650px) {
    .smart-select-menu { width: min(360px, calc(var(--ui-viewport-width, 100vw) - 36px)); max-width: none; left: 50%; transform: translateX(-50%); }
    .smart-select-input { padding-right: 48px; }
    .smart-select-toggle { width: 44px; height: 44px; top: 0; right: 0; }
    .remove-row { width: 44px; height: 44px; }
    .sheet-column-menu-option, .sheet-column-menu-reset { min-height: 44px; }
    .product-column-filter-reset { min-height: 44px; }
    .spreadsheet-panel.is-excel-view .warehouse-stock-table .stock-actions-column { min-width: 120px; width: 120px; }
    .stock-list-action { width: 44px; height: 44px; padding: 10px; }
    .spreadsheet-panel.is-excel-view .supplier-table th:last-child { min-width: 168px; }
    .dialog-close, .treasury-dialog .dialog-heading > button { width: 44px; height: 44px; min-width: 44px; flex: 0 0 44px; }
    .dialog-actions .button, .text-zoom-actions button { min-height: 44px; }
    .list-column-resize { width: 24px; }
    .spreadsheet-panel.is-excel-view .spreadsheet-table thead tr:first-child th:has(> .list-column-resize) { padding-right: 52px; }
}

/* Give frequently used mobile actions a reliable finger-sized target. */
@media (max-width: 900px) {
    .row-actions .row-action,
    .spreadsheet-table td > form > .row-action { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
    .row-actions form { display: inline-flex; }
    .icon-button { min-width: 44px; min-height: 44px; }
    .top-actions .language-option, .auth-language-switcher .language-option { min-width: 44px; min-height: 44px; }
    .top-actions .notification-button { min-width: 44px; }
    .sale-add-row { width: 48px; height: 48px; }
}

@media (max-width: 650px) {
    .topbar.topbar--sale-new { min-height: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 10px; }
    .topbar--sale-new > div:not(.top-actions) { min-width: 0; flex: initial; }
    .topbar--sale-new .top-actions { grid-column: 3; grid-row: 1; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
    .topbar--sale-new .language-switcher { flex: 0 0 auto; gap: 0; padding: 2px; }
    .topbar--sale-new .notification-button { flex: 0 0 44px; }
    .topbar--sale-new .pwa-install-button, .topbar--sale-new .top-actions > .button-primary { display: none; }
}

@media (max-width: 650px) {
    .sale-add-row { width: 44px; height: 44px; color: #0b8249; background: transparent; border: 0; box-shadow: none; font-size: .95rem; }
    .sale-add-row span { width: 24px; height: 24px; display: grid; place-items: center; background: #effaf4; border: 1px solid #a9ddc1; border-radius: 4px; box-shadow: 0 3px 8px rgba(11,130,73,.1); transform: none; }
    .sale-add-row:hover { color: #0b8249; background: transparent; border: 0; box-shadow: none; transform: none; }
    .sale-add-row:hover span { color: #fff; background: #0b8249; border-color: #0b8249; }
}

/* Keep list search, month navigation, and report drill-down links easy to tap. */
@media (max-width: 900px) {
    .search-form .button { min-width: 44px; min-height: 44px; }
    .monthly-expense-period-form > .button { min-width: 44px; min-height: 44px; }
    .monthly-expense-period-form > button { min-height: 44px; }
    .report-table-panel .table-link,
    .monthly-expense-lower-grid .table-link { min-width: 44px; min-height: 44px; max-width: 100%; display: inline-flex; align-items: center; padding: 4px 6px; overflow-wrap: anywhere; }
}

.price-restricted-panel { min-width: 0; }
.price-restricted-note { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; color: #23456a; background: #eaf3ff; border: 1px solid #c9defa; }
.price-restricted-links, .price-restricted-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.price-restricted-search { margin-bottom: 18px; }
.price-restricted-search input { min-width: min(290px, 100%); }
.price-restricted-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.price-restricted-fields > div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; }
.price-restricted-fields dt { color: var(--muted); font-size: .72rem; }
.price-restricted-fields dd { margin: 5px 0 0; overflow-wrap: anywhere; font-weight: 700; }
@media (max-width: 650px) {
    .price-restricted-fields { grid-template-columns: 1fr; }
    .price-restricted-search input { flex: 1 1 100%; }
}

/* Invoice designer: structured controls beside the actual PDF output. */
.invoice-designer-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.invoice-designer-intro h2 { margin: 4px 0 6px; font-size: clamp(1.3rem, 2vw, 1.9rem); }
.invoice-designer-intro p:last-child { max-width: 70ch; margin: 0; color: var(--muted); }
.invoice-designer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, .95fr); align-items: start; gap: 22px; }
.invoice-designer-controls { min-width: 0; }
.invoice-designer-controls .panel { padding: 22px; }
.invoice-designer-controls .panel-header { margin-bottom: 16px; }
.invoice-design-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.invoice-design-fields label, .invoice-text-fields label { display: grid; align-content: start; gap: 7px; min-width: 0; color: #33435b; font-weight: 700; }
.invoice-design-fields input, .invoice-design-fields select, .invoice-text-fields input, .invoice-text-fields textarea { width: 100%; min-width: 0; }
.invoice-design-fields input[type=color] { min-height: 46px; padding: 5px; cursor: pointer; }
.invoice-visibility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.invoice-visibility-toggle { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; }
.invoice-visibility-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #2469ce; }
.invoice-language-panel .badge { flex: none; }
.invoice-text-section { border-top: 1px solid var(--line); }
.invoice-text-section summary { padding: 13px 3px; color: #203b62; font-weight: 800; cursor: pointer; }
.invoice-text-section summary:focus-visible { outline: 2px solid #2469ce; outline-offset: 2px; }
.invoice-text-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 6px 2px 18px; }
.invoice-text-fields .invoice-wide-field { grid-column: 1 / -1; }
.invoice-designer-preview { position: sticky; top: 16px; min-width: 0; padding: 18px; }
.invoice-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.invoice-preview-toolbar h3 { margin: 0 0 3px; }
.invoice-preview-toolbar p { margin: 0; color: var(--muted); font-size: .86rem; }
.invoice-preview-toolbar select { width: 75px; flex: none; }
.invoice-designer-preview iframe { display: block; width: 100%; height: min(70vh, 800px); min-height: 440px; border: 1px solid var(--line); border-radius: 10px; background: #f5f7fb; }
.invoice-designer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.invoice-preview-hint { margin: 12px 0 0; color: var(--muted); font-size: .84rem; }
@media (max-width: 1200px) { .invoice-designer-grid { grid-template-columns: 1fr; } .invoice-designer-preview { position: static; } }
@media (max-width: 650px) { .invoice-designer-intro { flex-direction: column; } .invoice-design-fields, .invoice-text-fields, .invoice-visibility-grid { grid-template-columns: 1fr; } .invoice-designer-preview iframe { min-height: 380px; height: 60vh; } .invoice-designer-actions .button { flex: 1 1 100%; } }

/* First-entry actions: restrained luminous orbs, with captions below each icon. */
.home-shortcut-page { min-height: calc(var(--ui-viewport-height, 100vh) - 210px); display: grid; place-items: center; padding: clamp(24px, 4vw, 50px) 0; }
.home-shortcut-grid { position: relative; isolation: isolate; width: min(100%, 760px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; align-items: start; column-gap: clamp(18px, 4vw, 54px); row-gap: clamp(26px, 4vw, 46px); }
.home-shortcut-grid--plant-entry { width: min(100%, 340px); grid-template-columns: minmax(0, 1fr); }
.home-shortcut-cross { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.home-shortcut-cross::before, .home-shortcut-cross::after { content: ''; position: absolute; display: block; background: linear-gradient(90deg, transparent, #9bc9ff 18%, #5877c9 50%, #9bc9ff 82%, transparent); box-shadow: 0 0 10px rgba(89, 164, 236, .45); opacity: .75; }
.home-shortcut-cross::before { top: 3%; bottom: 3%; left: 50%; width: 2px; transform: translateX(-50%); background: linear-gradient(180deg, transparent, #9bc9ff 18%, #5877c9 50%, #9bc9ff 82%, transparent); }
.home-shortcut-cross::after { top: 50%; left: 3%; right: 3%; height: 2px; transform: translateY(-50%); }
.home-shortcut-cross-core { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 62px; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(45deg); border: 1px solid rgba(154, 222, 255, .88); border-radius: 17px; color: #eafaff; background: linear-gradient(145deg, #152c69, #2363a1); box-shadow: 0 0 0 5px rgba(235, 247, 255, .72), 0 0 25px rgba(57, 156, 244, .65), inset 0 1px 8px rgba(179, 232, 255, .3); }
.home-shortcut-cross-core svg { width: 34px; height: 34px; transform: rotate(-45deg); stroke-width: 3.5; filter: drop-shadow(0 0 6px rgba(173, 237, 255, .85)); }
.home-shortcut-cross-core svg path:last-child { stroke-width: 2; opacity: .78; }
.home-shortcut { position: relative; z-index: 1; --orb-top: #8176eb; --orb-bottom: #4e55b8; --orb-glow: rgba(99, 87, 219, .26); display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; min-width: 0; color: #1b2b4d; text-align: center; text-decoration: none; }
.home-shortcut--payment { --orb-top: #43c2da; --orb-bottom: #167fa4; --orb-glow: rgba(32, 163, 192, .25); }
.home-shortcut--treasury { --orb-top: #589bea; --orb-bottom: #2857b8; --orb-glow: rgba(45, 105, 197, .23); }
.home-shortcut--critical { --orb-top: #ed8ca5; --orb-bottom: #a64779; --orb-glow: rgba(174, 65, 116, .23); }
.home-shortcut--plant-entry { --orb-top: #50be85; --orb-bottom: #177651; --orb-glow: rgba(21, 132, 83, .25); }
.home-shortcut-orb { position: relative; isolation: isolate; display: grid; place-items: center; width: min(100%, 260px); aspect-ratio: 1; overflow: hidden; border: 1px solid rgba(255, 255, 255, .78); border-radius: 50%; background: radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .3), transparent 34%), linear-gradient(145deg, var(--orb-top), var(--orb-bottom)); box-shadow: 0 20px 36px var(--orb-glow), 0 4px 12px rgba(22, 39, 82, .08), inset 0 2px 2px rgba(255, 255, 255, .42); transition: transform .22s ease, box-shadow .22s ease; }
.home-shortcut-orb::before { content: ''; position: absolute; inset: 8%; border: 1px solid rgba(255, 255, 255, .28); border-radius: inherit; }
.home-shortcut-orb::after { content: ''; position: absolute; top: -38%; right: -50%; width: 100%; height: 85%; border-radius: 50%; background: rgba(255, 255, 255, .11); transform: rotate(28deg); }
.home-shortcut-icon { position: relative; z-index: 1; width: clamp(54px, 7vw, 88px); height: auto; color: #fff; filter: drop-shadow(0 5px 8px rgba(15, 31, 83, .14)); }
.home-shortcut-label { max-width: 100%; font-size: clamp(1.05rem, 1.7vw, 1.4rem); line-height: 1.2; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: anywhere; }
a.home-shortcut:hover { color: #152c61; }
a.home-shortcut:hover .home-shortcut-orb { transform: translateY(-6px) scale(1.025); box-shadow: 0 27px 44px var(--orb-glow), 0 5px 16px rgba(22, 39, 82, .12), inset 0 2px 2px rgba(255, 255, 255, .42); }
a.home-shortcut:focus-visible { outline: 0; }
a.home-shortcut:focus-visible .home-shortcut-orb { outline: 4px solid #1b4d94; outline-offset: 5px; }
.home-shortcut.is-disabled { filter: grayscale(1); opacity: .48; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .home-shortcut-orb { transition: none; } }
@media (max-width: 700px) {
    .home-shortcut-page { min-height: auto; padding: clamp(22px, 5vw, 36px) 0; }
    .home-shortcut-grid { column-gap: clamp(10px, 3vw, 20px); row-gap: clamp(22px, 5vw, 34px); }
    .home-shortcut-cross-core { width: 42px; border-radius: 12px; box-shadow: 0 0 0 3px rgba(235, 247, 255, .72), 0 0 18px rgba(57, 156, 244, .6), inset 0 1px 6px rgba(179, 232, 255, .3); }
    .home-shortcut-cross-core svg { width: 25px; height: 25px; stroke-width: 3.2; }
    .home-shortcut { gap: 11px; }
    .home-shortcut-orb { width: min(100%, 180px); }
    .home-shortcut-icon { width: clamp(40px, 12vw, 64px); }
    .home-shortcut-label { font-size: clamp(.82rem, 3.7vw, 1.08rem); }
}

/* Quote, order and contract workflow. Keep line entry compact like the sales sheet. */
.commercial-list-panel .panel-header { gap: 16px; }
.commercial-list-panel .panel-header p { margin: 4px 0 0; }
.commercial-table { width: 100%; }
.commercial-table .numeric { text-align: right; white-space: nowrap; }
.commercial-table th:last-child, .commercial-table td:last-child { text-align: center; }
.commercial-empty { text-align: center; padding: 28px !important; color: #718099; }
.commercial-status { display: inline-block; padding: 5px 9px; border-radius: 7px; color: #925900; background: #fff0d4; font-weight: 700; white-space: nowrap; }
.commercial-status--approved, .commercial-status--active { color: #0d7650; background: #e4f8ec; }
.commercial-form { display: grid; gap: 18px; }
.commercial-form-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 12px; padding: 18px; }
.commercial-form-grid label, .commercial-bottom-panel label, .commercial-template-card label { display: grid; gap: 6px; min-width: 0; color: #354560; font-weight: 700; }
.commercial-form-grid input, .commercial-form-grid select, .commercial-bottom-panel textarea, .commercial-template-card textarea { width: 100%; min-width: 0; }
.commercial-lines-wrap { padding: 15px 18px 18px; overflow-x: auto; }
.commercial-lines-header, .commercial-line { display: grid; grid-template-columns: minmax(170px,1.35fr) minmax(180px,1.5fr) minmax(110px,.8fr) minmax(90px,.55fr) minmax(135px,.9fr) minmax(115px,.7fr) minmax(115px,.7fr) 46px; align-items: center; gap: 7px; min-width: 1110px; }
.commercial-lines-header { padding: 8px 10px; color: #52647f; background: #eaf1f8; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.commercial-line { padding: 7px 10px; border-bottom: 1px solid #dce6f0; }
.commercial-line:nth-child(even) { background: #f7fafc; }
.commercial-line input, .commercial-line select { width: 100%; min-width: 0; height: 42px; padding: 8px 10px; font-size: .88rem; }
.commercial-line output { text-align: right; white-space: nowrap; font-weight: 700; }
.commercial-line button { min-width: 0; width: 42px; height: 42px; padding: 0; font-size: 1.25rem; }
.commercial-add-line { margin: 12px 0 0; }
.commercial-totals { width: min(360px,100%); margin: 14px 0 0 auto; border: 1px solid #cdd9e8; }
.commercial-totals > div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 13px; border-bottom: 1px solid #dce6f0; }
.commercial-totals > div:last-child { border-bottom: 0; }
.commercial-totals .commercial-grand { color: #fff; background: #10305e; font-size: 1.06rem; }
.commercial-bottom-panel { padding: 18px; }
.commercial-bottom-panel textarea { resize: vertical; }
.commercial-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
.commercial-template-grid { display: grid; grid-template-columns: repeat(3,minmax(220px,1fr)); gap: 16px; padding: 18px; }
.commercial-template-card { display: grid; gap: 12px; align-content: start; min-width: 0; }
.commercial-template-card textarea { resize: vertical; min-height: 230px; font-weight: 400; }
@media (max-width: 1300px) { .commercial-form-grid { grid-template-columns: repeat(3,minmax(150px,1fr)); } .commercial-template-grid { grid-template-columns: repeat(2,minmax(220px,1fr)); } }
@media (max-width: 760px) { .commercial-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .commercial-template-grid { grid-template-columns: 1fr; } .commercial-form-actions { justify-content: stretch; } .commercial-form-actions > * { flex: 1; text-align: center; } }
@media (max-width: 520px) { .commercial-form-grid { grid-template-columns: 1fr; } .commercial-lines-header { display: none; } .commercial-lines-wrap { overflow: visible; padding: 12px; } .commercial-line { min-width: 0; grid-template-columns: 1fr 1fr; border: 1px solid #dae4ef; border-radius: 12px; margin-bottom: 10px; } .commercial-line select, .commercial-line input:nth-child(2) { grid-column: 1 / -1; } .commercial-line output { text-align: left; align-self: center; } }
