        /* ============================================================
           PrimeHarvest WMS — Base Design System v2.0
           Full overhaul: proper color hierarchy, depth, polish
           ============================================================ */

        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

        /* ── App feel: disable text selection everywhere ─────────────
           Only inputs / textareas / contenteditable allow selection so the
           user can still edit values they're typing. Everything else is
           unselectable so the UI feels like a native app. */
        *, *::before, *::after {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }
        input, textarea, [contenteditable="true"], [contenteditable=""] {
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            user-select: text;
        }
        /* Buttons and clickable UI use pointer cursor, not text cursor */
        button, .btn, .nav-item, .quick-action, .dash-action-tile, .dash-stat-tile,
        .wh-tab, .cfo-tab, .admin-tab, .chat-tab, .route-filter-btn {
            cursor: pointer;
        }

        :root {
            /* ── Brand Greens ── */
            --green-dark:    #1B4332;
            --green-primary: #2D6A4F;
            --green-mid:     #40916C;
            --green-light:   #52B788;
            --green-pale:    #74C69D;
            --green-accent:  #95D5B2;
            --green-soft:    #D8F3DC;
            --green-ghost:   #F0FAF3;

            /* ── Semantic Status Colors — REAL colors, not all green ── */
            --status-success-bg:     #DCFCE7;
            --status-success-text:   #15803D;
            --status-success-border: #86EFAC;

            --status-warning-bg:     #FEF3C7;
            --status-warning-text:   #92400E;
            --status-warning-border: #FCD34D;

            --status-danger-bg:      #FEE2E2;
            --status-danger-text:    #B91C1C;
            --status-danger-border:  #FCA5A5;

            --status-info-bg:        #DBEAFE;
            --status-info-text:      #1E40AF;
            --status-info-border:    #93C5FD;

            --status-neutral-bg:     #F1F5F9;
            --status-neutral-text:   #475569;
            --status-neutral-border: #CBD5E1;

            --status-orange-bg:      #FFEDD5;
            --status-orange-text:    #9A3412;
            --status-orange-border:  #FDBA74;

            --status-purple-bg:      #EDE9FE;
            --status-purple-text:    #5B21B6;
            --status-purple-border:  #C4B5FD;

            /* ── UI Surfaces ── */
            --bg-page:   #F2F5F3;
            --bg-card:   #FFFFFF;
            --bg-hover:  #F8FBF9;
            --bg-input:  #FFFFFF;
            --bg-subtle: #EFF4F1;

            /* ── Sidebar — light ── */
            --sidebar-bg:      #FFFFFF;
            --sidebar-bg-2:    #F8FAF9;
            --sidebar-border:  #E0E8E3;
            --sidebar-text:    #5E7A6A;
            --sidebar-text-active: #1B4332;
            --sidebar-width:   240px;

            /* ── Borders ── */
            --border:        #E0E8E3;
            --border-strong: #C8D9CF;
            --border-focus:  #52B788;

            /* ── Text ── */
            --text:             #0D1F16;
            --text-secondary:   #2E4A38;
            --text-muted:       #5E7A6A;
            --text-placeholder: #9BB5A7;

            /* ── Shadows ── */
            --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-sm: 0 1px 4px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
            --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
            --shadow-xl: 0 20px 48px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.08);

            /* ── Radius ── */
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 14px;
            --radius-xl: 18px;

            /* ── Legacy aliases ── */
            --bg:      var(--green-primary);
            --bg-dark: var(--bg-page);
            --danger:  #B91C1C;
            --warning: #D97706;
            --success: var(--green-light);
            --info:    #1D4ED8;
        }

        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-page);
            color: var(--text);
            min-height: 100vh;
            font-size: 14px;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }

        .app { display: flex; min-height: 100vh; }

        /* ── SIDEBAR — Dark ── */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--sidebar-bg);
            border-right: 1px solid var(--sidebar-border);
            padding: 0;
            position: fixed;
            height: 100vh;
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 100;
            box-shadow: var(--shadow-sm);
        }

        .sidebar::-webkit-scrollbar { width: 3px; }
        .sidebar::-webkit-scrollbar-track { background: transparent; }
        .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

        .logo {
            padding: 18px 16px;
            border-bottom: 1px solid var(--border);
            background: var(--green-dark);
            display: flex;
            align-items: center;
            gap: 11px;
        }

        .logo-icon {
            width: 42px;
            height: 42px;
            background: rgba(255,255,255,0.12);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(255,255,255,0.15);
            overflow: hidden;
            flex-shrink: 0;
        }

        .logo-icon img {
            width: 68%;
            height: 68%;
            object-fit: contain;
            filter: brightness(0) invert(1);
        }

        .logo-text { display: flex; flex-direction: column; gap: 1px; }

        .logo-text .brand {
            font-size: 15px;
            font-weight: 700;
            letter-spacing: -0.02em;
            line-height: 1.2;
        }

        .logo-text .brand .prime   { color: #FFFFFF; }
        .logo-text .brand .harvest { color: var(--green-pale); }

        .logo-text .tagline {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 2.5px;
            color: rgba(255,255,255,0.35);
            margin-top: 1px;
        }

        .logo-text .version {
            font-size: 9px;
            color: rgba(255,255,255,0.25);
        }

        .nav-section { padding: 8px 0; }

        .nav-label {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: 700;
            color: var(--text-placeholder);
            padding: 10px 16px 5px;
            display: block;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 9px 10px 9px 14px;
            margin: 1px 8px;
            color: var(--sidebar-text);
            cursor: pointer;
            transition: all 0.15s ease;
            border-radius: var(--radius-md);
            border-left: 2px solid transparent;
            font-size: 13px;
            font-weight: 500;
        }

        .nav-item:hover {
            background: var(--green-ghost);
            color: var(--green-primary);
        }

        .nav-item.active {
            background: var(--green-ghost);
            color: var(--green-dark);
            border-left-color: var(--green-mid);
            font-weight: 600;
        }

        .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.65; }
        .nav-item.active svg { opacity: 1; color: var(--green-mid); }
        .nav-item:hover svg { opacity: 1; }

        /* ── Main Content ── */
        .main {
            flex: 1;
            margin-left: var(--sidebar-width);
            padding: 26px 28px;
            background: var(--bg-page);
            min-width: 0;
        }

        /* ── Page Header ── */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }

        .page-header h2 {
            font-size: 24px;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.03em;
            line-height: 1.2;
        }

        .page-header .subtitle {
            color: var(--text-muted);
            font-size: 13px;
            margin-top: 3px;
        }

        /* ── Cards ── */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 20px 22px;
            margin-bottom: 18px;
            box-shadow: var(--shadow-xs);
        }

        .card-title {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .card-title::before {
            content: '';
            width: 3px;
            height: 13px;
            background: var(--green-light);
            border-radius: 2px;
            flex-shrink: 0;
        }

        /* ── Stats Grid ── */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 14px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 18px 20px;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-xs);
            transition: box-shadow 0.2s, transform 0.2s;
        }

        .stat-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--green-mid), var(--green-pale));
        }

        .stat-card .label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .stat-card .value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 32px;
            font-weight: 700;
            color: var(--green-primary);
            line-height: 1;
        }

        .stat-card .value.warning { color: var(--warning); }
        .stat-card .value.info    { color: var(--info); }
        .stat-card .value.danger  { color: var(--danger); }

        /* ── Buttons ── */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 16px;
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.15s ease;
            position: relative;
            overflow: hidden;
            user-select: none;
            white-space: nowrap;
            letter-spacing: -0.01em;
        }

        .btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

        .btn .btn-ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(255,255,255,0.28);
            transform: scale(0);
            animation: btnRipple 0.5s linear;
            pointer-events: none;
        }
        @keyframes btnRipple { to { transform: scale(4); opacity: 0; } }

        .btn.btn--loading { opacity: 0.75; cursor: not-allowed; pointer-events: none; }
        .btn.btn--loading .btn-label { visibility: hidden; }
        .btn.btn--loading::before {
            content: '';
            position: absolute;
            width: 13px; height: 13px;
            border: 2px solid rgba(255,255,255,0.35);
            border-top-color: white;
            border-radius: 50%;
            animation: btnSpin 0.65s linear infinite;
        }
        @keyframes btnSpin { to { transform: rotate(360deg); } }

        .btn-primary {
            background: var(--green-primary);
            color: #FFFFFF;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
        }
        .btn-primary:hover:not(:disabled) {
            background: var(--green-mid);
            box-shadow: 0 4px 12px rgba(45,106,79,0.35);
            transform: translateY(-1px);
        }

        .btn-secondary {
            background: var(--bg-card);
            color: var(--text-secondary);
            border: 1px solid var(--border-strong);
            box-shadow: var(--shadow-xs);
        }
        .btn-secondary:hover:not(:disabled) {
            border-color: var(--green-light);
            color: var(--green-primary);
            background: var(--green-ghost);
        }

        .btn-danger {
            background: var(--status-danger-text);
            color: #FFFFFF;
            box-shadow: 0 1px 3px rgba(185,28,28,0.25);
        }
        .btn-danger:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

        .btn-success {
            background: var(--green-light);
            color: #FFFFFF;
            box-shadow: 0 1px 3px rgba(82,183,136,0.3);
        }
        .btn-success:hover:not(:disabled) { background: var(--green-mid); transform: translateY(-1px); }

        .btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: var(--radius-sm); }

        /* ── Forms ── */
        .form-group { margin-bottom: 16px; }

        .form-group label {
            display: block;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 9px 13px;
            background: var(--bg-input);
            border: 1px solid var(--border-strong);
            border-radius: var(--radius-md);
            color: var(--text);
            font-size: 13.5px;
            font-family: inherit;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .form-group input::placeholder { color: var(--text-placeholder); }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--green-light);
            box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }

        /* ── Search Bar ── */
        .search-bar { display: flex; gap: 10px; margin-bottom: 18px; }

        .search-bar input {
            flex: 1;
            padding: 9px 13px;
            background: var(--bg-input);
            border: 1px solid var(--border-strong);
            border-radius: var(--radius-md);
            color: var(--text);
            font-size: 13.5px;
            font-family: inherit;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .search-bar input:focus {
            outline: none;
            border-color: var(--green-light);
            box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
        }

        .search-bar select {
            padding: 9px 13px;
            background: var(--bg-input);
            border: 1px solid var(--border-strong);
            border-radius: var(--radius-md);
            color: var(--text);
            font-size: 13.5px;
            font-family: inherit;
            min-width: 140px;
        }

        /* ── Tables ── */
        .table-container { overflow-x: auto; }
        table { width: 100%; border-collapse: collapse; }

        th {
            padding: 10px 15px;
            text-align: left;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1.2px;
            color: var(--text-muted);
            font-weight: 700;
            background: var(--bg-subtle);
            border-bottom: 2px solid var(--border);
            white-space: nowrap;
        }

        th:first-child { border-radius: var(--radius-sm) 0 0 0; }
        th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

        td {
            padding: 12px 15px;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
            color: var(--text);
            vertical-align: middle;
        }

        tr:last-child td { border-bottom: none; }
        tr:hover td { background: rgba(82,183,136,0.06); }

        .mono {
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            color: var(--text-secondary);
        }

        /* ── BADGES — proper colors ── */
        .badge {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
            border: 1px solid transparent;
        }

        .badge-green {
            background: var(--status-success-bg);
            color: var(--status-success-text);
            border-color: var(--status-success-border);
        }

        .badge-yellow {
            background: var(--status-warning-bg);
            color: var(--status-warning-text);
            border-color: var(--status-warning-border);
        }

        .badge-red {
            background: var(--status-danger-bg);
            color: var(--status-danger-text);
            border-color: var(--status-danger-border);
        }

        .badge-blue {
            background: var(--status-info-bg);
            color: var(--status-info-text);
            border-color: var(--status-info-border);
        }

        .badge-orange {
            background: var(--status-orange-bg);
            color: var(--status-orange-text);
            border-color: var(--status-orange-border);
        }

        .badge-gray {
            background: var(--status-neutral-bg);
            color: var(--status-neutral-text);
            border-color: var(--status-neutral-border);
        }

        .badge-purple {
            background: var(--status-purple-bg);
            color: var(--status-purple-text);
            border-color: var(--status-purple-border);
        }

        /* ── Modal ── */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(4,10,6,0.65);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .modal-overlay.active { display: flex; }

        .modal {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 26px 28px;
            max-width: 920px;
            width: 95%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: var(--shadow-xl);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--border);
        }

        .modal-header h3 {
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.02em;
        }

        .modal-close {
            background: var(--bg-subtle);
            border: 1px solid var(--border);
            color: var(--text-muted);
            cursor: pointer;
            font-size: 18px;
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            flex-shrink: 0;
        }

        .modal-close:hover {
            background: var(--status-danger-bg);
            color: var(--status-danger-text);
            border-color: var(--status-danger-border);
        }

        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 22px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }

        /* ── Page Sections ── */
        .section { display: none; }
        .section.active { display: block; }

        /* ── Empty State ── */
        .empty-state {
            text-align: center;
            padding: 52px 20px;
            color: var(--text-muted);
            font-size: 13px;
        }

        /* ── Quick Actions ── */
        .quick-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 24px;
        }

        .quick-action {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 18px 20px;
            cursor: pointer;
            transition: all 0.18s ease;
            text-align: center;
            box-shadow: var(--shadow-xs);
        }

        .quick-action:hover {
            border-color: var(--green-light);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(45,106,79,0.12);
        }

        .quick-action svg { width: 30px; height: 30px; color: var(--green-mid); margin-bottom: 9px; }
        .quick-action h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
        .quick-action p  { font-size: 11.5px; color: var(--text-muted); }

        /* ── Activity List ── */
        .activity-list { max-height: 400px; overflow-y: auto; }

        .activity-item {
            display: flex;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
            align-items: flex-start;
        }

        .activity-item:last-child { border-bottom: none; }

        .activity-icon {
            width: 34px;
            height: 34px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .activity-icon.receive { background: var(--status-success-bg); color: var(--status-success-text); }
        .activity-icon.ship    { background: var(--status-info-bg);    color: var(--status-info-text); }
        .activity-icon.move    { background: var(--status-warning-bg); color: var(--status-warning-text); }
        .activity-icon.adjust  { background: var(--status-orange-bg);  color: var(--status-orange-text); }

        .activity-content { flex: 1; min-width: 0; }
        .activity-content h4 { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
        .activity-content p  { font-size: 11.5px; color: var(--text-muted); }
        .activity-time { font-size: 11px; color: var(--text-placeholder); white-space: nowrap; }

        /* ── Dashboard Canvas + Bubbles ── */
        @keyframes tickerScroll {
            0%   { transform: translateX(0); }
            100% { transform: translateX(-100%); }
        }

        .dash-canvas {
            position: relative;
            min-height: 900px;
            width: 100%;
            box-sizing: border-box;
        }

        .dash-bubble {
            position: absolute;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            min-width: 180px;
            min-height: 100px;
            display: flex;
            flex-direction: column;
            transition: box-shadow 0.18s;
            z-index: 1;
        }

        .dash-bubble:hover { box-shadow: var(--shadow-md); }

        .dash-bubble.is-dragging {
            box-shadow: var(--shadow-xl);
            opacity: 0.97;
            z-index: 10;
        }

        .dash-bubble-handle {
            cursor: grab;
            flex-shrink: 0;
            user-select: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-subtle);
        }

        .dash-bubble-handle:active { cursor: grabbing; }

        .dbh-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .dbh-label .dbh-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #22C55E;
            box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
        }

        .dash-bubble-body {
            flex: 1;
            overflow: auto;
            padding: 13px;
            min-height: 0;
        }

        .dash-bubble-body.np { padding: 0; }

        .dash-resize-grip {
            position: absolute;
            bottom: 0; right: 0;
            width: 18px; height: 18px;
            cursor: se-resize;
            z-index: 2;
        }

        .dash-resize-grip::before,
        .dash-resize-grip::after {
            content: '';
            position: absolute;
            background: var(--text-placeholder);
            border-radius: 1px;
            opacity: 0.35;
            transition: opacity 0.15s;
        }

        .dash-bubble:hover .dash-resize-grip::before,
        .dash-bubble:hover .dash-resize-grip::after { opacity: 0.65; }

        .dash-resize-grip::before { right: 3px; bottom: 7px; width: 9px; height: 1.5px; }
        .dash-resize-grip::after  { right: 3px; bottom: 3px; width: 13px; height: 1.5px; }

        .dash-graph-handle {
            background: var(--green-dark);
            padding: 9px 14px;
            cursor: grab;
            flex-shrink: 0;
            user-select: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: none;
        }

        .dash-graph-handle:active { cursor: grabbing; }
        .dash-graph-dots { display: flex; gap: 6px; align-items: center; }
        .dash-graph-dots span { width: 10px; height: 10px; border-radius: 50%; display: block; }

        .dash-stats-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
        .dash-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

        .dash-stat-tile {
            background: var(--bg-subtle);
            border-radius: var(--radius-md);
            padding: 11px 13px;
            border-left: 3px solid var(--green-light);
            transition: background 0.15s;
        }

        .dash-stat-tile:hover { background: var(--green-ghost); }
        .dash-stat-tile.info  { border-left-color: var(--info); }
        .dash-stat-tile.warn  { border-left-color: var(--warning); }

        .ds-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 4px;
        }

        .ds-val {
            font-family: 'JetBrains Mono', monospace;
            font-size: 26px;
            font-weight: 700;
            color: var(--green-primary);
            line-height: 1;
        }

        .dash-stat-tile.info .ds-val { color: var(--info); }
        .dash-stat-tile.warn .ds-val { color: var(--warning); }

        .dash-action-tile {
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 10px 12px;
            background: var(--bg-subtle);
            border-radius: var(--radius-md);
            cursor: pointer;
            border: 1px solid var(--border);
            transition: all 0.15s;
        }

        .dash-action-tile:hover {
            border-color: var(--green-light);
            background: var(--green-ghost);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .dash-action-tile svg { width: 16px; height: 16px; color: var(--green-mid); flex-shrink: 0; }
        .da-title { font-size: 12px; font-weight: 600; color: var(--text); }
        .da-sub   { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

        /* ── Scrollbar ── */
        ::-webkit-scrollbar { width: 5px; height: 5px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

        /* ── Grid helpers ── */
        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
        @media (max-width: 1024px) { .grid-2 { grid-template-columns: 1fr; } }

        /* ── Print ── */
        @media print {
            .sidebar, .no-print { display: none !important; }
            .main { margin-left: 0; }
            body { background: white; color: black; }
            .card { border: 1px solid #ccc; box-shadow: none; }
        }

        /* ── Welcome Screen ── */
        body.ph-post-login-hold .app,
        body.ph-post-login-hold .mob-menu-btn,
        body.ph-post-login-hold .sidebar-overlay {
            opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
        }

        body.ph-splash-active .login-overlay,
        body.ph-welcome-active .login-overlay,
        body.ph-login-transition .login-overlay {
            opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
        }

        body.ph-welcome-active { overflow: hidden; }

        body.ph-welcome-active .app,
        body.ph-welcome-active .mob-menu-btn,
        body.ph-welcome-active .sidebar-overlay,
        body.ph-login-transition .app {
            opacity: 0 !important; visibility: hidden !important; pointer-events: none;
        }

        .ph-welcome-screen {
            position: fixed;
            inset: 0;
            z-index: 100001;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 32px;
            visibility: hidden;
            opacity: 0;
            pointer-events: none;
            transition: opacity .42s ease, visibility 0s linear .42s;
        }

        .ph-welcome-screen.is-visible {
            visibility: visible;
            opacity: 1;
            pointer-events: auto;
            transition: opacity .42s ease;
        }

        .ph-welcome-screen.is-exiting { opacity: 0; pointer-events: none; }

        .ph-welcome-backdrop {
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at 50% 18%, rgba(116,198,157,0.28), transparent 36%),
                radial-gradient(circle at 50% 85%, rgba(82,183,136,0.14), transparent 30%),
                linear-gradient(180deg, rgba(248,252,249,0.98) 0%, rgba(233,244,236,0.98) 100%);
            backdrop-filter: blur(18px) saturate(130%);
        }

        .ph-welcome-card {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 18px;
            max-width: min(92vw, 960px);
            transform: translateY(18px) scale(.985);
            opacity: .94;
            transition: transform .72s cubic-bezier(.22,1,.36,1), opacity .42s ease;
        }

        .ph-welcome-screen.is-visible .ph-welcome-card { transform: translateY(0) scale(1); opacity: 1; }
        .ph-welcome-screen.is-exiting .ph-welcome-card { transform: translateY(-10px) scale(1.008); opacity: 0; }

        .ph-welcome-logo-shell { width: 82px; height: 82px; border-radius: 24px; box-shadow: 0 24px 60px rgba(45,106,79,0.22); }

        .ph-welcome-kicker {
            font-size: 13px;
            font-weight: 600;
            letter-spacing: .24em;
            text-transform: uppercase;
            color: var(--green-primary);
            opacity: .84;
        }

        .ph-welcome-name {
            font-size: clamp(36px, 5.8vw, 74px);
            line-height: 1.04;
            font-weight: 700;
            letter-spacing: -.045em;
            color: var(--green-dark);
        }

        /* ── Toasts ── */
        /* Toast zones — success/info bottom-right, errors top-center */
        .ph-toast-zone {
            position: fixed;
            z-index: 999999;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: none;
        }
        .ph-toast-zone--br { bottom: 22px; right: 22px; align-items: flex-end; }
        .ph-toast-zone--top { top: 18px; left: 50%; transform: translateX(-50%); align-items: center; }
        /* Back-compat: the old single container id still resolves to bottom-right */
        #ph-toast-container {
            position: fixed;
            bottom: 22px;
            right: 22px;
            z-index: 999999;
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-end;
            pointer-events: none;
        }

        /* Error notice — top-center, manual dismiss via Continue button */
        .ph-error-notice {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 13px 16px;
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 500;
            color: #fff;
            background: var(--status-danger-text, #b91c1c);
            box-shadow: var(--shadow-lg);
            opacity: 0;
            transform: translateY(-16px);
            transition: opacity .22s ease, transform .22s ease;
            max-width: 560px;
            min-width: 320px;
            pointer-events: auto;
        }
        .ph-error-notice.ph-toast--visible { opacity: 1; transform: translateY(0); }
        .ph-error-icon { font-size: 16px; font-weight: 700; flex-shrink: 0; }
        .ph-error-text { flex: 1; line-height: 1.4; }
        .ph-error-btn {
            flex-shrink: 0;
            background: rgba(255,255,255,0.18);
            border: 1px solid rgba(255,255,255,0.55);
            color: #fff;
            border-radius: 6px;
            padding: 5px 14px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }
        .ph-error-btn:hover { background: rgba(255,255,255,0.32); }

        /* Confirm / prompt dialog — sits above all modals */
        .ph-confirm-overlay {
            position: fixed;
            inset: 0;
            z-index: 1000001;
            background: rgba(0,0,0,0.45);
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding-top: 12vh;
            opacity: 0;
            transition: opacity .18s ease;
        }
        .ph-confirm-overlay.ph-confirm-visible { opacity: 1; }
        .ph-confirm-dialog {
            background: var(--bg-card, #fff);
            color: var(--text, #1a1a1a);
            border: 1px solid var(--border, #e5e7eb);
            border-radius: var(--radius-lg, 12px);
            box-shadow: var(--shadow-lg);
            max-width: 440px;
            width: 92%;
            padding: 22px 24px;
            transform: translateY(-12px);
            transition: transform .18s ease;
        }
        .ph-confirm-overlay.ph-confirm-visible .ph-confirm-dialog { transform: translateY(0); }
        .ph-confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
        .ph-confirm-msg { font-size: 14px; line-height: 1.5; margin-bottom: 20px; white-space: pre-wrap; }
        .ph-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
        .ph-prompt-input {
            width: 100%;
            padding: 9px 11px;
            border: 1px solid var(--border, #d1d5db);
            border-radius: 8px;
            font-size: 14px;
            margin-bottom: 18px;
        }
        .ph-prompt-input:focus { outline: none; border-color: var(--green-primary, #2D6A4F); box-shadow: 0 0 0 3px var(--green-ghost, #f0faf3); }

        .ph-toast {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 15px;
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 500;
            color: #fff;
            box-shadow: var(--shadow-lg);
            opacity: 0;
            transform: translateX(24px);
            transition: opacity .22s ease, transform .22s ease;
            max-width: 320px;
            min-width: 200px;
            pointer-events: auto;
            position: relative;
            overflow: hidden;
        }

        .ph-toast--visible { opacity: 1; transform: translateX(0); }
        .ph-toast-icon { font-size: 15px; flex-shrink: 0; }
        .ph-toast-text { flex: 1; }

        .ph-toast-bar {
            position: absolute;
            bottom: 0; left: 0;
            height: 3px;
            background: rgba(255,255,255,0.35);
            animation: toastBar 2.8s linear forwards;
        }
        @keyframes toastBar { from { width: 100%; } to { width: 0%; } }

        .ph-toast--success { background: var(--green-primary); }
        .ph-toast--error   { background: var(--status-danger-text); }
        .ph-toast--info    { background: var(--info); }

        @keyframes spin { to { transform: rotate(360deg); } }

        #rmBubble-map .dash-resize-grip {
            z-index: 1200;
            width: 28px; height: 28px;
            background: rgba(45,106,79,0.2);
            border-top-left-radius: 4px;
        }

        #rmBubble-map .dash-resize-grip::before { right:4px; bottom:9px; width:12px; height:2px; background:var(--green-dark); opacity:0.6; }
        #rmBubble-map .dash-resize-grip::after  { right:4px; bottom:4px; width:17px; height:2px; background:var(--green-dark); opacity:0.6; }

        .login-credit { color: rgba(0,0,0,0.45); font-size:11px; margin-top:12px; text-align:center; }
        .version-credit { color: rgba(255,255,255,0.5); font-size:10px; margin-top:3px; }
        .app-version .version-credit { color: rgba(255,255,255,0.65) !important; font-size:10px; display:block; }
