/* =========================================================
   Jask Auto - POC Dashboard Styles
   Brand: Navy #0d1b2a | Gold #FFB800
   ========================================================= */

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

:root {
  --navy:        #0d1b2a;
  --navy-hover:  #162436;
  --navy-active: #1e3352;
  --gold:        #FFB800;
  --gold-dark:   #e5a500;
  --gold-light:  #fff8e6;
  --white:       #ffffff;
  --bg:          #f4f6f9;
  --border:      #e2e8f0;
  --text:        #1a2332;
  --muted:       #6b7280;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md:   0 4px 24px rgba(0, 0, 0, 0.12);
}

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

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

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Brand / Logo */
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 140px;
  height: auto;
  display: block;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
}

/* Nav */
.sidebar-nav {
  list-style: none;
  padding: 16px 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 20px 6px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  background: var(--navy-hover);
  color: var(--white);
  border-left-color: rgba(255, 184, 0, 0.4);
}

.sidebar-nav .nav-link.active {
  background: var(--navy-active);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 600;
}

.sidebar-nav .nav-link .badge-count {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user .user-info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  text-transform: capitalize;
}

.sidebar-user .user-info .role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* =========================================================
   MAIN CONTENT WRAPPER
   ========================================================= */

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-title .breadcrumb-sep {
  color: var(--muted);
  font-weight: 300;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--gold-light);
  border: 1px solid rgba(255, 184, 0, 0.3);
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  color: #92680a;
}

.topbar-user-badge .mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* Page content area */
.page-content {
  padding: 28px;
  flex: 1;
}

/* =========================================================
   ALERTS / FLASH MESSAGES
   ========================================================= */

.flash-container {
  padding: 0 28px;
  padding-top: 16px;
}

.alert {
  border-radius: var(--radius);
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: #f0fdf4; color: #15803d; border-left: 4px solid #22c55e; }
.alert-danger  { background: #fef2f2; color: #b91c1c; border-left: 4px solid #ef4444; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-left: 4px solid #3b82f6; }
.alert-warning { background: var(--gold-light); color: #92400e; border-left: 4px solid var(--gold); }

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

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

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-header .subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

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

.btn-primary-gold {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary-gold:hover {
  background: var(--gold-dark);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 184, 0, 0.35);
}

.btn-outline-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline-edit:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.btn-outline-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline-delete:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.btn-navy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-navy:hover {
  background: var(--navy-active);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
  border-color: #cbd5e1;
}

/* =========================================================
   STATS CARD
   ========================================================= */

.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  min-width: 160px;
  flex: 1;
}

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

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

.stat-card .stat-icon {
  float: right;
  font-size: 28px;
  color: var(--gold);
  opacity: 0.8;
}

/* =========================================================
   TABLE
   ========================================================= */

.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.table-card-header .card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 7px;
}

/* Search */
.search-wrap {
  position: relative;
  min-width: 240px;
}

.search-wrap i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.15);
  background: var(--white);
}

.search-input::placeholder { color: #9ca3af; }

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 11px 16px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: #fafbfc; }

.data-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

.td-year {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

.td-make {
  font-weight: 600;
}

.td-spec {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 280px;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-num {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   FORM CARD
   ========================================================= */

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 860px;
}

.form-card-header {
  padding: 20px 24px;
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-card-header .fc-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.form-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.form-card-header .fc-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .req {
  color: #ef4444;
  font-size: 14px;
  line-height: 1;
}

.form-control-custom {
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fafbfc;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-control-custom:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.15);
  background: var(--white);
}

.form-control-custom::placeholder { color: #9ca3af; }

textarea.form-control-custom {
  resize: vertical;
  min-height: 90px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.form-card-footer {
  padding: 20px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   DELETE MODAL
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--white);
  border-radius: 14px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.show .modal-box { transform: scale(1); }

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fef2f2;
  color: #ef4444;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-body-text {
  font-size: 13.5px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-body-text strong { color: var(--text); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-danger-solid {
  padding: 9px 22px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger-solid:hover { background: #dc2626; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* subtle geometric background for login */
.login-page::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,0,0.08) 0%, transparent 70%);
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,0,0.05) 0%, transparent 70%);
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.login-card-top {
  background: var(--navy);
  padding: 32px 32px 24px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

.login-card-top img {
  height: 42px;
  width: auto;
  margin-bottom: 10px;
}

.login-card-top p {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 184, 0, 0.7);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

.login-card-body {
  padding: 32px;
}

.login-heading {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-bottom: 28px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: block;
}

.login-form .input-wrap {
  position: relative;
}

.login-form .input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.login-form input {
  width: 100%;
  padding: 12px 13px 12px 40px;
  border: 1.5px solid #d1d5db;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #f8fafc;
  outline: none;
  transition: all 0.15s;
}

.login-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.14);
  background: var(--white);
}

.login-form input::placeholder {
  color: #9ca3af;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 184, 0, 0.4);
}

.login-card-footer {
  padding: 13px 32px;
  background: #07111c;
  border-top: 1px solid rgba(255, 184, 0, 0.12);
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.3px;
}

.login-card-footer strong {
  color: rgba(255, 184, 0, 0.55);
  font-weight: 700;
}

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

.gold-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 5px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.text-muted-sm {
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================
   DARK MODE TOGGLE BUTTON
   ========================================================= */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 17px;
  border-radius: 8px;
  transition: all 0.15s;
  line-height: 1;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  background: var(--bg);
  color: var(--text);
}

/* =========================================================
   DARK MODE
   ========================================================= */

html.dark {
  --bg:         #0f172a;
  --white:      #1e293b;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --border:     #334155;
  --gold-light: #291f00;
}

html.dark body { background: var(--bg); }

html.dark .topbar {
  background: #1e293b;
  border-bottom-color: #334155;
}

html.dark .topbar-title { color: var(--text); }

html.dark .theme-toggle:hover { background: #253347; }

html.dark .table-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .table-card-header {
  border-bottom-color: #334155;
}

html.dark .table-card-header .card-title { color: var(--text); }

html.dark .data-table thead th {
  background: #162032;
  color: #94a3b8;
  border-bottom-color: #334155;
}

html.dark .data-table tbody tr { border-bottom-color: #334155; }

html.dark .data-table tbody tr:hover { background: #253347; }

html.dark .data-table td { color: var(--text); }

html.dark .td-year { color: var(--gold); }

html.dark .stat-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .stat-card .stat-value { color: var(--text); }

html.dark .form-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark .form-card-footer {
  background: #162032;
  border-top-color: #334155;
}

html.dark .form-control-custom {
  background: #0f172a;
  border-color: #334155;
  color: var(--text);
}

html.dark .form-control-custom:focus {
  background: #162032;
}

html.dark .form-label { color: var(--text); }

html.dark .search-input {
  background: #0f172a;
  border-color: #334155;
  color: var(--text);
}

html.dark .search-input:focus { background: #162032; }

html.dark .page-header h2 { color: var(--text); }

html.dark .dropdown-menu {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .dropdown-item { color: var(--text) !important; }

html.dark .dropdown-item:hover { background: #253347 !important; }

html.dark .dropdown-divider { border-color: #334155 !important; }

html.dark .modal-box { background: #1e293b; }

html.dark .modal-title { color: var(--text); }

html.dark .btn-ghost {
  color: var(--muted);
  border-color: #334155;
}

html.dark .btn-ghost:hover {
  background: #253347;
  color: var(--text);
  border-color: #475569;
}

html.dark .btn-outline-edit {
  color: #93c5fd;
  border-color: #1e3a5f;
}

html.dark .btn-outline-edit:hover {
  background: #1e3a5f;
  color: #bfdbfe;
}

html.dark .pagination-bar { border-top-color: #334155; }

html.dark .page-btn {
  background: #1e293b;
  border-color: #334155;
  color: var(--text);
}

html.dark .page-btn:hover {
  background: #253347;
  border-color: var(--gold);
  color: var(--gold);
}

html.dark .page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

html.dark .page-current { color: var(--text); }

html.dark .page-info { color: var(--muted); }

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.page-info {
  font-size: 13px;
  color: var(--muted);
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.page-btn:hover {
  background: var(--bg);
  border-color: var(--gold);
  color: var(--navy);
}

.page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 700;
}

.page-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 12px;
}

.pagination-top {
  border-top: none;
  border-bottom: 1px solid var(--border);
}

/* =========================================================
   TOPBAR SEARCH + LIVE SUGGEST
   ========================================================= */

.topbar-search-wrap {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.topbar-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all 0.15s;
}

.topbar-search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.12);
  background: var(--white);
}

.topbar-search-input::placeholder { color: #9ca3af; }

.suggest-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
  z-index: 1000;
  overflow: hidden;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.12s;
  overflow: hidden;
}

.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--gold-light); }

.suggest-year { font-weight: 700; color: var(--navy); flex-shrink: 0; }
.suggest-make { font-weight: 600; flex-shrink: 0; }
.suggest-model { color: var(--muted); flex-shrink: 0; }
.suggest-sep { color: #d1d5db; font-size: 11px; flex-shrink: 0; }
.suggest-part {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.suggest-all-link {
  display: block;
  text-align: center;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #92680a;
  background: var(--gold-light);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
}

.suggest-all-link:hover { background: #fef3c7; }

/* =========================================================
   FILTER CHIP (active search indicator)
   ========================================================= */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  background: var(--gold-light);
  border: 1px solid rgba(255, 184, 0, 0.35);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}

.filter-chip-clear {
  color: inherit;
  text-decoration: none;
  opacity: 0.65;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}

.filter-chip-clear:hover { opacity: 1; }

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */

.toast-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  pointer-events: none;
}

.toast-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
  border-left: 4px solid transparent;
  pointer-events: all;
  animation: toastIn 0.28s ease;
}

.toast-card.toast-fade-out { animation: toastOut 0.35s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

.toast-success { border-left-color: #22c55e; }
.toast-danger  { border-left-color: #ef4444; }
.toast-info    { border-left-color: #3b82f6; }
.toast-warning { border-left-color: var(--gold); }

.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: #22c55e; }
.toast-danger  .toast-icon { color: #ef4444; }
.toast-info    .toast-icon { color: #3b82f6; }
.toast-warning .toast-icon { color: var(--gold); }

.toast-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}

.toast-close:hover { color: var(--text); }

/* =========================================================
   DARK MODE - new elements
   ========================================================= */

html.dark .topbar-search-input {
  background: #0f172a;
  border-color: #334155;
  color: var(--text);
}

html.dark .topbar-search-input:focus { background: #162032; }

html.dark .suggest-dropdown {
  background: #1e293b;
  border-color: #334155;
}

html.dark .suggest-item {
  color: var(--text);
  border-bottom-color: #334155;
}

html.dark .suggest-item:hover { background: #253347; }
html.dark .suggest-year { color: var(--gold); }
html.dark .suggest-sep { color: #475569; }

html.dark .suggest-all-link {
  background: #162032;
  color: var(--gold);
  border-top-color: #334155;
}

html.dark .suggest-all-link:hover { background: #1e3352; }

html.dark .toast-card { background: #1e293b; }
html.dark .toast-msg { color: var(--text); }

html.dark .filter-chip {
  background: #291f00;
  border-color: rgba(255, 184, 0, 0.3);
  color: var(--gold);
}

/* =========================================================
   HISTORY DRAWER
   ========================================================= */

.history-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gold);
  color: #0d1b2a;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 18px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  z-index: 900;
  box-shadow: -2px 0 10px rgba(0,0,0,0.15);
  transition: background 0.2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.history-tab:hover { background: #e6a700; }

.history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
}
.history-overlay.open { display: block; }

.history-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 1100;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.history-drawer.open { right: 0; }

.history-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.history-drawer-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.history-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}
.history-close-btn:hover { background: var(--bg); color: var(--text); }

.history-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.history-entry {
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: 0 8px 8px 0;
}
.history-field-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: var(--gold);
  color: #0d1b2a;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.history-values {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 5px;
  word-break: break-word;
}
.history-values .old-val {
  color: #e74c3c;
  text-decoration: line-through;
  opacity: 0.8;
}
.history-values .new-val { color: #27ae60; font-weight: 500; }
.history-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}
.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 48px 20px;
  line-height: 2;
}

/* dark mode */
html.dark .history-drawer { background: #1e293b; border-left-color: #334155; }
html.dark .history-entry  { background: #0f172a; }
html.dark .history-drawer-header { border-bottom-color: #334155; }

html.dark .pagination-top { border-bottom-color: #334155; }
