/* ═══════════════════════════════════════════════════════════
   TaraRent Admin — Modern Design System
   Fonts: Plus Jakarta Sans (display) + Inter (body)
═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  /* Brand */
  --brand:        #0a6e5e;
  --brand-dark:   #085448;
  --brand-light:  #e6f4f1;
  --brand-glow:   rgba(10,110,94,.12);
  --acc:          #f59e0b;
  --acc-dark:     #d97706;
  --acc-soft:     #fef3c7;

  /* Neutrals */
  --ink:          #111827;
  --ink-2:        #374151;
  --muted:        #6b7280;
  --subtle:       #9ca3af;
  --line:         #e5e7eb;
  --line-2:       #f3f4f6;
  --bg:           #f9fafb;
  --card:         #ffffff;

  /* Semantic */
  --ok:           #059669;
  --ok-soft:      #d1fae5;
  --warn:         #d97706;
  --warn-soft:    #fef3c7;
  --danger:       #dc2626;
  --danger-soft:  #fee2e2;

  /* Tokens */
  --radius:       12px;
  --radius-lg:    16px;
  --radius-sm:    8px;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
  --shadow-md:    0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.04);

  /* Aliases for old code */
  --primary:      var(--brand);
  --primary-dark: var(--brand-dark);
  --primary-soft: var(--brand-light);
  --accent:       var(--acc);
  --accent-dark:  var(--acc-dark);
  --teal:         var(--brand);
  --teal-faint:   var(--brand-light);
  --coral:        var(--acc);
  --border:       var(--line);
  --surface-2:    var(--line-2);
  --text-muted:   var(--muted);
}

/* ── Dark mode ────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --ink:        #f1f5f9;
  --ink-2:      #cbd5e1;
  --muted:      #94a3b8;
  --subtle:     #64748b;
  --line:       #334155;
  --line-2:     #1e293b;
  --bg:         #0f172a;
  --card:       #1e293b;
  --brand-light:#0f3d35;
  --ok-soft:    #064e3b;
  --warn-soft:  #451a03;
  --danger-soft:#450a0a;
  color-scheme: dark;
}
[data-theme="dark"] .sidebar { background: #0f172a; border-right-color: #334155 }
[data-theme="dark"] .nav a { color: #94a3b8 }
[data-theme="dark"] .nav a:hover, [data-theme="dark"] .nav a.active { background: #0f3d35; color: #6ee7b7 }
[data-theme="dark"] .brand { border-bottom-color: #334155 }
[data-theme="dark"] .topbar { background: #1e293b; border-bottom-color: #334155 }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #0f172a; color: var(--ink); border-color: #334155;
}
[data-theme="dark"] .pill.green  { background: #064e3b; color: #6ee7b7 }
[data-theme="dark"] .pill.amber  { background: #451a03; color: #fbbf24 }
[data-theme="dark"] .pill.gray   { background: #1e293b; color: #94a3b8 }
[data-theme="dark"] .pill.blue   { background: #1e3a5f; color: #93c5fd }

/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -.02em;
  margin: 0;
  font-weight: 700;
}
a { color: var(--brand); text-decoration: none }
a:hover { text-decoration: underline }
.muted  { color: var(--muted) }
.subtle { color: var(--subtle) }
.tnum   { font-variant-numeric: tabular-nums }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  font: 600 13.5px/1 'Inter', sans-serif;
  padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
  text-decoration: none !important;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-sm) }
.btn:active { transform: translateY(0); box-shadow: none }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand) }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark) }
.btn-accent  { background: var(--acc); color: #fff; border-color: var(--acc) }
.btn-accent:hover  { background: var(--acc-dark); border-color: var(--acc-dark) }
.btn-ghost   { background: var(--card); color: var(--ink-2); border-color: var(--line) }
.btn-ghost:hover   { border-color: var(--brand); color: var(--brand) }
.btn-danger  { background: var(--card); color: var(--danger); border-color: #fca5a5 }
.btn-danger:hover  { background: var(--danger-soft) }
.btn-sm      { padding: .4rem .75rem; font-size: 12.5px }
.btn-block   { width: 100% }

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

/* Sidebar — Atlassian-style light */
.sidebar {
  width: 270px; flex-shrink: 0;
  background: #f7f8f9;
  border-right: 1px solid #dfe1e6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-top { padding: 0 .75rem .75rem }

/* Brand mark */
.brand {
  display: block;
  padding: 0 0 .75rem;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--acc) 0%, #f97316 100%);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
}
.brand-mark svg { display: block }
.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  color: var(--ink); letter-spacing: -.03em;
}

/* Nav */
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem }
.nav-section {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #8993a4;
  padding: .9rem .5rem .35rem;
}
.nav a {
  display: flex; align-items: center; gap: .7rem;
  color: #42526e; padding: .55rem .7rem;
  border-radius: 6px; font-weight: 500; font-size: 13.5px;
  transition: all .15s;
}
.nav a:hover  { background: #ebecf0; color: var(--ink); text-decoration: none }
.nav a.active { background: var(--brand-light); color: var(--brand); font-weight: 600 }
.nav .icon {
  width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center; font-size: 13px; flex-shrink: 0;
}

/* Sidebar footer / user card */
.sidebar-foot {
  margin-top: auto; padding: 1rem;
  border-top: 1px solid #dfe1e6;
}
.user-card {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .5rem; border-radius: 9px;
  transition: background .15s; cursor: default;
}
.user-card:hover { background: #ebecf0 }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #14b8a6 100%);
  display: grid; place-items: center; flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 13px; color: #fff;
}
.user-info { flex: 1; min-width: 0 }
.user-name  { color: var(--ink); font-size: 13px; font-weight: 600;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.user-email { color: var(--muted); font-size: 11.5px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.signout-link { color: var(--muted); font-size: 12px; transition: color .15s }
.signout-link:hover { color: var(--ink); text-decoration: none }

/* ── Main area ────────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .875rem 1.5rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left  { display: flex; align-items: center; gap: .75rem }
.topbar h1    { font-size: 1.05rem; font-weight: 700; color: var(--ink) }
.topbar-right { display: flex; align-items: center; gap: .5rem }

/* breadcrumb eyebrow */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--brand);
}

.content { padding: 1.5rem; flex: 1 }

/* ── Page head ────────────────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-head h2 { font-size: 1.5rem; line-height: 1.2 }
.page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.card-pad { padding: 1.25rem }

/* ── Layout helpers ───────────────────────────────────────────────────── */
.grid   { display: grid; gap: 1rem }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) }
.row    { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center }
.between { justify-content: space-between }
.stack  { display: flex; flex-direction: column; gap: 1rem }

/* ── Stat tiles ───────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; inset: 0 0 0 0;
  border-left: 3px solid var(--line); border-radius: var(--radius) 0 0 var(--radius);
}
.stat.accent { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); border: none; color: #fff }
.stat.accent::before { border-color: rgba(255,255,255,.2) }
.stat.amber  { }
.stat.amber::before { border-color: var(--acc) }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: .35rem }
.stat .value { font-family: 'Plus Jakarta Sans'; font-size: 2rem; font-weight: 800; line-height: 1 }
.stat.accent .label { color: rgba(255,255,255,.7) }
.stat.accent .value { color: #fff }
.stat-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.75rem; opacity: .12 }

/* ── Vehicle cards ────────────────────────────────────────────────────── */
.vehicle-card { overflow: hidden; display: flex; flex-direction: column; transition: all .18s }
.vehicle-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) }
.vehicle-photo {
  aspect-ratio: 16/10; background: var(--brand-light) center/cover no-repeat;
  display: grid; place-items: center; color: var(--brand); font-size: 2rem;
}
.vehicle-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1 }
.vehicle-body h3 { font-size: 1rem }
.price-tag { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-size: 1.2rem; color: var(--ink) }
.price-tag small { font-weight: 500; font-size: .78rem; color: var(--muted) }
.vehicle-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem }

/* ── Pills / badges ───────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11.5px; font-weight: 600; padding: .25rem .6rem; border-radius: 999px;
}
.pill.green  { background: var(--ok-soft);   color: var(--ok) }
.pill.amber  { background: var(--warn-soft);  color: var(--warn) }
.pill.gray   { background: var(--line-2);     color: var(--muted) }
.pill.coral  { background: #fee2e2;           color: var(--danger) }
.pill.blue   { background: #dbeafe;           color: #1d4ed8 }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px }
.table thead th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--subtle); padding: .65rem 1rem;
  background: var(--line-2); border-bottom: 1px solid var(--line);
}
.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0 }
.table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0 }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle }
.table tbody tr:last-child td { border-bottom: none }
.table tbody tr:hover td { background: var(--line-2) }
.table-wrap { overflow-x: auto; border-radius: var(--radius) }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem }
.field label { font-weight: 600; font-size: 13px; color: var(--ink-2) }
.field .hint { font-size: 11.5px; color: var(--muted); display: block; margin-top: .15rem }
input, select, textarea {
  font: inherit; padding: .6rem .8rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
input::placeholder { color: var(--subtle) }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem }
.form-grid .full, .field.full { grid-column: 1 / -1 }

.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 1rem }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fca5a5 }
.alert-ok    { background: var(--ok-soft);     color: var(--ok);    border: 1px solid #6ee7b7 }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted) }
.empty .big { font-size: 2.5rem; margin-bottom: .6rem }

/* ── Section divider ──────────────────────────────────────────────────── */
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding: .5rem 0 .75rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem;
}

/* ── Auth pages ───────────────────────────────────────────────────────── */
.center-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(135deg, #f0fdf8 0%, #fafafa 50%, #fefce8 100%);
}
.auth-card { width: 100%; max-width: 400px }
.auth-brand {
  display: flex; align-items: center; gap: .65rem;
  justify-content: center; margin-bottom: 1.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--ink);
}
.auth-brand .dot {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--acc) 0%, #f97316 100%);
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(245,158,11,.35);
}
.auth-subtitle { text-align: center; color: var(--muted); font-size: 13.5px; margin: -.5rem 0 1.25rem }

/* ── Mobile hamburger ─────────────────────────────────────────────────── */
.menu-btn {
  display: none; background: none; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: .45rem .6rem; cursor: pointer;
  color: var(--ink-2);
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .22s cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-md) }
  .sidebar.open { transform: translateX(0) }
  .menu-btn { display: inline-flex; align-items: center }
  .form-grid { grid-template-columns: 1fr }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: none }
  .scrim.show { display: block }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* ── Booking / public (legacy selectors kept) ─────────────────────────── */
.book-head  { background: var(--ink); color: #fff; padding: 2.5rem 1.5rem }
.book-head .inner { max-width: 900px; margin: 0 auto }
.book-head h1 { font-size: 2rem; margin-bottom: .3rem }
.book-wrap  { max-width: 900px; margin: -1.5rem auto 3rem; padding: 0 1.5rem; position: relative }
.quote-box  { position: sticky; top: 1rem }
.quote-line { display: flex; justify-content: space-between; padding: .4rem 0; font-size: 14px }
.quote-total {
  display: flex; justify-content: space-between;
  font-family: 'Plus Jakarta Sans'; font-weight: 700; font-size: 1.3rem;
  padding-top: .6rem; border-top: 2px solid var(--line); margin-top: .4rem;
}
.day-list { max-height: 160px; overflow: auto; font-size: 13px; color: var(--muted) }

/* ── Settings-specific ────────────────────────────────────────────────── */
.settings-section { max-width: 720px; margin-bottom: 1.25rem }
.settings-section h3 { margin-bottom: 1rem; font-size: 1rem }
.flash-ok {
  border-radius: var(--radius-sm); padding: .65rem 1rem; margin-bottom: 1rem;
  max-width: 720px; font-weight: 500; font-size: 13.5px;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #6ee7b7;
  display: flex; align-items: center; gap: .5rem;
}
.img-preview-wrap {
  margin-bottom: .6rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--line-2);
}
.img-preview        { display: block; width: 100%; object-fit: cover }
.logo-preview       { max-height: 68px; object-fit: contain; padding: 8px; background: #1a3a30 }
.hero-preview       { max-height: 130px; object-fit: cover }
.img-preview-meta   {
  display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .65rem; border-top: 1px solid var(--line); background: #fff; font-size: .78rem;
}
.img-filename       { color: var(--muted); font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px }
.img-delete-btn     { color: var(--danger); font-weight: 600; white-space: nowrap; text-decoration: none; padding: .1rem .4rem; border-radius: 4px }
.img-delete-btn:hover { background: var(--danger-soft) }
.replace-label      { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem }
.img-placeholder    {
  background: var(--line-2); border: 1.5px dashed #d1d5db; border-radius: var(--radius-sm);
  padding: 1.25rem; text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: .6rem;
}
.acc-grid { display: flex; flex-wrap: wrap; gap: .5rem .65rem }
.acc-item {
  display: flex; align-items: center; gap: .4rem; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 8px; padding: .35rem .65rem; font-size: .85rem;
  transition: all .15s;
}
.acc-item:has(input:checked) { background: var(--brand-light); border-color: var(--brand) }
.acc-item input { display: none }
.photo-grid  { display: flex; flex-wrap: wrap; gap: .6rem }
.photo-thumb { position: relative; width: 110px; height: 80px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--line) }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover }
.photo-del   {
  position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6);
  color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.req { color: var(--danger) }
.hint { font-size: .8rem; color: var(--muted); display: block; margin-top: .2rem }

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: .65rem;
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; margin-bottom: 1rem;
  animation: flashIn .2s ease;
}
@keyframes flashIn { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
.flash-ok      { background: var(--ok-soft);   color: #065f46; border: 1px solid #6ee7b7 }
.flash-error   { background: var(--danger-soft);color: #991b1b; border: 1px solid #fca5a5 }
.flash-warning { background: var(--warn-soft);  color: #92400e; border: 1px solid #fcd34d }
.flash-info    { background: #dbeafe;           color: #1e40af; border: 1px solid #93c5fd }
.flash-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: .9rem; opacity: .5; padding: 0; line-height: 1; color: inherit;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1 }
