/* Shared workspace theme derived from the approved INKA ERP reference. */
/* One palette for every HTML workspace and guest surface. PDF templates are separate. */
.erp-theme {
    --accent:#1763dc; --accent-strong:#1052bd; --accent-soft:#edf4ff;
    --ink:#18273c; --muted:#5c6c83; --text-secondary:#40516a;
    --canvas:#f4f6f9; --surface:#fff; --surface-soft:#f8fafc;
    --line:#e5eaf1; --line-soft:#e5eaf1; --input-line:#7d8ca3;
    --navy:#101d32; --navy-hover:#1a2b45; --nav-text:#bfccdf; --nav-muted:#93a5c0;
    --success:#166534; --success-soft:#ecfdf3; --success-line:#addfc0;
    --warning:#92400e; --warning-soft:#fff7e6; --warning-line:#efd398;
    --danger:#b42318; --danger-soft:#fff0ee; --danger-line:#f3c0bb;
    --info:#1856ad; --info-soft:#edf4ff; --info-line:#c5d8f7;
    --partial:#6941c6; --partial-soft:#f4efff;
    --neutral:#475569; --neutral-soft:#edf1f7; --teal:#176b75;
    --radius:10px; --control-radius:7px; --shadow-soft:0 2px 4px #18273c03;
    background:var(--canvas); color:var(--ink);
}
.erp-body .app-shell { display:block; padding-left:238px; }
.erp-body .sidebar { position:fixed; inset:0 auto 0 0; width:238px; height:100dvh; min-height:0; background:var(--navy); border:0; box-shadow:none; padding:26px 18px 16px; display:flex; flex-direction:column; gap:0; z-index:30; color:var(--nav-text); overflow-y:auto; }
.erp-body .brand { display:block; padding:0 12px 20px; }
.erp-body .brand-logo-wrap { justify-content:flex-start; min-height:0; }
.erp-body .inka-brand-logo { width:150px; max-width:150px; max-height:48px; filter:brightness(0) invert(1); }
.erp-body .brand-text { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.erp-workspace-label { color:var(--nav-muted); padding:0 12px 16px; text-transform:uppercase; letter-spacing:1.5px; font-size:10px; }
.erp-body .side-nav { display:flex; flex-direction:column; gap:2px; }
.erp-nav-group { margin:14px 0 0; }
.erp-nav-label { font-size:10px; font-weight:650; letter-spacing:1.2px; text-transform:uppercase; color:var(--nav-muted); margin:0 12px 5px; }
.erp-body .nav-link, .erp-body .side-nav button.nav-link { min-height:39px; padding:9px 12px; gap:11px; border:0; color:var(--nav-text); background:transparent; box-shadow:none; font-weight:500; font-size:13px; border-radius:7px; }
.erp-body .nav-link:hover, .erp-body .side-nav button.nav-link:hover { background:var(--navy-hover); color:#fff; }
.erp-body .nav-link.active { background:var(--accent); color:#fff; }
.erp-body .nav-glyph { color:currentColor; border:0; background:none; width:19px; height:19px; min-width:19px; box-shadow:none; }
.erp-body .nav-link.active .nav-glyph { background:none; color:inherit; border:0; }
.erp-body .sidebar-footer { display:grid; background:none; border:0; border-top:1px solid #29364b; border-radius:0; color:var(--nav-muted); padding:18px 10px 0; margin-top:20px; font-size:11px; }
.erp-body .sidebar-footer strong { color:#e7edf6; font-size:13px; }
.erp-body .sidebar-footer em { color:var(--nav-text); font-weight:400; }
.erp-body .nav-divider { display:block; border-color:#29364b; margin:14px 10px; }
.erp-body .workspace-topbar { height:72px; min-height:72px; padding:0 34px; flex-direction:row; align-items:center; gap:16px; }
.erp-breadcrumb { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; flex:1; }
.erp-body .topbar-kicker { display:inline; text-transform:none; font-size:13px; font-weight:400; margin:0; }
.erp-body .topbar-kicker::after { content:' /'; }
.erp-body .workspace-topbar strong { display:inline; font-size:13px; font-weight:550; }
.erp-topbar-account { font-size:12px; color:var(--muted); }
.erp-body .content-body { overflow:visible; min-width:0; max-width:1600px; padding:29px 34px 36px; }
.erp-theme h1 { font-size:26px; font-weight:700; letter-spacing:-.7px; line-height:1.3; margin:0 0 7px; overflow-wrap:anywhere; }
.erp-theme h2 { font-size:16px; font-weight:650; letter-spacing:-.15px; }
.erp-body .page-head { align-items:center; margin-bottom:25px; }
.erp-body .page-head .muted { margin:0; }
.erp-body .crumb { font-size:12px; font-weight:400; margin-bottom:8px; }
.erp-theme .panel, .erp-theme .table-wrap, .erp-theme .card, .erp-theme .toolbar { border-radius:10px; box-shadow:var(--shadow-soft); }
.erp-theme .panel { padding:22px; }
.erp-theme button, .erp-theme .button { border-radius:7px; box-shadow:none; font-weight:600; font-size:13px; padding:10px 14px; min-height:38px; }
.erp-theme button.secondary, .erp-theme .button.secondary { background:#fff; border:1px solid var(--line); color:#34445b; }
.erp-theme input:not([type=checkbox]):not([type=radio]), .erp-theme select, .erp-theme textarea { border-radius:7px; border-color:#dce4ef; min-height:39px; box-shadow:none; }
.erp-theme :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid #79b4ff; outline-offset:3px; }
.erp-theme .table-wrap { overflow:auto; }
.erp-theme table { font-size:13px; }
.erp-theme th { font-size:10px; text-transform:uppercase; letter-spacing:.5px; background:#f9fafc; font-weight:600; color:var(--muted); }
.erp-theme th, .erp-theme td { padding:15px 18px; border-bottom:1px solid #edf0f5; }
.erp-theme td { color:#40516a; }
.erp-theme tbody tr:last-child td { border-bottom:0; }
.erp-theme tbody tr:hover { background:#f8fbff; }
.erp-theme .file-badge { border-radius:5px; padding:5px 8px; font-size:11px; font-weight:600; line-height:1.25; border:0; }
.erp-theme .file-badge.status-overdue { color:#b44331; background:#fff0eb; }
.erp-theme .file-badge.status-paid { color:#18714d; background:#e9f6ed; }
.erp-theme :is(.file-badge.status-partial,.file-badge.status-partiallyreceived,.file-badge.status-partially-received) { color:#7652ac; background:#f1ebfa; }
.erp-theme .file-badge.status-approved { color:#2b62ad; background:#eaf2ff; }
.erp-theme .file-badge.status-pending, .erp-theme .file-badge.status-draft { color:#68788e; background:#edf1f6; }
.erp-body .accounting-register-filters { display:grid; grid-template-columns:2fr repeat(3,minmax(130px,1fr)); gap:12px; padding:18px; border-radius:10px; background:#fff; align-items:end; }
.erp-body .accounting-register-filters .filter-field { min-width:0; width:auto; }
.erp-body .accounting-register-filters input, .erp-body .accounting-register-filters select { width:100%; min-width:0; }
.erp-body .invoice-register-table .invoice-reference { min-width:9rem; max-width:18rem; }
.erp-body .results-pagination { padding:16px 18px; }
.erp-date-chip { padding:10px 13px; background:white; border:1px solid var(--line); border-radius:7px; color:#506077; font-size:13px; white-space:nowrap; }
.erp-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.erp-kpi { display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:10px; padding:20px; color:var(--ink); min-width:0; text-decoration:none; }
.erp-kpi:hover { border-color:#b9cfee; text-decoration:none; }
.erp-kpi-label { color:#52627a; font-size:13px; }
.erp-kpi-value { font-size:24px; letter-spacing:-.8px; line-height:1.3; margin:14px 0 7px; }
.erp-money-line { display:block; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.erp-money-line small { font-size:11px; color:var(--muted); letter-spacing:0; font-weight:500; margin-left:6px; }
.erp-kpi>small { font-size:11px; color:var(--muted); line-height:1.5; }
.erp-kpi-alert { border-top:3px solid #e37962; padding-top:18px; }
.erp-kpi-alert .erp-kpi-value { color:#b64531; }
.erp-dashboard-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr); gap:24px; margin-bottom:24px; }
.erp-body .erp-panel { padding:0; overflow:hidden; margin-bottom:24px; }
.erp-dashboard-grid .erp-panel { margin-bottom:0; }
.erp-panel-head { display:flex; align-items:center; justify-content:space-between; padding:20px 22px; border-bottom:1px solid var(--line); gap:14px; }
.erp-panel-head h2 { margin:0; }
.erp-panel-head p { margin:5px 0 0; font-size:12px; color:var(--muted); }
.erp-panel-head a { font-size:12px; white-space:nowrap; font-weight:600; }
.erp-panel .table-wrap { border:0; border-radius:0; box-shadow:none; }
.erp-queue-row { display:flex; align-items:center; gap:15px; justify-content:space-between; padding:18px 22px; border-bottom:1px solid #edf0f5; }
.erp-queue-row:hover { background:#f8fbff; text-decoration:none; }
.erp-queue-row>span { min-width:0; }
.erp-queue-row strong { font-size:13px; }
.erp-queue-row small { display:block; margin-top:5px; color:var(--muted); font-size:11px; }
.erp-queue-row .erp-queue-money { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.erp-queue-money small { color:#b44331; }
.erp-panel-note { padding:14px 22px; color:var(--muted); font-size:11px; margin:0; background:#fbfcfe; }
.erp-collections { padding:24px; font-size:28px; font-weight:700; }
.erp-collections .erp-money-line { margin-bottom:12px; }
.erp-empty { padding:30px 22px; color:var(--muted); font-size:13px; }
.erp-detail-grid { display:grid; grid-template-columns:minmax(0,1fr) 275px; gap:24px; align-items:start; }
.erp-detail-summary { display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:20px; padding:24px; border-bottom:1px solid var(--line); }
.erp-field-label { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.7px; color:var(--muted); margin-bottom:8px; }
.erp-detail-summary strong { font-size:17px; }
.erp-detail-summary small { display:block; margin-top:7px; color:var(--muted); }
.erp-detail-summary .erp-balance { font-size:24px; color:#b44331; font-variant-numeric:tabular-nums; }
.erp-tabs { display:flex; gap:24px; border-bottom:1px solid var(--line); padding:0 22px; overflow:auto; }
.erp-tabs a { padding:17px 0; font-size:13px; color:var(--muted); white-space:nowrap; font-weight:600; }
.erp-tabs a[aria-selected=true] { color:var(--accent); box-shadow:inset 0 -2px var(--accent); }
.erp-tab-panel { padding:22px; }
.erp-tab-panel[hidden] { display:none; }
.erp-tab-panel h2 { margin:0 0 16px; }
.erp-tab-panel .table-wrap { margin:0 -22px; width:calc(100% + 44px); }
.erp-context dl { margin:0; }
.erp-context dt { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.7px; margin-top:20px; }
.erp-context dd { margin:7px 0 0; font-size:13px; overflow-wrap:anywhere; }
.erp-context h2 { margin:0 0 22px; }
.erp-totals { margin:24px 0 0 auto; max-width:320px; display:grid; gap:12px; }
.erp-totals div { display:flex; justify-content:space-between; gap:20px; }
.erp-totals div:last-child { border-top:1px solid var(--line); padding-top:15px; font-weight:700; }
.erp-totals span:last-child { font-variant-numeric:tabular-nums; white-space:nowrap; }
.erp-payment-tools { margin-top:24px; }
.erp-payment-tools .invoice-workspace { grid-template-columns:1fr 1fr; }
.erp-payment-tools .invoice-payment-card { grid-column:1/-1; }
.erp-activity { padding:12px 0 16px 18px; border-left:2px solid #e1e9f5; }
.erp-activity small { display:block; margin-top:5px; color:var(--muted); }
.erp-disclosure { margin:20px 0; }
.erp-disclosure>summary { cursor:pointer; font-weight:600; padding:12px 0; }
.erp-record-heading { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.erp-record-heading h1 { margin:0; }
.erp-body .erp-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.erp-form-grid>p, .erp-form-grid>.erp-form-actions, .erp-form-grid>label:has(textarea) { grid-column:1/-1; }
.erp-form-actions { display:flex; gap:12px; }
.erp-mobile-menu { display:none; }
.skip-link { position:fixed; top:-100px; left:12px; background:#fff; padding:12px; z-index:100; }
.skip-link:focus { top:10px; }
@media (max-width:1200px) {
    .erp-body .content-body { padding:25px 24px; }
    .erp-kpi { padding:18px 15px; }
    .erp-kpi-value { font-size:21px; }
    .erp-detail-grid { grid-template-columns:minmax(0,1fr) 230px; }
    .erp-detail-summary { grid-template-columns:1fr 1fr; }
    .erp-detail-summary>div:first-child { grid-column:1/-1; }
    .erp-body .accounting-register-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
    .erp-body .app-shell { padding-left:0; }
    .erp-body .sidebar { position:relative; width:100%; height:auto; min-height:0; }
    .erp-navigation-ready .sidebar { display:none; }
    .erp-navigation-ready.erp-nav-open .sidebar { display:flex; position:fixed; top:64px; bottom:0; width:238px; height:calc(100dvh - 64px); box-shadow:8px 0 35px #101d3250; }
    .erp-body .erp-mobile-menu { display:block; padding:6px 10px; font-size:20px; }
    .erp-body .workspace-topbar { position:sticky; top:0; z-index:25; height:64px; min-height:64px; padding:0 20px; }
    .erp-body .content-body { padding:24px 20px; }
    .erp-detail-grid { grid-template-columns:1fr; }
    .erp-body .sidebar .brand-logo-wrap, .erp-body .sidebar .sidebar-footer { display:flex; }
    .erp-body .sidebar .sidebar-footer { flex-direction:column; }
    .erp-dashboard-grid { grid-template-columns:1fr; gap:18px; }
    .erp-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
    .erp-theme h1 { font-size:24px; }
    .erp-body .content-body { padding:22px 16px; }
    .erp-body .page-head { align-items:stretch; }
    .erp-date-chip { align-self:flex-start; }
    .erp-body .accounting-register-filters { grid-template-columns:1fr 1fr; }
    .erp-body .accounting-register-filters .filter-field:first-child { grid-column:1/-1; }
    .erp-topbar-account { display:none; }
    .erp-kpis { gap:10px; }
    .erp-kpi { padding:16px 12px; }
    .erp-kpi-value { font-size:19px; }
    .erp-kpi-label { font-size:12px; }
    .erp-detail-summary { padding:20px; }
    .erp-queue-row { padding:16px; align-items:flex-start; }
    .erp-queue-row .erp-queue-money { white-space:normal; }
    .erp-tabs { gap:20px; padding:0 18px; }
    .erp-payment-tools .invoice-workspace, .erp-body .erp-form-grid { grid-template-columns:1fr; }
    .erp-body .actions { flex-wrap:wrap; }
}
@media print {
    .erp-body .sidebar, .erp-body .workspace-topbar, .erp-body .skip-link { display:none; }
    .erp-body .app-shell { padding:0; }
    .erp-tab-panel[hidden] { display:block; }
    .erp-detail-grid, .erp-dashboard-grid { display:block; }
}
.erp-body .accounting-register-filters { grid-template-columns:2fr 1fr 1fr auto auto; margin-bottom:16px; border:1px solid var(--line); }
.erp-body .accounting-register-filters .filter-field { border:0; padding:0; box-shadow:none; background:none; }
.erp-body .accounting-register-filters .filter-field>span:first-child { font-size:11px; font-weight:500; color:var(--muted); }
.erp-advanced-filters { grid-column:1/-1; }
.erp-advanced-filters>summary { font-size:12px; color:var(--muted); cursor:pointer; padding:3px 0; }
.erp-advanced-filters>div { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; padding-top:14px; }
.erp-body .invoice-register-table th, .erp-body .invoice-register-table td { text-align:left; padding:14px 15px; }
.erp-body .invoice-register-table th:nth-last-child(-n+2), .erp-body .invoice-register-table td:nth-last-child(-n+2) { text-align:right; }
.erp-body .invoice-register-table th { white-space:nowrap; }
@media(max-width:1100px) {
    .erp-body .accounting-register-filters { grid-template-columns:2fr 1fr 1fr; }
    .erp-advanced-filters>div { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:620px) {
    .erp-body .accounting-register-filters { grid-template-columns:1fr 1fr; }
    .erp-advanced-filters>div { grid-template-columns:1fr 1fr; }
}
.erp-detail-grid>* { min-width:0; }
.erp-theme .table-wrap { max-width:100%; }
.erp-body .accounting-register-filters input, .erp-body .accounting-register-filters select { border:1px solid #dce4ef; padding:9px 10px; }
@media(max-width:900px) {
    .erp-body .erp-mobile-menu { width:40px; flex:0 0 40px; }
    .erp-breadcrumb { flex-wrap:nowrap; overflow:hidden; }
    .erp-breadcrumb strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .erp-detail-grid { grid-template-columns:minmax(0,1fr); }
}

/* Screen components are shared by all modules. Keep document/QR print rules intact. */
@media screen {
    .erp-theme { font-size:14px; line-height:1.5; }
    .erp-theme :is(h1,h2,h3) { color:var(--ink); }
    .erp-theme h3 { font-size:14px; font-weight:650; }
    .erp-theme :is(p,dd,td) { overflow-wrap:anywhere; }
    .erp-theme :is(label,.form-field,.production-field) { color:var(--text-secondary); font-weight:600; }
    .erp-theme :is(.muted,.crumb,.field-help,.card span,.stat-card span,.stat-card small,.erp-field-label,.erp-context dt) { color:var(--muted); }
    .erp-theme :is(.field-help,.stat-card small) { font-weight:400; line-height:1.5; }
    .erp-theme :is(.panel,.card,.stat-card,.warehouse-card,.share-card,.explorer-pane,.public-card,.file-list,.warehouse-reel-list,.warehouse-movement-list,.toolbar,.table-wrap) {
        background:var(--surface); border-color:var(--line); border-radius:var(--radius); box-shadow:var(--shadow-soft); min-width:0;
    }
    .erp-theme :is(.panel-inset,.offer-line-grid,.permission-setup-card,.module-permission,.production-worker,.production-supervisors) { border-color:var(--line); border-radius:var(--control-radius); }
    .erp-theme :is(.card,.stat-card,.warehouse-card) { padding:20px; }
    .erp-theme :is(.card strong,.stat-card strong) { font-size:26px; line-height:1.25; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
    .erp-theme :is(.card span,.stat-card span,.stat-card small) { font-size:12px; font-weight:500; }
    .erp-theme .panel>h2:first-child { margin-top:0; }
    .erp-theme :is(.grid,.explorer-layout,.analytics-grid,.stats-grid,.cards,.form-grid,.production-form-grid,.invoice-workspace)>* { min-width:0; }
    .erp-theme :is(.stack,.grid) { gap:20px; }
    .erp-theme :is(.panel,.table-wrap,.explorer-pane)+h2 { margin-top:28px; }
    .erp-theme :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
        border:1px solid var(--input-line); border-radius:var(--control-radius); color:var(--ink); background-color:var(--surface); padding:10px 12px; min-height:42px; max-width:100%; font-size:14px; box-shadow:none;
    }
    .erp-theme :is(input,textarea)::placeholder { color:var(--muted); opacity:1; }
    .erp-theme textarea { min-height:110px; }
    .erp-theme select { padding-right:34px; }
    .erp-theme input:is([type=checkbox],[type=radio]) { width:18px; height:18px; min-height:0; flex:0 0 18px; accent-color:var(--accent); vertical-align:middle; }
    .erp-theme input[type=file] { padding:7px; }
    .erp-theme input[type=file]::file-selector-button { border:0; border-radius:4px; padding:7px 10px; margin-right:10px; background:var(--accent-soft); color:var(--accent-strong); font:inherit; cursor:pointer; }
    .erp-theme :is(input,select,textarea):focus { border-color:var(--accent); box-shadow:0 0 0 3px #1763dc18; }
    .erp-theme :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
    .erp-theme .sidebar :is(a,button):focus-visible { outline-color:#a8ceff; }
    .erp-theme :is(input,select,textarea)[aria-invalid=true] { border-color:var(--danger); }
    .erp-theme :is(input,select,textarea):disabled, .erp-theme input[readonly] { background-color:var(--surface-soft); color:var(--muted); }
    .erp-theme :is(button,.button) { background:var(--accent); border:1px solid var(--accent); color:#fff; border-radius:var(--control-radius); min-height:40px; padding:10px 14px; font-size:13px; font-weight:600; box-shadow:none; }
    .erp-theme :is(button,.button):hover { background:var(--accent-strong); border-color:var(--accent-strong); }
    .erp-theme :is(button,.button).secondary { background:var(--surface); border-color:var(--input-line); color:var(--text-secondary); }
    .erp-theme :is(button,.button).secondary:hover { background:var(--surface-soft); border-color:var(--text-secondary); }
    .erp-theme :is(button,.button).danger { background:var(--danger); border-color:var(--danger); color:#fff; }
    .erp-theme :is(button,.button).danger:hover { background:#912018; border-color:#912018; }
    .erp-theme :is(button,.button):disabled, .erp-theme .button[aria-disabled=true] { opacity:.55; cursor:not-allowed; }
    .erp-theme .side-nav button.nav-link { background:transparent; color:var(--nav-text); border:0; justify-content:flex-start; min-height:39px; }
    .erp-theme .side-nav button.nav-link:hover { background:var(--navy-hover); color:#fff; }
    .erp-theme :is(.filter-field,.accounting-register-filters .filter-field) { border:0; padding:0; background:none; box-shadow:none; gap:7px; }
    .erp-theme :is(.filter-field,.accounting-register-filters .filter-field)>span:first-child { color:var(--muted); font-size:12px; font-weight:500; text-transform:none; }
    .erp-theme :is(.toolbar,.explorer-filters,.folder-searchbar,.accounting-register-filters) { padding:16px; gap:12px; }
    .erp-theme .filter-field :is(input,select) { min-height:42px; border:1px solid var(--input-line); padding:10px 12px; background-color:var(--surface); }
    .erp-theme .filter-field select { padding-right:34px; }
    .erp-theme .select-wrap::after { right:14px; top:16px; }
    .erp-theme .table-wrap { max-width:100%; overflow:auto; }
    .erp-theme table { font-size:13px; }
    .erp-theme th { background:var(--surface-soft); color:#52637a; font-size:11px; font-weight:600; letter-spacing:.45px; }
    .erp-theme :is(th,td) { border-bottom-color:var(--line); padding:14px 16px; }
    .erp-theme td { color:var(--text-secondary); }
    .erp-theme tbody tr:hover { background:#f8fbff; }
    .erp-theme :is(.file-badge,.catalog-status,.sales-status,.version-chip,.production-status,.reel-status,.command-pill) { border:1px solid transparent; border-radius:5px; display:inline-flex; align-items:center; font-size:11px; font-weight:600; line-height:1.35; padding:4px 8px; white-space:nowrap; }
    .erp-theme :is(.file-badge,.reel-status) { background:var(--success-soft); color:var(--success); }
    .erp-theme :is(.catalog-status.is-active,.sales-status.is-accepted,.file-badge.status-paid,.file-badge.status-documents-ready,.file-badge.status-delivered,.file-badge.status-closed,.file-badge.status-received,.production-status-active,.production-status-submitted,.production-status-completed) { background:var(--success-soft); color:var(--success); }
    .erp-theme :is(.sales-status.is-pending,.file-badge.status-requested,.file-badge.status-preparing,.production-status-maintenance,.production-status-reopened,.reel-status.status-reserved,.reel-status.status-adjust,.reel-status.status-warning,.command-pill) { background:var(--warning-soft); color:var(--warning); }
    .erp-theme :is(.sales-status.is-lost,.catalog-status.is-inactive,.file-badge.status-overdue,.file-badge.status-missing,.production-status-inactive,.production-status-cancelled,.production-status-deleted,.reel-status.status-scrap,.reel-status.status-critical) { background:var(--danger-soft); color:var(--danger); }
    .erp-theme :is(.version-chip,.file-badge.status-approved,.file-badge.status-uploaded,.file-badge.status-shipped,.file-badge.status-ordered,.production-status-open,.reel-status.status-used,.reel-status.status-out,.reel-status.status-info) { background:var(--info-soft); color:var(--info); }
    .erp-theme :is(.file-badge.status-draft,.file-badge.status-pending,.file-badge.status-cancelled,.file-badge.status-not-required,.file-badge.is-archived,.production-status-draft) { background:var(--neutral-soft); color:var(--neutral); }
    .erp-theme :is(.file-badge.status-partial,.file-badge.status-partiallyreceived,.file-badge.status-partially-received) { background:var(--partial-soft); color:var(--partial); }
    .erp-theme :is(.flash,.ok) { border:1px solid var(--success-line); color:var(--success); background:var(--success-soft); border-radius:var(--control-radius); }
    .erp-theme :is(.error,.bad) { border:1px solid var(--danger-line); color:var(--danger); background:var(--danger-soft); border-radius:var(--control-radius); }
    .erp-theme .production-field-error { color:var(--danger); }
    .erp-theme .warehouse-card.is-low { border-color:var(--warning-line); }
    .erp-theme .warehouse-meter span, .erp-theme .chart-track i { background:var(--accent); }
    .erp-theme .warehouse-card.is-low .warehouse-meter span, .erp-theme .chart-track i.sales-pending { background:var(--warning); }
    .erp-theme .chart-track i.sales-accepted { background:var(--success); }
    .erp-theme .chart-track i.sales-lost { background:var(--danger); }
    .erp-theme .stat-card.sales-accepted { border-top-color:var(--success); }
    .erp-theme .stat-card.sales-pending { border-top-color:var(--warning); }
    .erp-theme .stat-card.sales-lost { border-top-color:var(--danger); }
    .erp-theme .production-nav a { color:var(--muted); border-bottom:2px solid transparent; padding:9px 0; font-size:13px; }
    .erp-theme .production-nav a[aria-current=page], .erp-theme .production-nav a.active { color:var(--accent); border-bottom-color:var(--accent); }
    .erp-theme .public-shell { padding:32px 20px; min-height:100dvh; }
    .erp-theme .public-card { max-width:1100px; width:100%; }
    .erp-theme .public-card .content-body { padding:28px; min-width:0; overflow:visible; }
    .erp-theme .share-page { min-width:0; }
    .erp-theme .share-download-button { min-height:44px; }
    .erp-theme .share-hero { border-color:var(--line); }
    .erp-theme .skip-link { border:2px solid var(--accent); border-radius:var(--control-radius); box-shadow:0 4px 15px #101d3220; }
    .erp-theme.auth-body { background:var(--canvas); }
    .erp-theme.auth-body .public-shell { padding:40px 20px; }
    .erp-theme.auth-body .public-card { max-width:440px; border:0; background:none; box-shadow:none; }
    .erp-theme.auth-body .public-card .content-body { padding:0; }
    .erp-theme.auth-body .narrow { margin:0; max-width:none; }
    .erp-theme .login-card { width:100%; max-width:440px; margin-inline:auto; background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:0 12px 36px #101d3210; text-align:left; }
    .erp-theme .login-brand { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:24px 30px; background:var(--navy); color:var(--nav-text); }
    .erp-theme .login-logo { width:138px; max-width:138px; max-height:45px; margin:0; filter:brightness(0) invert(1); }
    .erp-theme .login-brand span { font-size:11px; line-height:1.45; max-width:82px; text-align:right; }
    .erp-theme .login-content { padding:32px 30px 26px; }
    .erp-theme .login-eyebrow { color:var(--accent-strong); font-size:10px; font-weight:700; letter-spacing:1.3px; text-transform:uppercase; margin:0 0 9px; }
    .erp-theme .login-content h1 { font-size:27px; letter-spacing:-.7px; margin:0 0 8px; }
    .erp-theme .login-intro { color:var(--muted); font-size:13px; margin:0 0 26px; }
    .erp-theme .login-form { margin:0; gap:20px; }
    .erp-theme .login-form label { font-size:13px; font-weight:600; gap:8px; }
    .erp-theme .login-form input { min-height:46px; }
    .erp-theme .login-password-group { display:grid; gap:8px; }
    .erp-theme .password-control { position:relative; }
    .erp-theme .password-control:has(.password-toggle:not([hidden])) input { padding-right:70px; }
    .erp-theme button.password-toggle { position:absolute; top:4px; right:4px; width:auto; min-width:56px; min-height:38px; border:0; background:transparent; color:var(--accent-strong); padding:7px 9px; font-size:12px; }
    .erp-theme button.password-toggle:hover { background:var(--accent-soft); }
    .erp-theme button.password-toggle[hidden] { display:none; }
    .erp-theme button.login-submit { width:100%; min-height:46px; font-size:14px; margin-top:4px; justify-content:space-between; padding-inline:16px; }
    .erp-theme .login-footnote { border-top:1px solid var(--line); padding-top:20px; margin:24px 0 0; text-align:center; color:var(--muted); font-size:11px; }
    .erp-theme .login-error { font-size:13px; margin:0 0 22px; text-align:left; }
    .erp-theme.diagnostic-body { padding:32px 20px; }
    .erp-theme.diagnostic-body .box { max-width:960px; margin:30px auto; padding:28px; border-radius:var(--radius); }
    .erp-theme.diagnostic-body .box>h1 { margin-bottom:16px; }
    .erp-theme.diagnostic-body code { background:var(--neutral-soft); border-radius:4px; padding:2px 5px; overflow-wrap:anywhere; }
    .erp-theme.diagnostic-body pre { background:var(--surface-soft); border:1px solid var(--line); border-radius:var(--control-radius); white-space:pre-wrap; overflow-wrap:anywhere; padding:16px; }
    .erp-theme.diagnostic-body table { margin-top:20px; }
}
@media screen and (max-width:900px) {
    .erp-theme :is(.cards,.stats-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .erp-theme .production-mobile-menu { display:none; }
    .erp-theme .erp-mobile-menu { width:40px; min-width:40px; }
}
@media screen and (max-width:620px) {
    .erp-theme :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px; }
    .erp-theme .panel, .erp-theme .explorer-pane { padding:18px; }
    .erp-theme :is(.card,.stat-card,.warehouse-card) { padding:16px; }
    .erp-theme :is(.card strong,.stat-card strong) { font-size:23px; }
    .erp-theme .erp-panel { padding:0; }
    .erp-theme .public-shell { padding:20px 14px; }
    .erp-theme .public-card .content-body { padding:20px 16px; }
    .erp-theme.auth-body .public-shell { padding:24px 16px; }
    .erp-theme .login-content { padding:28px 24px 24px; }
    .erp-theme .login-brand { padding:22px 24px; }
    .erp-theme .login-content h1 { font-size:26px; }
    .erp-theme .login-form input { font-size:16px; }
    .erp-theme :is(.panel-heading,.production-section-head) { flex-wrap:wrap; }
    .erp-theme.diagnostic-body { padding:20px 14px; }
    .erp-theme.diagnostic-body .box { margin:12px auto; padding:20px; }
}
@media (prefers-reduced-motion:reduce) {
    .erp-theme *, .erp-theme *::before, .erp-theme *::after { scroll-behavior:auto; transition:none; animation:none; }
}
@media screen {
    .erp-theme .sidebar :is(.glyph-catalog,.glyph-warehouse,.glyph-notifications,.glyph-logout)::before { background:currentColor; }
    .erp-theme .sidebar .glyph-warehouse::before { box-shadow:0 -5px 0 -2px currentColor, 0 5px 0 -2px currentColor; }
}
/* Dense records scroll as a table instead of collapsing identifiers into vertical text. */
@media screen {
    .erp-theme td { overflow-wrap:normal; word-break:normal; }
    .erp-theme td :is(code,.share-url,.copy-link) { overflow-wrap:anywhere; }
}
@media screen and (max-width:620px) {
    .erp-theme .table-wrap table:has(th:nth-child(4)) { min-width:640px; }
    .erp-theme .table-wrap table:has(th:nth-child(6)) { min-width:800px; }
}
@media screen {
    .erp-theme .content-body>:is(.panel,.table-wrap,.grid,.explorer-layout)+:is(.panel,.table-wrap,.grid,.explorer-layout) { margin-top:20px; }
    .erp-theme .production-module .table-wrap+.table-wrap { margin-top:16px; }
}
