/* The Sprayers — themes.
   ------------------------------------------------------------------------
   Loaded after app.css. Each theme overrides the custom properties app.css
   already uses, plus a handful of chrome rules where a different look needs
   more than a colour change.

   Nothing here touches the print stylesheets. A quotation or invoice must look
   the same whoever printed it and whenever — the theme is for the people using
   the system, not for the documents leaving it. */


/* ============================================================ MODERN =======
   Lighter chrome, more breathing room, one accent colour used sparingly.
   Same information density — a workshop screen still has to show forty rows
   without scrolling forever. */

html[data-theme="modern"] {
  --navy: #111827;
  --blue: #0F766E;
  --lblue: #E6F4F1;
  --grey: #F7F8FA;
  --border: #E4E7EC;
  --ink: #111827;
  --muted: #6B7280;

  --green-bg: #DCFCE7; --green-fg: #14663B;
  --amber-bg: #FEF3C7; --amber-fg: #92400E;
  --red-bg: #FEE2E2;   --red-fg: #B42318;
  --blue-bg: #E6F4F1;  --blue-fg: #0F5F59;
  --grey-bg: #F1F3F6;  --grey-fg: #4B5563;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

html[data-theme="modern"] body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: -0.005em;
}

/* Chrome recedes: white bar, thin rule, colour saved for actions. */
html[data-theme="modern"] .topbar {
  background: #FFFFFF;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding: 14px 22px;
}
html[data-theme="modern"] .topbar a { color: var(--blue); }
html[data-theme="modern"] .topbar .brand { letter-spacing: -0.02em; }
html[data-theme="modern"] .topbar .brand small { opacity: .6; }

html[data-theme="modern"] .nav {
  border-bottom: 1px solid var(--border);
  padding: 6px 14px;
  gap: 4px;
}
html[data-theme="modern"] .nav a {
  border-right: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 500;
}
html[data-theme="modern"] .nav a:hover {
  background: var(--grey-bg);
  color: var(--ink);
}
html[data-theme="modern"] .nav a.active {
  background: var(--lblue);
  color: var(--blue);
  font-weight: 600;
}

html[data-theme="modern"] h1 {
  border-bottom: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
html[data-theme="modern"] h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* Tables lose the heavy navy header band. */
html[data-theme="modern"] th {
  background: var(--grey-bg);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
html[data-theme="modern"] tbody tr:nth-child(even) { background: transparent; }
html[data-theme="modern"] tbody tr:hover { background: var(--grey); }
html[data-theme="modern"] tfoot td {
  background: var(--grey);
  border-top: 1px solid var(--border);
}

html[data-theme="modern"] .card { padding: 20px; }
html[data-theme="modern"] .kpi { padding: 18px; }
html[data-theme="modern"] .kpi .value { font-size: 28px; letter-spacing: -0.03em; }

html[data-theme="modern"] .btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 10px 16px;
}
html[data-theme="modern"] .input {
  border-radius: 8px;
  padding: 10px 12px;
}
html[data-theme="modern"] .input:focus {
  border-color: var(--blue);
  outline: 3px solid var(--lblue);
}
html[data-theme="modern"] .pill { border-radius: 6px; font-weight: 600; }


/* ===================================================== HIGH CONTRAST =======
   For bright workshop lighting, cheap monitors, and anyone who finds the other
   themes hard to read. Heavier weights, stronger borders, no low-contrast
   grey-on-grey anywhere. */

html[data-theme="contrast"] {
  --navy: #000000;
  --blue: #0B4FBF;
  --lblue: #DBE7FF;
  --grey: #FFFFFF;
  --border: #000000;
  --ink: #000000;
  --muted: #333333;

  --green-bg: #B7F0C6; --green-fg: #00450F;
  --amber-bg: #FFE066; --amber-fg: #4A3200;
  --red-bg: #FFC2C2;   --red-fg: #8A0000;
  --blue-bg: #DBE7FF;  --blue-fg: #002B77;
  --grey-bg: #E8E8E8;  --grey-fg: #1A1A1A;

  --radius: 4px;
  --shadow: none;
}

html[data-theme="contrast"] body { font-size: 16px; font-weight: 500; }
html[data-theme="contrast"] .card,
html[data-theme="contrast"] .table-wrap,
html[data-theme="contrast"] .kpi { border-width: 2px; }
html[data-theme="contrast"] td { border-top-width: 2px; }
html[data-theme="contrast"] th { font-size: 15px; }
html[data-theme="contrast"] table { font-size: 15px; }
html[data-theme="contrast"] .btn { border-width: 2px; font-weight: 700; }
html[data-theme="contrast"] .input { border-width: 2px; }
html[data-theme="contrast"] .pill { border: 2px solid currentColor; font-weight: 700; }
html[data-theme="contrast"] a { text-decoration: underline; }
html[data-theme="contrast"] .nav a { font-weight: 700; }
html[data-theme="contrast"] :focus-visible { outline: 4px solid #0B4FBF; outline-offset: 2px; }
html[data-theme="contrast"] tbody tr:nth-child(even) { background: #F2F2F2; }


/* ---------------------------------------------------- theme picker cards */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.theme-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  cursor: pointer;
  display: block;
}
.theme-option:hover { border-color: var(--blue); }
.theme-option.is-current {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--lblue);
}
.theme-option h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.theme-option p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.theme-swatch { display: flex; gap: 6px; }
.theme-swatch span {
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .12);
}
.theme-option input { margin-right: 8px; }
