/* ══════════════════════════════════════════════════════════════
   theme.css
   Crimson Slate theme layer + the print reset that keeps A4
   documents clean.
   ══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   CRIMSON SLATE REDESIGN  —  premium on-screen theme (v13)
   Appended last so it layers over the base styles. Screen only:
   an @media print reset at the end neutralises it for A4 output.
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --cs-accent: #F15A24;
  --cs-accent-2: #e0331d;
  --cs-accent-grad: linear-gradient(135deg, #F15A24 0%, #e0331d 100%);
  --cs-head-grad: linear-gradient(135deg, #1a1a2e 0%, #2a1520 58%, #4a1c1c 100%);
  --cs-ring: rgba(241,90,36,.18);
  --shadow: 0 1px 3px rgba(17,20,45,.06), 0 1px 2px rgba(17,20,45,.04);
  --shadow-md: 0 8px 24px rgba(17,20,45,.10);
  --shadow-lg: 0 18px 44px rgba(17,20,45,.16);
  --radius: 10px;
  --radius-lg: 16px;
}

body:not(.dark-mode) {
  background:
    radial-gradient(1100px 520px at 12% -8%, #fbe9e2 0%, rgba(251,233,226,0) 60%),
    radial-gradient(1000px 500px at 110% 0%, #e9edf6 0%, rgba(233,237,246,0) 55%),
    linear-gradient(180deg, #f5f6f9 0%, #eef0f5 100%);
  background-attachment: fixed;
}

/* ── Header: frosted crimson-slate gradient ── */
.header {
  background: var(--cs-head-grad);
  height: 60px; border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 6px 22px rgba(42,21,32,.28);
}
.header-brand { font-weight: 700; letter-spacing: -.01em; }
.header-logo { border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.header-sub { opacity: .55; }
/* header controls: consistent height, icon buttons square, sign-out keeps its label */
.header > div button {
  height: 36px !important; border-radius: 10px !important;
  background: rgba(255,255,255,.12) !important; backdrop-filter: blur(6px);
  transition: background .15s, transform .15s !important;
  display: inline-flex !important; align-items: center; justify-content: center;
}
.header > div button:hover {
  background: rgba(255,255,255,.22) !important; transform: translateY(-1px);
}
#bizBtn, #mechBtn, #darkToggle { width: 36px !important; padding: 0 !important; }
#logoutBtn { padding: 0 14px !important; gap: 6px; font-weight: 600; white-space: nowrap; }

/* ── Tab bar: pill container + gradient active + animated lift ── */
.view-tabs {
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6); border-radius: 14px; padding: 5px;
  box-shadow: 0 4px 16px rgba(17,20,45,.07); gap: 3px;
}
.view-tab { border-radius: 10px; font-weight: 600; padding: 8px 15px; transition: all .18s cubic-bezier(.4,0,.2,1); }
.view-tab.active {
  background: var(--cs-accent-grad); color: #fff;
  box-shadow: 0 4px 12px rgba(224,51,29,.34); transform: translateY(-1px);
}
.view-tab:hover:not(.active) { background: rgba(241,90,36,.09); color: var(--cs-accent-2); }

/* ── Buttons ── */
.btn { border-radius: 10px; font-weight: 600; transition: transform .14s, box-shadow .14s, background .14s, filter .14s; }
.btn-primary { background: var(--cs-accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(224,51,29,.28); border: none; }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 7px 18px rgba(224,51,29,.36); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,.9); border: 1px solid var(--border); box-shadow: var(--shadow); }
.btn-ghost:hover { background: #fff; border-color: var(--cs-accent); color: var(--cs-accent-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ── Inputs: rounded with focus ring ── */
input[type="text"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  border-radius: 10px; border: 1.5px solid var(--border);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type="text"]:focus, input[type="tel"]:focus, input[type="number"]:focus,
input[type="date"]:focus, select:focus, textarea:focus {
  border-color: var(--cs-accent); box-shadow: 0 0 0 4px var(--cs-ring); outline: none;
}

/* ── Job cards: glowing left border + hover lift ── */
.job-card {
  border-radius: 16px; border: 1px solid rgba(17,20,45,.07);
  box-shadow: 0 4px 16px rgba(17,20,45,.06); position: relative; overflow: hidden;
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s;
}
.job-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--cs-accent-grad); opacity: .9;
}
.job-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(241,90,36,.25); }
.job-card.overdue::before { background: linear-gradient(135deg,#ef4444,#b91c1c); }
.job-card.all-complete::before { background: linear-gradient(135deg,#22c55e,#15803d); }

/* keep the register/data rows feeling in the same family */
.ir-row, .jr-row, .cr-row { border-radius: 12px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.ir-row:hover, .jr-row:hover, .cr-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ── Status badges: subtle depth, stay flat & readable ── */
.status-badge { border-radius: 20px; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ── Modals: deeper radius + floating shadow + blur backdrop ── */
.modal-overlay { background: rgba(17,20,45,.42); backdrop-filter: blur(4px); }
.modal { border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.6); }
.print-overlay { background: rgba(17,20,45,.5); backdrop-filter: blur(4px); }
.print-sheet { border-radius: 18px; box-shadow: var(--shadow-lg); }

/* ── Number plate: crisper UK look ── */
.cr-reg, .cert-reg {
  font-family: 'Courier New', monospace; font-weight: 800; letter-spacing: .06em;
  background: linear-gradient(180deg,#ffe14d,#ffd60a); color: #12141c;
  border: 2px solid #12141c; border-radius: 5px; padding: 1px 7px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

/* ── Summary chips ── */
.irs-chip { border-radius: 12px; box-shadow: var(--shadow); }

/* ── Login: gradient stage with floating blurred orbs + glass card ── */
.login-screen { background: var(--cs-head-grad); overflow: hidden; }
.login-screen::before, .login-screen::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
}
.login-screen::before { width: 420px; height: 420px; background: #F15A24; top: -120px; left: -90px; animation: floatA 14s ease-in-out infinite; }
.login-screen::after  { width: 380px; height: 380px; background: #3b4fd8; bottom: -120px; right: -80px; animation: floatB 16s ease-in-out infinite; }
@keyframes floatA { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,30px)} }
@keyframes floatB { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-36px,-28px)} }
.login-box {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.92); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.6); border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0,0,0,.45); max-width: 400px;
}
.login-logo-img { box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.login-field input:focus { border-color: var(--cs-accent); box-shadow: 0 0 0 4px var(--cs-ring); }
.login-btn {
  background: var(--cs-accent-grad); border-radius: 12px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(224,51,29,.36); transition: filter .15s, transform .1s, box-shadow .15s;
}
.login-btn:hover { filter: brightness(1.06); box-shadow: 0 11px 26px rgba(224,51,29,.44); }

/* ── Calendar & day-panel headers pick up the gradient ── */
.cal-header { background: var(--cs-head-grad); }

/* ── Team cards & mechanics ── */
.team-card { border-radius: 16px; box-shadow: 0 4px 16px rgba(17,20,45,.06); transition: transform .16s, box-shadow .16s; }
.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Business-settings / register book tabs (segmented) ── */
.ir-book.active { box-shadow: 0 2px 8px rgba(17,20,45,.12); }

/* ── Gentle entrance for the main view area ── */
.app > #viewJobs, .app > #viewInvoices, .app > #viewTeam, .app > #viewJobReg,
.app > #viewCerts, .app > #viewCalendar, .app > #viewHistory, .app > #viewHighlights {
  animation: viewFade .28s ease;
}
@keyframes viewFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, .job-card, .view-tab, .btn, .login-screen::before, .login-screen::after { animation: none !important; transition: none !important; }
}

/* ═══ PRINT RESET — the redesign is screen-only; keep A4 documents pristine ═══ */
@media print {
  body:not(.dark-mode) { background: #fff !important; }
  .print-sheet { border-radius: 0 !important; box-shadow: none !important; }
  .cert-page, .cert-header, .cert-body { box-shadow: none !important; }
}

/* ── Customer account statement (screen only) ── */
.stmt-head, .stmt-row { display: grid; grid-template-columns: 40px 90px 90px 100px 1fr 95px 130px; gap: 8px; align-items: center; padding: 8px 10px; }
.stmt-head { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.stmt-row { font-size: 12.5px; color: var(--text); border-bottom: 1px solid var(--border); }
.stmt-row:hover { background: var(--bg); }
.stmt-totals { margin-top: 14px; margin-left: auto; width: 300px; font-size: 12.5px; }
.stmt-totals > div { display: flex; justify-content: space-between; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.stmt-totals .stmt-bal { border-bottom: none; border-top: 2px solid var(--border); margin-top: 2px; padding-top: 8px; font-size: 14px; font-weight: 700; }
@media (max-width: 720px) { .stmt-head { display: none; } .stmt-row { grid-template-columns: 40px 1fr 95px; } .stmt-row > :nth-child(3), .stmt-row > :nth-child(5) { display: none; } }
