/* Shared ERP styles, moved out of the page so browsers can cache them. Brand layer: movyn.css. */
        body.coal-mode {
            --surface:rgba(255,255,255,.9);
            --surface-strong:#ffffff;
            --surface-tint:rgba(241,245,249,.88);
            --ink:#142235;
            --ink-soft:#25364a;
            --muted:#61748a;
            --line:rgba(20,34,53,.1);
            --line-strong:rgba(20,34,53,.18);
            --accent:#28506f;
            --accent-strong:#16334b;
            --accent-soft:rgba(40,80,111,.12);
            --accent-fog:rgba(40,80,111,.18);
            --success:#1f7a56;
            --warn:#9a671e;
            --danger:#af463d;
            background:
                radial-gradient(circle at top left, rgba(40,80,111,.11), transparent 22%),
                radial-gradient(circle at top right, rgba(125,148,171,.14), transparent 20%),
                linear-gradient(180deg, #eef3f7 0%, #f4f7fa 46%, #f8fafc 100%);
        }
        body.coal-mode::before {
            background:
                linear-gradient(120deg, rgba(255,255,255,.22), transparent 42%),
                radial-gradient(circle at 18% 18%, rgba(255,255,255,.14), transparent 18%);
            opacity:.76;
        }
        body.fertilizer-mode {
            --bg:#eef4ee;
            --bg-soft:#f8fbf7;
            --surface:rgba(255,255,255,.9);
            --surface-strong:#ffffff;
            --surface-tint:rgba(244,248,242,.9);
            --ink:#152531;
            --ink-soft:#294050;
            --muted:#637784;
            --line:rgba(21,37,49,.1);
            --line-strong:rgba(21,37,49,.18);
            --accent:#2d6c57;
            --accent-strong:#194b3a;
            --accent-soft:rgba(45,108,87,.12);
            --accent-fog:rgba(45,108,87,.18);
            --success:#2b7f56;
            --warn:#9a691f;
            --danger:#af463d;
            background:
                radial-gradient(circle at top left, rgba(45,108,87,.12), transparent 24%),
                radial-gradient(circle at top right, rgba(160,186,151,.16), transparent 22%),
                linear-gradient(180deg, #eef5ef 0%, #f4f8f5 46%, #fafcf9 100%);
        }
        body.fertilizer-mode::before {
            background:
                linear-gradient(120deg, rgba(255,255,255,.22), transparent 40%),
                radial-gradient(circle at 16% 18%, rgba(255,255,255,.14), transparent 18%);
            opacity:.74;
        }
        body.container-mode {
            --surface:rgba(255,255,255,.9);
            --surface-strong:#ffffff;
            --surface-tint:rgba(243,241,249,.88);
            --ink:#1a1730;
            --ink-soft:#2d2945;
            --muted:#6b6580;
            --line:rgba(26,23,48,.1);
            --line-strong:rgba(26,23,48,.18);
            --accent:#5a3d8a;
            --accent-strong:#3e2566;
            --accent-soft:rgba(90,61,138,.12);
            --accent-fog:rgba(90,61,138,.18);
            --success:#1f7a56;
            --warn:#9a671e;
            --danger:#af463d;
            background:
                radial-gradient(circle at top left, rgba(90,61,138,.11), transparent 22%),
                radial-gradient(circle at top right, rgba(140,120,170,.14), transparent 20%),
                linear-gradient(180deg, #f0edf5 0%, #f5f3f8 46%, #faf9fc 100%);
        }
        body.container-mode::before {
            background:
                linear-gradient(120deg, rgba(255,255,255,.22), transparent 42%),
                radial-gradient(circle at 18% 18%, rgba(255,255,255,.14), transparent 18%);
            opacity:.76;
        }
        a { color:inherit; text-decoration:none; }
        strong { font-weight:700; }
        code {
            padding:2px 6px;
            border-radius:999px;
            background:rgba(22,33,50,.08);
            color:var(--ink);
            font-size:.92em;
        }
        .shell { max-width:1540px; margin:0 auto; padding:var(--shell-gutter); position:relative; z-index:1; }
        .app-shell {
            display:grid;
            grid-template-columns:minmax(0,1fr);
            gap:14px;
            align-items:start;
            min-height:100vh;
        }
        /* ── Sidebar layout (desktop: grid with sidebar column) ── */
        .app-shell.has-sidebar {
            grid-template-columns:260px minmax(0,1fr);
            align-items:start;
        }
        /* ── Mobile sidebar toggle button ── */
        .sidebar-toggle {
            display:none; /* hidden on desktop */
            position:fixed;
            bottom:18px;
            left:18px;
            z-index:60;
            width:48px;
            height:48px;
            border-radius:8px;
            border:1px solid var(--line);
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            color:#fff;
            box-shadow:0 14px 28px rgba(22,33,50,.18);
            cursor:pointer;
            padding:0;
            align-items:center;
            justify-content:center;
        }
        .sidebar-toggle-icon,
        .sidebar-toggle-icon::before,
        .sidebar-toggle-icon::after {
            display:block;
            width:20px;
            height:2px;
            background:#fff;
            border-radius:2px;
            position:relative;
            transition:transform .2s ease;
        }
        .sidebar-toggle-icon::before,
        .sidebar-toggle-icon::after {
            content:"";
            position:absolute;
            left:0;
            width:100%;
        }
        .sidebar-toggle-icon::before { top:-6px; }
        .sidebar-toggle-icon::after  { top:6px; }
        /* ── Mobile sidebar overlay ── */
        .sidebar-overlay {
            display:none;
            position:fixed;
            inset:0;
            z-index:68;
            background:rgba(20,34,53,.36);
            backdrop-filter:blur(3px);
        }
        .sidebar-overlay.active { display:block; }
        /* ── Sidebar close button (mobile only) ── */
        .sidebar-close {
            display:none; /* hidden on desktop */
            position:absolute;
            top:12px;
            right:12px;
            z-index:5;
            width:34px;
            height:34px;
            border-radius:8px;
            border:1px solid var(--line);
            background:rgba(255,255,255,.9);
            color:var(--ink);
            font-size:20px;
            line-height:1;
            cursor:pointer;
            padding:0;
            box-shadow:none;
        }
        .sidebar, .topbar, .panel, .stat, .hero-card, .login-card, .nav-card, .module-card, .metric-card {
            background:var(--surface);
            border:1px solid var(--line);
            border-radius:var(--radius-md);
            box-shadow:var(--shadow);
            backdrop-filter:blur(16px);
        }
        .top-nav-brand {
            display:inline-flex;
            align-items:center;
            min-height:42px;
            max-width:280px;
            padding:8px 12px;
            border-right:1px solid rgba(22,33,50,.1);
            color:var(--ink);
            font-size:13px;
            font-weight:900;
            line-height:1.15;
            white-space:nowrap;
            overflow:hidden;
            text-overflow:ellipsis;
        }
        .sidebar {
            padding:10px;
            position:sticky;
            top:16px;
            max-height:calc(100vh - 32px);
            overflow:auto;
            background:
                linear-gradient(180deg, rgba(255,255,255,.86), rgba(249,247,241,.8));
        }
        .sidebar-brand {
            padding:12px 14px;
            border-radius:8px;
            background:
                radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 30%),
                linear-gradient(145deg, rgba(24,34,50,.98), rgba(11,37,69,.94));
            color:#fff;
            margin-bottom:10px;
            box-shadow:0 24px 56px rgba(22,33,50,.16);
        }
        .sidebar-brand h1, .hero h2, .panel h3, .login-card h1, .topbar h1 {
            margin:0;
            font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",serif;
            font-weight:700;
            letter-spacing:-.03em;
            line-height:1.04;
        }
        .sidebar-brand h1 { font-size:28px; margin-top:4px; }
        .sidebar-brand p, .meta, .subtle, .nav-copy, .helper {
            color:var(--muted);
            font-size:13px;
        }
        .sidebar-brand p { color:rgba(255,255,255,.8); margin:6px 0 0; max-width:22ch; font-size:12px; }
        .section-label, .eyebrow {
            font-size:11px;
            text-transform:uppercase;
            letter-spacing:.16em;
            color:var(--muted);
            font-weight:700;
        }
        .nav-section {
            padding:6px;
            border-radius:8px;
            background:rgba(255,255,255,.16);
            border:1px solid rgba(22,33,50,.04);
        }
        .nav-section + .nav-section { margin-top:8px; }
        .nav-stack { display:grid; gap:5px; margin-top:7px; }
        .nav-card {
            display:flex;
            gap:10px;
            padding:8px 9px;
            position:relative;
            overflow:hidden;
            transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
            box-shadow:none;
            background:rgba(255,255,255,.32);
            border-color:rgba(22,33,50,.04);
        }
        .nav-card::after {
            content:"";
            position:absolute;
            inset:auto -30% -60% auto;
            width:120px;
            height:120px;
            background:radial-gradient(circle, rgba(11,37,69,.16), transparent 62%);
            pointer-events:none;
            /* opacity:.3; removed: see app.css for override */
        }
        .nav-card:hover {
            transform:translateY(-1px);
            border-color:rgba(11,37,69,.18);
            background:rgba(255,255,255,.74);
            box-shadow:0 6px 14px rgba(22,33,50,.06);
        }
        .nav-card.active {
            background:
                radial-gradient(circle at top right, rgba(255,255,255,.14), transparent 30%),
                linear-gradient(145deg, rgba(24,34,50,.98), rgba(11,37,69,.92));
            color:#fff;
            border-color:transparent;
            box-shadow:0 14px 30px rgba(22,33,50,.14);
        }
        .nav-card.active .nav-copy, .nav-card.active .section-label { color:rgba(255,255,255,.72); }
        .nav-icon {
            width:30px;
            height:30px;
            border-radius:8px;
            display:grid;
            place-items:center;
            font-size:11px;
            font-weight:800;
            letter-spacing:.08em;
            background:rgba(22,33,50,.06);
            color:var(--ink-soft);
            flex:none;
            box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
        }
        .nav-card strong { display:block; margin-bottom:1px; font-size:13px; }
        .nav-copy { font-size:12px; line-height:1.35; }
        .nav-card.active .nav-icon { background:rgba(255,255,255,.16); color:#fff; }

        /* ── Nested expandable nav-group ── */
        .nav-group { border-radius:var(--radius-md); }
        .nav-group-toggle {
            width:100%;
            border:1px solid rgba(22,33,50,.04);
            cursor:pointer;
            justify-content:space-between;
            align-items:center;
            font-family:inherit;
            color:inherit;
            text-align:left;
        }
        .nav-group-arrow {
            font-size:11px;
            transition:transform .2s ease;
            opacity:.5;
            flex:none;
        }
        .nav-group.open > .nav-group-toggle .nav-group-arrow { transform:rotate(180deg); opacity:.8; }
        .nav-group-children {
            display:none;
            padding:2px 0 4px 14px;
            border-left:2px solid rgba(11,37,69,.15);
            margin:4px 0 2px 16px;
        }
        .nav-group.open > .nav-group-children { display:grid; gap:1px; }
        .nav-child {
            display:block;
            padding:5px 10px;
            font-size:12px;
            font-weight:500;
            color:var(--ink-soft);
            border-radius:6px;
            text-decoration:none;
            transition:background .15s ease, color .15s ease;
        }
        .nav-child:hover { background:rgba(11,37,69,.08); color:var(--ink); }
        .nav-child.active {
            background:rgba(11,37,69,.14);
            color:var(--accent);
            font-weight:700;
        }

        .content-shell { min-width:0; display:grid; gap:14px; }
        .page-flow { display:grid; gap:14px; }
        .page-flow > section { min-width:0; }
        .page-flow > section + section { margin-top:0; }
        .main-menu-bar {
            display:flex;
            flex-wrap:wrap;
            gap:10px;
            align-items:center;
            padding:12px 16px;
            position:sticky;
            top:var(--shell-gutter);
            z-index:45;
            background:
                linear-gradient(180deg, rgba(255,255,255,.9), rgba(249,247,241,.78));
            border:1px solid var(--line);
            border-radius:var(--radius-md);
            box-shadow:0 18px 40px rgba(22,33,50,.1);
            backdrop-filter:blur(16px);
        }
        /* Topbar removed – CSS retained as stubs to avoid breakage if class referenced elsewhere */
        .topbar { display:none; }
        .topbar::after { display:none; }
        .topbar h1 { font-size:28px; }
        .brand {
            position:relative;
            z-index:1;
            min-width:0;
            display:grid;
            gap:6px;
        }
        .brand-row {
            display:flex;
            align-items:center;
            gap:12px;
            min-width:0;
        }
        .brand-mark {
            width:44px;
            height:44px;
            border-radius:8px;
            display:grid;
            place-items:center;
            flex:none;
            font-size:12px;
            font-weight:900;
            letter-spacing:.12em;
            color:#fff;
            background:
                radial-gradient(circle at top right, rgba(255,255,255,.26), transparent 34%),
                linear-gradient(145deg, rgba(24,34,50,.98), rgba(11,37,69,.94));
            box-shadow:0 14px 26px rgba(22,33,50,.16);
        }
        .brand-copy {
            min-width:0;
            display:grid;
            gap:2px;
        }
        .topbar-main {
            display:grid;
            gap:14px;
            min-width:0;
        }
        .topbar-head {
            display:flex;
            align-items:flex-start;
            justify-content:space-between;
            gap:16px;
        }
        .topbar-nav {
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            align-items:stretch;
            position:relative;
            z-index:2;
        }
        .top-nav-group {
            position:relative;
        }
        .top-nav-link,
        .top-nav-trigger {
            display:inline-flex;
            align-items:center;
            justify-content:center;
            gap:8px;
            min-height:42px;
            padding:10px 14px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.74);
            color:var(--ink-soft);
            font-size:12px;
            font-weight:800;
            line-height:1;
            box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
            transition:border-color .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, transform .18s ease;
        }
        .top-nav-trigger {
            appearance:none;
            font-family:inherit;
            cursor:pointer;
        }
        .top-nav-link:hover,
        .top-nav-trigger:hover {
            border-color:rgba(11,37,69,.22);
            box-shadow:0 10px 22px rgba(22,33,50,.08);
            transform:translateY(-1px);
        }
        .top-nav-link.active,
        .top-nav-group.active > .top-nav-trigger,
        .top-nav-group.open > .top-nav-trigger {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            border-color:transparent;
            color:#fff;
            box-shadow:0 14px 30px rgba(11,37,69,.18);
        }
        .top-nav-caret {
            font-size:11px;
            letter-spacing:0;
            transition:transform .18s ease;
        }
        .top-nav-group.open .top-nav-caret {
            transform:rotate(180deg);
        }
        .top-nav-panel {
            position:absolute;
            top:calc(100% + 10px);
            left:0;
            min-width:240px;
            max-width:min(280px, calc(100vw - 48px));
            padding:6px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.1);
            background:rgba(255,255,255,.98);
            box-shadow:0 16px 34px rgba(22,33,50,.12);
            backdrop-filter:blur(12px);
            display:none;
        }
        .top-nav-group.open > .top-nav-panel {
            display:grid;
            gap:0;
        }
        .top-nav-grid {
            display:grid;
            gap:2px;
            grid-template-columns:1fr;
        }
        .top-nav-grid.two-column {
            grid-template-columns:1fr;
        }
        .top-nav-item {
            display:flex;
            align-items:center;
            gap:10px;
            min-width:0;
            padding:10px 12px;
            border-radius:8px;
            border:none;
            background:transparent;
            box-shadow:none;
            transition:background .16s ease, color .16s ease;
        }
        .top-nav-item:hover {
            border-color:transparent;
            background:rgba(11,37,69,.08);
            box-shadow:none;
            transform:none;
        }
        .top-nav-item strong {
            display:block;
            font-size:13px;
            line-height:1.25;
            font-weight:700;
        }
        .top-nav-item.active {
            background:rgba(11,37,69,.12);
            border-color:transparent;
            color:var(--ink);
            box-shadow:none;
        }
        .top-nav-item.active .nav-icon {
            background:rgba(11,37,69,.14);
            color:var(--accent-strong);
        }
        .coal-workflow-nav {
            display:flex;
            flex-wrap:wrap;
            gap:8px;
            align-items:center;
            padding-top:2px;
        }
        .coal-workflow-tab {
            display:inline-flex;
            align-items:center;
            justify-content:center;
            min-height:38px;
            padding:8px 13px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(255,255,255,.78);
            color:var(--ink-soft);
            font-size:12px;
            font-weight:800;
            letter-spacing:.02em;
            box-shadow:inset 0 1px 0 rgba(255,255,255,.92);
            transition:border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
        }
        .coal-workflow-tab:hover {
            border-color:rgba(40,80,111,.24);
            box-shadow:0 10px 24px rgba(20,34,53,.08);
        }
        .coal-workflow-tab.active {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            border-color:transparent;
            color:#fff;
            box-shadow:0 14px 28px rgba(22,51,75,.18);
        }
        .coal-workflow-tab.utility {
            background:rgba(20,34,53,.05);
            color:var(--muted);
            border-style:dashed;
        }
        .coal-workflow-tab.utility.active {
            background:rgba(20,34,53,.86);
            color:#fff;
        }
        .fertilizer-nav-stack {
            display:grid;
            gap:8px;
        }
        .fertilizer-section-nav,
        .fertilizer-workflow-nav {
            display:flex;
            flex-wrap:wrap;
            gap:8px;
            align-items:center;
        }
        .fertilizer-tab {
            display:inline-flex;
            align-items:center;
            justify-content:center;
            min-height:38px;
            padding:8px 13px;
            border-radius:8px;
            border:1px solid rgba(21,37,49,.08);
            background:rgba(255,255,255,.82);
            color:var(--ink-soft);
            font-size:12px;
            font-weight:800;
            letter-spacing:.02em;
            box-shadow:inset 0 1px 0 rgba(255,255,255,.94);
            transition:border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
        }
        .fertilizer-tab:hover {
            border-color:rgba(45,108,87,.22);
            box-shadow:0 10px 22px rgba(21,37,49,.08);
        }
        .fertilizer-tab.active {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            border-color:transparent;
            color:#fff;
            box-shadow:0 14px 28px rgba(25,75,58,.18);
        }
        .fertilizer-section-nav .fertilizer-tab {
            min-height:40px;
            padding-inline:14px;
        }
        .fert-shell {
            display:grid;
            gap:12px;
        }
        .fert-surface {
            background:
                linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,249,246,.9));
            border:1px solid rgba(21,37,49,.08);
            box-shadow:0 18px 38px rgba(21,37,49,.08);
        }
        .fert-page-header {
            display:flex;
            justify-content:space-between;
            align-items:flex-start;
            gap:14px;
            flex-wrap:wrap;
        }
        .fert-page-title {
            display:grid;
            gap:4px;
            min-width:0;
        }
        .fert-page-title h3 {
            margin:0;
            font-size:22px;
            line-height:1.06;
        }
        .fert-page-title p {
            margin:0;
            color:var(--muted);
            font-size:13px;
            max-width:76ch;
        }
        .fert-inline-actions {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .fert-filter-strip,
        .fert-selection-strip,
        .fert-impact-strip {
            display:grid;
            gap:10px;
            padding:12px 14px;
            border:1px solid rgba(21,37,49,.08);
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.9), rgba(244,249,246,.8));
        }
        .fert-grid-12 {
            display:grid;
            grid-template-columns:repeat(12, minmax(0,1fr));
            gap:10px;
            align-items:start;
        }
        .fert-grid-12 > * { min-width:0; }
        .fert-span-2 { grid-column:span 2; }
        .fert-span-3 { grid-column:span 3; }
        .fert-span-4 { grid-column:span 4; }
        .fert-span-5 { grid-column:span 5; }
        .fert-span-6 { grid-column:span 6; }
        .fert-span-7 { grid-column:span 7; }
        .fert-span-8 { grid-column:span 8; }
        .fert-span-9 { grid-column:span 9; }
        .fert-span-12 { grid-column:1 / -1; }
        .fert-summary-strip {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .fert-summary-card {
            display:grid;
            gap:3px;
            min-width:112px;
            padding:9px 11px;
            border-radius:8px;
            border:1px solid rgba(21,37,49,.08);
            background:rgba(255,255,255,.78);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.86);
        }
        .fert-summary-card span {
            font-size:11px;
            font-weight:800;
            letter-spacing:.08em;
            text-transform:uppercase;
            color:var(--muted);
        }
        .fert-summary-card strong {
            font-size:15px;
            letter-spacing:-.02em;
        }
        .fert-table-shell {
            overflow:auto;
            border:1px solid rgba(21,37,49,.08);
            border-radius:8px;
            background:rgba(255,255,255,.78);
        }
        .fert-table-shell table {
            min-width:1040px;
            margin:0;
            border:none;
            border-radius:0;
            background:transparent;
        }
        .fert-table-shell.tight table { min-width:820px; }
        .fert-table-shell.tighter table { min-width:680px; }
        .fert-table-shell thead th {
            position:sticky;
            top:0;
            z-index:4;
            background:rgba(241,246,243,.97);
            box-shadow:inset 0 -1px 0 rgba(21,37,49,.08);
        }
        .fert-table-shell::-webkit-scrollbar { height:10px; }
        .fert-table-shell::-webkit-scrollbar-thumb {
            background:rgba(21,37,49,.16);
            border-radius:999px;
        }
        .fert-primary {
            display:block;
            font-weight:700;
            color:var(--ink);
        }
        .fert-secondary {
            display:block;
            margin-top:2px;
            color:var(--muted);
            font-size:11px;
            line-height:1.4;
        }
        .fert-row-actions {
            display:flex;
            justify-content:flex-end;
            gap:6px;
            flex-wrap:wrap;
        }
        .fert-row-actions .btn,
        .fert-row-actions button {
            min-height:34px;
            padding:8px 10px;
            border-radius:8px;
            font-size:12px;
            box-shadow:none;
        }
        .fert-context-strip {
            display:grid;
            grid-template-columns:repeat(5, minmax(0,1fr));
            gap:8px;
            padding:10px 12px;
            border-radius:8px;
            border:1px solid rgba(21,37,49,.08);
            background:rgba(45,108,87,.05);
        }
        .fert-context-item {
            min-width:0;
            display:grid;
            gap:3px;
        }
        .fert-context-item span {
            font-size:11px;
            font-weight:800;
            text-transform:uppercase;
            letter-spacing:.08em;
            color:var(--muted);
        }
        .fert-context-item strong {
            font-size:13px;
            color:var(--ink);
            white-space:nowrap;
            overflow:hidden;
            text-overflow:ellipsis;
        }
        .fert-register-footer,
        .fert-bottom-bar {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
        }
        .fert-bottom-bar.sticky {
            position:sticky;
            bottom:0;
            z-index:7;
            padding:12px 14px;
            border-top:1px solid rgba(21,37,49,.08);
            border-radius:0 0 18px 18px;
            background:rgba(248,251,249,.96);
        }
        .fert-inline-preview {
            display:grid;
            gap:8px;
            padding:10px 12px;
            border:1px solid rgba(21,37,49,.08);
            border-radius:8px;
            background:rgba(45,108,87,.05);
        }
        .fert-inline-preview h4 {
            margin:0;
            font-size:13px;
            color:var(--ink);
        }
        .fert-inline-preview p {
            margin:0;
            color:var(--muted);
            font-size:12px;
        }
        .fert-master-layout,
        .fert-report-layout {
            display:grid;
            grid-template-columns:260px minmax(0,1fr);
            gap:14px;
            align-items:start;
        }
        .topbar-right {
            display:flex;
            align-items:center;
            gap:8px;
            flex-wrap:wrap;
            justify-content:flex-end;
            position:relative;
            z-index:1;
        }
        .meta {
            font-size:13px;
            line-height:1.4;
            max-width:68ch;
        }
        .chip, .badge {
            display:inline-flex;
            align-items:center;
            gap:5px;
            padding:6px 10px;
            border-radius:999px;
            font-size:11px;
            font-weight:800;
            letter-spacing:.02em;
        }
        .chip {
            background:rgba(255,255,255,.78);
            border:1px solid rgba(22,33,50,.08);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
        }
        .chip.success { background:rgba(27,138,97,.12); color:var(--success); }
        .btn, button {
            appearance:none;
            border:none;
            border-radius:8px;
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            color:#fff;
            font-weight:800;
            padding:10px 14px;
            cursor:pointer;
            box-shadow:0 12px 24px rgba(11,37,69,.14);
            transition:transform .16s ease, box-shadow .16s ease, filter .16s ease, border-color .16s ease;
            font-size:13px;
            line-height:1.2;
        }
        .btn:hover, button:hover { transform:translateY(-1px); filter:saturate(1.05); box-shadow:0 14px 28px rgba(11,37,69,.18); }
        .btn:active, button:active { transform:translateY(0); }
        .btn.secondary, button.secondary {
            background:rgba(255,255,255,.84);
            color:var(--ink);
            border:1px solid var(--line);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
        }
        .btn.secondary:hover, button.secondary:hover { border-color:rgba(11,37,69,.22); box-shadow:0 8px 18px rgba(22,33,50,.08); }
        .topbar button.top-nav-trigger {
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.74);
            color:var(--ink-soft);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
            padding:10px 14px;
        }
        .topbar button.top-nav-trigger:hover {
            border-color:rgba(11,37,69,.22);
            box-shadow:0 10px 22px rgba(22,33,50,.08);
            filter:none;
        }
        .topbar .top-nav-group.active > button.top-nav-trigger,
        .topbar .top-nav-group.open > button.top-nav-trigger {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            color:#fff;
            border-color:transparent;
            box-shadow:0 14px 30px rgba(11,37,69,.18);
        }
        .hero { display:grid; grid-template-columns:1.45fr .95fr; gap:22px; }
        .hero-card, .panel, .login-card { padding:16px; }
        .hero-card {
            position:relative;
            overflow:hidden;
            background:
                linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,243,235,.84));
        }
        .hero-card.accent {
            background:
                radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 28%),
                linear-gradient(140deg, rgba(24,34,50,.98), rgba(11,37,69,.9));
            color:#fff;
            box-shadow:var(--shadow-lg);
        }
        .hero-card.accent .eyebrow,
        .hero-card.accent p,
        .hero-card.accent .subtle { color:rgba(255,255,255,.8); }
        .hero-card p { margin:12px 0 0; max-width:68ch; }
        .hero-card .list { margin-top:14px; }
        .stats, .metric-grid, .module-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; }
        .module-grid { grid-template-columns:repeat(3, minmax(0,1fr)); }
        .stat, .metric-card {
            padding:16px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,243,236,.78));
            position:relative;
            overflow:hidden;
            min-height:128px;
        }
        .stat::before, .metric-card::before {
            content:"";
            position:absolute;
            inset:0 auto auto 0;
            width:100%;
            height:4px;
            background:linear-gradient(90deg, var(--accent), rgba(11,37,69,.04));
        }
        .stat-value { font-size:34px; font-weight:800; margin-top:10px; letter-spacing:-.04em; }
        .stat .subtle, .metric-card .subtle { display:block; margin-top:8px; }
        .grid { display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:14px; align-items:start; }
        .grid > * { min-width:0; }
        .span-4 { grid-column:span 4; } .span-5 { grid-column:span 5; } .span-6 { grid-column:span 6; } .span-7 { grid-column:span 7; } .span-8 { grid-column:span 8; } .span-12 { grid-column:span 12; }
        .panel {
            position:relative;
            overflow:hidden;
            background:
                linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,243,236,.8));
        }
        .panel::before {
            content:"";
            position:absolute;
            inset:0;
            background:linear-gradient(180deg, rgba(255,255,255,.08), transparent 22%);
            pointer-events:none;
        }
        .panel-head {
            display:flex;
            justify-content:space-between;
            align-items:flex-start;
            gap:10px;
            margin-bottom:12px;
            padding-bottom:10px;
            border-bottom:1px solid rgba(22,33,50,.08);
        }
        .panel h3 { font-size:21px; margin:0; }
        .panel .panel {
            margin-top:12px;
            background:rgba(255,255,255,.56);
            box-shadow:none;
        }
        .panel > :last-child { margin-bottom:0; }
        .panel-copy {
            display:none;
        }
        table {
            width:100%;
            border-collapse:separate;
            border-spacing:0;
            background:rgba(255,255,255,.55);
            border:1px solid rgba(22,33,50,.08);
            border-radius:8px;
            overflow:hidden;
        }
        thead th {
            background:rgba(241,244,240,.96);
            color:var(--muted);
            text-transform:uppercase;
            letter-spacing:.08em;
            font-size:11px;
            font-weight:800;
            border-bottom:1px solid rgba(22,33,50,.08);
            position:static;
            top:auto;
            z-index:auto;
            backdrop-filter:none;
        }
        tfoot th, tfoot td {
            background:rgba(236,241,236,.92);
            color:var(--ink-soft);
            font-weight:800;
        }
        th, td {
            padding:9px 11px;
            border-bottom:1px solid rgba(22,33,50,.08);
            text-align:left;
            font-size:12.5px;
            vertical-align:middle;
        }
        tbody tr { transition:background .14s ease; }
        tbody tr:nth-child(even) { background:rgba(248,249,246,.78); }
        tbody tr:hover { background:rgba(11,37,69,.05); }
        tbody tr:nth-child(even):hover { background:rgba(11,37,69,.07); }
        tbody tr:last-child td { border-bottom:none; }
        .amount { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
        .badge { background:var(--accent-soft); color:var(--accent-strong); border:1px solid rgba(11,37,69,.12); }
        .badge.warn { background:rgba(165,111,24,.14); color:var(--warn); border-color:rgba(165,111,24,.14); }
        .badge.ghost { background:rgba(22,33,50,.06); color:var(--muted); border-color:rgba(22,33,50,.06); }
        .list { display:grid; gap:8px; }
        form.list { gap:12px; }
        .list-item {
            padding:10px 12px;
            border:1px solid rgba(22,33,50,.08);
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.88), rgba(247,243,236,.7));
            box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
        }
        .list-item strong { display:block; margin-bottom:4px; }
        .list-item .panel-head { margin-bottom:14px; padding-bottom:12px; }
        .form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
        .field { display:grid; gap:6px; align-content:start; }
        .field.full { grid-column:1 / -1; }
        label {
            font-size:11px;
            font-weight:800;
            text-transform:uppercase;
            letter-spacing:.07em;
            color:var(--muted);
        }
        input, select, textarea {
            width:100%;
            padding:9px 11px;
            border:1px solid rgba(22,33,50,.12);
            border-radius:8px;
            background:rgba(255,255,255,.94);
            color:var(--ink);
            font:inherit;
            transition:border-color .14s ease, box-shadow .14s ease, background .14s ease;
            box-shadow:inset 0 1px 1px rgba(255,255,255,.9);
            font-size:13px;
        }
        textarea { min-height:120px; resize:vertical; }
        input[type="checkbox"], input[type="radio"] {
            width:18px;
            height:18px;
            padding:0;
            accent-color:var(--accent);
            box-shadow:none;
        }
        input::placeholder, textarea::placeholder { color:#96a2b3; }
        input:hover, select:hover, textarea:hover { border-color:rgba(22,33,50,.18); }
        input:focus, select:focus, textarea:focus {
            outline:none;
            border-color:rgba(11,37,69,.45);
            box-shadow:0 0 0 4px rgba(11,37,69,.12);
            background:#fff;
        }
        .erp-smart-select {
            position: relative;
            width: 100%;
            min-width: 0;
        }
        .erp-smart-select-source {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: 0 !important;
            overflow: hidden !important;
            clip: rect(0 0 0 0) !important;
            clip-path: inset(50%) !important;
            border: 0 !important;
            white-space: nowrap !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        .erp-smart-select-compact {
            appearance: none;
            padding-right: 40px;
            background-image:
                linear-gradient(45deg, transparent 50%, rgba(49,65,84,.82) 50%),
                linear-gradient(135deg, rgba(49,65,84,.82) 50%, transparent 50%);
            background-position:
                calc(100% - 17px) calc(50% - 1px),
                calc(100% - 11px) calc(50% - 1px);
            background-size: 6px 6px, 6px 6px;
            background-repeat: no-repeat;
        }
        .erp-smart-select-trigger {
            width: 100%;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 12px;
            border: 1px solid rgba(22,33,50,.12);
            border-radius: 8px;
            background: rgba(255,255,255,.96);
            color: var(--ink);
            font: inherit;
            text-align: left;
            transition: border-color .14s ease, box-shadow .14s ease, background .14s ease, transform .14s ease;
            box-shadow: inset 0 1px 1px rgba(255,255,255,.9);
        }
        .erp-smart-select-trigger:hover {
            border-color: rgba(22,33,50,.18);
            transform: translateY(-1px);
        }
        .erp-smart-select.open .erp-smart-select-trigger,
        .erp-smart-select-trigger:focus {
            outline: none;
            border-color: rgba(11,37,69,.45);
            box-shadow: 0 0 0 4px rgba(11,37,69,.12);
            background: #fff;
        }
        .erp-smart-select.is-invalid .erp-smart-select-trigger {
            border-color: rgba(181,74,65,.45);
            box-shadow: 0 0 0 4px rgba(181,74,65,.12);
        }
        .erp-smart-select-trigger[disabled] {
            cursor: not-allowed;
            opacity: .72;
            transform: none;
            background: rgba(244,246,248,.92);
        }
        .erp-smart-select-trigger-copy {
            min-width: 0;
            display: grid;
            gap: 2px;
        }
        .erp-smart-select-trigger-label {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 13px;
            font-weight: 600;
        }
        .erp-smart-select-trigger-meta {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--muted);
            font-size: 11px;
        }
        .erp-smart-select-trigger-meta[hidden] {
            display: none;
        }
        .erp-smart-select-trigger-placeholder {
            color: #96a2b3;
            font-weight: 500;
        }
        .erp-smart-select-trigger-caret {
            flex: 0 0 auto;
            color: var(--muted);
            font-size: 11px;
        }
        .erp-smart-select-popover,
        .erp-smart-select-overlay {
            z-index: 140;
        }
        .erp-smart-select-popover {
            position: fixed;
            display: grid;
            gap: 0;
            border: 1px solid rgba(22,33,50,.12);
            border-radius: 8px;
            background: rgba(255,255,255,.99);
            box-shadow: 0 22px 46px rgba(22,33,50,.18);
            overflow: hidden;
            backdrop-filter: blur(16px);
        }
        .erp-smart-select-popover[hidden],
        .erp-smart-select-overlay[hidden] {
            display: none;
        }
        .erp-smart-select-overlay {
            position: fixed;
            inset: 0;
            display: grid;
            align-items: flex-end;
            justify-items: stretch;
        }
        .erp-smart-select-backdrop {
            position: absolute;
            inset: 0;
            border: 0;
            background: rgba(15,23,36,.34);
            padding: 0;
            margin: 0;
            cursor: default;
        }
        .erp-smart-select-sheet {
            position: relative;
            display: grid;
            grid-template-rows: auto auto minmax(0, 1fr);
            width: min(760px, calc(100vw - 28px));
            max-width: 100vw;
            max-height: min(88vh, calc(100vh - 24px));
            margin: 16px auto;
            border: 1px solid rgba(22,33,50,.12);
            border-radius: 8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,249,250,.96));
            box-shadow: 0 34px 80px rgba(22,33,50,.24);
            overflow: hidden;
        }
        .erp-smart-select-head {
            position: sticky;
            top: 0;
            z-index: 3;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px 10px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
            border-bottom: 1px solid rgba(22,33,50,.08);
        }
        .erp-smart-select-head-copy {
            min-width: 0;
            display: grid;
            gap: 2px;
        }
        .erp-smart-select-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--ink);
        }
        .erp-smart-select-subtitle {
            color: var(--muted);
            font-size: 11px;
        }
        .erp-smart-select-close {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: 1px solid rgba(22,33,50,.08);
            border-radius: 8px;
            background: rgba(255,255,255,.86);
            color: var(--ink-soft);
            font: inherit;
            font-size: 18px;
            line-height: 1;
            cursor: pointer;
            transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
        }
        .erp-smart-select-close:hover,
        .erp-smart-select-close:focus {
            outline: none;
            border-color: rgba(11,37,69,.22);
            background: #fff;
            box-shadow: 0 10px 24px rgba(22,33,50,.08);
        }
        .erp-smart-select-popover .erp-smart-select-close {
            display: none;
        }
        .erp-smart-select-search-shell {
            position: sticky;
            top: 0;
            z-index: 2;
            padding: 12px 14px;
            background: rgba(255,255,255,.98);
            border-bottom: 1px solid rgba(22,33,50,.08);
        }
        .erp-smart-select-search {
            width: 100%;
            min-height: 40px;
        }
        .erp-smart-select-list {
            min-height: 0;
            overflow: auto;
            padding: 8px;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .erp-smart-select-list::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }
        .erp-smart-select-list::-webkit-scrollbar-thumb {
            background: rgba(32,51,76,.18);
            border-radius: 999px;
        }
        .erp-smart-select-group-label {
            padding: 10px 12px 6px;
            color: var(--muted);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .14em;
            text-transform: uppercase;
        }
        .erp-smart-select-option,
        .erp-smart-select-empty {
            width: 100%;
            display: grid;
            gap: 4px;
            padding: 11px 12px;
            border: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--ink);
            font: inherit;
            text-align: left;
        }
        .erp-smart-select-option {
            cursor: pointer;
            transition: background .14s ease, box-shadow .14s ease, transform .14s ease;
        }
        .erp-smart-select-option:hover,
        .erp-smart-select-option.active {
            background: rgba(11,37,69,.08);
            transform: translateY(-1px);
        }
        .erp-smart-select-option.selected {
            background: rgba(11,37,69,.14);
            box-shadow: inset 0 0 0 1px rgba(11,37,69,.12);
        }
        .erp-smart-select-option:focus {
            outline: none;
            background: rgba(11,37,69,.12);
        }
        .erp-smart-select-option[disabled] {
            cursor: not-allowed;
            opacity: .58;
            transform: none;
        }
        .erp-smart-select-option-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }
        .erp-smart-select-option-title {
            min-width: 0;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.35;
        }
        .erp-smart-select-option-badges {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .erp-smart-select-option-badge {
            display: inline-flex;
            align-items: center;
            min-height: 22px;
            padding: 4px 8px;
            border-radius: 999px;
            background: rgba(22,33,50,.06);
            color: var(--ink-soft);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: .04em;
            text-transform: uppercase;
        }
        .erp-smart-select-option-badge.meta {
            background: rgba(32,51,76,.08);
        }
        .erp-smart-select-option-badge.hint {
            background: rgba(11,37,69,.12);
            color: var(--accent-strong);
        }
        .erp-smart-select-option-badge.selected {
            background: rgba(11,37,69,.18);
            color: var(--accent-strong);
        }
        .erp-smart-select-option-meta,
        .erp-smart-select-option-description {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.4;
        }
        .erp-smart-select-empty {
            color: var(--muted);
            cursor: default;
            padding-block: 18px;
        }
        body.erp-smart-select-lock {
            overflow: hidden;
        }
        @media (max-width: 900px) {
            .erp-smart-select-sheet {
                width: min(100vw, calc(100vw - 12px));
                max-height: calc(100vh - 8px);
                margin: 8px auto 0;
                border-radius: 8px 24px 0 0;
            }
        }
        @media (max-width: 720px) {
            .erp-smart-select-popover {
                left: 10px !important;
                right: 10px !important;
                width: auto !important;
                max-width: none !important;
            }
            .erp-smart-select-overlay {
                align-items: stretch;
            }
            .erp-smart-select-sheet {
                width: 100vw;
                max-height: 100vh;
                margin: 0;
                border-radius: 0;
                border-inline: 0;
                border-bottom: 0;
            }
            .erp-smart-select-head {
                padding-top: calc(14px + env(safe-area-inset-top, 0px));
            }
            .erp-smart-select-list {
                padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
            }
        }
        td input, td select {
            min-width:120px;
            padding:8px 10px;
            border-radius:8px;
        }
        .table-shell {
            overflow:auto;
            margin:0 -4px;
            padding:0 4px 4px;
        }
        .table-shell table { min-width:720px; }
        .table-shell.compact table { min-width:560px; }
        .table-shell::-webkit-scrollbar { height:10px; }
        .table-shell::-webkit-scrollbar-thumb {
            background:rgba(32,51,76,.18);
            border-radius:999px;
        }
        .flash, .errors {
            margin-bottom:4px;
            padding:12px 14px;
            border-radius:8px;
            box-shadow:var(--shadow-sm);
        }
        .flash {
            background:rgba(27,138,97,.12);
            color:var(--success);
            border:1px solid rgba(27,138,97,.18);
        }
        .entry-saved-banner {
            display:flex;
            align-items:center;
            gap:12px;
            padding:10px 16px;
            margin-bottom:6px;
            border-radius:8px;
            background:rgba(27,138,97,.10);
            border:1px solid rgba(27,138,97,.18);
            color:var(--success);
            font-size:var(--text-sm);
            box-shadow:var(--shadow-sm);
        }
        .entry-saved-banner .saved-label {
            flex:1;
            font-weight:600;
        }
        .entry-saved-banner .saved-actions {
            display:flex;
            gap:8px;
            flex-shrink:0;
        }
        .entry-saved-banner .saved-actions a {
            padding:4px 12px;
            border-radius:8px;
            font-size:var(--text-xs);
            font-weight:600;
            text-decoration:none;
            transition:background .15s;
        }
        .entry-saved-banner .btn-view-saved {
            background:rgba(27,138,97,.14);
            color:var(--success);
        }
        .entry-saved-banner .btn-view-saved:hover {
            background:rgba(27,138,97,.24);
        }
        .entry-saved-banner .btn-continue {
            background:rgba(27,138,97,.06);
            color:var(--success);
        }
        .entry-saved-banner .btn-continue:hover {
            background:rgba(27,138,97,.14);
        }
        .errors {
            background:rgba(181,74,65,.11);
            color:var(--danger);
            border:1px solid rgba(181,74,65,.16);
        }
        .login-shell {
            min-height:100vh;
            display:grid;
            place-items:center;
            padding:28px;
            position:relative;
            z-index:1;
        }
        .login-card {
            width:min(500px,100%);
            background:
                radial-gradient(circle at top right, rgba(11,37,69,.1), transparent 24%),
                linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,243,236,.84));
        }
        .login-card h1 { font-size:44px; margin-bottom:10px; }
        .footer-note { margin-top:18px; color:var(--muted); font-size:13px; }
        .action-row {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            margin-top:10px;
            align-items:center;
        }
        .action-row.tight { margin-top:0; }
        .action-row.compact { margin-top:6px; }
        .action-row form { margin:0; }
        .action-row .btn { display:inline-flex; align-items:center; }
        .module-card {
            padding:16px;
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,243,236,.74));
            transition:transform .16s ease, box-shadow .16s ease;
            display:flex;
            flex-direction:column;
            gap:8px;
            min-height:100%;
        }
        .module-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
        .module-card h3, .hero-card h2, .panel h3, .stat-value, .metric-card strong { color:var(--ink); }
        .module-card p { margin:0; }
        .module-card .action-row { margin-top:auto; }
        .hero-card.accent h2, .hero-card.accent .stat-value { color:#fff; }
        .metric-card strong { display:block; font-size:26px; margin-top:8px; letter-spacing:-.04em; }
        .empty-state {
            padding:16px 18px;
            border:1px dashed rgba(22,33,50,.2);
            border-radius:8px;
            color:var(--muted);
            background:rgba(255,255,255,.45);
            display:grid;
            gap:10px;
        }
        .empty-state strong {
            color:var(--ink-soft);
            font-size:16px;
        }
        .toolbar-links { display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
        .toolbar-links a {
            padding:10px 14px;
            border-radius:999px;
            border:1px solid rgba(255,255,255,.16);
            background:rgba(255,255,255,.12);
            font-weight:700;
        }
        .toolbar-links .chip,
        .choice-chip {
            cursor:pointer;
            display:inline-flex;
            align-items:center;
            gap:10px;
            padding:10px 14px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.82);
            color:var(--ink-soft);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.86);
        }
        .toolbar-links .chip input,
        .choice-chip input {
            margin:0;
            flex:none;
        }
        .hero-card:not(.accent) .toolbar-links a {
            border-color:var(--line);
            background:rgba(255,255,255,.78);
        }
        .helper {
            color:var(--muted);
            font-size:12px;
            line-height:1.55;
            padding:10px 12px;
            border-radius:8px;
            background:rgba(255,255,255,.62);
            border:1px dashed rgba(22,33,50,.12);
        }
        .helper-block { margin-top:12px; }
        .filter-grid { margin-bottom:12px; }
        .stack-gap-sm { margin-top:10px; }
        .stack-gap-xs { margin-top:8px; }
        .inline-check {
            display:flex;
            align-items:flex-end;
        }
        .inline-check label {
            display:flex;
            gap:10px;
            align-items:center;
            margin-bottom:8px;
            text-transform:none;
            letter-spacing:0;
            font-size:13px;
            font-weight:700;
            color:var(--ink-soft);
        }
        .section-title {
            margin:16px 0 10px;
            font-size:19px;
            font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",serif;
            letter-spacing:-.02em;
        }
        .badge-cloud,
        .signal-cluster {
            display:flex;
            flex-wrap:wrap;
            gap:10px;
        }
        .badge-cloud .badge,
        .signal-cluster .chip {
            backdrop-filter:blur(8px);
        }
        .panel-actions {
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            align-items:center;
        }
        .highlight-note {
            padding:12px 14px;
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.82), rgba(242,247,244,.72));
            border:1px solid rgba(22,33,50,.08);
            color:var(--ink-soft);
        }
        .metric-grid.two-up { grid-template-columns:repeat(2, minmax(0,1fr)); }
        .pagination {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:12px;
            margin-top:12px;
            padding-top:6px;
        }
        .pagination-links { display:flex; gap:10px; flex-wrap:wrap; }
        .workspace-stack { display:grid; gap:12px; }
        .workspace-header {
            display:flex;
            justify-content:space-between;
            align-items:flex-start;
            gap:10px;
            margin-bottom:10px;
        }
        .workspace-header.compact { margin-bottom:10px; }
        .workspace-title {
            display:grid;
            gap:5px;
            min-width:0;
        }
        .workspace-title h3 {
            margin:0;
        }
        .workspace-title .subtle,
        .workspace-title .panel-copy {
            margin:0;
        }
        .workspace-actions,
        .workspace-tools {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
            justify-content:flex-end;
        }
        .workspace-toolbar {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
            margin-bottom:6px;
        }
        .toolbar-menu {
            position:relative;
        }
        .toolbar-menu summary {
            list-style:none;
        }
        .toolbar-menu summary::-webkit-details-marker {
            display:none;
        }
        .toolbar-menu[open] summary {
            border-color:rgba(11,37,69,.24);
        }
        .toolbar-panel {
            position:absolute;
            top:calc(100% + 8px);
            right:0;
            min-width:min(360px, calc(100vw - 64px));
            padding:12px;
            border-radius:8px;
            border:1px solid var(--line);
            background:rgba(255,255,255,.96);
            box-shadow:var(--shadow);
            backdrop-filter:blur(14px);
            z-index:15;
        }
        .toolbar-panel .form-grid,
        .toolbar-panel .list {
            margin:0;
        }
        .toolbar-panel .action-row {
            margin-top:14px;
        }
        .workspace-split {
            display:grid;
            grid-template-columns:minmax(0, 1.3fr) minmax(280px, .7fr);
            gap:14px;
            align-items:start;
        }
        .workspace-side {
            display:grid;
            gap:10px;
        }
        .choice-grid {
            display:grid;
            grid-template-columns:repeat(3, minmax(0,1fr));
            gap:12px;
        }
        .choice-card {
            padding:14px;
            border-radius:8px;
            border:1px solid var(--line);
            background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,243,236,.76));
            box-shadow:var(--shadow-sm);
            display:grid;
            gap:10px;
        }
        .choice-card h4 {
            margin:0;
            font-size:18px;
            font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",serif;
            letter-spacing:-.02em;
        }
        .choice-card p {
            margin:0;
            color:var(--muted);
            font-size:13px;
        }
        .mini-stats {
            display:grid;
            grid-template-columns:repeat(4, minmax(0,1fr));
            gap:10px;
        }
        .mini-stats.six-up { grid-template-columns:repeat(6, minmax(0,1fr)); }
        .mini-stats.two-up { grid-template-columns:repeat(2, minmax(0,1fr)); }
        .mini-stat {
            padding:11px 12px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.72);
        }
        .mini-stat strong {
            display:block;
            margin-top:6px;
            font-size:22px;
            letter-spacing:-.03em;
        }
        .panel-stack {
            display:grid;
            gap:14px;
        }
        .inline-filter {
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            align-items:center;
        }
        .register-note {
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            align-items:center;
            color:var(--muted);
            font-size:13px;
        }
        .register-note strong {
            color:var(--ink-soft);
        }
        .section-shell { display:grid; gap:10px; }
        .record-summary {
            display:grid;
            gap:10px;
        }
        .workspace-tabs {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .workspace-tabs a {
            display:inline-flex;
            align-items:center;
            gap:8px;
            padding:8px 12px;
            border-radius:999px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.72);
            color:var(--ink-soft);
            font-size:12px;
            font-weight:800;
            line-height:1;
        }
        .workspace-tabs a.active {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            color:#fff;
            box-shadow:0 8px 16px rgba(11,37,69,.16);
            border-color:transparent;
        }
        .toolbar-search {
            min-width:220px;
            flex:1 1 220px;
        }
        .segmented-control {
            display:inline-flex;
            align-items:center;
            gap:4px;
            padding:4px;
            border:1px solid rgba(22,33,50,.08);
            border-radius:999px;
            background:rgba(255,255,255,.76);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
        }
        .segmented-control a,
        .segmented-control button {
            padding:8px 12px;
            border-radius:999px;
            background:transparent;
            color:var(--ink-soft);
            border:none;
            box-shadow:none;
            font-size:12px;
            font-weight:800;
            line-height:1;
        }
        .segmented-control a:hover,
        .segmented-control button:hover {
            transform:none;
            filter:none;
            box-shadow:none;
            background:rgba(22,33,50,.05);
        }
        .segmented-control .active {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            color:#fff;
            box-shadow:0 8px 16px rgba(11,37,69,.16);
        }
        .table-toolbar {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
        }
        .table-toolbar .workspace-title {
            gap:3px;
        }
        .table-toolbar-right {
            display:flex;
            align-items:center;
            justify-content:flex-end;
            gap:8px;
            flex-wrap:wrap;
            flex:1 1 360px;
        }
        .coal-shell {
            display:grid;
            gap:12px;
        }
        .coal-surface {
            background:
                linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,248,251,.88));
            border:1px solid rgba(20,34,53,.08);
            box-shadow:0 20px 44px rgba(20,34,53,.08);
        }
        .coal-page-header {
            display:flex;
            justify-content:space-between;
            align-items:flex-start;
            gap:14px;
            flex-wrap:wrap;
        }
        .coal-page-title {
            display:grid;
            gap:4px;
            min-width:0;
        }
        .coal-page-title h3 {
            margin:0;
            font-size:22px;
            line-height:1.06;
        }
        .coal-page-title p {
            margin:0;
            color:var(--muted);
            font-size:13px;
            max-width:76ch;
        }
        .coal-page-actions,
        .coal-inline-actions {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .coal-inline-actions.push-right {
            justify-content:flex-end;
        }
        .coal-kpi-row,
        .coal-summary-strip {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .coal-kpi,
        .coal-summary-pill {
            display:grid;
            gap:3px;
            min-width:112px;
            padding:9px 11px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(255,255,255,.72);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.82);
        }
        .coal-kpi span,
        .coal-summary-pill span {
            font-size:11px;
            font-weight:800;
            letter-spacing:.08em;
            text-transform:uppercase;
            color:var(--muted);
        }
        .coal-kpi strong,
        .coal-summary-pill strong {
            font-size:15px;
            letter-spacing:-.02em;
        }
        .coal-filter-strip {
            display:grid;
            gap:10px;
            padding:12px 14px;
            border:1px solid rgba(20,34,53,.08);
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,248,251,.76));
        }
        .coal-grid-12 {
            display:grid;
            grid-template-columns:repeat(12, minmax(0,1fr));
            gap:10px;
            align-items:start;
        }
        .coal-grid-12 > * {
            min-width:0;
        }
        .coal-span-2 { grid-column:span 2; }
        .coal-span-3 { grid-column:span 3; }
        .coal-span-4 { grid-column:span 4; }
        .coal-span-5 { grid-column:span 5; }
        .coal-span-6 { grid-column:span 6; }
        .coal-span-7 { grid-column:span 7; }
        .coal-span-8 { grid-column:span 8; }
        .coal-span-9 { grid-column:span 9; }
        .coal-span-12 { grid-column:1 / -1; }
        .coal-filter-actions {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
        }
        .coal-filter-meta {
            color:var(--muted);
            font-size:12px;
        }
        .coal-table-shell {
            overflow:auto;
            border:1px solid rgba(20,34,53,.08);
            border-radius:8px;
            background:rgba(255,255,255,.76);
        }
        .coal-table-shell table {
            min-width:1120px;
            margin:0;
            border:none;
            border-radius:0;
            background:transparent;
        }
        .coal-table-shell.register-wide table {
            min-width:1500px;
        }
        .coal-table-shell td,
        .coal-table-shell th {
            vertical-align:top;
            overflow-wrap:normal;
            word-break:normal;
            hyphens:none;
        }
        .coal-table-shell.tight table {
            min-width:860px;
        }
        .coal-table-shell.tighter table {
            min-width:760px;
        }
        .coal-table-shell thead th {
            position:sticky;
            top:0;
            z-index:4;
            background:rgba(241,246,250,.96);
            box-shadow:inset 0 -1px 0 rgba(20,34,53,.08);
        }
        .coal-table-shell::-webkit-scrollbar {
            height:10px;
        }
        .coal-table-shell::-webkit-scrollbar-thumb {
            background:rgba(20,34,53,.16);
            border-radius:999px;
        }
        .coal-primary {
            display:block;
            font-weight:700;
            color:var(--ink);
        }
        .coal-secondary {
            display:block;
            margin-top:2px;
            color:var(--muted);
            font-size:11px;
            line-height:1.4;
        }
        .coal-nowrap {
            white-space:nowrap;
        }
        .coal-row-actions {
            display:flex;
            justify-content:flex-end;
            gap:6px;
            flex-wrap:wrap;
        }
        .coal-row-actions .btn,
        .coal-row-actions button {
            min-height:34px;
            padding:8px 10px;
            border-radius:8px;
            font-size:12px;
            box-shadow:none;
        }
        .coal-register-footer {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
        }
        .coal-context-strip {
            display:grid;
            grid-template-columns:repeat(5, minmax(0,1fr));
            gap:8px;
            padding:10px 12px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(24,51,75,.04);
        }
        .coal-context-item {
            min-width:0;
            display:grid;
            gap:3px;
        }
        .coal-context-item span {
            font-size:11px;
            font-weight:800;
            text-transform:uppercase;
            letter-spacing:.08em;
            color:var(--muted);
        }
        .coal-context-item strong,
        .coal-context-item .value {
            display:block;
            min-width:0;
            font-size:13px;
            font-weight:700;
            overflow:hidden;
            text-overflow:ellipsis;
            white-space:nowrap;
        }
        .coal-context-item .subtle {
            font-size:11px;
        }
        .coal-inline-preview,
        .coal-preview-card,
        .coal-selection-bar,
        .coal-impact-bar {
            display:grid;
            gap:8px;
            padding:10px 12px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(255,255,255,.74);
        }
        .coal-inline-preview table,
        .coal-preview-card table {
            min-width:0;
            border:none;
            background:transparent;
        }
        .coal-inline-preview th,
        .coal-inline-preview td,
        .coal-preview-card th,
        .coal-preview-card td {
            padding:8px 9px;
        }
        .coal-inline-preview thead th,
        .coal-preview-card thead th {
            position:static;
            background:rgba(238,243,247,.92);
        }
        .coal-helper-note {
            margin:0;
            color:var(--muted);
            font-size:12px;
            line-height:1.45;
        }
        .coal-status,
        .coal-badge {
            display:inline-flex;
            align-items:center;
            gap:5px;
            padding:6px 10px;
            border-radius:999px;
            font-size:11px;
            font-weight:800;
            letter-spacing:.08em;
            text-transform:uppercase;
            border:1px solid transparent;
            white-space:nowrap;
        }
        .coal-badge.info,
        .coal-status.info {
            background:rgba(40,80,111,.1);
            color:var(--accent-strong);
            border-color:rgba(40,80,111,.14);
        }
        .coal-badge.success,
        .coal-status.success {
            background:rgba(31,122,86,.12);
            color:var(--success);
            border-color:rgba(31,122,86,.14);
        }
        .coal-badge.warn,
        .coal-status.warn {
            background:rgba(154,103,30,.12);
            color:var(--warn);
            border-color:rgba(154,103,30,.14);
        }
        .coal-badge.ghost,
        .coal-status.ghost {
            background:rgba(20,34,53,.06);
            color:var(--muted);
            border-color:rgba(20,34,53,.08);
        }
        .coal-badge.danger,
        .coal-status.danger {
            background:rgba(175,70,61,.12);
            color:var(--danger);
            border-color:rgba(175,70,61,.16);
        }
        .coal-sticky-actions {
            position:sticky;
            bottom:12px;
            z-index:6;
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
            padding:10px 12px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(252,253,255,.96);
            box-shadow:0 18px 30px rgba(20,34,53,.12);
            backdrop-filter:blur(12px);
        }
        .coal-sticky-actions .btn,
        .coal-sticky-actions button {
            box-shadow:none;
        }
        .coal-sticky-copy {
            color:var(--muted);
            font-size:12px;
        }
        .coal-impact-grid {
            display:grid;
            grid-template-columns:repeat(3, minmax(0,1fr));
            gap:8px;
        }
        .coal-impact-card {
            padding:10px 12px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(255,255,255,.76);
        }
        .coal-impact-card span {
            display:block;
            font-size:11px;
            font-weight:800;
            text-transform:uppercase;
            letter-spacing:.08em;
            color:var(--muted);
        }
        .coal-impact-card strong {
            display:block;
            margin-top:5px;
            font-size:16px;
            letter-spacing:-.02em;
        }
        .coal-report-layout {
            display:grid;
            grid-template-columns:240px minmax(0,1fr);
            gap:14px;
            align-items:start;
        }
        .coal-report-menu {
            display:grid;
            gap:8px;
        }
        .coal-report-link {
            display:grid;
            gap:5px;
            padding:12px;
            border-radius:8px;
            border:1px solid rgba(20,34,53,.08);
            background:rgba(255,255,255,.76);
            box-shadow:inset 0 1px 0 rgba(255,255,255,.84);
        }
        .coal-report-link strong {
            font-size:13px;
            line-height:1.35;
        }
        .coal-report-link span {
            color:var(--muted);
            font-size:12px;
            line-height:1.45;
        }
        .coal-report-link.active {
            background:linear-gradient(145deg, rgba(22,51,75,.96), rgba(40,80,111,.94));
            border-color:transparent;
            box-shadow:0 18px 34px rgba(20,34,53,.16);
        }
        .coal-report-link.active strong,
        .coal-report-link.active span {
            color:#fff;
        }
        .coal-dialog {
            width:min(520px, calc(100vw - 32px));
            /* Taller than the screen: scroll, never cut off the buttons. */
            max-height:calc(100vh - 32px);
            padding:0;
            border:none;
            border-radius:8px;
            overflow:auto;
            box-shadow:0 36px 72px rgba(20,34,53,.24);
        }
        .coal-dialog::backdrop {
            background:rgba(20,34,53,.36);
            backdrop-filter:blur(3px);
        }
        .coal-dialog-shell {
            display:grid;
            gap:12px;
            padding:16px;
            background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,248,251,.94));
        }
        .coal-dialog-actions {
            display:flex;
            justify-content:flex-end;
            gap:8px;
            flex-wrap:wrap;
            /* Stays at the bottom of a scrolling dialog, so Cancel / Generate Bill are always on screen. */
            position:sticky;
            bottom:0;
            z-index:1;
            margin:0 -16px -16px;
            padding:12px 16px 16px;
            background:#f4f8fb;
            border-top:1px solid rgba(20,34,53,.08);
        }
        .status-badge {
            min-width:84px;
            justify-content:center;
            font-size:11px;
            letter-spacing:.08em;
            text-transform:uppercase;
        }
        .status-badge.pending { background:rgba(32,51,76,.1); color:var(--ink-soft); border-color:rgba(32,51,76,.08); }
        .status-badge.progress { background:rgba(11,37,69,.14); color:var(--accent-strong); border-color:rgba(11,37,69,.14); }
        .status-badge.done { background:rgba(27,138,97,.14); color:var(--success); border-color:rgba(27,138,97,.14); }
        .status-badge.warn { background:rgba(165,111,24,.14); color:var(--warn); border-color:rgba(165,111,24,.14); }
        .table-empty td {
            padding:0;
            background:transparent;
            border-bottom:none;
        }
        .page-intro {
            display:grid;
            gap:12px;
            padding:14px 16px;
        }
        .page-intro .workspace-header {
            margin-bottom:0;
        }
        .page-intro-meta,
        .context-pills {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
        }
        .page-intro-actions {
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
            justify-content:flex-end;
        }
        .section-intro {
            display:grid;
            gap:4px;
            margin-bottom:2px;
        }
        .section-intro h3 {
            margin:0;
        }
        .section-intro p {
            margin:0;
            color:var(--muted);
            font-size:13px;
        }
        .danger-zone {
            border-color:rgba(150,56,35,.18);
            background:linear-gradient(180deg, rgba(255,247,244,.96), rgba(252,241,236,.82));
        }
        .danger-zone .panel-head h3,
        .danger-zone .workspace-title h3 {
            color:#7c2d12;
        }
        .danger-zone .list-item {
            background:rgba(255,255,255,.6);
        }
        .danger-button,
        .danger-zone .secondary {
            border-color:rgba(150,56,35,.2);
            background:rgba(150,56,35,.08);
            color:#7c2d12;
        }
        .permission-groups {
            display:grid;
            gap:12px;
        }
        .permission-card {
            padding:12px 14px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.68);
            display:grid;
            gap:10px;
        }
        .permission-card h4 {
            margin:0;
            font-size:16px;
        }
        .permission-card p {
            margin:0;
            color:var(--muted);
            font-size:12px;
        }
        @media print {
            body {
                background:#fff;
                color:#000;
            }
            body::before { display:none; }
            .shell {
                max-width:none;
                padding:0;
            }
            .app-shell { display:block; }
            .sidebar, .topbar, .flash, .errors, .action-row, .toolbar-links, .pagination, .btn, button {
                display:none !important;
            }
            .content-shell, .page-flow { display:block; }
            .hero, .grid, .metric-grid, .stats, .module-grid {
                display:block;
            }
            .hero-card, .panel, .stat, .metric-card, .module-card, .list-item {
                box-shadow:none;
                border:1px solid #d6d6d6;
                background:#fff;
                backdrop-filter:none;
                break-inside:avoid;
                page-break-inside:avoid;
            }
            .hero-card, .panel { margin-bottom:14px; }
            .table-shell {
                overflow:visible;
                margin:0;
                padding:0;
            }
            .table-shell table,
            table {
                min-width:0;
            }
        }
        @media (max-width:1280px) {
            .app-shell,
            .app-shell.no-sidebar,
            .app-shell.has-sidebar { grid-template-columns:1fr; }
            .topbar { padding:14px 16px; }
            /* Mobile sidebar drawer */
            .sidebar-toggle { display:flex; }
            .sidebar-close { display:flex; align-items:center; justify-content:center; }
            .sidebar {
                position:fixed;
                top:0;
                left:0;
                bottom:0;
                z-index:70;
                width:min(280px, 85vw);
                max-height:100vh;
                border-radius:0 var(--radius-md) var(--radius-md) 0;
                box-shadow:var(--shadow-lg);
                transform:translateX(-110%);
                transition:transform .28s cubic-bezier(.4,0,.2,1);
            }
            .sidebar.drawer-open {
                transform:translateX(0);
            }
            /* Fert/coal sub-layouts also go single column */
            .fert-master-layout,
            .fert-report-layout,
            .coal-report-layout { grid-template-columns:1fr; }
            .fert-side-menu,
            .coal-report-menu { position:static; }
        }
        /* ── Tablet breakpoint: handle main menu overflow ── */
        @media (max-width:960px) {
            .main-menu-bar {
                flex-wrap:nowrap;
                overflow:auto hidden;
                -webkit-overflow-scrolling:touch;
                padding:10px 12px;
                gap:6px;
            }
            .main-menu-bar .top-nav-link {
                flex:none;
                white-space:nowrap;
                padding:8px 12px;
                font-size:12px;
            }
            .top-nav-brand {
                flex:none;
                max-width:220px;
                min-height:36px;
                padding:8px 10px;
                font-size:12px;
            }
        }
        @media (max-width:1080px) {
            .stats, .hero, .metric-grid, .module-grid { grid-template-columns:1fr; }
            .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column:span 12; }
            .panel, .hero-card, .stat, .metric-card { overflow:auto hidden; }
            .workspace-split,
            .choice-grid,
            .mini-stats { grid-template-columns:1fr; }
            .coal-report-layout,
            .coal-impact-grid { grid-template-columns:1fr; }
            .coal-context-strip { grid-template-columns:repeat(2, minmax(0,1fr)); }
            .coal-grid-12 .coal-span-2,
            .coal-grid-12 .coal-span-3,
            .coal-grid-12 .coal-span-4,
            .coal-grid-12 .coal-span-5,
            .coal-grid-12 .coal-span-6 { grid-column:span 6; }
            .coal-grid-12 .coal-span-7,
            .coal-grid-12 .coal-span-8,
            .coal-grid-12 .coal-span-9,
            .coal-grid-12 .coal-span-12 { grid-column:1 / -1; }
            /* Fertilizer grids responsive */
            .fert-grid-12 .fert-span-2,
            .fert-grid-12 .fert-span-3,
            .fert-grid-12 .fert-span-4,
            .fert-grid-12 .fert-span-5,
            .fert-grid-12 .fert-span-6 { grid-column:span 6; }
            .fert-grid-12 .fert-span-7,
            .fert-grid-12 .fert-span-8,
            .fert-grid-12 .fert-span-9,
            .fert-grid-12 .fert-span-12 { grid-column:1 / -1; }
            .fert-context-strip { grid-template-columns:repeat(2, minmax(0,1fr)); }
            .fert-master-layout,
            .fert-report-layout { grid-template-columns:1fr; }
            .fert-side-menu { position:static; }
            .toolbar-panel {
                position:static;
                margin-top:10px;
                min-width:0;
            }
            .topbar { grid-template-columns:1fr; }
            .topbar-head { flex-direction:column; }
            .topbar-right { justify-content:flex-start; }
            /* Setup admin responsive */
            .setup-admin-body { grid-template-columns:minmax(0,1fr); }
        }
        @media (max-width:720px) {
            :root {
                --shell-gutter:10px;
            }
            .topbar { padding:12px; }
            .topbar h1 { font-size:20px; }
            .form-grid { grid-template-columns:1fr; }
            .stat-value { font-size:26px; }
            th, td { padding:8px 7px; font-size:12px; }
            .sidebar-brand h1 { font-size:24px; }
            .login-card h1 { font-size:30px; }
            .table-shell table { min-width:560px; }
            .coal-workflow-nav {
                display:flex;
                flex-wrap:nowrap;
                overflow:auto hidden;
                padding-bottom:4px;
                -webkit-overflow-scrolling:touch;
            }
            .coal-context-strip,
            .coal-grid-12,
            .coal-impact-grid { grid-template-columns:1fr; }
            .coal-grid-12 > * { grid-column:1 / -1 !important; }
            .coal-table-shell table { min-width:640px; }
            .fert-table-shell table { min-width:640px; }
            .fert-grid-12 { grid-template-columns:1fr; }
            .fert-grid-12 > * { grid-column:1 / -1 !important; }
            .fert-context-strip { grid-template-columns:1fr; }
            .coal-page-actions,
            .coal-filter-actions,
            .coal-register-footer,
            .coal-sticky-actions,
            .fert-page-header,
            .fert-inline-actions,
            .fert-register-footer,
            .fert-bottom-bar { flex-direction:column; align-items:stretch; }
            .coal-row-actions,
            .fert-row-actions { justify-content:flex-start; }
            .metric-grid.two-up { grid-template-columns:1fr; }
            .workspace-header,
            .workspace-toolbar { flex-direction:column; align-items:stretch; }
            .workspace-actions,
            .workspace-tools { justify-content:flex-start; }
            .table-toolbar { flex-direction:column; align-items:stretch; }
            .table-toolbar-right { flex:none; }
            .segmented-control {
                width:100%;
                justify-content:flex-start;
                overflow:auto hidden;
                -webkit-overflow-scrolling:touch;
            }
            .brand-row { align-items:flex-start; }
            /* Top nav mobile */
            .topbar-nav {
                display:grid;
                grid-template-columns:1fr;
            }
            .top-nav-group { width:100%; }
            .top-nav-link,
            .top-nav-trigger { width:100%; justify-content:space-between; }
            .top-nav-panel {
                position:static;
                min-width:0;
                max-width:none;
                width:100%;
                margin-top:10px;
            }
            .top-nav-grid.two-column { grid-template-columns:1fr; }
            .topbar-right { justify-content:flex-start; }
            /* Main menu bar mobile */
            .main-menu-bar {
                gap:6px;
                padding:8px 10px;
                border-radius:8px;
            }
            .main-menu-bar .top-nav-link {
                padding:8px 10px;
                font-size:11px;
                min-height:36px;
                width:auto;
            }
            .top-nav-brand {
                max-width:180px;
                min-height:34px;
                padding:7px 8px;
                font-size:11px;
            }
            /* Stats grid mobile */
            .mini-stats { grid-template-columns:repeat(2, minmax(0,1fr)); }
            .mini-stats.six-up { grid-template-columns:repeat(2, minmax(0,1fr)); }
            .mini-stat strong { font-size:18px; }
            /* Coal/fert summary pills wrap */
            .coal-kpi-row,
            .coal-summary-strip,
            .fert-summary-strip { flex-direction:column; align-items:stretch; }
            .coal-kpi,
            .coal-summary-pill,
            .fert-summary-card { min-width:0; }
            /* Action rows mobile */
            .action-row { flex-direction:column; align-items:stretch; }
            .action-row .btn,
            .action-row button { width:100%; justify-content:center; }
            /* Hero mobile */
            .hero { grid-template-columns:1fr; }
            /* Panel head mobile */
            .panel-head { flex-direction:column; gap:8px; }
            /* Erp header mobile adjustments */
            .erp-pill-row {
                flex-wrap:nowrap;
                overflow:auto hidden;
                padding-bottom:4px;
                -webkit-overflow-scrolling:touch;
            }
            .erp-breadcrumbs {
                flex-wrap:nowrap;
                overflow:auto hidden;
            }
            .erp-crumb {
                max-width:none;
            }
            /* Setup layout mobile */
            .setup-admin-body { grid-template-columns:1fr; }
            .setup-header-tools { grid-template-columns:1fr; }
            .setup-quick-actions { justify-content:flex-start; }
            /* Inline check mobile */
            .inline-filter { flex-direction:column; align-items:stretch; }
            /* Choice grid mobile */
            .choice-grid { grid-template-columns:1fr; }
            /* Page intro mobile */
            .page-intro-actions { justify-content:flex-start; }
            /* Override inline grid-template-columns for generic .grid on mobile */
            .grid[style*="grid-template-columns"] {
                grid-template-columns:1fr !important;
            }
        }
        .erp-header {
            position:sticky;
            top:var(--shell-gutter);
            z-index:46;
            display:grid;
            gap:0;
            padding:0;
            border:1px solid var(--line);
            border-radius:8px;
            background:
                linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,247,241,.9));
            box-shadow:0 18px 44px rgba(22,33,50,.1);
            backdrop-filter:blur(18px);
            overflow:visible;
        }
        .erp-header::after {
            content:"";
            position:absolute;
            inset:0 auto auto 62%;
            width:120px;
            height:120px;
            background:radial-gradient(circle, rgba(11,37,69,.12), transparent 64%);
            pointer-events:none;
        }
        body.coal-mode .erp-header {
            background:
                linear-gradient(180deg, rgba(255,255,255,.97), rgba(244,248,251,.9));
        }
        body.fertilizer-mode .erp-header {
            background:
                linear-gradient(180deg, rgba(255,255,255,.97), rgba(244,249,246,.9));
        }
        body.container-mode .erp-header {
            background:
                linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,244,251,.9));
        }
        body.container-mode .erp-header::after {
            background:radial-gradient(circle, rgba(90,61,138,.12), transparent 64%);
        }
        .erp-header-bar {
            position:relative;
            z-index:2;
            display:grid;
            grid-template-columns:minmax(0,1fr) auto;
            align-items:center;
            gap:12px;
            min-height:60px;
            padding:10px 14px;
        }
        .erp-header-main {
            display:flex;
            align-items:center;
            gap:12px;
            min-width:0;
        }
        .erp-brand-mark {
            width:38px;
            height:38px;
            border-radius:8px;
            display:grid;
            place-items:center;
            flex:none;
            font-size:11px;
            font-weight:900;
            letter-spacing:.12em;
            color:#fff;
            background:
                radial-gradient(circle at top right, rgba(255,255,255,.26), transparent 34%),
                linear-gradient(145deg, rgba(24,34,50,.98), rgba(11,37,69,.94));
            box-shadow:0 12px 24px rgba(22,33,50,.16);
        }
        .erp-brand-copy {
            min-width:0;
            display:grid;
            gap:3px;
        }
        .erp-brand-title {
            font-size:15px;
            font-weight:800;
            letter-spacing:-.02em;
            line-height:1.1;
            white-space:nowrap;
            overflow:hidden;
            text-overflow:ellipsis;
        }
        .erp-breadcrumbs {
            display:flex;
            align-items:center;
            gap:6px;
            min-width:0;
            flex-wrap:wrap;
        }
        .erp-crumb {
            max-width:24ch;
            overflow:hidden;
            text-overflow:ellipsis;
            white-space:nowrap;
            font-size:12px;
            color:var(--muted);
        }
        .erp-crumb.current {
            color:var(--ink);
            font-weight:700;
        }
        .erp-crumb-sep {
            font-size:11px;
            color:rgba(22,33,50,.38);
        }
        .erp-status-bar,
        .erp-status-group,
        .erp-control-group {
            display:flex;
            align-items:center;
            gap:8px;
            flex-wrap:wrap;
        }
        .erp-status-bar {
            justify-content:flex-end;
        }
        .erp-control-group {
            justify-content:flex-end;
        }
        .erp-header-control,
        .erp-header-control.secondary {
            min-height:36px;
            padding:8px 12px;
            border-radius:8px;
            font-size:12px;
            box-shadow:none;
        }
        .erp-header-control.secondary {
            background:rgba(255,255,255,.86);
        }
        .erp-header-control[aria-pressed="true"] {
            background:var(--accent-soft);
            color:var(--accent-strong);
            border-color:rgba(11,37,69,.18);
        }
        .erp-nav-drawer {
            max-height:0;
            opacity:0;
            overflow:hidden;
            padding:0 14px;
            border-top:1px solid transparent;
            transform:translateY(-6px);
            transition:max-height .24s ease, opacity .18s ease, padding .24s ease, border-color .18s ease, transform .24s ease;
        }
        .erp-header.is-expanded .erp-nav-drawer {
            max-height:360px;
            opacity:1;
            padding:0 14px 12px;
            border-top-color:var(--line);
            overflow:visible;
            transform:none;
        }
        .erp-nav-stack {
            display:grid;
            gap:10px;
            padding-top:10px;
        }
        .erp-nav-row {
            display:grid;
            grid-template-columns:88px minmax(0,1fr);
            gap:10px;
            align-items:start;
        }
        .erp-nav-label {
            padding-top:7px;
            font-size:11px;
            text-transform:uppercase;
            letter-spacing:.16em;
            color:var(--muted);
            font-weight:800;
        }
        .erp-pill-row {
            display:flex;
            flex-wrap:wrap;
            gap:8px;
            align-items:center;
            min-width:0;
        }
        .erp-nav-tab {
            display:inline-flex;
            align-items:center;
            justify-content:center;
            min-height:34px;
            padding:7px 12px;
            border-radius:8px;
            border:1px solid rgba(22,33,50,.08);
            background:rgba(255,255,255,.84);
            color:var(--ink-soft);
            font-size:12px;
            font-weight:800;
            line-height:1.1;
            box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
            transition:border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
        }
        .erp-nav-tab:hover {
            border-color:rgba(11,37,69,.2);
            box-shadow:0 10px 22px rgba(22,33,50,.08);
            transform:translateY(-1px);
        }
        .erp-nav-tab.active {
            background:linear-gradient(135deg, var(--accent), var(--accent-strong));
            border-color:transparent;
            color:#fff;
            box-shadow:0 14px 28px rgba(22,33,50,.16);
        }
        .erp-pill-row.main .erp-nav-tab {
            min-height:36px;
            padding-inline:14px;
            border-radius:8px;
        }
        .erp-nav-tab.utility {
            background:rgba(22,33,50,.05);
            border-style:dashed;
            color:var(--muted);
        }
        .erp-nav-tab.utility.active {
            background:rgba(22,33,50,.9);
            color:#fff;
            border-style:solid;
        }
        @media print {
            .erp-header {
                display:none !important;
            }
        }
        @media (max-width:1080px) {
            .erp-header-bar {
                grid-template-columns:1fr;
                align-items:start;
            }
            .erp-status-bar,
            .erp-status-group,
            .erp-control-group {
                justify-content:flex-start;
            }
            .erp-nav-row {
                grid-template-columns:1fr;
            }
            .erp-nav-label {
                padding-top:0;
            }
        }
        @media (max-width:720px) {
            .erp-header-bar {
                padding:12px;
            }
            .erp-nav-drawer,
            .erp-header.is-expanded .erp-nav-drawer {
                padding-left:12px;
                padding-right:12px;
            }
            .erp-status-group {
                flex-wrap:nowrap;
                overflow:auto hidden;
                padding-bottom:4px;
            }
            .erp-pill-row {
                flex-wrap:nowrap;
                overflow:auto hidden;
                padding-bottom:4px;
            }
            .erp-breadcrumbs {
                flex-wrap:nowrap;
                overflow:auto hidden;
            }
            .erp-crumb {
                max-width:none;
            }
        }

        /* ── Shared Setup / Masters workspace ─────────────────── */
        .setup-admin-shell { display:grid; gap:18px; align-items:start; }
        .setup-admin-header, .setup-admin-register, .setup-admin-drawer { background:var(--surface); border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow); backdrop-filter:blur(16px); }
        .setup-admin-header h2, .setup-admin-register h3, .setup-admin-drawer h3 { margin:0; font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",serif; letter-spacing:-.02em; }
        .setup-muted, .setup-breadcrumb, .setup-empty-state p { color:var(--muted); font-size:13px; }
        .setup-global-search, .setup-register-filter { width:100%; border:1px solid var(--line); border-radius:8px; padding:11px 13px; background:rgba(255,255,255,.92); color:var(--ink); }
        .setup-admin-main { display:grid; gap:18px; min-width:0; }
        .setup-admin-header { padding:18px 20px; display:grid; gap:16px; }
        .setup-header-top { display:flex; justify-content:space-between; gap:16px; align-items:start; flex-wrap:wrap; }
        .setup-breadcrumb { letter-spacing:.06em; text-transform:uppercase; font-size:11px; font-weight:700; }
        .setup-header-title p { margin:6px 0 0; max-width:70ch; color:var(--ink-soft); }
        .setup-header-tools { display:grid; grid-template-columns:minmax(220px,320px) auto; gap:12px; width:100%; align-items:center; }
        .setup-quick-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
        .setup-module-strip { display:flex; gap:10px; flex-wrap:wrap; }
        .setup-chip { padding:8px 12px; border-radius:999px; background:rgba(255,255,255,.82); border:1px solid var(--line); font-size:12px; color:var(--ink-soft); }
        .setup-admin-body { display:grid; grid-template-columns:minmax(0,1fr) 420px; gap:18px; min-width:0; }
        .setup-admin-register { padding:18px; display:grid; gap:16px; min-width:0; }
        .setup-register-head { display:flex; justify-content:space-between; gap:16px; align-items:start; flex-wrap:wrap; }
        .setup-register-head p, .setup-detail-head p { margin:6px 0 0; color:var(--ink-soft); }
        .setup-register-meta { display:flex; gap:10px; flex-wrap:wrap; }
        .setup-register-toolbar { display:flex; justify-content:space-between; gap:14px; align-items:center; flex-wrap:wrap; padding:14px 16px; border:1px solid var(--line); border-radius:8px; background:rgba(248,250,252,.82); }
        .setup-register-toolbar .field { min-width:min(100%,320px); flex:1 1 260px; margin:0; }
        .setup-register-toolbar .field label { display:block; margin-bottom:6px; font-size:12px; color:var(--muted); font-weight:700; }
        .setup-table-wrap { border:1px solid var(--line-strong); border-radius:8px; overflow:hidden; }
        .setup-table-wrap table { width:100%; border-collapse:collapse; }
        .setup-table-wrap thead th { position:sticky; top:0; z-index:1; background:rgba(32,51,76,.08); color:var(--ink-soft); }
        .setup-table-wrap th, .setup-table-wrap td { padding:10px 12px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); vertical-align:top; font-size:13px; }
        .setup-table-wrap th:last-child, .setup-table-wrap td:last-child { border-right:none; }
        .setup-table-wrap tbody tr:nth-child(even) td { background:rgba(22,33,50,.04); }
        .setup-table-wrap tbody tr:last-child td { border-bottom:none; }
        .setup-empty-state { padding:34px 24px; border:1px dashed var(--line-strong); border-radius:8px; background:rgba(255,255,255,.72); text-align:center; }
        .setup-empty-state strong { display:block; margin-bottom:8px; }
        .setup-inline-actions, .action-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
        .setup-admin-drawer { position:sticky; top:calc(var(--sticky-topbar-offset) + 8px); padding:18px; display:grid; gap:16px; max-height:calc(100vh - var(--sticky-topbar-offset) - 24px); overflow:auto; }
        .setup-detail-head { display:grid; gap:8px; }
        .setup-detail-context { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
        .setup-context-item { border:1px solid var(--line); border-radius:8px; padding:10px 12px; background:rgba(255,255,255,.82); }
        .setup-context-item span { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); font-weight:700; margin-bottom:4px; }
        .setup-drawer-form { display:grid; gap:14px; }
        .setup-drawer-form .form-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:14px; }
        .setup-drawer-form .field { margin:0; }
        .setup-drawer-form .field.full { grid-column:1 / -1; }
        .setup-drawer-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; border-top:1px solid var(--line); padding-top:14px; }
        .setup-feedback-list { display:grid; gap:10px; }
        .setup-feedback-item { border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:rgba(255,255,255,.86); }
        .setup-helper-box { border:1px solid var(--line); border-radius:8px; padding:14px 16px; background:rgba(248,250,252,.82); }
        .setup-row-hidden { display:none; }
        .setup-source-scope-wrap { display:grid; gap:12px; }
        .setup-source-scope-search { width:100%; border:1px solid var(--line); border-radius:8px; padding:11px 13px; background:rgba(255,255,255,.92); color:var(--ink); }
        .setup-source-multiselect { display:grid; gap:8px; max-height:280px; overflow:auto; padding:6px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.72); }
        .setup-source-option { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border:1px solid transparent; border-radius:8px; background:rgba(255,255,255,.7); cursor:pointer; }
        .setup-source-option:hover { border-color:var(--accent-fog); background:rgba(255,255,255,.94); }
        .setup-source-option input { margin-top:3px; }
        .setup-source-option-copy { display:grid; gap:2px; }
        .setup-source-option-copy small { color:var(--muted); }
        .setup-source-option-hidden { display:none; }
        .setup-rule-preview { border:1px dashed var(--line-strong); border-radius:8px; padding:12px 14px; background:rgba(255,255,255,.68); }
        .setup-rule-preview strong { display:block; margin-bottom:6px; }
        @media (max-width:1220px) { .setup-admin-body { grid-template-columns:minmax(0,1fr); } .setup-admin-drawer { position:static; max-height:none; } .setup-header-tools { grid-template-columns:minmax(0,1fr); } .setup-quick-actions { justify-content:flex-start; } }
        @media (max-width:700px) { .setup-drawer-form .form-grid, .setup-detail-context { grid-template-columns:minmax(0,1fr); } }
        @media print { .setup-admin-drawer, .setup-header-tools, .setup-register-toolbar, .action-row, .setup-inline-actions { display:none !important; } .setup-admin-shell, .setup-admin-body { display:block; } .setup-admin-register { box-shadow:none; border:none; background:#fff; } }


    /* Helper-note classes that appear under inputs/columns app-wide.
       Hidden by default for a cleaner, faster data-entry experience. */
    body:not(.tips-on) .coal-helper-note,
    body:not(.tips-on) .coal-sticky-copy,
    body:not(.tips-on) .bf-helper-note,
    body:not(.tips-on) .twopay-helper-note,
    body:not(.tips-on) .erp-field-help,
    body:not(.tips-on) .field-help,
    body:not(.tips-on) .help-text,
    body:not(.tips-on) [data-field-tip] {
        display: none !important;
    }

    /* Floating "i" toggle button — bottom-right, always reachable. */
    .field-tips-toggle {
        position: fixed;
        right: 18px;
        bottom: 18px;
        z-index: 950;
        width: 40px; height: 40px;
        border-radius: 50%;
        border: 1px solid rgba(20,34,53,.14);
        background: #fff;
        color: #0B2545;
        font: 700 17px/1 'Georgia', serif;
        font-style: italic;
        cursor: pointer;
        box-shadow: 0 6px 18px rgba(15,30,50,.12);
        transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .field-tips-toggle:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,30,50,.16); }
    .field-tips-toggle[aria-pressed="true"] {
        background: #0B2545;
        color: #fff;
        border-color: #0B2545;
    }
    .field-tips-toggle .ftt-dot {
        position: absolute;
        top: -3px; right: -3px;
        width: 10px; height: 10px;
        background: #0B2545;
        border: 2px solid #fff;
        border-radius: 50%;
        opacity: 0;
        transition: opacity .15s ease;
    }
    body.tips-on .field-tips-toggle .ftt-dot { opacity: 1; }

    /* When tips are ON, accent helper notes lightly so users can spot them. */
    body.tips-on .coal-helper-note,
    body.tips-on .bf-helper-note,
    body.tips-on .twopay-helper-note,
    body.tips-on .erp-field-help,
    body.tips-on .field-help,
    body.tips-on .help-text {
        border-left: 2px solid rgba(26,79,139,.30);
        padding-left: 8px;
        background: linear-gradient(90deg, rgba(26,79,139,.04), transparent 70%);
        border-radius: 4px;
    }

    /* Print: never show the toggle. */
    @media print {
        .field-tips-toggle { display: none !important; }
        body:not(.tips-on) .coal-helper-note,
        body:not(.tips-on) .coal-sticky-copy,
        body:not(.tips-on) .bf-helper-note,
        body:not(.tips-on) .twopay-helper-note,
        body:not(.tips-on) .erp-field-help,
        body:not(.tips-on) .field-help,
        body:not(.tips-on) .help-text { display: block !important; }
    }

    /* ───────────── App-wide form refresh (Coal + Container + everything else) ─────────────
       Visual-only polish for every form in the app. No structural change,
       no logic change — denser spacing, clearer focus, stronger visual
       separation between user-input fields and read-only / derived fields,
       a friendlier sticky save bar, and right-aligned numerics. Scoped to
       elements inside <form> so list pages and read-only views are
       untouched. */
    :root {
        --vf-radius: 10px;
        --vf-input-h: 36px;
        --vf-gap: 9px;
        --vf-accent: #0B2545;
    }
    body.coal-mode       { --vf-accent: #8a4a14; }
    body.container-mode  { --vf-accent: #0B2545; }
    body.fertilizer-mode { --vf-accent: #0B2545; }

    /* Tighten common 12-col / form grids for speed */
    form .coal-grid-12,
    form .form-grid,
    form .erp-form-grid {
        gap: var(--vf-gap);
    }

    /* Field block — compact label + input pair */
    form .field {
        display: grid;
        gap: 4px;
        align-content: start;
    }
    form .field > label {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .03em;
        color: #38465c;
        text-transform: none;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    form .field > input,
    form .field > select,
    form .field > textarea {
        padding: 0 10px;
        border-radius: var(--vf-radius);
        border: 1px solid rgba(20,34,53,.16);
        background: #fff;
        font-size: 13px;
        line-height: 1;
        transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
    }
    form .field > input,
    form .field > select {
        height: var(--vf-input-h);
    }
    form .field > textarea {
        padding: 8px 10px;
        line-height: 1.4;
        min-height: calc(var(--vf-input-h) * 2);
        resize: vertical;
    }
    form .field > input:focus,
    form .field > select:focus,
    form .field > textarea:focus {
        outline: none;
        border-color: var(--vf-accent);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--vf-accent) 18%, transparent);
        background: #fff;
    }

    /* Read-only / system-derived fields — visually muted so users instantly
       know "I do NOT type here". Speeds up data entry significantly. */
    form .field > input[readonly],
    form .field > textarea[readonly] {
        background: rgba(20,34,53,.04);
        color: #2c3a50;
        border-color: rgba(20,34,53,.10);
        font-variant-numeric: tabular-nums;
        cursor: default;
    }
    form .field > input[readonly]:focus,
    form .field > textarea[readonly]:focus {
        box-shadow: none;
        border-color: rgba(20,34,53,.18);
    }
    form .field > input[disabled],
    form .field > select[disabled],
    form .field > textarea[disabled] {
        background: rgba(20,34,53,.06);
        color: #5b6678;
        cursor: not-allowed;
        opacity: .85;
    }

    /* "Required" inputs get a soft accent ring so they stand out */
    form .field > input[required],
    form .field > select[required],
    form .field > textarea[required] {
        border-color: rgba(26,79,139,.28);
        background: linear-gradient(180deg, #fff, #fafcff);
    }

    /* Numeric inputs right-align for fast scanning */
    form .field > input[type="number"] {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    /* Context strip — denser, scannable (used on coal/container voucher forms
       and reusable across the app). */
    form .coal-context-strip {
        gap: 6px;
        padding: 8px 10px;
        border-radius: 8px;
        background: linear-gradient(180deg, #fbfdff, #f3f7fb);
        border: 1px solid rgba(20,34,53,.07);
    }
    form .coal-context-item {
        padding: 6px 10px;
        background: #fff;
        border-radius: 8px;
        border: 1px solid rgba(20,34,53,.06);
    }

    /* Inline GL preview — compact and pinned-feeling */
    form .coal-inline-preview {
        padding: 10px 12px;
        border-radius: 8px;
        border: 1px solid rgba(20,34,53,.08);
        background: #fff;
    }
    form .coal-inline-preview table { font-size: 12.5px; }

    /* Sticky save bar — give Save the spotlight */
    form .coal-sticky-actions {
        background: rgba(255,255,255,.98);
        border: 1px solid rgba(20,34,53,.10);
        box-shadow: 0 14px 30px rgba(20,34,53,.10);
    }
    form .coal-sticky-actions button[type="submit"] {
        min-width: 160px;
        font-weight: 700;
        letter-spacing: .02em;
    }

    /* When tips are off, give the helper-less form a tighter rhythm */
    body:not(.tips-on) form .coal-grid-12,
    body:not(.tips-on) form .form-grid,
    body:not(.tips-on) form .erp-form-grid {
        row-gap: 8px;
    }

    /* Settings that pages use with no fallback but nothing defined, which silently removed borders and sizes.
       --erp-line matches the value the bilty forms already set for themselves. */
    :root {
        --top-bar-height: 68px;
        --erp-line: #d7dde8;
        --text-xs: 11px;
        --text-sm: 12.5px;
        --shadow-md: var(--shadow-sm);
    }
    @media (max-width:960px) { :root { --top-bar-height: 56px; } }

    /* Top bar sits flush while scrolling, so rows no longer show above it; the sidebar stays below it. */
    .main-menu-bar { top: 0; }
    .app-shell { margin-top: 8px; }
    .sidebar { top: calc(var(--top-bar-height) + 8px); max-height: calc(100vh - var(--top-bar-height) - 32px); }
    @media (max-width:1280px) { .sidebar { top: 0; max-height: 100vh; } }

    /* The tips button lives in the top bar, not floating over the last table column. */
    .field-tips-toggle { position: relative; right: auto; bottom: auto; width: 32px; height: 32px; font-size: 15px; padding: 0; flex: none; box-shadow: none; }
    .field-tips-toggle:hover { transform: none; box-shadow: none; }

    /* A disabled button must look disabled. */
    button:disabled, button:disabled:hover, .btn:disabled, input[type="submit"]:disabled {
        opacity: .5;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
        filter: saturate(.3);
    }

    /* Row checkboxes were forced to the 120px width meant for table inputs. */
    td input[type="checkbox"], td input[type="radio"] { min-width: 0; padding: 0; }

    /* Status tiles on a dark card keep readable text. */
    .hero-card.accent .list-item { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); box-shadow: none; color: rgba(255,255,255,.85); }
    .hero-card.accent .list-item strong { color: #fff; }

    /* A long folder path wraps instead of pushing the page sideways. */
    .mini-stat strong { overflow-wrap: anywhere; }
    .mini-stat strong.mini-stat-path { font-size: 13px; font-weight: 600; letter-spacing: 0; }

    /* Validation problems sit above the form, covering nothing, and each field is marked. */
    .form-error-summary { padding: 12px 14px; border: 1px solid rgba(181,74,65,.3); border-left: 4px solid var(--danger); border-radius: 8px; background: #fdf3f2; color: #7a2a24; font-size: 13px; }
    .form-error-summary__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .form-error-summary__close { padding: 0 6px; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: inherit; font-size: 18px; line-height: 1; }
    .form-error-summary__close:hover { transform: none; box-shadow: none; filter: none; background: rgba(181,74,65,.12); }
    .form-error-summary ul { margin: 6px 0 0; padding-left: 18px; }
    .form-error-summary li[data-has-field] { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
    .erp-smart-select-trigger.ajax-error-highlight { border-color: var(--danger) !important; box-shadow: 0 0 0 2px rgba(181,74,65,.18); }

