/* ================================================
   White-label — Design System 2026
   Light default / Neutral / Minimal SaaS
   (Dark mode available via html[data-theme="dark"])
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---- Tokens — LIGHT (default) neutral spectrum ---- */
:root {
  --bg:          #F5F6F8;
  --surface:     #FFFFFF;
  --surface-2:   #F0F1F4;
  --surface-3:   #E8EAEE;
  --border:      #E3E6EA;
  --border-2:    #D2D6DC;
  --text:        #1F2430;
  --text-2:      #5B6470;
  --muted:       #8A929E;
  --accent:      #4B5563;
  --accent-hv:   #374151;
  --accent-dim:  rgba(75,85,99,0.08);
  --accent-glow: rgba(75,85,99,0.14);
  --brand:       #4F46E5;
  --brand-hv:    #4338CA;
  --brand-dim:   rgba(79,70,229,0.10);
  --brand-glow:  rgba(79,70,229,0.20);
  --green:       #16A34A;
  --green-dim:   rgba(22,163,74,0.10);
  --green-glow:  rgba(22,163,74,0.16);
  --red:         #DC2626;
  --red-dim:     rgba(220,38,38,0.10);
  --amber:       #D97706;
  --amber-dim:   rgba(217,119,6,0.10);
  --amber-glow:  rgba(217,119,6,0.16);
  --slate-dim:   rgba(100,116,139,0.12);
  --radius-sm:   6px;
  --radius-md:   9px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 2px rgba(16,24,40,0.06);
  --shadow-md:   0 4px 16px rgba(16,24,40,0.08);
  --shadow-lg:   0 12px 40px rgba(16,24,40,0.12);
  --transition:  150ms cubic-bezier(0.4,0,0.2,1);
}

/* ---- Tokens — DARK override (original values; wins via higher specificity) ---- */
html[data-theme="dark"] {
  --bg:          #0a0708;   /* near-black, warm red undertone */
  --surface:     #110c0d;
  --surface-2:   #180f10;
  --surface-3:   #1e1314;
  --border:      #2c191c;
  --border-2:    #3d2124;
  --text:        #ede8ea;   /* warm off-white */
  --text-2:      #9c8e92;
  --muted:       #5c4b4f;
  --accent:      #c8c0c4;   /* neutral warm white — UI chrome highlight */
  --accent-hv:   #e8e0e4;
  --accent-dim:  rgba(200,192,196,0.08);
  --accent-glow: rgba(200,192,196,0.15);
  --brand:       #FC191F;   /* brand red — primary CTA + active nav ONLY */
  --brand-hv:    #d01418;
  --brand-dim:   rgba(252,25,31,0.12);
  --brand-glow:  rgba(252,25,31,0.25);
  --green:       #22c55e;
  --green-dim:   rgba(34,197,94,0.10);
  --green-glow:  rgba(34,197,94,0.18);
  --red:         #ef4444;   /* system error / loss — distinct from brand */
  --red-dim:     rgba(239,68,68,0.10);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,0.10);
  --amber-glow:  rgba(245,158,11,0.18);
  --slate-dim:   rgba(100,116,139,0.15);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.55);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.65);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.75);
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ================================================
   SIDEBAR — Icon rail (60px), hover expands (240px)
   ================================================ */

/* ── Sidebar shell ─────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: 68px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 240ms cubic-bezier(0.4,0,0.2,1);
}
#sidebar:hover { width: 252px; }

/* ── Logo ──────────────────────────────────────── */
.sb-logo {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.sb-logo-mark {
  width: 36px;
  min-width: 36px;
  height: 36px;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sb-logo-mark img {
  width: 30px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px var(--brand-glow));
}
.sb-logo-text {
  opacity: 0;
  transition: opacity 200ms ease;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.3;
}
#sidebar:hover .sb-logo-text { opacity: 1; }
.sb-logo-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: block;
  letter-spacing: -0.2px;
}
.sb-logo-sub {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

/* ── Nav scroll area ───────────────────────────── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}
.sb-nav::-webkit-scrollbar { display: none; }

/* ── Settings group separator ──────────────────── */
.sb-group {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 16px 6px;
  overflow: hidden;
}
.sb-group-line {
  height: 1px;
  width: 24px;
  min-width: 24px;
  background: var(--border);
  transition: opacity 200ms ease;
}
#sidebar:hover .sb-group-line { opacity: 0; width: 0; min-width: 0; }
.sb-group-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 200ms ease;
  padding-left: 4px;
}
#sidebar:hover .sb-group-lbl { opacity: 1; }

/* ── Nav link ──────────────────────────────────── */
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin: 2px 8px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.sb-link:hover { color: var(--text); }
.sb-link:hover .sb-icon-wrap {
  background: var(--surface-3);
  color: var(--text);
}
.sb-link.active { color: var(--accent); }
.sb-link.active .sb-icon-wrap {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Settings links — slightly smaller */
.sb-link-sm .sb-icon-sm { font-size: 12px; }
.sb-link-sm .sb-lbl     { font-size: 12.5px; }

/* ── Icon wrap ─────────────────────────────────── */
.sb-icon-wrap {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.sb-icon-sm {
  width: 32px;
  min-width: 32px;
  height: 32px;
  font-size: 12px;
}

/* ── Nav label ─────────────────────────────────── */
.sb-lbl {
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 200ms ease;
}
#sidebar:hover .sb-lbl { opacity: 1; }

/* ── Footer ────────────────────────────────────── */
.sb-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.sb-avatar {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.sb-user-info {
  opacity: 0;
  flex: 1;
  overflow: hidden;
  transition: opacity 200ms ease;
}
#sidebar:hover .sb-user-info { opacity: 1; }
.sb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-role {
  font-size: 11px;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  text-transform: capitalize;
}
.sb-logout-form { display: contents; }
.sb-logout-btn {
  opacity: 0;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), opacity 200ms ease;
}
#sidebar:hover .sb-logout-btn { opacity: 1; }
.sb-logout-btn:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}

/* ================================================
   MAIN LAYOUT
   ================================================ */

#main-content-wrapper {
  margin-left: 68px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================================================
   HEADER
   ================================================ */

/* ── Header shell ──────────────────────────────── */
.app-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.mobile-menu-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.header-page-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-sep {
  width: 1px;
  height: 22px;
  background: var(--border-2);
  margin: 0 4px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  flex-shrink: 0;
}
.header-uname {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.header-btn-label { /* hide on very small screens via media query */ }

.btn-icon-logout {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-icon-logout:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}

/* ================================================
   PAGE CONTENT
   ================================================ */

.page-content {
  flex: 1;
  padding: 28px 28px 48px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ================================================
   CARDS
   ================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ================================================
   STAT CARDS
   ================================================ */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-meta {
  font-size: 12px;
  color: var(--muted);
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.si-blue   { background: var(--accent-dim); color: var(--accent); }
.si-red    { background: var(--red-dim);    color: var(--red); }
.si-amber  { background: var(--amber-dim);  color: var(--amber); }
.si-green  { background: var(--green-dim);  color: var(--green); }

/* ================================================
   TABLES
   ================================================ */

.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.tbl th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tbl td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tbody tr { transition: background 100ms ease; }
.tbl tbody tr:hover td { background: var(--surface-2); }

.tbl-main { font-weight: 500; }
.tbl-sub  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tbl-mono {
  font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

/* ================================================
   STATUS BADGES
   ================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.s-received    { background: var(--slate-dim); color: #64748b; }
.s-received::before { background: #64748b; }

.s-inprogress  { background: var(--accent-dim); color: var(--accent); }
.s-inprogress::before { background: var(--accent); }

.s-ready       { background: var(--green-dim); color: var(--green); }
.s-ready::before { background: var(--green); }

.s-delayed     { background: var(--amber-dim); color: var(--amber); }
.s-delayed::before { background: var(--amber); }

/* Dark mode — brighter status text on translucent fills */
html[data-theme="dark"] .s-received   { color: #94a3b8; }
html[data-theme="dark"] .s-ready      { color: #4ade80; }
html[data-theme="dark"] .s-delayed    { color: #fbbf24; }

/* Payment */
.pay-paid    { color: var(--green); font-weight: 500; }
.pay-unpaid  { color: var(--red);   font-weight: 500; }
.pay-partial { color: var(--amber); font-weight: 500; }
.pay-due     { color: var(--red);   font-weight: 600; }
.pay-clear   { color: var(--muted); font-weight: 500; }

/* Type */
.type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.type-person  { background: var(--accent-dim); color: var(--accent); }
.type-company { background: var(--amber-dim);  color: var(--amber); }
html[data-theme="dark"] .type-person  { color: #ff8a8c; }
html[data-theme="dark"] .type-company { color: #fbbf24; }

/* Role */
.role-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-admin    { background: var(--green-dim);  color: var(--green); }
.role-employee { background: var(--accent-dim); color: var(--accent); }
html[data-theme="dark"] .role-admin    { color: #4ade80; }
html[data-theme="dark"] .role-employee { color: #ff8a8c; }

/* ================================================
   BUTTONS
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hv); color: #fff; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 6px 10px;
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red-dim);
}
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
  gap: 4px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 14px;
  border-radius: 9px;
  gap: 8px;
  font-weight: 600;
}

/* ================================================
   FORMS
   ================================================ */

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 7px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 130ms ease, box-shadow 130ms ease;
  color-scheme: light dark;
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234e5669' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); }

.form-input.is-error,
.form-textarea.is-error,
.form-select.is-error { border-color: var(--red); }

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
}
html[data-theme="dark"] .form-error { color: #f87171; }

.form-field { margin-bottom: 20px; }

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
}
.form-checkbox-row:hover { color: var(--text); }

.form-checkbox {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* Form card */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 800px;
}
.form-card-wide { max-width: 960px; }

.form-card-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.form-card-body { padding: 24px; }

.form-card-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
}

/* ================================================
   SERVICES ROWS (repair form)
   ================================================ */

.service-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 130ms ease;
}

.service-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
}

.service-cb {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.service-row-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 130ms ease;
}

.service-costs {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  display: none;
}
.service-costs.visible { display: block; }

/* ================================================
   TOTAL BAR
   ================================================ */

.total-bar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}

.total-bar-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 4px;
}

.total-bar-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.total-bar-value.is-red  { color: var(--red); }
.total-bar-value.is-blue { color: var(--accent); }

/* ================================================
   DASHBOARD REPAIR ITEMS
   ================================================ */

.repair-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 100ms ease;
}
.repair-item:last-child { border-bottom: none; }
.repair-item:hover { background: var(--surface-2); }

.ri-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ri-car  { font-size: 12px; color: var(--text-2); }
.ri-meta { font-size: 12px; color: var(--muted); }

.ri-link {
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  display: inline-block;
}
.ri-link:hover { text-decoration: underline; }

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ================================================
   FLASH NOTIFICATION
   ================================================ */

#overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}

.flash-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 32px 28px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.flash-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 18px;
}

.flash-success-icon { background: var(--green-dim); color: var(--green); }
.flash-error-icon   { background: var(--amber-dim); color: var(--amber); }

.flash-message {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ================================================
   REPORTS
   ================================================ */

.report-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.rs-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 8px;
}

.rs-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.rs-value.positive { color: var(--green); }
.rs-value.negative { color: var(--red); }
.rs-value.neutral  { color: var(--accent); }

.rs-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ================================================
   CLIENT PROFILE
   ================================================ */

.profile-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.profile-info-row:last-child { border-bottom: none; }

.profile-info-key {
  width: 80px;
  min-width: 80px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
  flex-shrink: 0;
}
.profile-info-val { color: var(--text); flex: 1; }

.car-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================================================
   FOOTER
   ================================================ */

.app-footer {
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  flex-shrink: 0;
}

/* ================================================
   SELECT2 DARK THEME
   ================================================ */

.select2-container--default .select2-selection--single {
  background: var(--bg) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 7px !important;
  height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text) !important;
  line-height: 36px !important;
  padding-left: 12px !important;
  font-size: 13.5px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
  right: 6px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--muted) transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-dim) !important;
}

.select2-container--default.select2-container--open
  .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--muted) transparent !important;
}

.select2-dropdown {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow-lg) !important;
  margin-top: 4px !important;
}

.select2-search--dropdown {
  padding: 8px 8px 4px !important;
}

.select2-search--dropdown .select2-search__field {
  background: var(--bg) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 6px !important;
  color: var(--text) !important;
  padding: 7px 10px !important;
  outline: none !important;
  font-size: 13px !important;
  font-family: 'Inter', sans-serif !important;
}

.select2-container--default .select2-results > .select2-results__options {
  max-height: 220px !important;
}

.select2-container--default .select2-results__option {
  padding: 9px 14px !important;
  color: var(--text-2) !important;
  font-size: 13.5px !important;
  font-family: 'Inter', sans-serif !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--accent-dim) !important;
  color: var(--text) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
}
html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
  color: #ff8a8c !important;
}

/* ================================================
   UTILITIES
   ================================================ */

.text-accent   { color: var(--accent); }
.text-green    { color: var(--green); }
.text-red      { color: var(--red); }
.text-amber    { color: var(--amber); }
.text-muted    { color: var(--muted); }
.text-secondary{ color: var(--text-2); }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ================================================
   MOBILE
   ================================================ */

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
    width: 252px;
    transition: transform 240ms cubic-bezier(0.4,0,0.2,1);
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #sidebar:hover { width: 252px; }

  /* Show all labels on mobile (sidebar is full-width when open) */
  #sidebar .sb-logo-text,
  #sidebar .sb-lbl,
  #sidebar .sb-group-lbl,
  #sidebar .sb-user-info,
  #sidebar .sb-logout-btn { opacity: 1; }

  #sidebar .sb-group-line { opacity: 0; width: 0; min-width: 0; }

  #main-content-wrapper { margin-left: 0; }

  .mobile-menu-btn { display: flex; align-items: center; }

  #sidebar-overlay.open { display: block; }

  .page-content { padding: 20px 16px 40px; }

  .header-uname { display: none; }
  .header-btn-label { display: none; }
}

/* ================================================
   FOCUS STATES — WCAG AA / AAA
   ================================================ */

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove default outline on non-keyboard interaction */
*:focus:not(:focus-visible) { outline: none; }

/* ================================================
   STAT CARD — Hover lift + glow
   ================================================ */

.stat-card {
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-2);
}

.stat-card.si-card-blue:hover  { box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow); }
.stat-card.si-card-amber:hover { box-shadow: var(--shadow-md), 0 0 0 1px var(--amber-glow); }
.stat-card.si-card-red:hover   { box-shadow: var(--shadow-md), 0 0 0 1px var(--red-dim); }
.stat-card.si-card-green:hover { box-shadow: var(--shadow-md), 0 0 0 1px var(--green-glow); }

/* ================================================
   BUTTONS — Glow effects + transitions
   ================================================ */

.btn {
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hv);
  box-shadow: 0 0 18px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: none; }

/* ================================================
   BENTO GRID — Dashboard layout
   ================================================ */

.bento-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

/* Stat cells */
.bento-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.bento-stat:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.bento-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
}

.bento-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}

.bento-stat-meta {
  font-size: 12px;
  color: var(--muted);
}

.bento-stat-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Color modifiers */
.bento-blue  { --glow-color: var(--accent-glow); }
.bento-blue  .bento-stat-icon { background: var(--accent-dim); color: var(--accent); }
.bento-blue:hover  { box-shadow: 0 8px 32px var(--glow-color); border-color: var(--accent-glow); }

.bento-amber { --glow-color: var(--amber-glow); }
.bento-amber .bento-stat-icon { background: var(--amber-dim); color: var(--amber); }
.bento-amber:hover { box-shadow: 0 8px 32px var(--glow-color); border-color: var(--amber-glow); }
.bento-amber .bento-stat-value { color: var(--amber); }

.bento-red   { --glow-color: var(--red-dim); }
.bento-red   .bento-stat-icon { background: var(--red-dim); color: var(--red); }
.bento-red:hover   { box-shadow: 0 8px 32px var(--glow-color); border-color: var(--red-dim); }
.bento-red   .bento-stat-value { color: var(--red); }

.bento-green { --glow-color: var(--green-glow); }
.bento-green .bento-stat-icon { background: var(--green-dim); color: var(--green); }
.bento-green:hover { box-shadow: 0 8px 32px var(--glow-color); border-color: var(--green-glow); }
.bento-green .bento-stat-value { color: var(--green); }

/* Grid span helpers */
.col-span-4  { grid-column: span 4; }
.col-span-6  { grid-column: span 6; }
.col-span-8  { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }

/* Repair list card inside bento */
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bento-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bento-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bento-card-body {
  flex: 1;
  overflow-y: auto;
}

/* ================================================
   BULK ACTIONS — floating bar
   ================================================ */

.bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  z-index: 300;
  white-space: nowrap;
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.4,0,0.2,1), opacity 220ms ease;
  pointer-events: none;
}

.bulk-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bulk-bar-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  padding-right: 8px;
  border-right: 1px solid var(--border-2);
  margin-right: 4px;
}

.bulk-bar-count span {
  color: var(--accent);
}

/* Row selection highlight */
.tbl tbody tr.row-selected td {
  background: var(--accent-dim) !important;
}

/* Checkbox column */
.tbl .col-check {
  width: 44px;
  padding-left: 16px;
  padding-right: 8px;
}

/* Custom styled checkbox */
.row-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  position: relative;
  vertical-align: middle;
}
.row-checkbox:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.row-checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.row-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.row-checkbox:checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ================================================
   CUSTOM SCROLLBAR
   ================================================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ================================================
   CURSOR — interactive elements
   ================================================ */

.tbl tbody tr { cursor: default; }
.btn, a, label[for], .sb-link,
.form-checkbox-row, .service-row-head,
.ri-link { cursor: pointer; }

/* ================================================
   GRID RESPONSIVE — Bento
   ================================================ */

@media (max-width: 1023px) {
  .col-span-4, .col-span-6, .col-span-8 { grid-column: span 12; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .col-span-4 { grid-column: span 6; }
}

/* ================================================
   DASHBOARD — KPI Cards
   ================================================ */

.db-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.db-kpi {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.db-kpi:hover { transform: translateY(-3px); }

.db-kpi-inner {
  padding: 20px 22px 22px;
  position: relative;
  z-index: 1;
}

.db-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 14px;
}

.db-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}

.db-kpi-value {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.db-kpi-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Glow layer */
.db-kpi-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.db-kpi:hover .db-kpi-glow { opacity: 1; }

/* Color variants */
.db-kpi-blue  { --kpi-color: var(--accent); }
.db-kpi-blue  .db-kpi-icon  { background: var(--accent-dim); color: var(--accent); }
.db-kpi-blue  .db-kpi-value { color: var(--accent); }
.db-kpi-blue:hover  { border-color: var(--accent-glow); box-shadow: 0 8px 32px var(--accent-glow); }
.db-kpi-blue  .db-kpi-glow  { background: radial-gradient(ellipse at bottom right, var(--accent-dim), transparent 70%); }

.db-kpi-green { --kpi-color: var(--green); }
.db-kpi-green .db-kpi-icon  { background: var(--green-dim); color: var(--green); }
.db-kpi-green .db-kpi-value { color: var(--green); }
.db-kpi-green:hover { border-color: rgba(34,197,94,0.30); box-shadow: 0 8px 32px rgba(34,197,94,0.14); }
.db-kpi-green .db-kpi-glow  { background: radial-gradient(ellipse at bottom right, rgba(34,197,94,0.08), transparent 70%); }

.db-kpi-amber { --kpi-color: var(--amber); }
.db-kpi-amber .db-kpi-icon  { background: var(--amber-dim); color: var(--amber); }
.db-kpi-amber .db-kpi-value { color: var(--amber); }
.db-kpi-amber:hover { border-color: rgba(245,158,11,0.30); box-shadow: 0 8px 32px rgba(245,158,11,0.14); }
.db-kpi-amber .db-kpi-glow  { background: radial-gradient(ellipse at bottom right, rgba(245,158,11,0.08), transparent 70%); }

.db-kpi-red   { --kpi-color: var(--red); }
.db-kpi-red   .db-kpi-icon  { background: var(--red-dim); color: var(--red); }
.db-kpi-red   .db-kpi-value { color: var(--red); }
.db-kpi-red:hover   { border-color: rgba(239,68,68,0.30); box-shadow: 0 8px 32px rgba(239,68,68,0.14); }
.db-kpi-red   .db-kpi-glow  { background: radial-gradient(ellipse at bottom right, rgba(239,68,68,0.08), transparent 70%); }

.db-kpi-neutral .db-kpi-icon  { background: var(--slate-dim); color: var(--text-2); }
.db-kpi-neutral .db-kpi-value { color: var(--text); }
.db-kpi-neutral:hover { border-color: var(--border-2); }

/* Trend badge */
.db-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
}
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }

/* ================================================
   DASHBOARD — Main grid
   ================================================ */

.db-main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}

/* ================================================
   DASHBOARD — Panel (generic card)
   ================================================ */

.db-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.db-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.db-panel-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.db-panel-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ================================================
   DASHBOARD — Activity list
   ================================================ */

.db-activity-list { display: flex; flex-direction: column; }

.db-activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.db-activity-row:last-child { border-bottom: none; }
.db-activity-row:hover { background: var(--surface-2); }

.db-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.db-activity-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.db-activity-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.db-activity-client {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.db-activity-car {
  font-size: 12.5px;
  color: var(--text-2);
}

.db-activity-plate {
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

.db-activity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.db-activity-date {
  font-size: 11.5px;
  color: var(--muted);
}

.db-activity-amount {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.db-activity-action {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.db-activity-row:hover .db-activity-action {
  opacity: 1;
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text-2);
}

.db-activity-action:hover { color: var(--text) !important; }

/* ================================================
   DASHBOARD — Status breakdown bars
   ================================================ */

.db-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.db-status-row:last-child { margin-bottom: 0; }

.db-status-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  width: 80px;
  flex-shrink: 0;
}

.db-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-status-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.db-status-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--bar-color, var(--accent));
  width: 0;
  transition: width 700ms cubic-bezier(0.4, 0, 0.2, 1);
}

.db-status-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ================================================
   DASHBOARD — Alert banners
   ================================================ */

.db-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.db-alert-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.db-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.db-alert-sub {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.db-alert > div:nth-child(2) { flex: 1; }

.db-alert-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.db-alert-amber {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.18);
}
.db-alert-amber .db-alert-icon { background: var(--amber-dim); color: var(--amber); }
.db-alert-amber .db-alert-btn  {
  background: rgba(245,158,11,0.10);
  border-color: rgba(245,158,11,0.25);
  color: var(--amber);
}
.db-alert-amber .db-alert-btn:hover { background: rgba(245,158,11,0.18); }

.db-alert-green {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.18);
}
.db-alert-green .db-alert-icon { background: var(--green-dim); color: var(--green); }
.db-alert-green .db-alert-btn  {
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.25);
  color: var(--green);
}
.db-alert-green .db-alert-btn:hover { background: rgba(34,197,94,0.18); }

/* ================================================
   DASHBOARD — Responsive
   ================================================ */

@media (max-width: 1200px) {
  .db-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1023px) {
  .db-main-grid > * { grid-column: span 12 !important; }
}

@media (max-width: 640px) {
  .db-kpi-grid { grid-template-columns: 1fr 1fr; }
  .db-kpi-value { font-size: 26px; }
  .db-activity-main { flex-direction: column; align-items: flex-start; gap: 3px; }
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Header
   ================================================ */

.mmd-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.mmd-header-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.mmd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.mmd-dot-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.mmd-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.mmd-header-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — KPI Strip
   ================================================ */

.mmd-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.mmd-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}

.mmd-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--kpi-accent, var(--border-2));
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-2);
}

.mmd-kpi-accent-bar {
  width: 4px;
  background: var(--kpi-accent, var(--accent));
  flex-shrink: 0;
  border-radius: 0;
  opacity: 0.85;
}

.mmd-kpi-icon {
  width: 42px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin: 16px 0 16px 14px;
  border-radius: 9px;
  flex-shrink: 0;
  height: 42px;
  align-self: center;
}

.mmd-kpi-body {
  flex: 1;
  padding: 16px 18px 16px 12px;
  min-width: 0;
}

.mmd-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 5px;
  white-space: nowrap;
}

.mmd-kpi-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 5px;
}

.mmd-kpi-unit {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 2px;
  color: var(--text-2);
}

.mmd-kpi-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Main layout
   ================================================ */

.mmd-main-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 0;
}

.mmd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Pipeline
   ================================================ */

.mmd-pipeline-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.mmd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.mmd-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.mmd-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  min-height: 300px;
}

.mmd-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.mmd-col:last-child { border-right: none; }

.mmd-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mmd-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.mmd-col-count {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(var(--col-color-rgb, 255,255,255), 0.1);
  border: 1px solid var(--col-color, var(--border-2));
  color: var(--col-color, var(--text-2));
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.mmd-col-body {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 420px;
}

.mmd-col-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 12.5px;
}

/* Work order card */
.mmd-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  cursor: default;
}

.mmd-card:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.mmd-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.mmd-card-avatar {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.mmd-card-info { min-width: 0; flex: 1; }

.mmd-card-client {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mmd-card-car {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mmd-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mmd-card-plate {
  font-size: 11px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}

.mmd-card-price {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.mmd-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.mmd-card-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.mmd-card-btn:hover { background: var(--accent-glow); }

/* ================================================
   MODERN MECHANIC DASHBOARD — Panels
   ================================================ */

.mmd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.mmd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.mmd-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Sparkline
   ================================================ */

.mmd-sparkline-wrap {
  position: relative;
}

.mmd-sparkline-svg {
  width: 100%;
  height: 60px;
  display: block;
}

.mmd-sparkline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.mmd-sparkline-labels span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Distribution bars
   ================================================ */

.mmd-dist-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.mmd-dist-row:last-child { margin-bottom: 0; }

.mmd-dist-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mmd-dist-label {
  font-size: 12px;
  color: var(--text-2);
  width: 72px;
  flex-shrink: 0;
}

.mmd-dist-track {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}

.mmd-dist-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 700ms cubic-bezier(0.4,0,0.2,1);
}

.mmd-dist-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Alert
   ================================================ */

.mmd-alert {
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 14px;
  padding: 16px;
}

/* ================================================
   MODERN MECHANIC DASHBOARD — Activity
   ================================================ */

.mmd-activity { display: flex; flex-direction: column; }

.mmd-act-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  position: relative;
}
.mmd-act-row:last-child { border-bottom: none; }
.mmd-act-row:hover { background: var(--surface-2); }

.mmd-act-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.mmd-act-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.mmd-act-body { flex: 1; min-width: 0; }

.mmd-act-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.mmd-act-client {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mmd-act-car {
  font-size: 12px;
  color: var(--text-2);
}

.mmd-act-plate {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
}

.mmd-act-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mmd-act-date {
  font-size: 11.5px;
  color: var(--muted);
}

.mmd-act-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.mmd-act-edit {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}

.mmd-act-row:hover .mmd-act-edit {
  opacity: 1;
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text-2);
}

.mmd-act-edit:hover { color: var(--accent) !important; }

/* ================================================
   MODERN MECHANIC DASHBOARD — Responsive
   ================================================ */

@media (max-width: 1280px) {
  .mmd-main-row { grid-template-columns: 1fr 260px; }
  .mmd-pipeline { grid-template-columns: repeat(2, 1fr); }
  .mmd-col:nth-child(2) { border-right: none; }
  .mmd-col:nth-child(1),
  .mmd-col:nth-child(2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 1023px) {
  .mmd-main-row { grid-template-columns: 1fr; }
  .mmd-pipeline { grid-template-columns: repeat(2, 1fr); }
  .mmd-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .mmd-kpi-strip { grid-template-columns: 1fr 1fr; }
  .mmd-pipeline  { grid-template-columns: 1fr 1fr; }
  .mmd-kpi-value { font-size: 24px; }
  .mmd-header    { flex-direction: column; align-items: flex-start; }
}

/* ================================================
   DRAG & DROP — Pipeline
   ================================================ */

/* Card is being dragged */
.mmd-card-dragging {
  opacity: 0.5;
  box-shadow: var(--shadow-lg);
  transform: scale(1.03) rotate(1deg);
  border-color: var(--accent) !important;
  cursor: grabbing !important;
}

/* Placeholder ghost */
.mmd-card-ghost {
  opacity: 0.25;
  border: 2px dashed var(--accent);
  background: var(--accent-dim) !important;
  border-radius: 9px;
}

/* Card chosen (just clicked) */
.mmd-card-chosen {
  cursor: grab;
  border-color: var(--border-2);
}

/* Column highlighted as drop zone */
.mmd-col-drop-target {
  background: var(--accent-dim);
}

/* Cursor on draggable cards */
.mmd-card { cursor: grab; }
.mmd-card:active { cursor: grabbing; }

/* ================================================
   TOAST — Status update notification
   ================================================ */

.mmd-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  pointer-events: none;
}

.mmd-toast::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 9px;
  vertical-align: middle;
  flex-shrink: 0;
}

.mmd-toast-error::before { background: var(--red); }

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

/* ================================================
   REPAIR FORM  (rf-*)
   Centered create/edit form — MMD style
   ================================================ */

/* ── Wrapper ────────────────────────────────────── */
.rf-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 48px;
}

/* ── Page header ────────────────────────────────── */
.rf-page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.rf-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}
.rf-back:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.rf-page-title-group { flex: 1; }

.rf-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.rf-page-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

.rf-required { color: var(--red); margin-left: 2px; }

/* ── 2-column grid ──────────────────────────────── */
.rf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Panel card ─────────────────────────────────── */
.rf-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.rf-grid-2 .rf-panel { margin-bottom: 0; }

.rf-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.rf-panel-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.rf-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.rf-panel-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.rf-panel-body {
  padding: 20px;
}

/* ── Status pills ───────────────────────────────── */
.rf-status-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rf-status-radio { display: none; }

.rf-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.rf-status-pill:hover {
  border-color: var(--pill-color, var(--accent));
  color: var(--pill-color, var(--accent));
  background: var(--pill-bg, var(--accent-dim));
}
.rf-status-pill.checked {
  border-color: var(--pill-color, var(--accent));
  color: var(--pill-color, var(--accent));
  background: var(--pill-bg, var(--accent-dim));
}

/* ── Services grid ──────────────────────────────── */
.rf-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.rf-svc-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 20px;
}

.rf-svc-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}
.rf-svc-card.rf-svc-active {
  border-color: var(--accent);
  background: var(--surface-3);
}

.rf-svc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.rf-svc-check { position: relative; flex-shrink: 0; }
.rf-svc-check input[type="checkbox"] { display: none; }

.rf-svc-checkmark {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: all var(--transition);
}
.rf-svc-active .rf-svc-checkmark {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.rf-svc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

/* ── Service cost rows (collapsible) ────────────── */
.rf-svc-costs {
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease, padding var(--transition);
  border-top: 0 solid var(--border);
}
.rf-svc-costs.open {
  max-height: 160px;
  border-top-width: 1px;
}

.rf-costs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px 6px;
}

.rf-svc-subtotal {
  padding: 6px 14px 12px;
  font-size: 12px;
  color: var(--text-2);
}
.rf-svc-subtotal-val {
  font-weight: 600;
  color: var(--accent);
}

/* ── Payment toggle ─────────────────────────────── */
.rf-paid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 4px;
}
.rf-paid-cb { display: none; }

.rf-paid-track {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1.5px solid var(--border-2);
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.rf-paid-cb:checked ~ .rf-paid-track {
  background: var(--green);
  border-color: var(--green);
}

.rf-paid-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: left var(--transition), background var(--transition);
}
.rf-paid-cb:checked ~ .rf-paid-track .rf-paid-thumb {
  left: 19px;
  background: #fff;
}

.rf-paid-lbl {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ── Total panel ────────────────────────────────── */
.rf-total-panel { }

.rf-total-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rf-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rf-total-lbl {
  font-size: 13px;
  color: var(--text-2);
}

.rf-total-val {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.rf-total-main .rf-total-lbl {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.rf-total-main .rf-total-val {
  font-size: 18px;
}

.rf-total-blue  { color: var(--accent); }
.rf-total-green { color: var(--green); }
.rf-total-red   { color: var(--red); }

.rf-total-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* ── Form actions bar ───────────────────────────── */
.rf-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
}

.rf-submit {
  min-width: 160px;
  justify-content: center;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 680px) {
  .rf-grid-2 { grid-template-columns: 1fr; }
  .rf-services-grid { grid-template-columns: 1fr; }
  .rf-costs-grid { grid-template-columns: 1fr 1fr; }
  .rf-status-group { gap: 6px; }
  .rf-status-pill { padding: 7px 11px; font-size: 12px; }
  .rf-actions { flex-direction: column-reverse; }
  .rf-actions .btn { width: 100%; justify-content: center; }
}

/* ── Quick-create client modal ──────────────────────── */
.qc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.qc-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.qc-modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 200ms;
  overflow: hidden;
}
.qc-backdrop.open .qc-modal {
  transform: translateY(0) scale(1);
}

.qc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.qc-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.qc-modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.qc-modal-close:hover { background: var(--surface-2); color: var(--text); }

.qc-modal-body { padding: 20px 22px; }

.qc-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 10px;
}
.qc-section-label:first-child { margin-top: 0; }

.qc-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0 14px;
}

.qc-modal-foot {
  padding: 14px 22px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.qc-error {
  font-size: 12px;
  color: var(--red);
  background: var(--red-dim);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 12px;
  display: none;
}

/* deadline badge on pipeline cards */
.mmd-card-deadline {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.mmd-card-deadline.ok      { color: var(--green); background: var(--green-dim); }
.mmd-card-deadline.warning { color: var(--amber); background: var(--amber-dim); }
.mmd-card-deadline.overdue { color: var(--red);   background: var(--red-dim); }

/* ================================================
   REPAIRS INDEX  (ri-*)
   ================================================ */

/* ── Filter bar ─────────────────────────────────── */
.ri-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ri-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.ri-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.ri-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.ri-search-input::placeholder { color: var(--muted); }
.ri-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Status filter pills ────────────────────────── */
.ri-status-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ri-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.ri-filter-pill:hover {
  border-color: var(--fp-color, var(--accent));
  color: var(--fp-color, var(--accent));
  background: var(--fp-bg, var(--accent-dim));
}
.ri-filter-pill.active {
  border-color: var(--fp-color, var(--accent));
  color: var(--fp-color, var(--accent));
  background: var(--fp-bg, var(--accent-dim));
}
.ri-filter-pill[data-status=""].active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Row avatar ─────────────────────────────────── */
.ri-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Client link ────────────────────────────────── */
.ri-client-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}
.ri-client-link:hover { color: var(--accent-hv); }

/* ================================================
   REPORTS  (rp-*)
   ================================================ */

.rp-filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.rp-filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.rp-quick-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.rp-date-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ================================================
   BRAND OVERRIDES — Red used sparingly
   Primary CTA button + active sidebar nav only
   ================================================ */

/* Primary button — brand red */
.btn-primary              { background: var(--brand); color: #fff; }
.btn-primary:hover        { background: var(--brand-hv); color: #fff;
                            box-shadow: 0 0 18px var(--brand-glow); transform: translateY(-1px); }
.btn-primary:active       { transform: translateY(0); box-shadow: none; }

/* Active sidebar nav — brand red */
.sb-link.active           { color: var(--brand); }
.sb-link.active .sb-icon-wrap { background: var(--brand-dim); color: var(--brand); }

/* Dashboard eyebrow label */
.mmd-header-eyebrow       { color: var(--brand); }

/* Drag ghost — neutral dashed outline */
.mmd-card-dragging        { border-color: var(--accent) !important; }
.mmd-card-ghost           { border: 2px dashed var(--accent);
                            background: var(--accent-dim) !important; }

/* In-progress status — violet (distinct from brand AND system error red) */
.s-inprogress             { background: rgba(139,92,246,0.10); color: #6d28d9; }
.s-inprogress::before     { background: #8b5cf6; }
html[data-theme="dark"] .s-inprogress { color: #c4b5fd; }

/* ================================================
   HEADER STATUS PILLS  (hdr-*)
   ================================================ */

.hdr-status-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hdr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 150ms, border-color 150ms, transform 150ms;
  cursor: pointer;
  white-space: nowrap;
}
.hdr-pill i { font-size: 11px; flex-shrink: 0; }

.hdr-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}

/* Received — slate */
.hdr-pill-received {
  color: #475569;
  background: rgba(100,116,139,0.08);
  border-color: rgba(100,116,139,0.20);
}
.hdr-pill-received:hover {
  background: rgba(100,116,139,0.15);
  border-color: rgba(100,116,139,0.35);
  transform: translateY(-1px);
}
.hdr-pill-received .hdr-pill-count {
  background: rgba(100,116,139,0.20);
  color: #475569;
}

/* In-progress — violet */
.hdr-pill-inprogress {
  color: #6d28d9;
  background: rgba(139,92,246,0.08);
  border-color: rgba(139,92,246,0.20);
}
.hdr-pill-inprogress:hover {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.35);
  transform: translateY(-1px);
}
.hdr-pill-inprogress .hdr-pill-count {
  background: rgba(139,92,246,0.20);
  color: #6d28d9;
}

/* Ready — green */
.hdr-pill-ready {
  color: var(--green);
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.20);
}
.hdr-pill-ready:hover {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.35);
  transform: translateY(-1px);
}
.hdr-pill-ready .hdr-pill-count {
  background: rgba(34,197,94,0.20);
  color: var(--green);
}

/* Delayed — amber */
.hdr-pill-delayed {
  color: var(--amber);
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.20);
}
.hdr-pill-delayed:hover {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.35);
  transform: translateY(-1px);
}
.hdr-pill-delayed .hdr-pill-count {
  background: rgba(245,158,11,0.20);
  color: var(--amber);
}

/* Dark mode — brighter pill text on translucent fills */
html[data-theme="dark"] .hdr-pill-received,
html[data-theme="dark"] .hdr-pill-received .hdr-pill-count   { color: #94a3b8; }
html[data-theme="dark"] .hdr-pill-inprogress,
html[data-theme="dark"] .hdr-pill-inprogress .hdr-pill-count { color: #c4b5fd; }
html[data-theme="dark"] .hdr-pill-ready,
html[data-theme="dark"] .hdr-pill-ready .hdr-pill-count      { color: #86efac; }
html[data-theme="dark"] .hdr-pill-delayed,
html[data-theme="dark"] .hdr-pill-delayed .hdr-pill-count    { color: #fcd34d; }

/* Alert state when delayed > 0 */
.hdr-pill-alert {
  animation: hdr-pill-pulse 2.5s ease infinite;
}
@keyframes hdr-pill-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(245,158,11,0.20); }
}

/* Compact "+" new-repair icon button in header */
.hdr-new-repair {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-dim);
  color: var(--brand);
  border: 1px solid var(--brand-glow);
  font-size: 13px;
  text-decoration: none;
  transition: background 150ms, box-shadow 150ms, transform 150ms;
  flex-shrink: 0;
}
.hdr-new-repair:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 14px var(--brand-glow);
  transform: scale(1.08);
}

/* User info column — name + role */
.header-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.header-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* Hide pill labels on small screens */
@media (max-width: 1100px) {
  .hdr-pill-label { display: none; }
  .hdr-pill { padding: 5px 9px; gap: 4px; }
}
@media (max-width: 760px) {
  .hdr-status-nav { display: none; }
}
@media (max-width: 640px) {
  .header-user-info { display: none; }
}

/* ================================================
   REPAIR SHOW / PROFILE PAGE  (rp-hero, rp-show-*)
   ================================================ */

.rp-hero {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  flex-wrap: wrap;
}

.rp-hero-car {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  flex: 1;
  min-width: 220px;
}

.rp-hero-car-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-hero-car-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.rp-hero-plate {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 3px 10px;
  letter-spacing: 0.08em;
}

.rp-hero-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
}

.rp-hero-client {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  flex: 1;
  min-width: 200px;
}

.rp-hero-client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(167,139,250,0.10);
  border: 1.5px solid rgba(167,139,250,0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #6d28d9;
  flex-shrink: 0;
}
html[data-theme="dark"] .rp-hero-client-avatar { color: #a78bfa; }

.rp-hero-dates {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 24px 28px;
  flex-shrink: 0;
}

.rp-hero-date-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.rp-hero-date-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Two-column grid for show page body */
.rp-show-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .rp-show-grid { grid-template-columns: 1fr; }
  .rp-hero { flex-direction: column; }
  .rp-hero-divider { width: 100%; height: 1px; }
}

/* Eye / view button on pipeline cards */
.mmd-card-btn-eye {
  background: var(--surface-3);
  color: var(--accent);
  border-color: var(--border-2);
  padding: 4px 8px;
}
.mmd-card-btn-eye:hover {
  background: var(--accent-dim);
  color: var(--accent-hv);
}

/* ── Admin Page Loader ────────────────────────────────── */
body.adm-loading { overflow: hidden; }

#adm-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
#adm-loader.ld-out {
  opacity: 0; transform: translateY(-100%); pointer-events: none;
}

/* Speed lines */
.adm-ldsp {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.adm-ldsp i {
  position: absolute; right: 0; display: block;
  border-radius: 0; opacity: 0;
  background: linear-gradient(90deg, transparent 0%, var(--brand-glow) 50%, transparent 100%);
  animation: admLine linear infinite;
}
.adm-ldsp i:nth-child(1) { top:39%; width:38vw; height:1px;   animation-duration:1.4s; animation-delay:0s; }
.adm-ldsp i:nth-child(2) { top:44%; width:22vw; height:2px;   animation-duration:1.7s; animation-delay:0.22s; background:linear-gradient(90deg,transparent,var(--brand-glow),transparent); }
.adm-ldsp i:nth-child(3) { top:49%; width:55vw; height:1.5px; animation-duration:1.2s; animation-delay:0.08s; background:linear-gradient(90deg,transparent,var(--brand-glow),transparent); }
.adm-ldsp i:nth-child(4) { top:54%; width:28vw; height:1px;   animation-duration:1.6s; animation-delay:0.38s; }
.adm-ldsp i:nth-child(5) { top:59%; width:44vw; height:2px;   animation-duration:1.9s; animation-delay:0.55s; }
.adm-ldsp i:nth-child(6) { top:34%; width:18vw; height:1px;   animation-duration:1.5s; animation-delay:0.7s; }
@keyframes admLine {
  0%   { transform: translateX(0);      opacity: 0; }
  8%   { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateX(-130vw); opacity: 0; }
}

/* Center block */
.adm-ld-center {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1.6rem;
}
.adm-ld-logo {
  height: 52px; width: auto;
  animation: admLogoPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
  filter: drop-shadow(0 0 20px var(--brand-glow));
}
@keyframes admLogoPop {
  from { opacity: 0; transform: scale(0.78) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.adm-ld-bar-track {
  width: 180px; height: 2px;
  background: var(--border);
  position: relative;
  animation: admBarFadeIn 0.3s 0.6s both;
}
@keyframes admBarFadeIn { from { opacity:0; } to { opacity:1; } }
.adm-ld-bar {
  height: 100%; width: 0;
  background: var(--brand);
  animation: admBarFill 1.65s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
  position: relative;
}
.adm-ld-bar::after {
  content: '';
  position: absolute; right: -1px; top: -3px; bottom: -3px;
  width: 5px; background: var(--brand); border-radius: 3px;
  box-shadow: 0 0 10px var(--brand), 0 0 20px var(--brand-glow);
}
@keyframes admBarFill {
  0%   { width: 0%; }
  55%  { width: 68%; }
  80%  { width: 88%; }
  100% { width: 100%; }
}
