/* ============================================================
   Workshop Invoice System — Main Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --sidebar-w:   240px;
  --primary:     #2563eb;
  --primary-d:   #1d4ed8;
  --primary-lt:  #eff6ff;
  --primary-mid: #bfdbfe;
  --success:     #16a34a;
  --success-lt:  #f0fdf4;
  --warning:     #d97706;
  --warning-lt:  #fffbeb;
  --danger:      #dc2626;
  --danger-lt:   #fef2f2;
  --purple:      #7c3aed;
  --purple-lt:   #f5f3ff;
  --dark:        #0f172a;
  --dark-2:      #1e293b;
  --body-bg:     #f1f5f9;
  --card-bg:     #ffffff;
  --border:      #e2e8f0;
  --border-lt:   #f1f5f9;
  --text:        #1e293b;
  --muted:       #64748b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:   0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg:   0 12px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
}

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell ──────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid rgba(255,255,255,.04);
}

.sidebar-header {
  padding: 1.35rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  display: flex; align-items: center; gap: .65rem;
  color: #f8fafc; font-weight: 700; font-size: .95rem; letter-spacing: -.01em;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.sidebar-logo-icon svg { width: 18px; height: 18px; color: #fff; }
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-name { font-size: .9rem; font-weight: 700; color: #f1f5f9; }
.sidebar-logo-sub  { font-size: .67rem; color: #64748b; font-weight: 500; }

.sidebar-nav { flex: 1; padding: .65rem .75rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-section-label {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: #475569; padding: .9rem .75rem .35rem;
}

.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem .85rem;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-size: .845rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: rgba(59,130,246,.18); color: #93c5fd; font-weight: 600; }
.nav-item.active svg { opacity: 1; color: #60a5fa; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: .65rem;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
  color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-details { flex: 1; overflow: hidden; }
.user-name { font-size: .8rem; font-weight: 600; color: #e2e8f0;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .68rem; color: #64748b; text-transform: capitalize; }
.logout-btn { color: #475569; display: flex; align-items: center; padding: .3rem;
              border-radius: 6px; transition: color .15s, background .15s; }
.logout-btn svg { width: 17px; height: 17px; }
.logout-btn:hover { color: #f87171; background: rgba(248,113,113,.1); }

/* ── Main Content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.page-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.page-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -.02em;
}
.page-header-sub { margin: .1rem 0 0; font-size: .75rem; color: var(--muted); font-weight: 400; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: .25rem; color: var(--dark); }
.hamburger svg { width: 22px; height: 22px; }

.page-body { padding: 1.5rem; flex: 1; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .85rem;
  display: flex; align-items: center; gap: .5rem;
  color: var(--dark);
  background: #fafbfc;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 1.25rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .52rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .855rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s, opacity .15s;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -.01em;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn-sm  { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: .95rem; }
.btn-full { width: 100%; }

.btn-primary  { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.btn-primary:hover  { background: var(--primary-d); box-shadow: 0 3px 8px rgba(37,99,235,.35); }
.btn-success  { background: var(--success); color: #fff; box-shadow: 0 1px 3px rgba(22,163,74,.25); }
.btn-success:hover  { background: #15803d; }
.btn-danger   { background: var(--danger); color: #fff; box-shadow: 0 1px 3px rgba(220,38,38,.25); }
.btn-danger:hover   { background: #b91c1c; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-lt); }
.btn-ghost    { background: #f1f5f9; color: var(--text); }
.btn-ghost:hover    { background: #e2e8f0; }
.btn-icon     { padding: .4rem; border-radius: 6px; background: transparent; color: var(--muted); }
.btn-icon:hover { background: #f1f5f9; color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-lt); color: var(--danger); }

/* ── Forms ──────────────────────────────────────────────── */
.form-group       { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .8rem; font-weight: 600;
  color: var(--dark); margin-bottom: .35rem; letter-spacing: -.005em;
}
.form-row { display: flex; gap: .75rem; }
.form-row .form-group { flex: 1; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"],
select, textarea {
  width: 100%;
  padding: .5rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: .6rem;
}
.alert-danger  { background: var(--danger-lt);  border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: var(--success-lt); border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: var(--warning-lt); border: 1px solid #fed7aa; color: #92400e; }
.alert-info    { background: var(--primary-lt); border: 1px solid var(--primary-mid); color: #1e40af; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left; padding: .65rem 1rem;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--border);
  font-size: .73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
}
td { padding: .78rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .18rem .6rem;
  border-radius: 20px; font-size: .72rem; font-weight: 700;
  letter-spacing: .01em;
}
.badge-primary { background: var(--primary-lt); color: var(--primary); }
.badge-success { background: var(--success-lt); color: var(--success); }
.badge-warning { background: var(--warning-lt); color: var(--warning); }
.badge-danger  { background: var(--danger-lt);  color: var(--danger); }

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,16,38,.55);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.98);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal { transform: none; }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 980px; }
.modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--card-bg); z-index: 1;
  border-radius: 16px 16px 0 0;
}
.modal-header h2 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 1.3rem; line-height: 1; padding: .2rem .45rem; border-radius: 6px;
  transition: background .15s, color .15s;
}
.modal-close:hover { color: var(--danger); background: var(--danger-lt); }
.modal-body   { padding: 1.4rem; }
.modal-footer {
  padding: 1rem 1.4rem; border-top: 1px solid var(--border);
  display: flex; gap: .75rem; justify-content: flex-end;
  border-radius: 0 0 16px 16px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: .65rem 1.15rem;
  font-size: .855rem; font-weight: 600;
  border: none; background: none; cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search ──────────────────────────────────────────────── */
.search-bar { display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 180px; }

/* ── Dashboard ───────────────────────────────────────────── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.35rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.2rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-blue::after   { background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%); }
.stat-green::after  { background: linear-gradient(90deg, var(--success) 0%, #34d399 100%); }
.stat-purple::after { background: linear-gradient(90deg, var(--purple) 0%, #a78bfa 100%); }
.stat-orange::after { background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%); }

.stat-icon-wrap {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; flex-shrink: 0;
}
.stat-icon-wrap svg { width: 20px; height: 20px; }
.stat-icon-wrap.stat-blue   { background: var(--primary-lt); color: var(--primary); }
.stat-icon-wrap.stat-green  { background: var(--success-lt); color: var(--success); }
.stat-icon-wrap.stat-purple { background: var(--purple-lt);  color: var(--purple); }
.stat-icon-wrap.stat-orange { background: var(--warning-lt); color: var(--warning); }

.stat-value {
  font-size: 1.75rem; font-weight: 800;
  color: var(--dark); letter-spacing: -.04em;
  line-height: 1; margin-bottom: .3rem;
}
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; margin-bottom: .7rem; }
.stat-meta  { font-size: .75rem; color: var(--muted); line-height: 1.5; }

.stat-change { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; }
.stat-change.up      { color: var(--success); }
.stat-change.down    { color: var(--danger); }
.stat-change.neutral { color: var(--muted); }

.stat-loading .stat-value  { color: transparent; }
.stat-loading .stat-meta   { color: transparent; }
.skeleton-line {
  display: inline-block; height: .85em;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.quick-actions-bar {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: 1.35rem;
  padding: .9rem 1.15rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quick-actions-label {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; margin-right: .35rem;
}

.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.1rem;
  align-items: start;
}
.dash-recent-card { min-width: 0; }
.dash-sidebar-col { display: flex; flex-direction: column; }

.summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border-lt);
  font-size: .855rem;
}
.summary-label { color: var(--muted); font-weight: 500; }
.summary-val   { font-weight: 700; color: var(--dark); }

.ts-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border-lt);
}
.ts-row:last-child { border-bottom: none; }
.ts-rank {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--body-bg); display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; color: var(--muted); flex-shrink: 0;
}
.ts-name { font-size: .82rem; font-weight: 600; color: var(--dark); margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-bar-wrap { height: 4px; background: var(--body-bg); border-radius: 2px; }
.ts-bar { height: 4px; background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%); border-radius: 2px; transition: width .6s ease; }
.ts-count { font-size: .78rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }

@media (max-width: 1100px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .dash-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-stats-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   POS PAGE — LAYOUT & COMPONENTS
   ══════════════════════════════════════════════════════════ */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) { .pos-layout { grid-template-columns: 1fr; } }

/* POS customer search bar */
.pos-search-bar {
  display: flex; align-items: center; gap: .5rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .25rem .25rem .25rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.pos-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.pos-search-icon { color: var(--muted); display: flex; align-items: center; flex-shrink: 0; }
.pos-search-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: .88rem; font-family: inherit; color: var(--text);
  padding: .35rem 0;
}
.pos-search-input::placeholder { color: var(--muted); }

/* Customer search results */
.customer-section { margin-bottom: 1rem; }

.cust-result-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.cust-result-item:hover { border-color: var(--primary); background: var(--primary-lt); }
.cust-result-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cust-result-info { flex: 1; min-width: 0; }
.cust-result-name  { font-weight: 700; font-size: .875rem; color: var(--text); }
.cust-result-phone { font-size: .78rem; color: var(--muted); }

.customer-found-bar {
  display: flex; align-items: center; gap: .75rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: .75rem 1rem;
}
.cf-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.customer-found-bar .cf-info { flex: 1; min-width: 0; }
.customer-found-bar .cf-name  { font-weight: 700; font-size: .92rem; color: var(--dark); }
.customer-found-bar .cf-phone { font-size: .77rem; color: var(--muted); margin-top: 1px; }

/* Vehicle chips */
.vehicles-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.vehicle-chip {
  display: flex; align-items: center; gap: .4rem;
  padding: .38rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 20px; background: #fff;
  cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--text);
  transition: all .15s; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.vehicle-chip:hover { border-color: var(--primary); background: var(--primary-lt); color: var(--primary); }
.vehicle-chip.selected {
  border-color: var(--primary); background: var(--primary);
  color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.vehicle-chip.add-chip { border-style: dashed; border-color: #cbd5e1; color: var(--muted); background: #fafbfc; }
.vehicle-chip.add-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.vehicle-chip svg { width: 13px; height: 13px; }

/* Odometer */
.odo-section {
  margin-top: .8rem; padding: .8rem 1rem;
  background: #f8fafc; border: 1.5px solid var(--border); border-radius: 10px;
}
.odo-section-label {
  font-size: .65rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .45rem;
  display: flex; align-items: center; gap: .3rem;
}
.odo-current-row { display: flex; align-items: center; gap: .5rem; }
.odo-current-row input { flex: 1; font-size: .95rem; font-weight: 700; text-align: right; padding: .4rem .7rem; }
.odo-unit { font-size: .8rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }

/* Cart */
.cart-section { margin-top: 1rem; }
.cart-empty-actions { display: flex; gap: .75rem; padding: 1.5rem 0; justify-content: center; }

.cart-block {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  margin-bottom: .85rem; overflow: hidden;
}
.cart-block-header {
  background: #f8fafc; padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  display: flex; align-items: center; gap: .5rem; justify-content: space-between;
}
.cart-block-body { padding: .65rem .85rem; }

.service-row, .repair-row {
  display: grid; gap: .45rem;
  align-items: center; padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.service-row { grid-template-columns: 2fr 1.1fr .9fr 1fr auto; }
.repair-row  { grid-template-columns: 2fr 1fr auto; }
.service-row:last-child, .repair-row:last-child { border-bottom: none; }

.cart-add-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem;
  font-size: .79rem; font-weight: 600;
  background: none; border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--muted);
  margin-top: .55rem; width: 100%; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
  font-family: inherit;
}
.cart-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

/* Totals sidebar */
.totals-card { position: sticky; top: 5rem; }
.totals-card > .card-header {
  background: var(--dark); color: #e2e8f0;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; border-bottom: none;
}
.totals-card .card-body { padding: 1rem; }

.total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .42rem 0; font-size: .875rem; color: var(--text);
}
.total-row .total-label { color: var(--muted); font-size: .82rem; }
.total-row.grand {
  font-size: 1.1rem; font-weight: 800; padding: .7rem 0 .5rem;
  border-top: 2px solid var(--border); color: var(--primary); margin-top: .2rem;
}
.total-row.grand .total-label { color: var(--primary); font-size: inherit; }
.totals-divider { height: 1px; background: var(--border); margin: .5rem 0; }

/* Next-service panel */
.next-svc-panel {
  border: 1.5px solid #93c5fd; border-radius: 10px;
  overflow: hidden; background: #fff;
}
.next-svc-header {
  background: linear-gradient(135deg, var(--primary-d) 0%, var(--primary) 100%);
  color: #fff; font-size: .65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; padding: .4rem .8rem;
  display: flex; align-items: center; gap: .35rem;
}
.next-svc-header svg { width: 11px; height: 11px; opacity: .85; }
.next-svc-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--border); gap: 1px;
}
.next-svc-item { background: #fff; padding: .6rem .7rem; }
.next-svc-item-label {
  font-size: .62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: .35rem;
}
.next-svc-item-input { display: flex; align-items: center; gap: .25rem; margin-bottom: .3rem; }
.next-svc-plus { font-size: .75rem; color: var(--muted); font-weight: 700; flex-shrink: 0; }
.next-svc-interval { flex: 1; min-width: 0; padding: .28rem .35rem; font-size: .82rem; font-weight: 600; text-align: right; }
.next-svc-km-label { font-size: .67rem; color: var(--muted); flex-shrink: 0; }
.next-svc-item-result { font-size: .9rem; font-weight: 800; color: var(--primary); min-height: 1.1rem; letter-spacing: -.01em; }

/* ── Records page ────────────────────────────────────────── */
.records-filters { margin-bottom: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.records-filters input, .records-filters select { max-width: 200px; }

/* Records stats strip */
.records-stats-strip {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.35rem;
  display: flex; align-items: center; gap: 1.5rem;
  box-shadow: var(--shadow); flex-wrap: wrap;
}
.rss-item { display: flex; flex-direction: column; gap: .1rem; }
.rss-val { font-size: 1.25rem; font-weight: 800; color: var(--dark); letter-spacing: -.03em; }
.rss-lbl { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rss-divider { width: 1px; height: 2rem; background: var(--border); flex-shrink: 0; }

/* ── Settings ────────────────────────────────────────────── */
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 700px) { .settings-row { grid-template-columns: 1fr; } }

.settings-tabs-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.settings-tabs-card .tabs {
  border-bottom: none;
  margin-bottom: 0;
  padding: .5rem .65rem;
  gap: .25rem;
  background: #f8fafc;
}
.settings-tabs-card .tab-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  border-bottom: none; margin-bottom: 0;
}
.settings-tabs-card .tab-btn.active {
  background: var(--primary); color: #fff;
  border-bottom-color: transparent;
}

.logo-preview {
  max-width: 180px; max-height: 80px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px;
}

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fafbfc; }
.list-item-label { font-size: .875rem; }
.list-item-actions { display: flex; gap: .4rem; }

/* ── Invoice Preview ─────────────────────────────────────── */
.size-toggle { display: flex; gap: .5rem; margin-bottom: 1rem; }
.size-btn {
  flex: 1; padding: .5rem; text-align: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .855rem; font-weight: 600; color: var(--muted);
  background: #fff; transition: border-color .15s, color .15s, background .15s;
  font-family: inherit;
}
.size-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.size-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0f1e 0%, #111827 50%, #0c1a3b 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 1rem; }
.login-card {
  background: #fff; border-radius: 20px; padding: 2.75rem 2.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.login-brand { text-align: center; margin-bottom: 2.25rem; }
.login-brand-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; box-shadow: 0 8px 20px rgba(37,99,235,.35);
}
.login-brand-icon svg { color: #fff; width: 28px; height: 28px; }
.login-brand h1 { margin: 0 0 .35rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; }
.login-brand p  { margin: 0; color: var(--muted); font-size: .855rem; }

/* ── Utilities ───────────────────────────────────────────── */
.text-muted    { color: var(--muted); }
.text-sm       { font-size: .82rem; }
.text-xs       { font-size: .75rem; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--success); }
.text-primary  { color: var(--primary); }
.font-bold     { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-center  { display: flex; align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.w-100  { width: 100%; }
.hidden { display: none !important; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--primary-mid);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .service-row { grid-template-columns: 1fr 1fr; }
  .service-row > *:nth-child(1) { grid-column: 1 / -1; }
  .repair-row { grid-template-columns: 1fr auto; }
  .repair-row > *:nth-child(1) { grid-column: 1 / -1; }
  .next-svc-grid { grid-template-columns: 1fr; }
  .quick-actions-bar { flex-wrap: wrap; }
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.45);
}
.sidebar-overlay.open { display: block; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: .28rem; }
.filter-field label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}

/* ── Field label (inline) ────────────────────────────────── */
.field-label {
  display: block;
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: .38rem;
}

/* ── Card header split ───────────────────────────────────── */
.card-header-split { justify-content: space-between; }

/* ── Count badge ─────────────────────────────────────────── */
.count-badge {
  display: inline-flex; align-items: center;
  padding: .15rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
  background: var(--primary-lt); color: var(--primary);
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3.5rem 1.5rem; text-align: center;
}
.empty-state-icon { margin-bottom: 1rem; opacity: .18; color: var(--muted); }
.empty-state-title { font-weight: 600; font-size: .95rem; color: var(--text); margin: 0 0 .35rem; }
.empty-state-sub   { font-size: .82rem; color: var(--muted); margin: 0; }

/* ── Search input with icon ──────────────────────────────── */
.search-input-wrap { position: relative; }
.search-input-wrap input { padding-left: 2.15rem; width: 100%; }
.search-input-icon {
  position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
  display: flex; align-items: center;
}

/* ── Form sections (settings) ────────────────────────────── */
.form-section { margin-bottom: 1.75rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--primary);
  margin: 0 0 1rem; padding: .5rem .8rem;
  background: var(--primary-lt);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex; align-items: center; gap: .4rem;
}

/* ── Pagination bar ──────────────────────────────────────── */
.pagination-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}
.pagination-info { font-size: .8rem; color: var(--muted); flex: 1; }

/* ── Dashboard greeting ──────────────────────────────────── */
.dash-greeting {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.35rem;
}
.dash-greeting-text h2 {
  margin: 0 0 .2rem; font-size: 1.15rem; font-weight: 800;
  letter-spacing: -.025em; color: #fff;
}
.dash-greeting-text p { margin: 0; font-size: .8rem; color: #64748b; }

/* ── POS: amount & notes inputs ──────────────────────────── */
.amount-input { text-align: right; font-size: .95rem !important; font-weight: 700 !important; }
.notes-input  { font-size: .82rem; resize: none; min-height: 60px; }

/* ── Success modal ───────────────────────────────────────── */
.modal-sm      { max-width: 420px; }
.success-body  { text-align: center; padding: 2.5rem 1.5rem; }
.success-icon  { margin-bottom: 1rem; color: var(--success); }
.success-inv-no { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin: .5rem 0; }
.success-actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; }

/* ── Reports page ─────────────────────────────────────────── */
.rpt-type-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.rpt-type-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .48rem 1rem; border: 1.5px solid var(--border);
  border-radius: 20px; background: #fff; color: var(--text);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.rpt-type-btn:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }
.rpt-type-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.rpt-type-btn svg    { opacity: .7; flex-shrink: 0; }
.rpt-type-btn.active svg { opacity: 1; }

.preset-group { display: flex; flex-wrap: wrap; gap: .35rem; }
.preset-btn {
  padding: .3rem .78rem; border: 1.5px solid var(--border);
  border-radius: 20px; background: #fff; color: var(--muted);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.preset-btn:hover  { border-color: var(--primary); color: var(--primary); }
.preset-btn.active { background: var(--primary-lt); border-color: var(--primary); color: var(--primary); }

.report-summary-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1.25rem;
  box-shadow: var(--shadow);
}
.report-summary-text { font-size: .875rem; color: var(--text); line-height: 1.5; }
.report-export-btns  { display: flex; gap: .5rem; flex-shrink: 0; }

/* spin keyframe for loading button state */
@keyframes spin { to { transform: rotate(360deg); } }
