/* Night mode: the app's dark gray theme. Loaded after app.css only when dark is on
   (the phone/computer is in dark mode, or "Dark" was picked in the top bar). */
:root {
  color-scheme: dark;
  --ink: #f5f5f5;
  --ink-2: #d4d4d4;
  --muted: #a3a3a3;
  --line: #3f3f3f;
  --line-2: #333333;
  --bg: #1a1a1a;
  --card: #2a2a2a;
  --green: #34d399;
  --green-600: #6ee7b7;
  --green-700: #a7f3d0;
  --green-50: rgba(52, 211, 153, .12);
  --blue: #60a5fa;   --blue-50: rgba(96, 165, 250, .14);
  --violet: #a78bfa; --violet-50: rgba(167, 139, 250, .14);
  --amber: #fbbf24;  --amber-50: rgba(251, 191, 36, .14);
  --red: #f87171;    --red-50: rgba(248, 113, 113, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px -12px rgba(0, 0, 0, .6);
  background: var(--bg);
}

/* Surfaces that were plain white */
.sidebar, .filters, .summary-strip > div, .person-card, .shop-pick-item, .auth, .auth .auth-card,
.btn, .sync-state, .topsearch input[type=search],
input[type=search], input[type=text], input[type=password], input[type=date], input:not([type]), select {
  background: var(--card);
}
.auth-card { background: rgba(42, 42, 42, .92); }
.topbar { background: rgba(26, 26, 26, .82); border-bottom-color: var(--line); }
.btn:hover, .shop-switch:hover, .icon-btn:hover { background: #333333; border-color: #525252; }
.issue:hover, .shop-pick-item:hover { border-color: #525252; }
.no-nav .main { background: radial-gradient(60% 50% at 50% 0%, rgba(52, 211, 153, .08), transparent 70%), var(--bg); }

/* Buttons and counts keep the solid brand green with white text */
.btn-primary, .btn-primary:hover { background: linear-gradient(180deg, #10b981, #0b7a4b); border-color: #0b7a4b; color: #fff; }
.count { background: #0b7a4b; color: #fff; }
.count-warn { background: rgba(251, 191, 36, .18); color: #fcd34d; }
.btn-wa { color: #4ade80; }

/* Tables, tabs, segments */
.table th, .pnl-table tr.sub td, .till { background: #262626; }
.table tbody tr:hover { background: #303030; }
.tabs, .seg { background: #222222; }
.tabs a:hover, .seg a:hover { background: rgba(255, 255, 255, .06); }
.tabs a.on, .seg a.on { background: #404040; box-shadow: none; }

/* Status colours on dark */
.pill-active, .badge-ok, .badge-active, .ok-line, .flash-ok { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.pill-quiet, .badge-warn, .badge-quiet { background: rgba(251, 191, 36, .12); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.pill-inactive, .badge-bad, .badge-inactive, .flash-err { background: rgba(248, 113, 113, .12); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.badge-info { color: #93c5fd; }
.alert-warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .3); color: #fcd34d; }
.alert-bad { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.alert-info { background: rgba(96, 165, 250, .08); border-color: rgba(96, 165, 250, .3); color: #93c5fd; }
.tone-amber .stat-icon, .stat.tone-warn .stat-icon, .tone-warn.issue-icon, .feed-icon.tone-warn, .sale-icon.refund { color: #fbbf24; }
.tone-teal .stat-icon { background: rgba(45, 212, 191, .14); color: #5eead4; }
.stat.tone-warn { border-color: rgba(251, 191, 36, .35); }
.stat.tone-bad { border-color: rgba(248, 113, 113, .35); background: linear-gradient(180deg, var(--card), #332626); }
.stat.tone-ok { border-color: rgba(52, 211, 153, .35); }
.trend.down { color: #fca5a5; }
.pnl-table tr.total.loss td { color: #fca5a5; }
.rank li:first-child .rank-n { background: rgba(251, 191, 36, .18); color: #fcd34d; }
.weekday span { background: rgba(52, 211, 153, .35); }
.join-code { border-color: rgba(110, 231, 183, .45); }
.filters .check:has(input:checked) { border-color: rgba(52, 211, 153, .4); }
.shop-pick-item.on { border-color: var(--green); }

/* Quiet grey text */
.nav-label, .sidenav a .icon, .issue-go, .feed-time, .sale-side small, .quiet-row td { color: #8a8a8a; }

/* The green hero areas stay green */
.stat.hero, .shop-hero, .auth-side { color: #fff; }

/* Phone: frosted top bar and nav pills */
@media (max-width: 760px) {
  .sidebar { background: rgba(26, 26, 26, .94); }
  .sidenav a.on { background: #0b7a4b; border-color: #0b7a4b; color: #fff; }
}

/* Reports */
.ir-switch a, .ir-chip, .ir-donut > div { background: var(--card); }
.ir-switch a.on { background: var(--ir); border-color: var(--ir); color: #fff; }
.ir-tile { background: color-mix(in srgb, var(--ir) 18%, var(--card)); }
.ir-chip { border-top-color: color-mix(in srgb, var(--ir) 55%, var(--card)); }
.ir-chip.ok { border-top-color: #34d399; }
.ir-chip.warn { border-top-color: #f59e0b; }
.ir-chip.bad { border-top-color: #ef4444; }
.ir-chip.info { border-top-color: #60a5fa; }
.ir-chip.accent { border-top-color: var(--ir); }
.ir-watermark { opacity: .045; }
.ir-watermark span { color: #d4d4d4; }
.ir-chip.accent { background: color-mix(in srgb, var(--ir) 14%, var(--card)); }
.ir-table tbody tr:nth-child(even) { background: #262626; }
.ir-table tbody tr:hover { background: color-mix(in srgb, var(--ir) 10%, var(--card)); }
.ir-table tfoot tr.total td { background: color-mix(in srgb, var(--ir) 12%, var(--card)); }
.ir-table th { border-bottom-color: color-mix(in srgb, var(--ir) 40%, var(--card)); }

.theme-pick a.on { background: #404040; }

/* Alerts bell and support */
.bell-btn { background: var(--card); border-color: var(--line); }
.bell-panel { background: #242424; border-color: #3a3a3a; }
.bell-item:hover, .bell-btn:hover, .bell[open] .bell-btn { background: #303030; }
.bell-badge { box-shadow: 0 0 0 2px #242424; }
.bell-ico { background: #303030; }
.bell-ico.tone-brand { background: rgba(110, 231, 183, .12); }
.bell-ico.tone-amber { background: rgba(245, 158, 11, .14); }
.bell-ico.tone-bad { background: rgba(239, 68, 68, .14); }
.support-reply { background: rgba(110, 231, 183, .1); }
.support-reply strong { color: var(--green-600); }
/* The agreement stays a white paper document, as printed. */
.agreement { border-color: #3a3a3a; }
