/* ═══════════════════════════════════════════════════════════════
   theme-twotone.css — White + Red-Orange single-accent theme
   ───────────────────────────────────────────────────────────────
   One accent colour across the whole app. Surfaces stay white, text
   stays near-black / grey for readability, and EVERY coloured accent
   (blue, green, indigo, purple, pink, amber, teal, red…) is folded
   into the brand red-orange. Loaded last so it wins the cascade.
   Tune the five --brand-* values below to shift the shade.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Premium Rosso-leaning red-orange — deep, confident, a touch of warmth. */
  --brand:      #DD3B1B;   /* primary */
  --brand-dark: #B22C10;   /* hover / pressed / gradient base */
  --brand-mid:  #F0542B;   /* bright highlight / gradient top */
  --brand-50:   #FDF1ED;   /* light tint background */
  --brand-100:  #F6CFC2;   /* light tint border */
  --brand-ink:  #AE2C11;   /* accent text on white */
  --brand-ring: rgba(221,59,27,.22);
  /* Fold the other named brand hues into the accent too */
  --brand-orange: #DD3B1B;
  --brand-blue:   #AE2C11;
  --brand-cream:  #FDF1ED;
  --gold:       #DD3B1B;
  --gold-soft:  #F0542B;
  /* Warm dark-grey ink (never pure black) for a crisp, expensive read */
  --ink-900:    #322E2B;
}

/* ── Solid accent backgrounds → brand ───────────────────────────── */
.bg-emerald-400,.bg-emerald-500,.bg-emerald-600,.bg-emerald-700,
.bg-green-400,.bg-green-500,.bg-green-600,.bg-green-700,
.bg-indigo-400,.bg-indigo-500,.bg-indigo-600,.bg-indigo-700,
.bg-violet-500,.bg-violet-600,.bg-purple-500,.bg-purple-600,.bg-purple-700,
.bg-rose-500,.bg-rose-600,.bg-pink-500,.bg-pink-600,
.bg-amber-500,.bg-amber-600,.bg-orange-500,.bg-orange-600,
.bg-sky-500,.bg-sky-600,.bg-cyan-500,.bg-cyan-600,.bg-teal-500,.bg-teal-600,
.bg-red-500,.bg-red-600 {
  background: var(--brand) !important; color: #fff !important;
}
.hover\:bg-emerald-600:hover,.hover\:bg-emerald-700:hover,
.hover\:bg-green-600:hover,.hover\:bg-green-700:hover,
.hover\:bg-indigo-600:hover,.hover\:bg-indigo-700:hover,
.hover\:bg-purple-600:hover,.hover\:bg-purple-700:hover,
.hover\:bg-rose-600:hover,.hover\:bg-rose-700:hover,
.hover\:bg-pink-600:hover,.hover\:bg-amber-600:hover,.hover\:bg-orange-600:hover,
.hover\:bg-red-600:hover,.hover\:bg-red-700:hover,
.hover\:bg-teal-600:hover,.hover\:bg-sky-600:hover { background: var(--brand-dark) !important; }

/* ── Light tint backgrounds → brand tint ────────────────────────── */
.bg-emerald-50,.bg-green-50,.bg-indigo-50,.bg-violet-50,.bg-purple-50,
.bg-rose-50,.bg-pink-50,.bg-amber-50,.bg-orange-50,.bg-yellow-50,
.bg-sky-50,.bg-cyan-50,.bg-teal-50,.bg-red-50 { background: var(--brand-50) !important; }
.bg-emerald-100,.bg-green-100,.bg-indigo-100,.bg-purple-100,.bg-violet-100,
.bg-rose-100,.bg-pink-100,.bg-amber-100,.bg-orange-100,.bg-yellow-100,
.bg-sky-100,.bg-cyan-100,.bg-teal-100,.bg-red-100 { background: var(--brand-50) !important; border-color: var(--brand-100) !important; }

/* ── Accent text → brand ink ────────────────────────────────────── */
.text-emerald-500,.text-emerald-600,.text-emerald-700,
.text-green-500,.text-green-600,.text-green-700,
.text-indigo-500,.text-indigo-600,.text-indigo-700,
.text-violet-500,.text-violet-600,.text-purple-500,.text-purple-600,.text-purple-700,
.text-rose-500,.text-rose-600,.text-rose-700,.text-pink-500,.text-pink-600,
.text-amber-500,.text-amber-600,.text-amber-700,.text-orange-500,.text-orange-600,.text-orange-700,
.text-sky-500,.text-sky-600,.text-cyan-500,.text-cyan-600,.text-teal-500,.text-teal-600,
.text-red-500,.text-red-600,.text-red-700 { color: var(--brand-ink) !important; }

/* ── Accent borders → brand tint border ─────────────────────────── */
.border-emerald-100,.border-emerald-200,.border-emerald-300,
.border-green-100,.border-green-200,.border-green-300,
.border-indigo-100,.border-indigo-200,.border-indigo-300,
.border-purple-100,.border-purple-200,.border-purple-300,.border-violet-200,
.border-rose-100,.border-rose-200,.border-rose-300,.border-pink-100,.border-pink-200,
.border-amber-100,.border-amber-200,.border-amber-300,.border-orange-200,.border-orange-300,
.border-sky-200,.border-cyan-200,.border-teal-200,
.border-red-100,.border-red-200,.border-red-300 { border-color: var(--brand-100) !important; }

/* ── Focus rings / accent rings → brand ─────────────────────────── */
.ring-emerald-500,.ring-green-500,.ring-indigo-500,.ring-purple-500,
.ring-rose-500,.ring-pink-500,.ring-amber-500,.ring-orange-500,
.ring-teal-500,.ring-sky-500,.ring-red-500,
.focus\:ring-emerald-100:focus,.focus\:ring-indigo-100:focus,.focus\:ring-purple-100:focus,
.focus\:ring-rose-100:focus,.focus\:ring-amber-100:focus { --tw-ring-color: var(--brand) !important; }
input[type=checkbox],input[type=radio] { accent-color: var(--brand) !important; }

/* ── Colourful launcher tiles (home / hubs) → one red-orange ─────────
   The base theme rotates 5 gradients via :nth-child; these mirror those
   selectors (same specificity, later source order) so every tile icon
   becomes the single accent. */
#equipGrid > div:nth-child(5n+1) > div:first-child,
#labourGrid > div:nth-child(5n+1) > div:first-child,
#invGrid > div:nth-child(5n+1) > div:first-child,
#settingsHomeGrid > div:nth-child(5n+1) > div:first-child,
#moduleCardsGrid > div:nth-child(5n+1) > div > div:first-child,
#equipGrid > div:nth-child(5n+2) > div:first-child,
#labourGrid > div:nth-child(5n+2) > div:first-child,
#invGrid > div:nth-child(5n+2) > div:first-child,
#settingsHomeGrid > div:nth-child(5n+2) > div:first-child,
#moduleCardsGrid > div:nth-child(5n+2) > div > div:first-child,
#equipGrid > div:nth-child(5n+3) > div:first-child,
#labourGrid > div:nth-child(5n+3) > div:first-child,
#invGrid > div:nth-child(5n+3) > div:first-child,
#settingsHomeGrid > div:nth-child(5n+3) > div:first-child,
#moduleCardsGrid > div:nth-child(5n+3) > div > div:first-child,
#equipGrid > div:nth-child(5n+4) > div:first-child,
#labourGrid > div:nth-child(5n+4) > div:first-child,
#invGrid > div:nth-child(5n+4) > div:first-child,
#settingsHomeGrid > div:nth-child(5n+4) > div:first-child,
#moduleCardsGrid > div:nth-child(5n+4) > div > div:first-child,
#equipGrid > div:nth-child(5n) > div:first-child,
#labourGrid > div:nth-child(5n) > div:first-child,
#invGrid > div:nth-child(5n) > div:first-child,
#settingsHomeGrid > div:nth-child(5n) > div:first-child,
#moduleCardsGrid > div:nth-child(5n) > div > div:first-child {
  /* Lacquered, dimensional accent — not a flat square: a three-stop gradient,
     a soft inner top-highlight and a red-tinted drop shadow. */
  background: linear-gradient(145deg, var(--brand-mid) 0%, var(--brand) 52%, var(--brand-dark) 100%) !important;
  box-shadow: 0 7px 16px -7px rgba(221,59,27,.55), inset 0 1px 0 rgba(255,255,255,.30) !important;
  border: none !important;
}

/* ── Premium depth on the white cards (soft, layered, warm shadow) ──── */
.bg-white.rounded-2xl, .bg-white.border.rounded-2xl,
#moduleCardsGrid > div, #projDashKPIs > div,
#invGrid > div, #labourGrid > div, #equipGrid > div {
  box-shadow: 0 1px 2px rgba(23,18,15,.04), 0 14px 30px -18px rgba(23,18,15,.16) !important;
}
#moduleCardsGrid > div:active, #invGrid > div:active { transform: translateY(1px); }

/* ── Crisper, more confident headings (near-black, tighter tracking) ── */
.view-section h2, .view-section h3, #projDashTitle {
  color: var(--ink-900) !important; letter-spacing: -.02em !important;
}

/* ── Premium WHITE side menu with a single red accent rail (no black) ── */
#appSidebar {
  background: #ffffff !important;
  background-image: none !important;
  border-right: 1px solid #F1ECE9 !important;
  color: #44403C !important;
}
#appSidebar * { color: inherit; }
#appSidebar .nav-btn { color: #52504B !important; font-weight: 600 !important; }
#appSidebar .nav-btn:hover { background: #FBF4F1 !important; color: var(--brand-ink) !important; }
#appSidebar .nav-btn.active {
  background: var(--brand-50) !important;
  border-left: 3px solid var(--brand) !important;
  color: var(--brand-ink) !important;
  font-weight: 700 !important;
}
#appSidebar .nav-btn.active::after { background: var(--brand) !important; opacity: 1 !important; }
/* Section labels + logo lockup read as calm grey on white */
#appSidebar p { color: #A8A29E !important; }
#appSidebar h1 { color: var(--ink-900) !important; }
/* The Support "Call" link follows the accent */
#appSidebar a[href^="tel:"] { color: var(--brand) !important; }

/* ── Dashboard KPI icon chips → brand tint (icons stay as glyphs) ── */
#projDashKPIs > div > div:first-child { background: var(--brand-50) !important; }

/* ── Bottom navigation: active + FAB → brand ────────────────────── */
.mobile-bottom-nav .mbn-item.active { color: var(--brand) !important; }
.mobile-bottom-nav .mbn-item:active { color: var(--brand-dark) !important; }
.mobile-bottom-nav .mbn-fab .mbn-fab-circle {
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-dark)) !important;
  box-shadow: 0 8px 20px rgba(227,74,39,.45), 0 2px 6px rgba(0,0,0,.15) !important;
}

/* ── Payments module: fold its purple/indigo/green/red into brand ───
   The module injects its own <style> with these vars + a few hardcoded
   gradients; the `html` prefix outranks that injected block. */
html #paymentsHubView {
  --purple: var(--brand); --purple-tint: var(--brand-50);
  --indigo: var(--brand); --green: var(--brand); --green-tint: var(--brand-50);
  --red: var(--brand); --red-tint: var(--brand-50);
  --bg: #ffffff; --line: #ece9f1;
}
html #paymentsHubView .pmt-bal.primary {
  background: linear-gradient(150deg, var(--brand-mid), var(--brand)) !important;
  box-shadow: 0 12px 26px -12px rgba(227,74,39,.6) !important;
}
html #paymentsHubView .pmt-seg button.on-out,
html #paymentsHubView .pmt-seg button.on-in {
  background: linear-gradient(135deg, var(--brand-mid), var(--brand)) !important;
  box-shadow: 0 8px 18px -8px rgba(227,74,39,.55) !important;
}

/* ── Logout stays the one place we keep a true red cue (destructive),
   as an outline so the palette holds. Comment out for pure two-tone. */
