@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ── */
:root {
  --navy:        #1E3A5F;
  --navy-dark:   #152B47;
  --navy-mid:    #2A4D73;
  --red:         #D62828;
  --red-light:   #E84040;
  --green:       #00A86B;
  --green-bg:    #E6F7F1;
  --amber:       #FF8C00;
  --amber-bg:    #FFF4E5;
  --blue:        #2E75B6;
  --blue-bg:     #EBF3FB;
  --indigo:      #6366F1;
  --indigo-bg:   #EEEFFD;
  --surface:     #F4F7FB;
  --surface2:    #EBF1F8;
  --white:       #FFFFFF;
  --text:        #0F1C2E;
  --text-mid:    #4A5A72;
  --text-light:  #8A9BB8;
  --border:      #D4E0EF;
  --sidebar-w:   260px;
  --header-h:    64px;
  --shadow:      0 4px 24px rgba(30,58,95,.10);
  --shadow-sm:   0 2px 8px  rgba(30,58,95,.08);
  --r:           12px;
  --r-sm:        8px;
  --transition:  .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════ LAYOUT ══════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 72px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon {
  width: 38px; height: 38px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 22px; height: 22px; fill: #fff; }
.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.brand-sub { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 16px 0 8px;
}
.nav-section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 16px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
  border-radius: var(--r-sm);
  margin: 1px 8px;
  color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,.10);
  color: #fff;
  border-left-color: var(--red);
  font-weight: 600;
}
.nav-item svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity var(--transition);
}
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px; text-align: center;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 20px;
}

.sidebar-footer {
  padding: 12px 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
}
.user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-avatar svg { width: 16px; height: 16px; stroke: #fff; fill: none; }
.user-info { flex: 1; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,.45); }
.logout-btn {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.08);
  border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.logout-btn:hover { background: rgba(214,40,40,.3); }
.logout-btn svg { width: 15px; height: 15px; stroke: rgba(255,255,255,.7); fill: none; }

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

/* ── Topbar ── */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  width: 36px; height: 36px;
  background: transparent; border: none;
  border-radius: var(--r-sm);
  display: none;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--surface); }
.sidebar-toggle svg { width: 20px; height: 20px; stroke: var(--text-mid); fill: none; }
.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text);
  flex: 1;
}
.topbar-breadcrumb {
  font-size: 13px; color: var(--text-light);
  display: flex; align-items: center; gap: 6px;
}
.topbar-breadcrumb span { color: var(--text-mid); }
.topbar-actions {
  display: flex; align-items: center; gap: 10px;
}
.topbar-btn {
  width: 38px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--surface2); }
.topbar-btn svg { width: 18px; height: 18px; stroke: var(--text-mid); fill: none; }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--red); border-radius: 50%;
  border: 2px solid var(--white);
}
.topbar-operator {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.topbar-operator svg { width: 14px; height: 14px; stroke: var(--text-light); fill: none; }

/* ── Content ── */
.content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ══════════════ COMPONENTS ══════════════ */

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-info {}
.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 800;
  color: var(--text);
}
.page-subtitle { font-size: 14px; color: var(--text-mid); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 18px;
  border: none; border-radius: var(--r-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary svg { stroke: #fff; fill: none; }
.btn-primary:hover { background: var(--navy-mid); }
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 10px rgba(214,40,40,.3);
}
.btn-danger svg { stroke: #fff; fill: none; }
.btn-danger:hover { background: var(--red-light); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}
.btn-outline svg { stroke: var(--text-mid); fill: none; }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover svg { stroke: var(--navy); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  justify-content: center;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface);
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 16px; height: 16px; stroke: var(--blue); fill: none; }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--surface);
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; fill: none; stroke-width: 1.8; }
.stat-icon.navy  { background: var(--surface2); } .stat-icon.navy  svg { stroke: var(--navy); }
.stat-icon.red   { background: #FFF0F0; }         .stat-icon.red   svg { stroke: var(--red); }
.stat-icon.green { background: var(--green-bg); } .stat-icon.green svg { stroke: var(--green); }
.stat-icon.amber { background: var(--amber-bg); } .stat-icon.amber svg { stroke: var(--amber); }
.stat-icon.blue  { background: var(--blue-bg); }  .stat-icon.blue  svg { stroke: var(--blue); }
.stat-icon.indigo{ background: var(--indigo-bg);} .stat-icon.indigo svg { stroke: var(--indigo); }
.stat-body { flex: 1; }
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 3px; }
.stat-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 700;
  margin-top: 6px;
  padding: 2px 7px; border-radius: 10px;
}
.trend-up   { background: var(--green-bg); color: var(--green); }
.trend-down { background: #FFF0F0; color: var(--red); }
.trend-up svg { width: 10px; height: 10px; stroke: var(--green); fill: none; }
.trend-down svg { width: 10px; height: 10px; stroke: var(--red); fill: none; }

/* ── Two-col grid ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.col-wide { grid-column: 1 / span 2; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface); }
thead th {
  padding: 10px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-light);
  text-align: left; white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--surface);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
tbody td {
  padding: 12px 16px;
  font-size: 13.5px; color: var(--text-mid);
  white-space: nowrap;
}
td.td-main { color: var(--text); font-weight: 600; }
td.td-actions { text-align: right; }
td.td-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em; white-space: nowrap;
}
.badge-new      { background: var(--blue-bg);   color: var(--blue); }
.badge-contacted{ background: var(--amber-bg);  color: var(--amber); }
.badge-closed   { background: var(--green-bg);  color: var(--green); }
.badge-lost     { background: var(--surface2);  color: var(--text-light); }
.badge-spam     { background: #FFF0F0;           color: var(--red); }
.badge-testdrive{ background: var(--indigo-bg); color: var(--indigo); }
.badge-info     { background: var(--surface2);  color: var(--text-mid); }
.badge-nuovo    { background: var(--navy-dark); color: #fff; }
.badge-usato    { background: var(--surface2);  color: var(--text-mid); }
.badge-km0      { background: var(--green-bg);  color: var(--green); }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.form-control, .form-input, .form-select {
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 14px;
  font-size: 14px; color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus, .form-input:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}
.form-input::placeholder { color: var(--text-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Search bar ── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 40px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--navy); }
.search-bar svg { width: 16px; height: 16px; stroke: var(--text-light); fill: none; flex-shrink: 0; }
.search-bar input {
  border: none; background: transparent;
  font-size: 14px; color: var(--text);
  outline: none; flex: 1;
}
.search-bar input::placeholder { color: var(--text-light); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state svg { width: 48px; height: 48px; stroke: var(--border); fill: none; margin-bottom: 12px; }
.empty-state p { font-size: 14px; color: var(--text-light); }

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

/* ══════════════ LOGIN PAGE ══════════════ */
body.login-page {
  background: linear-gradient(135deg, #0F1C2E 0%, #1E3A5F 55%, #152B47 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.login-logo .brand-icon { width: 44px; height: 44px; border-radius: 12px; }
.login-logo .brand-icon svg { width: 26px; height: 26px; }
.login-logo .brand-name { font-size: 22px; }
.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-submit {
  height: 48px;
  background: var(--navy); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition);
  margin-top: 4px;
}
.login-submit:hover { background: var(--navy-mid); }
.login-submit svg { width: 18px; height: 18px; stroke: #fff; fill: none; }
.login-error {
  background: #FFF0F0;
  border: 1px solid #FFCDD2;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px; color: var(--red);
  display: none;
}
.login-error.show { display: block; }
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px; color: var(--text-light);
}

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 1024px) {
  .two-col   { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
  .col-wide  { grid-column: 1; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Overlay (mobile sidebar) ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Utilities ── */
.text-muted   { color: var(--text-light); font-size: 13px; }
.text-navy    { color: var(--navy); }
.text-red     { color: var(--red); }
.text-green   { color: var(--green); }
.fw-700       { font-weight: 700; }
.font-outfit  { font-family: 'Outfit', sans-serif; }
.d-flex       { display: flex; align-items: center; gap: 8px; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16{ margin-top: 16px; }

/* ── Sidebar brand aliases ── */
.sidebar-brand-name { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; color: #fff; line-height: 1.1; }
.sidebar-brand-sub  { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }

/* ── Sidebar user aliases ── */
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff; font-size: 14px; font-weight: 700;
  font-family: 'Outfit', sans-serif;
}
.sidebar-user-info { flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; display: block; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.45); display: block; }

/* ── Nav icon alias ── */
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; transition: opacity var(--transition); }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }

/* ── Nav group (sub-menu) ── */
.nav-group { }
.nav-group-toggle {
  width: 100%; background: none; border: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  height: 44px;
  border-radius: var(--r-sm);
  margin: 1px 8px;
  color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
  width: calc(100% - 16px);
}
.nav-group-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-chevron {
  width: 14px; height: 14px; margin-left: auto;
  transition: transform var(--transition);
  opacity: .5;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.nav-group.open .nav-sub { max-height: 300px; }
.nav-sub-item {
  padding-left: 46px !important;
  font-size: 13px !important;
  height: 38px !important;
  color: rgba(255,255,255,.5) !important;
}
.nav-sub-item:hover, .nav-sub-item.active { color: rgba(255,255,255,.9) !important; }

/* ── Nav badge red variant ── */
.nav-badge-red { background: var(--red); }

/* ── Nav item logout style ── */
.nav-item-logout { color: rgba(255,255,255,.5); }
.nav-item-logout:hover { color: #ff9898; background: rgba(214,40,40,.15); }

/* ── Stat card color variants ── */
.stat-navy  .stat-icon { background: var(--surface2);  } .stat-navy  .stat-icon svg { stroke: var(--navy); }
.stat-red   .stat-icon { background: #FFF0F0;           } .stat-red   .stat-icon svg { stroke: var(--red); }
.stat-green .stat-icon { background: var(--green-bg);  } .stat-green .stat-icon svg { stroke: var(--green); }
.stat-amber .stat-icon { background: var(--amber-bg);  } .stat-amber .stat-icon svg { stroke: var(--amber); }
.stat-blue  .stat-icon { background: var(--blue-bg);   } .stat-blue  .stat-icon svg { stroke: var(--blue); }
.stat-indigo .stat-icon{ background: var(--indigo-bg); } .stat-indigo .stat-icon svg { stroke: var(--indigo); }

/* ── Topbar extras ── */
.topbar-spacer { flex: 1; }
.topbar-date   { font-size: 13px; color: var(--text-light); white-space: nowrap; }

/* ── Card body table variant ── */
.card-body-table { padding: 0; }

/* ── Sidebar overlay (JS uses .visible) ── */
.sidebar-overlay.visible { display: block; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--text); color: #fff;
  padding: 12px 22px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0; transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }

/* ── Login page extra ── */
.login-title    { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 28px; }

/* ── Filter bar (search + selects row) ── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--surface);
}
.filter-bar .search-bar { flex: 1; min-width: 180px; }

/* ── Filter tabs (status tabs above table) ── */
.filter-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface);
}
.filter-tab {
  height: 32px; padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: transparent;
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-tab:hover { background: var(--surface); color: var(--text-mid); }
.filter-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-tab-count { font-size: 11px; margin-left: 4px; opacity: .7; }

/* ── Form textarea ── */
.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px; color: var(--text);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}
.form-textarea::placeholder { color: var(--text-light); }

/* ── Form section title ── */
.form-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-light);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface);
  margin-bottom: 16px;
}

/* ── Form check (checkbox row) ── */
.form-check { display: flex; align-items: center; gap: 9px; }
.form-check-input { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; flex-shrink: 0; }
.form-check-label { font-size: 14px; color: var(--text); cursor: pointer; }

/* ── Pagination ── */
.pagination {
  display: flex; gap: 4px; align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--surface);
}
.pagination-info { font-size: 13px; color: var(--text-light); margin-right: auto; }
.page-btn {
  height: 34px; min-width: 34px; padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Published / draft badge aliases ── */
.badge-published { background: var(--green-bg); color: var(--green); }
.badge-draft     { background: var(--surface2);  color: var(--text-light); }

/* ── Drawer (slide-in panel) ── */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 200;
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 540px; max-width: 100vw;
  background: var(--white);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700; color: var(--text);
}
.drawer-close {
  width: 36px; height: 36px;
  background: var(--surface); border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.drawer-close:hover { background: var(--surface2); }
.drawer-close svg { width: 18px; height: 18px; stroke: var(--text-mid); fill: none; }
.drawer-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}
.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .drawer { width: 100vw; }
}

/* ── Modal (dialog centrato) ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 300;
}
.modal-overlay.open { display: block; }
.modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  z-index: 301;
  flex-direction: column;
  overflow: hidden;
}
.modal.open { display: flex; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.modal-title svg { width: 18px; height: 18px; stroke: var(--red); flex-shrink: 0; }
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-shrink: 0;
}
.pn-toggle { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.pn-toggle label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-mid); transition: background var(--transition), color var(--transition);
  border: none;
}
.pn-toggle input[type="radio"] { display: none; }
.pn-toggle input[type="radio"]:checked + span { color: var(--navy); }

/* ── Vehicle image upload ── */
.img-cover-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition);
}
.img-cover-area:hover { border-color: var(--navy-mid); }
.img-cover-area img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-cover-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.img-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  min-height: 40px;
}
.img-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.img-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img-gallery-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.55);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.img-gallery-item:hover .img-gallery-del { opacity: 1; }
.img-gallery-del svg { width: 12px; height: 12px; stroke: #fff; }
.pn-toggle label:has(input:checked) { background: var(--navy-light, #eef2f9); color: var(--navy); }
