/* Armor shared theme: Midnight Glass. Rules are scoped per app by <html data-app="...">; load after each app's inline styles. */
/* ── Midnight Glass theme (dark default; light mode keeps tokens, gets shape + motion) ── */
@keyframes ag-up{ from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes ag-ring{ 0%,100% { box-shadow:0 0 0 0 rgba(34,197,94,.55); } 50% { box-shadow:0 0 0 6px rgba(34,197,94,0); } }
:root:where([data-app="command"]):not(.light) body { background: radial-gradient(1200px 520px at 15% -8%, rgba(59,130,246,.16), transparent 60%) fixed, var(--armor-black); }
:root:where([data-app="command"]):not(.light) header { background: rgba(11,15,23,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: rgba(255,255,255,.07); box-shadow: none; }
:root:where([data-app="command"]):not(.light) :is(.kpi-card,.zone-card,.owner-panel,.ai-box,.auth-card,.ai-bullet-card,.drill-panel,.schedule-pulse-card,.schedule-month-card) {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)), var(--armor-panel);
  border-color: rgba(255,255,255,.08); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(0,0,0,.25);
}
:where([data-app="command"]) :is(.kpi-card,.zone-card,.owner-panel,.ai-box,.ai-bullet-card,.schedule-pulse-card,.schedule-month-card) { border-radius: 16px; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
:where([data-app="command"]) :is(.kpi-card,.zone-card,.owner-panel,.ai-box) { animation: ag-up .45s cubic-bezier(.2,.8,.2,1) both; }
:where([data-app="command"]) :is(.kpi-card,.zone-card):nth-child(2) { animation-delay: .04s; } :where([data-app="command"]) :is(.kpi-card,.zone-card):nth-child(3) { animation-delay: .08s; }
:where([data-app="command"]) :is(.kpi-card,.zone-card):nth-child(4) { animation-delay: .12s; } :where([data-app="command"]) :is(.kpi-card,.zone-card):nth-child(n+5) { animation-delay: .16s; }
:root:where([data-app="command"]):not(.light) .kpi-card:hover, :root:where([data-app="command"]):not(.light) .zone-card:hover { border-color: rgba(59,130,246,.35); box-shadow: 0 0 0 1px rgba(59,130,246,.15), 0 14px 36px rgba(0,0,0,.35); }
:where([data-app="command"]) .kpi-card:is(.accent,.green,.blue,.red,.orange,.gray) { border-top-width: 3px; }
:where([data-app="command"]) .kpi-label { font-family: 'Barlow', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 1.2px; }
:where([data-app="command"]) .kpi-value { font-weight: 700; font-size: 42px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
:where([data-app="command"]) .section-title { font-weight: 600; letter-spacing: 1.2px; }
:where([data-app="command"]) .section-line { background: linear-gradient(90deg, var(--armor-border), transparent); }
:where([data-app="command"]) .btn-refresh, :where([data-app="command"]) .btn-connect { border-radius: 10px; }
:root:where([data-app="command"]):not(.light) .btn-connect { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 6px 20px rgba(59,130,246,.3); }
:root:where([data-app="command"]):not(.light) .btn-refresh { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
:root:where([data-app="command"]):not(.light) .btn-refresh:hover { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.5); color: #bfdbfe; }
:where([data-app="command"]) .dot.connected { box-shadow: none; animation: ag-ring 2.2s infinite; }
:root:where([data-app="command"]):not(.light) .sales-subnav { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08); }
:where([data-app="command"]) .sales-subnav-btn { transition: background .15s, color .15s, border-color .15s; }
:root:where([data-app="command"]):not(.light) .data-table tbody tr { transition: background .12s; }
:root:where([data-app="command"]):not(.light) .data-table tbody tr:hover { background: rgba(59,130,246,.06); }
:root:where([data-app="command"]):not(.light) :is(input,select) { background-color: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
:where([data-app="command"]) :is(input,select):focus-visible, :where([data-app="command"]) button:focus-visible, :where([data-app="command"]) a:focus-visible { outline: 2px solid var(--armor-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { :where([data-app="command"]) *, :where([data-app="command"]) *::before, :where([data-app="command"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ── Midnight Glass: home screen + header ── */
:root:where([data-app="command"]):not(.light) :is(.command-stat,.command-section-card,.command-domain) {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--armor-panel);
  border-color: rgba(255,255,255,.08); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 14px 40px rgba(0,0,0,.28);
}
:root:where([data-app="command"]):not(.light) .command-hero { border-color: rgba(59,130,246,.35); background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(99,102,241,.08) 50%, rgba(18,26,39,.9)); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 24px 70px rgba(0,0,0,.35), 0 0 60px rgba(59,130,246,.08); }
:root:where([data-app="command"]):not(.light) .command-hero:after { background: radial-gradient(circle, rgba(96,165,250,.3), transparent 68%); }
:root:where([data-app="command"]):not(.light) :is(.command-domain-kpi,.command-attention-row,.command-health,.command-row) { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.07); }
:where([data-app="command"]) :is(.command-hero,.command-stat,.command-section-card,.command-domain) { animation: ag-up .5s cubic-bezier(.2,.8,.2,1) both; }
:where([data-app="command"]) .command-stat:nth-child(2), :where([data-app="command"]) .command-domain:nth-child(2) { animation-delay: .05s; } :where([data-app="command"]) .command-stat:nth-child(3), :where([data-app="command"]) .command-domain:nth-child(3) { animation-delay: .1s; }
:where([data-app="command"]) .command-stat:nth-child(4), :where([data-app="command"]) .command-domain:nth-child(4) { animation-delay: .15s; } :where([data-app="command"]) .command-domain:nth-child(n+5) { animation-delay: .2s; }
:root:where([data-app="command"]):not(.light) :is(.command-domain,.command-stat):hover { border-color: rgba(59,130,246,.4); box-shadow: 0 0 0 1px rgba(59,130,246,.15), 0 18px 44px rgba(0,0,0,.4); transform: translateY(-2px); }
:where([data-app="command"]) .command-stat-value, :where([data-app="command"]) .command-domain-kpi :is(b,strong,div:first-child) { font-variant-numeric: tabular-nums; }
:where([data-app="command"]) .command-stat-value { font-weight: 700; font-size: 38px; }
:root:where([data-app="command"]):not(.light) .command-link { background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(29,78,216,.14)); border-color: rgba(96,165,250,.45); transition: transform .15s, box-shadow .15s, background .15s; }
:root:where([data-app="command"]):not(.light) .command-link:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(59,130,246,.3); background: linear-gradient(135deg, rgba(59,130,246,.35), rgba(29,78,216,.22)); }
:root:where([data-app="command"]):not(.light) .command-status { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
:root:where([data-app="command"]):not(.light) .command-nav-btn.active { color:#DBEAFE; border-color: rgba(96,165,250,.3); background: rgba(59,130,246,.18); }
:root:where([data-app="command"]):not(.light) .command-tab-bar { border-bottom-color: rgba(255,255,255,.07); }
:root:where([data-app="command"]):not(.light) :is(.apps-btn,.header-btn-small,.theme-toggle-compact) { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); border-radius: 10px; }
:root:where([data-app="command"]):not(.light) .status-pill { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
@media (max-width: 768px) {
  :where([data-app="command"]) header { padding: 10px 14px; gap: 8px; }
  :where([data-app="command"]) .acc-app-sub { display: none; }
  :where([data-app="command"]) .header-controls { width: 100%; flex-wrap: nowrap; gap: 6px; }
  :where([data-app="command"]) .header-btn-small, :where([data-app="command"]) .theme-toggle-compact { padding: 6px 9px; font-size: 12px; flex: 0 0 auto; }
  :where([data-app="command"]) .status-pill { width: auto; flex: 1 1 auto; min-width: 0; font-size: 11px; letter-spacing: .5px; padding: 6px 10px; }
  :where([data-app="command"]) .status-pill #status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
/* Overhaul: KPI numbers, trend chips, skeletons, tables, drill */
:where([data-app="command"]) .kpi-value, :where([data-app="command"]) .command-stat-value, :where([data-app="command"]) .command-domain-kpi strong, :where([data-app="command"]) .data-table td {font-variant-numeric:tabular-nums}
:where([data-app="command"]) .trend-chip {display:inline-flex;align-items:center;gap:4px;margin-top:8px;padding:3px 10px;border-radius:999px;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
:where([data-app="command"]) .trend-chip.up {color:#6EE7B7;background:rgba(52,211,153,.14)}:where([data-app="command"]) .trend-chip.down {color:#FCA5A5;background:rgba(248,113,113,.14)}:where([data-app="command"]) .trend-chip.flat {color:#CBD5E1;background:rgba(148,163,184,.14)}
:root:where([data-app="command"]).light .trend-chip.up {color:#047857;background:rgba(16,185,129,.12)}:root:where([data-app="command"]).light .trend-chip.down {color:#B91C1C;background:rgba(239,68,68,.1)}:root:where([data-app="command"]).light .trend-chip.flat {color:#475569;background:rgba(100,116,139,.12)}
:where([data-app="command"]) .trend-chip-spacer {height:28px}
:where([data-app="command"]) .kpi-foot {display:flex;justify-content:space-between;align-items:flex-end;gap:8px;margin-top:6px}
:where([data-app="command"]) .kpi-spark {flex:0 0 auto;display:block}
:where([data-app="command"]) .kpi-badge {display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.5px;vertical-align:middle;text-transform:uppercase}
:where([data-app="command"]) .kpi-badge.partial {color:#FDE68A;background:rgba(250,204,21,.14)}:where([data-app="command"]) .kpi-badge.stale {color:#FDBA74;background:rgba(249,115,22,.16)}
:root:where([data-app="command"]).light .kpi-badge.partial {color:#92400E;background:rgba(234,179,8,.16)}:root:where([data-app="command"]).light .kpi-badge.stale {color:#9A3412;background:rgba(249,115,22,.14)}
:where([data-app="command"]) .command-stat-grid:empty, :where([data-app="command"]) .command-domain-kpis:empty {min-height:72px;border-radius:12px;background:linear-gradient(90deg,rgba(148,163,184,.06) 25%,rgba(148,163,184,.14) 50%,rgba(148,163,184,.06) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}
:where([data-app="command"]) .data-table th {font-family:'Barlow',sans-serif;font-size:12px;font-weight:600;letter-spacing:.06em;padding:12px 18px}
:where([data-app="command"]) .data-table td {padding:14px 18px;font-size:15px}
:where([data-app="command"]) .data-table tbody tr td {transition:background .12s}:where([data-app="command"]) .data-table tbody tr:hover td {background:rgba(148,163,184,.06)}
:root:where([data-app="command"]):not(.light) .data-table {background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.08)}
:root:where([data-app="command"]):not(.light) .data-table th, :root:where([data-app="command"]):not(.light) .data-table tfoot td {background:rgba(255,255,255,.04)}
:root:where([data-app="command"]):not(.light) .data-table td {border-bottom-color:rgba(255,255,255,.06)}
:where([data-app="command"]) .drill-panel {width:min(540px,100vw);right:calc(-1 * min(540px,100vw))}
:root:where([data-app="command"]):not(.light) .drill-panel {background:rgba(13,18,28,.94);backdrop-filter:blur(16px);border-left-color:rgba(255,255,255,.08)}
:root:where([data-app="command"]):not(.light) .drill-header {background:rgba(255,255,255,.03)}
:where([data-app="command"]) .drill-close:focus-visible, :where([data-app="command"]) .drill-btn:focus-visible {outline:2px solid #60A5FA;outline-offset:2px}
@media (prefers-reduced-motion:reduce) {:where([data-app="command"]) .command-stat-grid:empty, :where([data-app="command"]) .command-domain-kpis:empty {animation:none}:where([data-app="command"]) .data-table tbody tr td {transition:none}}

/* ── Midnight Glass: Inventory (keeps Inventory fonts, layout and body.light tokens) ── */
:where([data-app="inventory"]) body:not(.light) { --black:#0B0F17; --card:#121A27; --card2:#0F1622; --border:rgba(255,255,255,.09); background-image: radial-gradient(1200px 520px at 15% -8%, rgba(59,130,246,.16), transparent 60%); background-attachment: fixed; }
:where([data-app="inventory"]) body:not(.light) header { background: rgba(11,15,23,.72); border-bottom-color: rgba(255,255,255,.07); }
:where([data-app="inventory"]) body:not(.light) :is(.card,.form-card,.job-card,.table-wrap) { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)), var(--card); border-color: rgba(255,255,255,.08); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(0,0,0,.25); }
:where([data-app="inventory"]) :is(.card,.job-card) { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
:where([data-app="inventory"]) body:not(.light) :is(.card,.job-card):hover { border-color: rgba(59,130,246,.35); box-shadow: 0 0 0 1px rgba(59,130,246,.15), 0 14px 36px rgba(0,0,0,.35); }
:where([data-app="inventory"]) .panel.active :is(.card,.form-card,.table-wrap) { animation: ag-up .45s cubic-bezier(.2,.8,.2,1) both; }
:where([data-app="inventory"]) .metric { font-variant-numeric: tabular-nums; }
:where([data-app="inventory"]) .tabs { gap: 4px; }
:where([data-app="inventory"]) .tab { border-radius: 999px; border-bottom: 0; margin-bottom: 10px; transition: background .15s, color .15s; }
:where([data-app="inventory"]) .tab:hover { color: var(--text); background: rgba(148,163,184,.08); }
:where([data-app="inventory"]) .tab.active { color: #DBEAFE; background: rgba(59,130,246,.18); box-shadow: inset 0 0 0 1px rgba(96,165,250,.3); }
:where([data-app="inventory"]) body.light .tab.active { color: #1D4ED8; background: rgba(59,130,246,.12); }
:where([data-app="inventory"]) .btn { transition: background .15s, border-color .15s, box-shadow .15s; }
:where([data-app="inventory"]) body:not(.light) .btn-primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-color: #2563eb; box-shadow: 0 6px 20px rgba(59,130,246,.3); }
:where([data-app="inventory"]) body:not(.light) :is(input,select,textarea) { background-color: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
:where([data-app="inventory"]) :is(input,select,textarea,button,a):focus-visible { outline: 2px solid #60A5FA; outline-offset: 2px; }
:where([data-app="inventory"]) body:not(.light) .table-wrap tbody tr:hover td { background: rgba(59,130,246,.06); }
@media (prefers-reduced-motion: reduce) { :where([data-app="inventory"]) *, :where([data-app="inventory"]) *::before, :where([data-app="inventory"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } :where([data-app="inventory"]) :is(.card,.job-card):hover { transform: none; } }

/* ── Midnight Glass: Crew (dark only; loads after liquid-glass.css, so surface rules need !important; keeps Crew fonts, layout, mobile sizing) ── */
:where([data-app="crew"]) body { --black:#0B0F17; --card:#121A27; --card2:#0F1622; --border:rgba(255,255,255,.09); background-color: var(--black) !important; background-image: radial-gradient(1200px 520px at 15% -8%, rgba(59,130,246,.16), transparent 60%) !important; }
:where([data-app="crew"]) .header { background: rgba(11,15,23,.72) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.07) !important; box-shadow: none !important; }
:where([data-app="crew"]) .card { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)), var(--card) !important; border-color: rgba(255,255,255,.08) !important; box-shadow: inset 0 1px rgba(255,255,255,.06), 0 18px 48px rgba(0,0,0,.35) !important; animation: ag-up .45s cubic-bezier(.2,.8,.2,1) both; }
:where([data-app="crew"]) .card:nth-of-type(2) { animation-delay: .05s; } :where([data-app="crew"]) .card:nth-of-type(n+3) { animation-delay: .1s; }
:where([data-app="crew"]) :is(.form-section,.chip) { background: rgba(0,0,0,.22) !important; border-color: rgba(255,255,255,.07) !important; box-shadow: none !important; }
:where([data-app="crew"]) .jobber-box { background: rgba(59,130,246,.08) !important; border-color: rgba(96,165,250,.35) !important; box-shadow: none !important; }
:where([data-app="crew"]) .mender-section { background: rgba(255,209,102,.055) !important; border-color: rgba(255,209,102,.4) !important; }
:where([data-app="crew"]) :is(input,select,textarea) { background-color: rgba(255,255,255,.04) !important; border-color: rgba(255,255,255,.1) !important; }
:where([data-app="crew"]) :is(input,select,textarea):focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,.2) !important; }
:where([data-app="crew"]) .btn:not(.secondary):not(.batch-add) { background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important; border-color: #2563eb !important; box-shadow: 0 6px 20px rgba(59,130,246,.3) !important; }
:where([data-app="crew"]) :is(.btn.secondary,.batch-add) { background: rgba(255,255,255,.04) !important; border-color: rgba(255,255,255,.1) !important; box-shadow: none !important; }
:where([data-app="crew"]) :is(.btn.secondary,.batch-add):hover { background: rgba(59,130,246,.12) !important; border-color: rgba(59,130,246,.5) !important; }
:where([data-app="crew"]) .toast { background: rgba(13,18,28,.94) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
:where([data-app="crew"]) :is(.liquid-total,.chip strong) { font-variant-numeric: tabular-nums; }
:where([data-app="crew"]) :is(input,select,textarea,button,a):focus-visible { outline: 2px solid #60A5FA !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { :where([data-app="crew"]) *, :where([data-app="crew"]) *::before, :where([data-app="crew"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ── Midnight Glass: Repairs (keeps Repairs fonts, layout and body.light tokens; loads after liquid-glass.css, so dark surface rules need !important) ── */
:where([data-app="repairs"]) body:not(.light) { background-color: #0B0F17 !important; background-image: radial-gradient(1200px 520px at 15% -8%, rgba(59,130,246,.16), transparent 60%) !important; }
:where([data-app="repairs"]) body:not(.light) header { background: rgba(11,15,23,.72) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.07) !important; box-shadow: none !important; }
:where([data-app="repairs"]) body:not(.light) :is(.kpi,.panel,.upcoming-panel,.region-panel,.repair-card,.filters,.hero) { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)), #121A27 !important; border-color: rgba(255,255,255,.08) !important; box-shadow: inset 0 1px rgba(255,255,255,.06), 0 18px 48px rgba(0,0,0,.35) !important; }
:where([data-app="repairs"]) body:not(.light) :is(.schedule-row,.attention-row,.city-block) { background: rgba(0,0,0,.22) !important; border-color: rgba(255,255,255,.07) !important; }
:where([data-app="repairs"]) :is(.kpi,.panel,.upcoming-panel,.region-panel,.repair-card) { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
:where([data-app="repairs"]) :is(.kpi,.panel,.upcoming-panel) { animation: ag-up .45s cubic-bezier(.2,.8,.2,1) both; }
:where([data-app="repairs"]) .kpi:nth-child(2) { animation-delay: .04s; } :where([data-app="repairs"]) .kpi:nth-child(3) { animation-delay: .08s; } :where([data-app="repairs"]) .kpi:nth-child(n+4) { animation-delay: .12s; }
:where([data-app="repairs"]) body:not(.light) :is(.kpi.clickable,.repair-card):hover { border-color: rgba(59,130,246,.35) !important; box-shadow: 0 0 0 1px rgba(59,130,246,.15), 0 14px 36px rgba(0,0,0,.35) !important; }
:where([data-app="repairs"]) :is(.kpi-value,.tab-count,.upcoming-count,.schedule-date-day) { font-variant-numeric: tabular-nums; }
:where([data-app="repairs"]) .tab.active { color: #DBEAFE !important; background: rgba(59,130,246,.18) !important; border-color: rgba(96,165,250,.3) !important; box-shadow: none !important; }
:where([data-app="repairs"]) body.light .tab.active { color: #1D4ED8 !important; background: rgba(59,130,246,.12) !important; }
:where([data-app="repairs"]) body:not(.light) .btn-primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important; border-color: #2563eb !important; box-shadow: 0 6px 20px rgba(59,130,246,.3) !important; }
:where([data-app="repairs"]) body:not(.light) :is(input,select,textarea) { background-color: rgba(255,255,255,.04) !important; border-color: rgba(255,255,255,.1) !important; }
:where([data-app="repairs"]) :is(input,select,textarea,button,a):focus-visible { outline: 2px solid #60A5FA !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { :where([data-app="repairs"]) *, :where([data-app="repairs"]) *::before, :where([data-app="repairs"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
