/*
 * ══════════════════════════════════════════════════════════════
 *  67 MOTOR STUDIO — MASTER THEME
 *  resources/css/67ms-theme.css
 *
 *  Single source of truth for all colours, typography, spacing,
 *  shadows, and base component styles.
 *
 *  Usage: @import or <link> this file once in your layout blade.
 *  Never hard-code any colour value in a blade or component file —
 *  always reference a CSS variable defined here.
 * ══════════════════════════════════════════════════════════════
 */
 
/* ── GOOGLE FONTS ─────────────────────────────────────────────
   Include in your <head> — or via @import if preferred:
   <link href="https://fonts.googleapis.com/css2?family=Bebas+Neue
   &family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;
   0,9..40,500;1,9..40,300&display=swap" rel="stylesheet">
──────────────────────────────────────────────────────────────*/
 
/* ════════════════════════════════════════════════════════════ */
/*  1. DESIGN TOKENS — ROOT VARIABLES                          */
/* ════════════════════════════════════════════════════════════ */
:root {
 
  /* ── BRAND PALETTE (source of truth) ──────────────────── */
  --brand-blue:        #010b64;   /* Primary blue — logo, CTAs, active states  */
  --brand-charcoal:    #36373d;   /* Dark grey — section titles, headings       */
  --brand-grey:        #999999;   /* Mid grey — secondary text, muted labels    */
  --brand-white:       #ffffff;   /* White — primary text on dark, clean areas  */
 
  /* ── SURFACE COLOURS ───────────────────────────────────── */
  --bg:                #f2f3f7;   /* Page body background                       */
  --surface:           #ffffff;   /* Card / panel background                    */
  --surface-alt:       #f8f9fc;   /* Slightly off-white — hover rows, alt areas */
  --line:              #dde0ea;   /* Subtle borders and dividers                */
  --line-strong:       #c4c8d8;   /* Stronger borders — form inputs, separators */
 
  /* ── SIDEBAR / TOPBAR ──────────────────────────────────── */
  --sidebar-bg:        #010b64;   /* Sidebar: brand blue                        */
  --topbar-bg:         #ffffff;   /* Topbar: white                              */
 
  /* ── TEXT ──────────────────────────────────────────────── */
  --text:              #36373d;   /* Primary body text — brand charcoal         */
  --text-mid:          #666870;   /* Secondary body text                        */
  --text-muted:        #999999;   /* Muted labels — brand grey                  */
  --text-dim:          #b8bcc8;   /* Dimmed text, placeholders                  */
  --text-white:        #ffffff;   /* Text on dark surfaces                      */
  --text-on-blue:      rgba(255,255,255,0.6); /* Subdued text on blue sidebar   */
 
  /* ── BLUE TINTS ────────────────────────────────────────── */
  --blue-hover:        #020e78;   /* Darkened blue for button hover             */
  --blue-light:        #eaebf5;   /* Very light blue tint — active bg, chips    */
  --blue-soft:         #d0d4ee;   /* Soft blue — borders, step connectors       */
  --blue-mid:          #3040a0;   /* Mid blue — links, secondary accents        */
 
  /* ── STATUS — SUCCESS ──────────────────────────────────── */
  --green:             #1a6e3e;
  --green-bg:          #eef7f2;
  --green-border:      #b0dcc0;
  --green-text:        #1a6e3e;
 
  /* ── STATUS — WARNING ──────────────────────────────────── */
  --amber:             #a05000;
  --amber-bg:          #fdf4e8;
  --amber-border:      #e8cc90;
  --amber-text:        #a05000;
 
  /* ── STATUS — DANGER / ERROR ───────────────────────────── */
  --red:               #c0392b;
  --red-bg:            #fdf0ef;
  --red-border:        #f0c0bc;
  --red-text:          #c0392b;
 
  /* ── STATUS — INFO ─────────────────────────────────────── */
  --info:              #1a4a8a;
  --info-bg:           #eaf0f8;
  --info-border:       #b0c8e8;
  --info-text:         #1a4a8a;
 
  /* ── TYPOGRAPHY ────────────────────────────────────────── */
  --font-display:      'Bebas Neue', sans-serif; /* Job IDs, section headers, display */
  --font-body:         'DM Sans', sans-serif;    /* All body copy, labels, inputs      */
 
  /* ── BORDER RADIUS ─────────────────────────────────────── */
  --r:                 6px;    /* Default — buttons, inputs, small chips */
  --r-lg:              10px;   /* Cards, panels, modals                  */
  --r-xl:              14px;   /* Large surfaces, overlays               */
  --r-pill:            999px;  /* Pill badges                            */
 
  /* ── SHADOWS ───────────────────────────────────────────── */
  --shadow-sm:  0 1px 3px rgba(1,11,100,0.06), 0 1px 2px rgba(1,11,100,0.04);
  --shadow-md:  0 4px 14px rgba(1,11,100,0.08), 0 2px 4px rgba(1,11,100,0.04);
  --shadow-lg:  0 8px 32px rgba(1,11,100,0.12), 0 4px 8px rgba(1,11,100,0.06);
 
  /* ── LAYOUT ────────────────────────────────────────────── */
  --sidebar-w:         220px;
  --topbar-h:          58px;
  --content-pad:       28px;
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  2. RESET & BASE                                            */
/* ════════════════════════════════════════════════════════════ */
*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }
 
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
 
body {
  background:   var(--bg);
  color:        var(--text);
  font-family:  var(--font-body);
  font-size:    13px;
  line-height:  1.5;
  min-height:   100vh;
  display:      flex;
}
 
a { color: var(--blue-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
 
img, svg { display: block; max-width: 100%; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  3. LAYOUT SHELL                                            */
/* ════════════════════════════════════════════════════════════ */
 
/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width:          var(--sidebar-w);
  min-height:     100vh;
  background:     var(--sidebar-bg);
  display:        flex;
  flex-direction: column;
  flex-shrink:    0;
  position:       fixed;
  top: 0; left: 0; bottom: 0;
  box-shadow:     2px 0 16px rgba(1,11,100,0.18);
  z-index:        30;
}
 
.logo-block {
  padding:        24px 20px 18px;
  border-bottom:  1px solid rgba(255,255,255,0.1);
}
 
.logo-mark {
  display:        flex;
  align-items:    center;
  gap:            10px;
  margin-bottom:  4px;
}
 
.logo-badge {
  width: 32px; height: 32px;
  background:     #ffffff;
  border-radius:  4px;
  display:        flex; align-items: center; justify-content: center;
  font-family:    var(--font-display);
  font-size:      17px;
  color:          var(--brand-blue);
  letter-spacing: 0.5px;
  flex-shrink:    0;
}
 
.logo-text {
  font-family:    var(--font-display);
  font-size:      18px;
  letter-spacing: 2px;
  color:          #ffffff;
  line-height:    1;
}
 
.logo-sub {
  font-size:      10px;
  letter-spacing: 3px;
  color:          var(--text-on-blue);
  text-transform: uppercase;
  margin-top:     2px;
  padding-left:   42px;
}
 
/* ── Sidebar Nav ─────────────────────────────────────────── */
.sidebar nav {
  flex:         1;
  padding:      12px 0;
  overflow-y:   auto;
}
 
.nav-section {
  padding:        10px 16px 4px;
  font-size:      9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color:          var(--text-on-blue);
}
 
.nav-item {
  display:        flex;
  align-items:    center;
  gap:            10px;
  padding:        8px 16px;
  cursor:         pointer;
  transition:     all 0.15s;
  border-left:    2px solid transparent;
  font-size:      12.5px;
  color:          rgba(255,255,255,0.6);
  font-weight:    300;
  text-decoration: none;
}
 
.nav-item:hover {
  background:  rgba(255,255,255,0.08);
  color:       #ffffff;
  text-decoration: none;
}
 
.nav-item.active {
  background:        rgba(255,255,255,0.14);
  color:             #ffffff;
  border-left-color: #ffffff;
  font-weight:       500;
}
 
.nav-icon {
  width: 16px; height: 16px;
  opacity:     0.6;
  flex-shrink: 0;
}
 
.nav-item.active .nav-icon { opacity: 1; }
 
.nav-badge {
  margin-left:   auto;
  background:    rgba(255,255,255,0.22);
  color:         #ffffff;
  font-size:     9px;
  font-weight:   600;
  padding:       1px 6px;
  border-radius: var(--r-pill);
  min-width:     16px;
  text-align:    center;
}
 
/* ── Sidebar Footer (logged-in user) ─────────────────────── */
.sidebar-footer {
  padding:      14px 16px;
  border-top:   1px solid rgba(255,255,255,0.1);
  display:      flex;
  align-items:  center;
  gap:          10px;
  cursor:       pointer;
  position:     relative;
  transition:   background 0.15s;
}
.sidebar-footer:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background:    rgba(255,255,255,0.2);
  display:       flex; align-items: center; justify-content: center;
  font-size:     11px;
  font-weight:   600;
  color:         #ffffff;
  flex-shrink:   0;
  font-family:   var(--font-display);
  letter-spacing: 0.5px;
}

.user-info    { flex: 1; min-width: 0; }
.user-name    { font-size: 12px; font-weight: 500; color: #ffffff; }
.user-role    { font-size: 10px; color: var(--text-on-blue); }

.user-chevron {
  width: 12px; height: 12px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.sidebar-footer.menu-open .user-chevron { transform: rotate(180deg); }

/* User popup menu */
.user-menu {
  display:       none;
  position:      absolute;
  bottom:        calc(100% + 6px);
  left:          12px; right: 12px;
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r);
  box-shadow:    0 8px 24px rgba(0,0,0,0.18);
  overflow:      hidden;
  z-index:       200;
}
.user-menu.open { display: block; }

.user-menu-item {
  display:     flex;
  align-items: center;
  gap:         10px;
  width:       100%;
  padding:     11px 14px;
  font-size:   13px;
  color:       var(--text-dark);
  background:  transparent;
  border:      none;
  cursor:      pointer;
  text-decoration: none;
  transition:  background 0.12s;
  font-family: var(--font-body);
}
.user-menu-item:hover { background: var(--surface-alt); }
.user-menu-item svg   { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.user-menu-item + .user-menu-item { border-top: 1px solid var(--line); }
.user-menu-logout     { color: var(--red); }
.user-menu-logout svg { color: var(--red); }
 
/* ── Main content area ───────────────────────────────────── */
.main {
  margin-left:    var(--sidebar-w);
  flex:           1;
  min-height:     100vh;
  display:        flex;
  flex-direction: column;
}
 
/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  background:    var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  padding:       14px var(--content-pad);
  display:       flex;
  align-items:   center;
  gap:           16px;
  position:      sticky;
  top:           0;
  z-index:       20;
  box-shadow:    var(--shadow-sm);
  min-height:    var(--topbar-h);
}
 
.topbar-title {
  font-family:    var(--font-display);
  font-size:      20px;
  letter-spacing: 2px;
  color:          var(--brand-blue);
  flex:           1;
  line-height:    1;
}
 
.topbar-subtitle {
  font-size:      11px;
  color:          var(--text-muted);
  letter-spacing: 1px;
  margin-top:     2px;
}
 
/* ── Content padding wrapper ─────────────────────────────── */
.content { padding: var(--content-pad); flex: 1; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  4. BUTTONS                                                 */
/* ════════════════════════════════════════════════════════════ */
.btn {
  display:        inline-flex;
  align-items:    center;
  gap:            6px;
  padding:        7px 14px;
  border-radius:  var(--r);
  border:         1px solid var(--line-strong);
  background:     var(--surface);
  color:          var(--text);
  font-family:    var(--font-body);
  font-size:      12px;
  font-weight:    400;
  cursor:         pointer;
  transition:     all 0.15s;
  white-space:    nowrap;
  box-shadow:     var(--shadow-sm);
  text-decoration: none;
}
 
.btn:hover {
  background:    var(--bg);
  border-color:  var(--blue-soft);
  text-decoration: none;
}
 
/* Primary */
.btn-primary,
.btn-blue {
  background:    var(--brand-blue);
  color:         #ffffff;
  border-color:  var(--brand-blue);
  font-weight:   500;
  box-shadow:    0 2px 8px rgba(1,11,100,0.2);
}
.btn-primary:hover,
.btn-blue:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
 
/* Danger */
.btn-danger,
.btn-red {
  background:  var(--red-bg);
  color:       var(--red);
  border-color: var(--red-border);
  box-shadow:  none;
}
.btn-danger:hover,
.btn-red:hover { background: #fce8e6; }
 
/* Success */
.btn-success,
.btn-green {
  background:  var(--green-bg);
  color:       var(--green);
  border-color: var(--green-border);
  box-shadow:  none;
}
.btn-success:hover,
.btn-green:hover { background: #e0f2e8; }
 
/* ── Alert banners (validation errors, flash messages) ──────── */
.alert-danger {
  background:    var(--red-bg);
  border:        1px solid var(--red-border);
  color:         var(--red-text);
  border-radius: var(--r);
  padding:       12px 16px;
  font-size:     13px;
  line-height:   1.5;
}
.alert-danger div + div { margin-top: 4px; }

.alert-success {
  background:    var(--green-bg);
  border:        1px solid var(--green-border);
  color:         var(--green);
  border-radius: var(--r);
  padding:       12px 16px;
  font-size:     13px;
  line-height:   1.5;
}

.alert-info {
  background:    var(--info-bg);
  border:        1px solid var(--info-border);
  color:         var(--info);
  border-radius: var(--r);
  padding:       12px 16px;
  font-size:     13px;
  line-height:   1.5;
}

/* Ghost / outline */
.btn-ghost {
  background:  transparent;
  border-color: var(--line-strong);
  box-shadow:  none;
}
.btn-ghost:hover { background: var(--surface-alt); }

/* Outline — blue border, blue text, transparent bg */
.btn-outline {
  background:   transparent;
  color:        var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow:   none;
  font-weight:  500;
}
.btn-outline:hover { background: var(--blue-light); border-color: var(--brand-blue); }

/* Size modifiers */
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  5. CARDS & PANELS                                          */
/* ════════════════════════════════════════════════════════════ */
.card {
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-lg);
  padding:       16px 18px;
  box-shadow:    var(--shadow-sm);
}
 
.card-title {
  font-size:      10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color:          var(--text-muted);
  margin-bottom:  12px;
}
 
/* Stat card */
.stat-card {
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-lg);
  padding:       16px 18px;
  box-shadow:    var(--shadow-sm);
}
 
.stat-value {
  font-family:    var(--font-display);
  font-size:      28px;
  letter-spacing: 1px;
  color:          var(--brand-blue);
  line-height:    1;
}
 
.stat-label {
  font-size:   11px;
  color:       var(--text-muted);
  margin-top:  4px;
}
 
/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr;      gap: 14px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;  gap: 14px; margin-bottom: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  6. JOB CARD HEADER BANNER                                  */
/* ════════════════════════════════════════════════════════════ */
.jc-header {
  display:        flex;
  align-items:    flex-start;
  gap:            20px;
  background:     var(--brand-blue);
  border-radius:  var(--r-lg);
  padding:        22px 24px;
  margin-bottom:  18px;
  box-shadow:     var(--shadow-md);
  position:       relative;
  overflow:       hidden;
}
 
/* Decorative watermark */
.jc-header::after {
  content:        '67';
  position:       absolute;
  right: -10px; bottom: -20px;
  font-family:    var(--font-display);
  font-size:      120px;
  color:          rgba(255,255,255,0.04);
  letter-spacing: -4px;
  pointer-events: none;
  line-height:    1;
}
 
.jc-ids { flex: 1; }
 
.jc-number {
  font-family:    var(--font-display);
  font-size:      30px;
  letter-spacing: 3px;
  color:          #ffffff;
  line-height:    1;
  margin-bottom:  2px;
}
 
.jc-enq {
  font-size:      11px;
  color:          rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  margin-bottom:  10px;
}
 
.jc-enq span {
  color:          rgba(255,255,255,0.8);
  font-family:    var(--font-display);
  font-size:      13px;
  letter-spacing: 2px;
}
 
.jc-client-vehicle {
  font-size:   14px;
  font-weight: 500;
  color:       #ffffff;
  margin-bottom: 8px;
}
 
.jc-tags { display: flex; gap: 8px; flex-wrap: wrap; }
 
.tag {
  padding:       3px 8px;
  border-radius: 4px;
  font-size:     10px;
  background:    rgba(255,255,255,0.12);
  color:         rgba(255,255,255,0.75);
  border:        1px solid rgba(255,255,255,0.15);
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  7. WORKFLOW PROGRESS TRACK                                 */
/* ════════════════════════════════════════════════════════════ */
.workflow-progress {
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-lg);
  padding:       18px 20px;
  margin-bottom: 18px;
  box-shadow:    var(--shadow-sm);
}
 
.progress-track {
  display:      flex;
  align-items:  center;
  gap:          0;
  overflow-x:   auto;
  padding-bottom: 4px;
}
 
.progress-step { display: flex; align-items: center; flex-shrink: 0; }
 
.step-node {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
  min-width:      60px;
}
 
.step-circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  border:        1.5px solid var(--line-strong);
  background:    var(--surface-alt);
  display:       flex; align-items: center; justify-content: center;
  font-size:     9px;
  color:         var(--text-dim);
  transition:    all 0.2s;
}
 
.step-circle.done {
  background:  var(--brand-blue);
  border-color: var(--brand-blue);
  color:       #ffffff;
  font-size:   10px;
  font-weight: 700;
}
 
.step-circle.current {
  border-color: var(--brand-blue);
  background:   var(--blue-light);
  color:        var(--brand-blue);
  box-shadow:   0 0 0 3px rgba(1,11,100,0.1);
  font-weight:  600;
}
 
.step-label {
  font-size:   9px;
  color:       var(--text-dim);
  text-align:  center;
  line-height: 1.2;
  max-width:   56px;
}
 
.step-label.current { color: var(--brand-blue); font-weight: 500; }
 
.step-connector {
  width:         24px; height: 1.5px;
  background:    var(--line);
  flex-shrink:   0;
  margin-bottom: 18px;
}


/* ════════════════════════════════════════════════════════════ */
/*  7b. INFO ITEM — label/value row used in show pages          */
/* ════════════════════════════════════════════════════════════ */
.info-item {
  display:       flex;
  align-items:   baseline;
  gap:           8px;
  padding:       5px 0;
  border-bottom: 1px solid var(--line);
  font-size:     12.5px;
  line-height:   1.4;
}

.info-item:last-child { border-bottom: none; }

.info-item label {
  min-width:   110px;
  flex-shrink: 0;
  font-size:   11px;
  font-weight: 600;
  color:       var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item label::after { content: ':'; }

.info-item span {
  color:      var(--text);
  flex:       1;
  min-width:  0;
  word-break: break-word;
}
 
.step-connector.done { background: var(--blue-soft); }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  8. COLLAPSIBLE SECTION WRAPPERS (job card sections)        */
/* ════════════════════════════════════════════════════════════ */
.jc-section {
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  overflow:      hidden;
  box-shadow:    var(--shadow-sm);
}
 
.section-head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 20px;
  border-bottom:   1px solid var(--line);
  cursor:          pointer;
  user-select:     none;
  transition:      background 0.15s;
  background:      var(--surface);
}
 
.section-head:hover { background: var(--surface-alt); }
 
.section-head-left {
  display:     flex;
  align-items: center;
  gap:         12px;
}
 
.section-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background:    var(--bg);
  border:        1.5px solid var(--line-strong);
  display:       flex; align-items: center; justify-content: center;
  font-size:     11px;
  font-weight:   500;
  color:         var(--text-muted);
  flex-shrink:   0;
  font-family:   var(--font-display);
  letter-spacing: 1px;
}
 
.section-num.done {
  background:  var(--brand-blue);
  border-color: var(--brand-blue);
  color:       #ffffff;
  font-size:   12px;
}
 
.section-num.current {
  border-color: var(--brand-blue);
  background:   var(--blue-light);
  color:        var(--brand-blue);
  box-shadow:   0 0 0 3px rgba(1,11,100,0.08);
}
 
.section-name {
  font-family:    var(--font-display);
  font-size:      15px;
  letter-spacing: 2px;
  color:          var(--brand-charcoal);
}
 
.section-toggle {
  color:      var(--text-muted);
  font-size:  14px;
  line-height: 1;
  transition: transform 0.2s;
}
 
.section-toggle.open { transform: rotate(180deg); }
 
.section-body { padding: 20px; display: none; }
.section-body.open { display: block; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  9. STATUS BADGES                                           */
/* ════════════════════════════════════════════════════════════ */
.badge {
  display:        inline-flex;
  align-items:    center;
  gap:            4px;
  padding:        2px 8px;
  border-radius:  var(--r-pill);
  font-size:      10px;
  font-weight:    500;
  letter-spacing: 0.5px;
  border:         1px solid transparent;
  white-space:    nowrap;
}
 
/* Section state badges */
.sbadge-done    { background: var(--green-bg);   color: var(--green);       border-color: var(--green-border);  }
.sbadge-pending { background: var(--bg);          color: var(--text-muted);  border-color: var(--line-strong);   }
.sbadge-active  { background: var(--blue-light);  color: var(--brand-blue);  border-color: var(--blue-soft);     }
.sbadge-warning { background: var(--red-bg);      color: var(--red);         border-color: var(--red-border);    }
.sbadge-amber   { background: var(--amber-bg);    color: var(--amber);       border-color: var(--amber-border);  }
.sbadge-info    { background: var(--info-bg);     color: var(--info);        border-color: var(--info-border);   }
 
/* Generic status (job statuses etc.) */
.status-new        { background: var(--blue-light); color: var(--brand-blue); border-color: var(--blue-soft); }
.status-booked     { background: var(--info-bg);    color: var(--info);       border-color: var(--info-border); }
.status-in-progress { background: var(--amber-bg); color: var(--amber);      border-color: var(--amber-border); }
.status-qc         { background: var(--blue-light); color: var(--blue-mid);  border-color: var(--blue-soft); }
.status-complete   { background: var(--green-bg);   color: var(--green);     border-color: var(--green-border); }
.status-hold       { background: var(--red-bg);     color: var(--red);       border-color: var(--red-border); }
.status-cancelled  { background: var(--bg);         color: var(--text-muted); border-color: var(--line-strong); }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  10. TABLES                                                 */
/* ════════════════════════════════════════════════════════════ */
.table-wrap {
  background:    var(--surface);
  border:        1px solid var(--line);
  border-radius: var(--r-lg);
  overflow:      hidden;
  box-shadow:    var(--shadow-sm);
  margin-bottom: 18px;
}
 
table { width: 100%; border-collapse: collapse; }
 
thead th {
  padding:        10px 14px;
  text-align:     left;
  font-size:      9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color:          var(--text-muted);
  background:     var(--surface-alt);
  border-bottom:  1px solid var(--line);
  font-weight:    500;
}
 
tbody td {
  padding:        10px 14px;
  font-size:      12.5px;
  color:          var(--text);
  border-bottom:  1px solid var(--line);
  vertical-align: middle;
}
 
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-alt); }
 
.td-muted  { color: var(--text-muted); font-size: 11.5px; }
.td-bold   { font-weight: 500; color: var(--text); }
.td-blue   { color: var(--brand-blue); font-weight: 500; }
.td-green  { color: var(--green); font-weight: 500; }
.td-red    { color: var(--red); }
.td-amber  { color: var(--amber); }
 
/* Job ID display in tables */
.job-id {
  font-family:    var(--font-display);
  letter-spacing: 1.5px;
  font-size:      13px;
  color:          var(--brand-blue);
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  11. FORM ELEMENTS                                          */
/* ════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
 
.form-label {
  display:        block;
  font-size:      10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color:          var(--text-muted);
  margin-bottom:  6px;
  font-weight:    500;
}
 
.form-input,
.form-select,
.form-textarea {
  width:          100%;
  background:     var(--surface);
  border:         1px solid var(--line-strong);
  border-radius:  var(--r);
  padding:        9px 12px;
  font-family:    var(--font-body);
  font-size:      12.5px;
  color:          var(--text);
  outline:        none;
  transition:     border-color 0.15s, box-shadow 0.15s;
}
 
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-blue);
  box-shadow:   0 0 0 3px rgba(1,11,100,0.08);
}
 
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }
 
.form-input[readonly],
.form-textarea[readonly] {
  background: var(--surface-alt);
  color:      var(--text-mid);
}
 
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--surface-alt);
  color:      var(--text-muted);
  cursor:     not-allowed;
}
 
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
 
.form-grid   { display: grid; grid-template-columns: 1fr 1fr;      gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;  gap: 12px; }
.form-divider { height: 1px; background: var(--line); margin: 18px 0; }
 
.sub-label {
  font-size:      10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color:          var(--text-muted);
  margin-bottom:  10px;
  margin-top:     16px;
  font-weight:    500;
}
 
.form-hint {
  font-size:   11px;
  color:       var(--text-muted);
  margin-top:  4px;
}
 
.form-error {
  font-size:   11px;
  color:       var(--red);
  margin-top:  4px;
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  12. CHECKBOXES, TOGGLES & FIELD ROWS                      */
/* ════════════════════════════════════════════════════════════ */
.check-row {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     7px 0;
  font-size:   12.5px;
  color:       var(--text);
  cursor:      pointer;
}
 
.check-box {
  width: 16px; height: 16px;
  border-radius: 3px;
  border:        1.5px solid var(--line-strong);
  background:    var(--surface);
  flex-shrink:   0;
  display:       flex; align-items: center; justify-content: center;
  transition:    all 0.15s;
}
 
.check-box.checked { background: var(--brand-blue); border-color: var(--brand-blue); }
.check-box.checked::after { content: '✓'; font-size: 9px; color: #ffffff; font-weight: 700; }
 
.toggle-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         8px 0;
  border-bottom:   1px solid var(--line);
}
 
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 12.5px; color: var(--text); }
.toggle-hint  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
 
.toggle-switch {
  width: 36px; height: 20px;
  border-radius: var(--r-pill);
  background:    var(--line-strong);
  position:      relative;
  cursor:        pointer;
  flex-shrink:   0;
  transition:    background 0.2s;
}
 
.toggle-switch.on { background: var(--brand-blue); }
 
.toggle-switch::after {
  content:       '';
  position:      absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background:    #ffffff;
  top: 3px; left: 3px;
  transition:    all 0.2s;
  box-shadow:    0 1px 3px rgba(0,0,0,0.2);
}
 
.toggle-switch.on::after { left: 19px; }
 
/* Field rows (read-only display pairs) */
.field-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         7px 0;
  border-bottom:   1px solid var(--line);
  gap:             12px;
}
 
.field-row:last-child { border-bottom: none; }
.field-label  { color: var(--text-muted); font-size: 11.5px; flex-shrink: 0; }
.field-value  { color: var(--text); font-size: 12px; font-weight: 400; text-align: right; }
.field-value.blue  { color: var(--brand-blue); font-weight: 500; }
.field-value.green { color: var(--green); font-weight: 500; }
.field-value.red   { color: var(--red); }
 
/* Profile / client avatar bar */
.profile-bar {
  display:     flex;
  align-items: center;
  gap:         10px;
  margin-bottom: 12px;
}
 
.profile-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background:    var(--brand-blue);
  display:       flex; align-items: center; justify-content: center;
  font-size:     12px;
  font-weight:   600;
  color:         #ffffff;
  flex-shrink:   0;
  font-family:   var(--font-display);
  letter-spacing: 1px;
}
 
.profile-name { font-size: 13px; font-weight: 500; color: var(--text); }
.profile-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  13. TABS                                                   */
/* ════════════════════════════════════════════════════════════ */
.tab-nav {
  display:       flex;
  gap:           2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x:    auto;
}
 
.tab-btn {
  padding:        8px 14px;
  font-size:      11px;
  font-weight:    400;
  color:          var(--text-muted);
  cursor:         pointer;
  border-bottom:  2px solid transparent;
  margin-bottom:  -1px;
  white-space:    nowrap;
  background:     none;
  border-top:     none;
  border-left:    none;
  border-right:   none;
  font-family:    var(--font-body);
  transition:     all 0.15s;
}
 
.tab-btn:hover { color: var(--text); }
 
.tab-btn.active {
  color:        var(--brand-blue);
  border-bottom-color: var(--brand-blue);
  font-weight:  500;
}
 
.tab-panel         { display: block; }
.tab-panel.active  { display: block; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  14. MODALS                                                 */
/* ════════════════════════════════════════════════════════════ */
.modal-overlay {
  position:        fixed;
  inset:           0;
  background:      rgba(1,11,100,0.35);
  backdrop-filter: blur(2px);
  z-index:         100;
  display:         none;
  align-items:     center;
  justify-content: center;
  padding:         20px;
}
 
.modal-overlay.open { display: flex; }
 
.modal {
  background:    var(--surface);
  border:        1px solid var(--line-strong);
  border-radius: var(--r-xl);
  width:         100%;
  max-width:     480px;
  box-shadow:    var(--shadow-lg);
  overflow:      hidden;
}
 
.modal-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         16px 22px;
  border-bottom:   1px solid var(--line);
}
 
.modal-title {
  font-family:    var(--font-display);
  font-size:      16px;
  letter-spacing: 2px;
  color:          var(--brand-charcoal);
}
 
.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background:    var(--bg);
  border:        none;
  cursor:        pointer;
  display:       flex; align-items: center; justify-content: center;
  color:         var(--text-muted);
  font-size:     16px;
  transition:    background 0.15s;
}
 
.modal-close:hover { background: var(--line); }
 
.modal-body   { padding: 20px 22px; }
.modal-footer {
  padding:         14px 22px;
  border-top:      1px solid var(--line);
  display:         flex;
  justify-content: flex-end;
  gap:             10px;
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  15. TOAST NOTIFICATION                                     */
/* ════════════════════════════════════════════════════════════ */
.toast {
  position:       fixed;
  bottom:         24px;
  left:           50%;
  transform:      translateX(-50%) translateY(20px);
  background:     var(--brand-charcoal);
  color:          #ffffff;
  padding:        12px 20px;
  border-radius:  var(--r);
  font-size:      13px;
  font-weight:    500;
  line-height:    1.5;
  box-shadow:     var(--shadow-md);
  z-index:        9999;
  opacity:        0;
  transition:     opacity 0.25s, transform 0.25s;
  white-space:    normal;
  word-break:     break-word;
  pointer-events: none;
  width:          max-content;
  max-width:      calc(100vw - 32px);
  text-align:     center;
  box-sizing:     border-box;
}
.toast.toast-error,
.toast.toast-warning {
  cursor:         pointer;
  pointer-events: auto;
  max-width:      calc(100vw - 32px);
}
.toast.toast-error   { background: #dc2626; }
.toast.toast-success { background: #16a34a; }
.toast.toast-warning { background: #d97706; }
.toast.toast-info    { background: #0369a1; }

.toast.show {
  opacity:    1;
  transform:  translateX(-50%) translateY(0);
}

/* Mobile — show toast at top so keyboard never covers it */
@media (max-width: 600px) {
  .toast {
    bottom:    unset;
    top:       16px;
    left:      16px;
    right:     16px;
    width:     auto;
    max-width: none;
    transform: translateX(0) translateY(-20px);
    font-size: 13.5px;
    padding:   14px 16px;
    text-align: left;
  }
  .toast.show {
    transform: translateX(0) translateY(0);
  }
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  16. ACTIVITY LOG                                           */
/* ════════════════════════════════════════════════════════════ */
.activity-item {
  display:       flex;
  gap:           12px;
  padding:       10px 0;
  border-bottom: 1px solid var(--line);
}
 
.activity-item:last-child { border-bottom: none; }
 
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background:  var(--brand-grey);
  flex-shrink: 0;
  margin-top:  5px;
}
 
.activity-dot.blue   { background: var(--brand-blue); }
.activity-dot.green  { background: var(--green); }
.activity-dot.red    { background: var(--red); }
.activity-dot.amber  { background: var(--amber); }
 
.activity-text  { flex: 1; font-size: 12px; line-height: 1.4; color: var(--text-mid); }
.activity-text strong { color: var(--text); font-weight: 500; }
.activity-time  { font-size: 10px; color: var(--text-dim); white-space: nowrap; margin-top: 2px; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  17. UTILITY HELPERS                                        */
/* ════════════════════════════════════════════════════════════ */
.text-blue    { color: var(--brand-blue) !important; }
.text-charcoal { color: var(--brand-charcoal) !important; }
.text-grey    { color: var(--brand-grey) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-dim     { color: var(--text-dim) !important; }
.text-green   { color: var(--green) !important; }
.text-red     { color: var(--red) !important; }
.text-amber   { color: var(--amber) !important; }
.text-white   { color: #ffffff !important; }
.text-display { font-family: var(--font-display) !important; }
 
.bg-blue      { background: var(--brand-blue) !important; }
.bg-surface   { background: var(--surface) !important; }
.bg-alt       { background: var(--surface-alt) !important; }
 
.divider      { height: 1px; background: var(--line); margin: 16px 0; }
.divider-sm   { height: 1px; background: var(--line); margin: 8px 0; }
 
.mt-0  { margin-top:    0; }      .mb-0  { margin-bottom:  0; }
.mt-4  { margin-top:   4px; }     .mb-4  { margin-bottom: 4px; }
.mt-8  { margin-top:   8px; }     .mb-8  { margin-bottom: 8px; }
.mt-12 { margin-top:  12px; }     .mb-12 { margin-bottom: 12px; }
.mt-16 { margin-top:  16px; }     .mb-16 { margin-bottom: 16px; }
.mt-20 { margin-top:  20px; }     .mb-20 { margin-bottom: 20px; }
 
.flex           { display: flex; }
.flex-center    { display: flex; align-items: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8     { gap: 8px; }
.flex-gap-12    { gap: 12px; }
.flex-gap-16    { gap: 16px; }
.flex-1         { flex: 1; }
.flex-shrink-0  { flex-shrink: 0; }
.flex-wrap      { flex-wrap: wrap; }
 
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  18. SCROLLBAR POLISH                                       */
/* ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar         { width: 4px; height: 4px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--line-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-grey); }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  19. RESPONSIVE BREAKPOINTS                                 */
/* ════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  19. RESPONSIVE — DESKTOP BASE                              */
/* ════════════════════════════════════════════════════════════ */
 
/* Hamburger — HIDDEN on desktop */
.hamburger {
  display:         none;
  flex-direction:  column;
  justify-content: center;
  gap:             5px;
  width:           36px;
  height:          36px;
  padding:         6px;
  margin-right:    8px;
  background:      none;
  border:          none;
  cursor:          pointer;
  flex-shrink:     0;
  border-radius:   var(--r);
  transition:      background 0.15s;
}
.hamburger:hover  { background: var(--surface-alt); }
.hamburger span   {
  display:      block;
  width:        100%;
  height:       2px;
  background:   var(--brand-charcoal);
  border-radius: 2px;
  transition:   transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}

/* Hamburger → ✕ when sidebar is open */
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
 
/* Sidebar close row — nav item style, hidden on desktop */
.sidebar-close-row {
  display:      none !important;
  cursor:       pointer;
  color:        rgba(255,255,255,0.5) !important;
  border-left:  2px solid transparent !important;
  font-size:    12px !important;
}
.sidebar-close-row:hover {
  color:        rgba(255,255,255,0.9) !important;
  background:   rgba(255,255,255,0.08) !important;
}
 
/* Overlay — HIDDEN until sidebar opens */
.sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(1,11,100,0.5);
  z-index:    29;
  backdrop-filter: blur(1px);
}
.sidebar-overlay.show { display: block; }
 
 
/* ════════════════════════════════════════════════════════════ */
/*  20. RESPONSIVE — TABLET & MOBILE (≤ 900px)                */
/* ════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
 
  /* Sidebar: fixed off-screen, slides in on .open */
  .sidebar {
    transform:  translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index:    30;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(1,11,100,0.3);
  }
 
  /* Show close row inside sidebar on mobile */
  .sidebar-close-row { display: flex !important; }
 
  /* Main takes full width — no sidebar margin */
  .main { margin-left: 0; }
 
  /* Show hamburger in topbar */
  .hamburger { display: flex; }
 
  /* Tighter content padding */
  .content { padding: 16px; }
 
  /* Grids collapse to single column */
  .grid-2,
  .grid-3,
  .grid-4           { grid-template-columns: 1fr; }
  .form-grid,
  .form-grid-3      { grid-template-columns: 1fr; }
 
  /* Job card header stacks */
  .jc-header        { flex-direction: column; gap: 14px; }
 
  /* Settings wrap stacks */
  .settings-wrap    { grid-template-columns: 1fr !important; }
  .settings-nav     { position: static !important; }
}
 
 
/* ════════════════════════════════════════════════════════════ */
/*  21. RESPONSIVE — SMALL PHONES (≤ 480px)                   */
/* ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
 
  .topbar           { padding: 10px 14px; flex-wrap: wrap; }
  .topbar-title     { font-size: 16px; letter-spacing: 1.5px; }
 
  .content          { padding: 12px; }
 
  .stat-value       { font-size: 22px; }
 
  /* Tables scroll horizontally rather than wrapping */
  .table-wrap       { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 480px; }
}

/* ── Info Cards Grid ──────────────────────────────────────────────────────── */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0;
}

@media (max-width: 900px) {
    .info-cards-grid { grid-template-columns: 1fr; }
}

.info-card {
    padding: 20px;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}
.info-card-header:hover { opacity: 0.85; }
.info-card-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.info-card.is-collapsed .info-card-chevron { transform: rotate(-90deg); }
.info-card.is-collapsed .info-card-body { display: none; }

.info-card-icon { font-size: 18px; }

.info-card-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.info-card-name {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--brand-charcoal);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.info-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.info-card-row .label {
    color: var(--text-muted);
    font-size: 12px;
}

.info-card-upsell-flag {
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.progress-bar-wrap {
    display: flex;
    align-items: center;
    padding: 16px 0;
    overflow-x: auto;
    gap: 0;
    margin: 16px 0;
}

.progress-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 70px;
}

.stage-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}

.stage-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.stage-done .stage-dot {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

.stage-done .stage-label { color: var(--brand-blue); }

.stage-current .stage-dot {
    background: #fff;
    border-color: var(--brand-blue);
    border-width: 3px;
    color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(1,11,100,0.12);
}

.stage-current .stage-label {
    color: var(--brand-blue);
    font-weight: 700;
}

.progress-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-top: -14px; /* align to centre of dots */
    min-width: 12px;
}

.connector-done { background: var(--brand-blue); }

/* ── Section Blocks ──────────────────────────────────────────────────────── */
.section-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #f8f9fc;
}

.section-block-title {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--brand-charcoal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-num {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--brand-blue);
    line-height: 1;
}

/* ── Two Column Layout (Section 3) ──────────────────────────────────────── */
.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

@media (max-width: 900px) {
    .two-col-layout { grid-template-columns: 1fr; }
}

/* ── Fuel Selector ────────────────────────────────────────────────────────── */
.fuel-selector {
    display: flex;
    gap: 8px;
}

.fuel-option input { display: none; }

.fuel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 2px solid var(--border);
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 16px;
    cursor: pointer;
    transition: all .15s;
}

.fuel-option input:checked + .fuel-btn {
    border-color: var(--brand-blue);
    background: var(--brand-blue);
    color: #fff;
}

/* ── Assessment Tabs ─────────────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 2px solid var(--border);
    background: #f8f9fc;
}

.tab-btn {
    padding: 12px 16px;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}

.tab-btn:hover { color: var(--brand-blue); }

.tab-active {
    color: var(--brand-blue) !important;
    border-bottom-color: var(--brand-blue) !important;
    font-weight: 600;
}

.tab-tick { color: #16a34a; margin-right: 3px; }
.tab-active .tab-tick { color: inherit; }
.tab-btn-inner { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; }

.row-clickable { cursor: pointer; }
.row-clickable:hover { background: var(--blue-light); }
.row-clickable td { user-select: none; }



.tab-panel { padding: 20px; }

.tab-panel-title {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--brand-charcoal);
    margin-bottom: 16px;
}

.assessment-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.assessment-panel-card {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    transition: border-color .15s;
}

.panel-saved   { border-color: #16a34a; }
.panel-locked  { opacity: 0.75; background: var(--surface-alt); pointer-events: none; }

.panel-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--brand-charcoal);
}

.condition-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.condition-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11px;
    cursor: pointer;
    transition: all .15s;
}

.condition-good.condition-active    { background: #16a34a; color: #fff; border-color: #16a34a; }
.condition-ok.condition-active      { background: #16a34a; color: #fff; border-color: #16a34a; }
.condition-fair.condition-active    { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.condition-cloudy.condition-active  { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.condition-yellow.condition-active  { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.condition-poor.condition-active    { background: #dc2626; color: #fff; border-color: #dc2626; }
.condition-cracked.condition-active { background: #dc2626; color: #fff; border-color: #dc2626; }
.condition-not_working.condition-active { background: #dc2626; color: #fff; border-color: #dc2626; }

.upsell-flag-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0;
    cursor: pointer;
}

.save-indicator { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.save-ok        { color: #16a34a; }

/* Assessment global save bar */
.assessment-save-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    font-size: 11px;
    min-height: 28px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
}
.save-bar-saving { color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.save-bar-ok     { color: #16a34a; }
.save-bar-spinner {
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid var(--line);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Saving dot on tab button */
.tab-saving-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--brand-blue);
    border-radius: 50%;
    margin-right: 4px;
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }

.photo-thumb-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.photo-thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 3px; }

.tab-nav-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Task Checklist ──────────────────────────────────────────────────────── */
.task-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin: 0 20px 16px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: var(--brand-blue);
    border-radius: 2px;
    transition: width .3s ease;
}

.task-counter {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--brand-blue);
}

.task-group { margin-bottom: 16px; }

.task-group-header {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.task-row {
    padding: 8px 0;
    border-bottom: 1px solid #f1f2f4;
    transition: opacity .15s;
}

.task-done .task-name-done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--brand-blue);
    flex-shrink: 0;
}

.task-meta-row { margin-left: 28px; margin-top: 3px; }

/* ── Expense Tracker ─────────────────────────────────────────────────────── */
.exp-add-area {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 16px;
    margin-bottom: 14px;
}

.exp-field-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.exp-field { display: flex; flex-direction: column; }
.exp-label {
    font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.exp-desc  { flex: 3; min-width: 150px; }
.exp-qty   { flex: 0.7; min-width: 64px; }
.exp-cost  { flex: 1; min-width: 96px; }
.exp-btn-col { flex: 0 0 auto; }

.exp-input {
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    font-size: 14px;
    color: var(--text);
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: var(--font-body);
}
.exp-input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(1,11,100,0.08);
}
.exp-add-btn { height: 40px; white-space: nowrap; }

.exp-preview-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--brand-blue);
    background: var(--blue-light);
    border-radius: var(--r-pill);
    padding: 3px 12px;
}

.exp-lines { margin-bottom: 14px; }

.exp-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.exp-line-info { flex: 1; min-width: 0; }
.exp-line-desc { display: block; font-weight: 500; color: var(--text); }
.exp-line-meta { font-size: 11px; color: var(--text-muted); }
.exp-line-total { font-weight: 600; color: var(--brand-charcoal); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-delete {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: none;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.exp-delete:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

.exp-totals {
    border-top: 2px solid var(--line);
    padding-top: 10px;
}
.exp-total-row {
    display: flex; justify-content: space-between;
    padding: 5px 0; font-size: 13px; color: var(--text-mid);
}
.exp-total-divider { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.exp-total-margin {
    font-weight: 700; font-size: 14px; color: var(--text);
    margin-top: 6px; padding-top: 8px;
    border-top: 2px solid var(--line);
}

/* ── Internal Notes compose ──────────────────────────────────────────────── */
.note-compose {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px;
}
.note-textarea {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.note-textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(1,11,100,0.08);
}
.note-compose-footer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px;
}

.margin-positive { color: #16a34a; }
.margin-negative { color: #dc2626; }

/* ── QC Section ──────────────────────────────────────────────────────────── */
.qc-group { margin-bottom: 16px; }
.qc-group-header {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.qc-item-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.qc-item-done .qc-item-text { color: var(--text-muted); text-decoration: line-through; }
.qc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    min-height: 44px;
    padding: 2px 0;
}
.qc-checkbox-label input[type=checkbox] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: var(--brand-blue);
    flex-shrink: 0;
}
.qc-item-meta { margin-left: 32px; margin-top: 3px; }

/* Custom QC item input */
.qc-custom-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.qc-custom-row input { flex: 1; }

.qc-decision-row { display: flex; gap: 12px; flex-wrap: wrap; }

.qc-decision-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all .15s;
    min-width: 180px;
}

.qc-decision-btn input { display: none; }

.qc-pass:hover,
.qc-pass.qc-decision-selected  { border-color: #16a34a; background: #f0fdf4; color: #166534; }

/* Locked — not all QC items ticked yet */
.qc-pass.qc-decision-locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface-alt);
    border-color: var(--line);
    color: var(--text-muted);
    pointer-events: none;
}

.qc-fail:hover,
.qc-fail.qc-decision-selected  { border-color: #dc2626; background: #fef2f2; color: #991b1b; }

.qc-passed-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-weight: 600;
}

.qc-passed-icon {
    width: 32px;
    height: 32px;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.rework-history {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.rework-history-title {
    font-weight: 700;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 10px;
}

.rework-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #fde68a;
    font-size: 13px;
}

.rework-note { color: #92400e; margin: 4px 0 0; }

/* ── Sign-Off Section ────────────────────────────────────────────────────── */
.sign-off-summary {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 10px;
}

.sign-off-icon {
    width: 48px;
    height: 48px;
    background: var(--brand-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sign-off-title {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--brand-blue);
    margin-bottom: 6px;
}

.sign-off-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.sign-off-rows { font-size: 13px; }
.sign-off-row {
    display: flex;
    gap: 16px;
    padding: 4px 0;
}

.sign-off-row .label { color: var(--text-muted); min-width: 140px; }
.sign-off-notes { margin-top: 12px; font-size: 13px; color: var(--text-muted); font-style: italic; }

/* ── Page Header (title + action buttons row) ─────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-header-left  { flex: 1; min-width: 0; }
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.page-title {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 3px;
    color: var(--brand-charcoal);
    line-height: 1;
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ── Badge additions ─────────────────────────────────────────────────────── */
.badge-complete  { background: #dcfce7; color: #166534; }
.badge-pending   { background: #f3f4f6; color: var(--text-muted); }
.badge-inprogress{ background: #dbeafe; color: #1e40af; }
.badge-fail      { background: #fee2e2; color: #991b1b; }
.badge-progress  { background: #fef3c7; color: #92400e; }
.badge-required  { background: #fee2e2; color: #991b1b; font-size: 10px; }
.badge-custom    { background: #ede9fe; color: #6b21a8; font-size: 10px; }

/* ── Change Log ──────────────────────────────────────────────────────────── */
.change-log-table-wrap { overflow-x: auto; }

/* ── Photo Upload Grid (Check-In) ────────────────────────────────────────── */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.photo-slot { }

.photo-slot-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.photo-slot-drop {
    height: 90px;
    border: 2px dashed var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.photo-slot-drop:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    background: rgba(1,11,100,0.03);
}

/* ── Checkbox Grid (Accessories) ─────────────────────────────────────────── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.checkbox-label:has(input:checked) {
    border-color: var(--brand-blue);
    background: rgba(1,11,100,0.04);
}

/* ── Toggle Switch ────────────────────────────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 360px;
}

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch label {
    position: absolute; cursor: pointer; inset: 0;
    background: #e5e7eb; border-radius: 12px; transition: .3s;
}
.toggle-switch label::after {
    content: ''; position: absolute;
    width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + label { background: var(--brand-blue); }
.toggle-switch input:checked + label::after { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════════
   PHASE 1E — INVOICE BADGES & TOTALS
   ═══════════════════════════════════════════════════════════ */

/* Invoice type badges */
.badge-type-deposit   { background: #1a3a6b; color: #fff; }
.badge-type-interim   { background: #4a4a7a; color: #fff; }
.badge-type-final     { background: #010b64; color: #fff; }
.badge-type-ad_hoc    { background: #36373d; color: #fff; }

/* Invoice status badges */
.badge-invoice-draft          { background: #36373d; color: #fff; }
.badge-invoice-sent           { background: #1a5276; color: #fff; }
.badge-invoice-partially_paid { background: #7d6608; color: #fff; }
.badge-invoice-paid           { background: #1e8449; color: #fff; }
.badge-invoice-overdue        { background: #922b21; color: #fff; }
.badge-invoice-cancelled      { background: #999999; color: #fff; }

/* Invoice totals block */
.invoice-totals         { border-top: 1px solid #36373d; padding-top: 14px; }
.totals-row             { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totals-row-total       { font-weight: 700; font-size: 16px; border-top: 1px solid #36373d; margin-top: 6px; padding-top: 8px; }
.totals-row-balance     { font-weight: 700; font-size: 15px; }


/* ════════════════════════════════════════════════════════════ */
/*  INDEX PAGE — SHARED MOBILE CARD LAYOUT                      */
/* ════════════════════════════════════════════════════════════ */
.idx-desktop-table { display: block; }
.idx-mobile-list   { display: none; }

.idx-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.idx-card:active { border-color: var(--brand-blue); }
.idx-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 10px;
}
.idx-card-main {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.idx-card-id {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--brand-blue);
}
.idx-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 10px;
}
.idx-card-meta span { margin-right: 10px; white-space: nowrap; }
.idx-card-actions {
    display: flex;
    gap: 8px;
}
.idx-card-actions .btn { flex: 1; text-align: center; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   MOBILE — iPhone 11 baseline (max-width: 640px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

  /* ── Sidebar ── */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    position: fixed;
    z-index: 200;
    height: 100%;
    top: 0;
    left: 0;
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }
  .sidebar-overlay.show { display: block; }
  .sidebar-close-row { display: flex !important; }

  /* ── Main content ── */
  .main-content { margin-left: 0 !important; }
  .main { overflow-x: hidden; max-width: 100vw; }
  .content { overflow-x: hidden; }

  /* ── Topbar ── */
  .topbar { padding: 10px 14px; }
  .topbar-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 160px);
  }
  .topbar-subtitle { display: none; }
  .topbar-actions { gap: 6px; flex-shrink: 0; }
  .topbar-actions .btn { font-size: 11px; padding: 5px 10px; }

  /* ── Page ── */
  .page { padding: 14px; }
  .page-title { font-size: 18px; margin-bottom: 14px; }

  /* ── Cards ── */
  .card { padding: 14px; border-radius: var(--r); }

  /* ── Form grids ── */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid.three { grid-template-columns: 1fr !important; }
  .form-group.full { grid-column: span 1 !important; }
  .options-grid { grid-template-columns: 1fr !important; }

  /* ── Info grids ── */
  .info-grid { grid-template-columns: 1fr !important; }

  /* ── Job header ── */
  .job-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .job-header .actions { flex-wrap: wrap; gap: 6px; }
  .job-header .actions .btn { font-size: 12px; padding: 6px 12px; }

  /* ── Two-column grids ── */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Data tables → card layout ── */
  .data-table { display: block; }
  .data-table thead { display: none; }
  .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  .data-table td { border: none; padding: 3px 0; font-size: 13px; }
  .data-table td:last-child { padding-top: 8px; }

  /* ── Buttons ── */
  .btn { font-size: 12px; padding: 8px 14px; }
  .btn-lg { font-size: 14px; padding: 10px 20px; }

  /* ── Badges ── */
  .badge { font-size: 10px; padding: 2px 8px; }

  /* ── History items ── */
  .history-item { padding: 8px 0; }

  /* ── Job card sections ── */
  .form-section { padding: 14px 0; }
  .form-section-title { font-size: 12px; }
  .form-row { flex-direction: column; gap: 12px; }

  /* ── Fuel selector ── */
  .fuel-selector { gap: 4px; }
  .fuel-btn { padding: 8px 10px; font-size: 13px; }

  /* ── Client header ── */
  .client-header { padding: 16px; }
  .client-header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .header-actions { margin-left: 0; flex-wrap: wrap; }
  .stats-strip { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .client-layout { grid-template-columns: 1fr !important; }

  /* ── Tab bar ── */
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  /* ── Assessment sub-tab nav: wrap on mobile ── */
  .tab-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 5px;
    padding: 8px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    border-radius: var(--r) var(--r) 0 0;
  }
  .tab-btn {
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 11px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-mid);
    margin-bottom: 0;
  }
  .tab-btn.tab-active,
  .tab-active {
    background: var(--brand-blue) !important;
    color: var(--text-white) !important;
    border-color: var(--brand-blue) !important;
    font-weight: 600;
  }

  /* ── Quote / Invoice line items ── */
  .line-header { display: none !important; }
  .line-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    margin-bottom: 10px;
  }
  .line-row input { width: 100%; box-sizing: border-box; }
  .btn-remove { align-self: flex-end; }

  /* ── Totals wrap ── */
  .totals-wrap { text-align: left; }
  .totals-table { display: table; width: 100%; }
  .totals-table td { padding: 4px 8px; font-size: 12px; }

  /* ── Signature canvas ── */
  #signature-canvas { max-width: 100% !important; }

  /* ── Photo upload grid ── */
  .photo-upload-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

  /* ── Search rows ── */
  .search-row { flex-wrap: wrap; }
  .search-row input { max-width: 100% !important; }

  /* ── Section titles ── */
  .section-title { font-size: 9px; }

  /* ── Hamburger ── */
  .hamburger { display: flex !important; }

  /* ── Page header ── */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .page-header-actions .btn { font-size: 12px; padding: 6px 10px; }

  /* ── Cards — prevent forcing viewport wider ── */
  .card { min-width: 0; box-sizing: border-box; width: 100%; }
  .section-block { min-width: 0; }
  .jc-section { min-width: 0; }
  .page-title  { font-size: 18px; letter-spacing: 2px; }
  .page-subtitle { font-size: 11px; }

  /* ── Job card tab bar ── */
  .jc-tab-bar  { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .jc-tab      { padding: 9px 14px; font-size: 12px; }

  /* ── QC decision buttons ── */
  .qc-decision-row { flex-direction: column; }
  .qc-decision-btn { min-width: 0; width: 100%; }

  /* ── Sign-off summary ── */
  .sign-off-summary { flex-direction: column; gap: 12px; }
  .sign-off-row { flex-direction: column; gap: 2px; }
  .sign-off-row .label { min-width: 0; }

  /* ── Expense line items ── */
  .exp-field-row { flex-wrap: wrap; }
  .exp-desc { flex: 1 1 100%; }
  .exp-qty, .exp-cost { flex: 1 1 calc(50% - 5px); }


  /* ── Info-card rows ── */
  .info-card-row { font-size: 12px; padding: 3px 0; flex-wrap: wrap; gap: 2px; }
  .info-card-row .value { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }

  /* ── Task / checklist items ── */
  .task-item label { font-size: 13px; word-break: break-word; white-space: normal; }
  .qc-item { padding: 10px 12px; font-size: 13px; word-break: break-word; white-space: normal; }

  /* ── Assessment condition buttons ── */
  /* ── Assessment panel cards ── */
  .assessment-panel-grid { grid-template-columns: 1fr; gap: 10px; }
  .assessment-panel-card { padding: 14px; border-radius: var(--r-lg); }
  .panel-name { font-size: 14px; margin-bottom: 12px; }

  /* Bigger condition buttons */
  .condition-btn { padding: 10px 14px; font-size: 13px; min-height: 44px; border-radius: var(--r); }

  /* Bigger checkboxes for easy tapping */
  .upsell-flag-label input[type=checkbox],
  .assessment-panel-card input[type=checkbox] {
    width: 22px; height: 22px; min-width: 22px; cursor: pointer; accent-color: var(--brand-blue);
  }
  .upsell-flag-label { font-size: 13px; gap: 10px; padding: 4px 0; }

  /* Bigger photo button */
  .assessment-panel-card .btn-outline { font-size: 13px; padding: 8px 14px; min-height: 40px; }

  /* Save indicator more visible */
  .save-indicator { font-size: 12px; margin-top: 8px; }

  /* ── Tab panels ── */
  .tab-panel { padding: 12px !important; }

  /* ── FIX 3: Progress bar — wrap instead of scroll ── */
  .progress-bar-wrap {
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    padding: 12px 0;
  }
  .progress-stage { min-width: 54px; flex: 0 0 auto; gap: 4px; }
  .stage-dot { width: 24px; height: 24px; font-size: 9px; }
  .stage-label { font-size: 9px; white-space: nowrap; }
  .progress-connector { min-width: 8px; flex: 0 0 8px; margin-top: -12px; }

  /* ── FIX 5: Main job card tab bar — wrap + prominent active ── */
  .jc-tab-bar {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
    padding: 8px;
    background: var(--surface-alt);
    border-bottom: 2px solid var(--brand-blue);
    border-radius: var(--r) var(--r) 0 0;
  }
  .jc-tab {
    flex: 1 1 auto;
    min-width: 130px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: var(--surface);
    color: var(--brand-blue);
    border-bottom-color: var(--line);
    margin-bottom: 0;
    white-space: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .jc-tab.active {
    background: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
  }
  .jc-tab.active .jc-tab-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
  }

  /* ── FIX 12: Clients index — force grid on mobile, single card per row ── */
  .client-grid { grid-template-columns: 1fr !important; }
  .client-list-table thead { display: none; }
  .client-list-table tbody tr { display: block; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 10px; padding: 12px 14px; }
  .client-list-table tbody tr td { display: block; padding: 2px 0; border: none; font-size: 13px; }
  .client-list-table td.cb-col { display: inline-block; }

  /* ── FIX 12: clients/show tab bar wrapping ── */
  .tab-bar {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 6px !important;
    padding: 8px !important;
    background: var(--surface-alt) !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: var(--r) var(--r) 0 0 !important;
  }
  .tab-btn {
    border-radius: var(--r) !important;
    border: 1px solid var(--line) !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
    margin-bottom: 0 !important;
    background: var(--surface) !important;
    color: var(--text-mid) !important;
  }
  .tab-btn.tab-active,
  .tab-btn.active {
    background: var(--brand-blue) !important;
    color: var(--text-white) !important;
    border-color: var(--brand-blue) !important;
  }

  /* ── FIX 11: info cards collapsed by default on mobile ── */
  .info-card:not(.force-open) { }
  .info-card-chevron { display: flex; }

  /* ── FIX 1 mobile: show card list, hide desktop tables ── */
  .idx-desktop-table { display: none !important; }
  .idx-mobile-list   { display: block; }

  /* ── Overflow containment ── */
  .main { overflow-x: hidden; max-width: 100vw; }
  .content { overflow-x: hidden; }

}
