/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
#app { min-height: 100vh; }

.dashboard-layout {
  /* La sidebar è position:fixed (220px). Il main-content la compensa con
     margin-left:220px. NON usare grid qui: combinato col margin spingerebbe
     e comprimerebbe il contenuto in una colonna stretta. */
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  /* Stessa altezza (60px) della topbar, così il bordo inferiore della sidebar
     si allinea esattamente con quello della topbar. */
  height: 60px;
  box-sizing: border-box;
  padding: 0 1.25rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.sidebar-logo svg {
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(139,92,246,0.5));
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: rgba(139,92,246,0.12);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { flex-shrink: 0; }
.nav-item .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
}

.sidebar-footer {
  padding: 0.875rem 0.75rem 1.125rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.575rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-chip.free       { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.plan-chip.pro        { background: rgba(139,92,246,0.18); color: var(--accent); border: 1px solid rgba(139,92,246,0.3); }
.plan-chip.business   { background: rgba(59,130,246,0.18); color: var(--accent-2); border: 1px solid rgba(59,130,246,0.3); }
.plan-chip.enterprise { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.875rem;
  padding: 0.5rem 0.125rem;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(59,130,246,0.3));
  border: 1px solid rgba(139,92,246,0.35);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.user-plan { line-height: 1; }

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 0.875rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,0.06);
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════ */
.main-content {
  margin-left: 220px;
  /* Occupa tutta la larghezza residua accanto alla sidebar fixed. Senza questo,
     in alcuni contesti il blocco collassava a larghezza minima del contenuto. */
  width: calc(100% - 220px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  box-sizing: border-box;
}

.topbar {
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.topbar-breadcrumb span:last-child {
  color: var(--text);
  font-weight: 600;
}
.topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 0.625rem; }

.view-body {
  padding: 2rem;
  flex: 1;
  width: 100%;
  /* Riempie la larghezza disponibile accanto alla sidebar. Un cap ampio evita
     righe troppo lunghe su monitor ultrawide, centrandosi; sotto i 1600px usa
     tutto lo spazio (niente più vuoto a destra). */
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.59375rem 1.1875rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.07);
}
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.18); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 0.375rem 0.8125rem; font-size: 0.8rem; border-radius: 8px; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.75rem; border-radius: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Toggle group */
.btn-group {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.btn-group .btn-tab {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-group .btn-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title svg { color: var(--accent); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: rgba(139,92,246,0.35); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-sub { font-size: 0.775rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════
   CAR CARDS — mini-CRM style
═══════════════════════════════════════════════════════ */
.garage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.garage-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.garage-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-weight: 500;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.125rem;
  align-items: start;
}

.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.car-card:hover {
  border-color: rgba(139,92,246,0.45);
  box-shadow: 0 10px 36px rgba(0,0,0,0.42), 0 0 0 1px rgba(139,92,246,0.18);
}

.car-thumb-wrap {
  height: 150px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.car-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.car-card:hover .car-thumb-wrap img { transform: scale(1.03); }
.car-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.car-thumb-empty svg { opacity: 0.3; }

.car-thumb-badges {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  right: 0.625rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Portal badges */
.portal-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
}
.portal-badge.autoscout24  { background: rgba(0,100,230,0.85); color: #fff; }
.portal-badge.subito       { background: rgba(255,140,0,0.85); color: #fff; }
.portal-badge.automobile   { background: rgba(220,38,38,0.85); color: #fff; }
.portal-badge.carmarket    { background: rgba(34,197,94,0.85); color: #fff; }
.portal-badge.default      { background: rgba(30,37,53,0.9); color: var(--text-muted); }

/* Status badge on card */
.status-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--transition);
}
.status-badge.da_valutare   { background: rgba(100,116,139,0.85); color: #e2e8f0; }
.status-badge.in_valutazione{ background: rgba(234,179,8,0.85); color: #1a1000; }
.status-badge.contattato    { background: rgba(139,92,246,0.85); color: #fff; }
.status-badge.scartato      { background: rgba(239,68,68,0.85); color: #fff; }

.car-body {
  padding: 0.875rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.car-title {
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  color: var(--text);
}
.car-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.car-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.car-price-original {
  font-size: 0.8125rem;
  color: #f87171;
  text-decoration: line-through;
}
.car-price-delta {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.car-price-delta.down { background: rgba(34,197,94,0.15); color: var(--success); }
.car-price-delta.up   { background: rgba(239,68,68,0.12); color: var(--danger); }

.car-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.car-chip {
  padding: 0.175rem 0.525rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.04);
}
.car-chip.days {
  background: rgba(59,130,246,0.1);
  color: var(--accent-2);
  border-color: rgba(59,130,246,0.15);
}

.car-online-hint {
  margin-top: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  line-height: 1.35;
}
.car-online-label {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}
.car-online-hint .badge-giorni {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(234,179,8,0.13);
  border: 1px solid rgba(234,179,8,0.25);
  color: #eab308;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 50px;
}

/* (Lo stile di .car-actions e dei suoi bottoni è consolidato più in basso,
   nel blocco "Azioni card impilate full-width".) */

/* Status dropdown */
.status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 200;
  min-width: 160px;
  overflow: hidden;
  animation: dropdownIn 0.15s ease;
}
.status-dropdown-item {
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.status-dropdown-item:hover { background: var(--surface-2); }
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   TABLE VIEW
═══════════════════════════════════════════════════════ */
.garage-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.garage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.garage-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
.garage-table thead th.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}
.garage-table thead th.th-sortable:hover { color: var(--text); background: rgba(139,92,246,0.08); }
.garage-table thead th.th-sort-active { color: var(--accent); }
.garage-table thead th .th-sort-arrow { font-size: 0.6rem; }
.garage-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.garage-table tbody tr:last-child { border-bottom: none; }
.garage-table tbody tr:hover { background: rgba(139,92,246,0.05); }
.garage-table td {
  padding: 0.875rem 1rem;
  color: var(--text);
  vertical-align: middle;
}
.garage-table td.td-title { font-weight: 600; max-width: 220px; }
.garage-table td.td-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.garage-table td.td-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.garage-table td.td-online {
  color: var(--text-muted);
  font-size: 0.78rem;
  max-width: 180px;
  line-height: 1.25;
}
.garage-table td.td-actions { white-space: nowrap; text-align: right; }

/* ═══════════════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════════════ */
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.notif-unread-badge {
  background: rgba(139,92,246,0.15);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.25);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}
.notif-list { display: flex; flex-direction: column; gap: 0.625rem; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.notif-item:hover {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.04);
}
.notif-item.unread {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 2px);
}
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-icon.price_drop      { background: rgba(34,197,94,0.12); color: var(--success); }
.notif-icon.listing_removed { background: rgba(239,68,68,0.12); color: #ef4444; }
.notif-icon.new_listing     { background: rgba(59,130,246,0.12); color: #3b82f6; }
.notif-icon.watchlist_hit   { background: rgba(234,179,8,0.12); color: var(--warning); }
/* il link interno occupa la riga, lasciando spazio al cestino in .notif-meta */
.notif-item-link { display: flex; align-items: flex-start; gap: 1rem; flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-sub { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
}
.notif-time { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}
/* cestino per eliminare la singola notifica */
.notif-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 4px; border-radius: 6px;
  display: flex; align-items: center; transition: all var(--transition);
}
.notif-del:hover { color: #ef4444; background: rgba(239,68,68,0.12); }
/* pallino rosso sul nav "Notifiche" quando ci sono non lette */
.notif-nav-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 6px #ef4444;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════
   PROFILE
═══════════════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.profile-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.profile-card h3 svg { color: var(--accent); }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 1rem;
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { font-size: 0.8125rem; color: var(--text-muted); flex-shrink: 0; }
.info-value { font-size: 0.875rem; font-weight: 600; text-align: right; }

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.copy-value {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem;
  background: var(--surface-2);
  padding: 0.275rem 0.625rem;
  border-radius: 6px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.275rem 0.625rem;
  border-radius: 6px;
  background: rgba(139,92,246,0.1);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,0.2);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-copy:hover { background: rgba(139,92,246,0.2); }
.btn-copy.copied { background: rgba(34,197,94,0.12); color: var(--success); border-color: rgba(34,197,94,0.25); }

.upgrade-banner {
  background: linear-gradient(135deg, rgba(139,92,246,0.12) 0%, rgba(59,130,246,0.08) 100%);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.upgrade-banner p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   DOWNLOAD VIEW
═══════════════════════════════════════════════════════ */
.download-card {
  max-width: 600px;
}
.download-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.download-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(59,130,246,0.15));
  border: 1px solid rgba(139,92,246,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.download-hero-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.download-version {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.175rem 0.55rem;
  border-radius: 50px;
}
.download-btn-wrap { margin-bottom: 1.75rem; }
.download-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
}

.install-steps { display: flex; flex-direction: column; gap: 1rem; }
.install-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.25);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-body { flex: 1; }
.step-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.2rem; }
.step-desc { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.step-desc code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: 'Menlo', 'Monaco', monospace;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(139,92,246,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(59,130,246,0.07) 0%, transparent 60%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.08);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}
.login-logo svg { color: var(--accent); filter: drop-shadow(0 0 8px rgba(139,92,246,0.5)); }
.login-title {
  font-size: 1.625rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.55;
}
.form-group { margin-bottom: 1.125rem; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.form-input::placeholder { color: var(--text-dim); }
.form-error { margin-top: 0.5rem; font-size: 0.8rem; color: var(--danger); display: none; }
.form-error.visible { display: block; }
.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.login-footer a { color: var(--accent); font-weight: 500; }
.login-footer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   EMPTY / LOADING / ERROR STATES
═══════════════════════════════════════════════════════ */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  min-height: 280px;
}
.state-svg {
  margin-bottom: 1.5rem;
  opacity: 0.55;
}
.state-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.state-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; max-width: 360px; line-height: 1.6; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 25%,
    rgba(255,255,255,0.045) 50%,
    var(--surface-2) 75%
  );
  background-size: 400%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.sk-card { height: 250px; border-radius: var(--radius); }
.sk-line  { height: 14px; margin-bottom: 8px; }
.sk-line.short { width: 60%; }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.8125rem 1.125rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: toastIn 0.3s ease;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast .toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  flex-shrink: 0;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.success .toast-icon { background: rgba(34,197,94,0.15); color: var(--success); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.error   .toast-icon { background: rgba(239,68,68,0.12); color: var(--danger); }
.toast.info    { border-color: var(--border); }
.toast.info    .toast-icon { background: rgba(59,130,246,0.12); color: var(--accent-2); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   HAMBURGER & SIDEBAR OVERLAY
═══════════════════════════════════════════════════════ */
#btn-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
#btn-menu:hover { background: var(--surface-2); border-color: var(--accent); }
#btn-menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#btn-menu svg { pointer-events: none; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  animation: overlayIn 0.2s ease;
}
.sidebar-overlay.visible { display: block; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0,0,0,0.5);
  }
  .sidebar-overlay { z-index: 199; }
  .main-content { margin-left: 0; width: 100%; }
  .topbar { padding: 0 1.25rem; }
  .view-body { padding: 1.25rem; }
  .profile-grid { grid-template-columns: 1fr; }
  #btn-menu { display: inline-flex; }
}

@media (max-width: 640px) {
  .cars-grid { grid-template-columns: 1fr; }
  .topbar-title { font-size: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 1.75rem 1.5rem; }
}

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

/* ═══════════════════════════════════════════════════════
   CAR CARD — EXTENDED COMPONENTS
   (thumbnail inline, portal badge, delta, days, rimossa,
    price estimate badge, CRM select, note, checklist,
    dealer fields, link)
═══════════════════════════════════════════════════════ */

/* Inline thumbnail (used when card layout is horizontal) */
.car-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.car-thumb-placeholder {
  width: 120px;
  height: 80px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Horizontal card variant (garage list) */
.car-card.car-card--row {
  flex-direction: row;
  gap: 1rem;
  padding: 1.25rem;
  overflow: visible;
}
.car-card.rimossa {
  opacity: 0.65;
  border-color: rgba(239,68,68,0.3);
}

/* Portal badge — sidebar variant (pill style) */
.car-portal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.car-portal-badge.portal-autoscout24 { background: rgba(59,130,246,0.15); color: #3b82f6; }
.car-portal-badge.portal-subito      { background: rgba(34,197,94,0.15);  color: #22c55e; }
.car-portal-badge.portal-mobile_de   { background: rgba(245,158,11,0.15); color: #f59e0b; }
.car-portal-badge.portal-autouncle   { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.car-portal-badge.portal-default     { background: var(--surface-2); color: var(--text-muted); }

/* Price delta (extended from .car-price-delta) */
.price-delta {
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.price-delta.down { color: var(--success); }
.price-delta.up   { color: var(--danger); }

/* Days on listing pill */
.car-days {
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  display: inline-block;
  margin-top: 0.25rem;
}

/* Badge: listing removed */
.badge-rimossa {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--danger);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Badge: price estimate */
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.price-badge.green  { background: rgba(34,197,94,0.1);  color: var(--success); }
.price-badge.yellow { background: rgba(245,158,11,0.1); color: #f59e0b; }
.price-badge.red    { background: rgba(239,68,68,0.1);  color: var(--danger); }

/* CRM status select */
.stato-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
  font-family: var(--font);
}

/* Annotation textarea */
.car-nota {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  margin-top: 0.5rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.car-nota:focus { outline: none; border-color: var(--accent); }

/* Seller checklist */
.checklist-section { margin-top: 0.75rem; }
.checklist-section summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0;
  list-style: none;
  user-select: none;
}
.checklist-section summary::-webkit-details-marker { display: none; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}
.checklist-item input[type="checkbox"] { accent-color: var(--accent); }
.checklist-done {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  margin-top: 0.25rem;
}

/* Dealer fields */
.dealer-section {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.dealer-section summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0.4rem 0;
  list-style: none;
  user-select: none;
}
.dealer-section summary::-webkit-details-marker { display: none; }
.dealer-field { margin-top: 0.5rem; }
.dealer-field label {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.2rem;
}
.dealer-field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.dealer-field input:focus { outline: none; border-color: var(--accent); }
.margine-calc {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 0.5rem;
}

/* Responsive: car-card--row stacks vertically on mobile */
@media (max-width: 640px) {
  .car-card.car-card--row {
    flex-direction: column;
  }
  .car-thumb,
  .car-thumb-placeholder {
    width: 100%;
    height: 160px;
    border-radius: 8px 8px 0 0;
  }
}

/* ═══════════════════════════════════════════════════════
   GARAGE TOOLBAR & VIEW TOGGLE
═══════════════════════════════════════════════════════ */
.garage-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle-btn {
  padding: 0.4rem 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s;
  font-family: var(--font);
}
.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   GARAGE TABLE — SORTING & EXTENDED STYLES
═══════════════════════════════════════════════════════ */

/* Sortable header */
.garage-table thead th {
  cursor: pointer;
}
.garage-table thead th:hover { color: var(--text); }
.garage-table th .sort-icon {
  margin-left: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.garage-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--accent);
}

/* Thumbnail inside table */
.garage-table .td-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}

/* Horizontal scroll on mobile */
@media (max-width: 768px) {
  .garage-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .garage-table { min-width: 700px; }
}

/* ═══════════════════════════════════════════════════════
   FEATURE LOCK OVERLAY (Business+)
═══════════════════════════════════════════════════════ */
.feature-lock { position: relative; }
.feature-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
}
.feature-lock-overlay .lock-icon  { font-size: 2rem; }
.feature-lock-overlay .lock-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.feature-lock-overlay .lock-sub   { font-size: 0.875rem; color: var(--text-muted); text-align: center; max-width: 280px; }

/* ═══════════════════════════════════════════════════════
   MONITOR ANNUNCI (Business+)
═══════════════════════════════════════════════════════ */
.monitor-page {
  padding: 1.5rem;
  max-width: 900px;
}
.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.monitor-view-root {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem;
}
.monitor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.monitor-status-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.22);
}
.monitor-status-dot,
.monitor-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  background: var(--text-dim);
}
.monitor-status-dot.active,
.monitor-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(34,197,94,0.12), 0 0 14px rgba(34,197,94,0.5);
}
.monitor-dot.paused {
  background: var(--text-dim);
  box-shadow: none;
}
.monitor-kicker,
.monitor-section-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.monitor-toolbar h2 {
  margin: 0.25rem 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.monitor-toolbar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.monitor-stats {
  margin-bottom: 0;
}
.monitor-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}
.monitor-col-searches,
.monitor-col-news {
  padding: 0;
  overflow: hidden;
}
.monitor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.monitor-section-head h3 {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 800;
}
.monitor-count,
.monitor-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.24);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}
.monitor-search-card {
  margin: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--transition), background var(--transition);
}
.monitor-search-card:hover {
  border-color: rgba(139,92,246,0.38);
  background: rgba(30,37,53,0.92);
}
.monitor-search-card.paused {
  opacity: 0.72;
}
.monitor-search-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}
.monitor-search-name {
  min-width: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monitor-search-url {
  color: var(--text-dim);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.7rem;
}
.monitor-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
}
.monitor-search-actions,
.monitor-new-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.monitor-new-actions {
  grid-column: 2;
}
.monitor-empty,
.monitor-empty-news {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2rem 1.25rem;
}
.monitor-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.24);
}
.monitor-empty h4,
.monitor-empty-news h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.monitor-empty p,
.monitor-empty-news p {
  margin: 0;
  max-width: 320px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.monitor-new-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0;
}
.monitor-new-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}
.monitor-new-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.75rem;
  margin: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.monitor-new-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.22);
}
.monitor-new-body {
  min-width: 0;
}
.monitor-new-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
}
.monitor-new-price,
.monitor-new-meta,
.monitor-new-portale {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.monitor-new-price {
  color: var(--success);
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
}
.monitor-new-meta-row {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 960px) {
  .monitor-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .monitor-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .monitor-toolbar .btn {
    justify-content: center;
  }
  .monitor-search-card,
  .monitor-new-item {
    margin: 0.85rem;
  }
}

/* Saved search card */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}
.search-card:hover { border-color: rgba(139,92,246,0.4); }

.search-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-card-url {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
  margin-top: 0.25rem;
}
.search-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Search active status dot */
.search-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 5px rgba(34,197,94,0.5);
}
.search-status-dot.paused {
  background: var(--text-dim);
  box-shadow: none;
}

/* New listings detected section */
.new-listings-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.new-listing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: background var(--transition);
}
.new-listing-item:hover { background: rgba(30,37,53,0.9); }
.new-listing-badge {
  background: rgba(59,130,246,0.15);
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  white-space: nowrap;
}
.new-listing-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.new-listing-meta { font-size: 0.8rem; color: var(--text-muted); }
.new-listing-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Add-search modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlayIn 0.2s ease;
}
.modal,
.modal-box {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.62), 0 0 0 1px rgba(255,255,255,0.03);
  animation: modalIn 0.2s ease;
  overflow: visible;
}
.modal { padding: 2rem; }
.modal-box { padding: 0; }
.monitor-modal-box { max-width: 520px; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.modal-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.modal-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font: 700 1.1rem/1 var(--font);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.modal-close:hover {
  color: var(--text);
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.12);
}
.modal-box form {
  padding: 1.25rem 1.5rem 1.5rem;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Form fields inside modal */
.form-field { margin-bottom: 1rem; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-field input,
.form-field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.form-field input:focus,
.form-field select:focus { outline: none; border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.monitor-modal-box .form-group { margin-bottom: 1.05rem; }
.monitor-modal-box .form-label {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}
.monitor-modal-box .form-input {
  height: 46px;
  background: var(--surface-2);
  border-color: rgba(139,92,246,0.24);
  border-radius: 10px;
}
.monitor-modal-box .form-input:hover { border-color: rgba(139,92,246,0.42); }
.monitor-modal-box .form-hint {
  margin-top: 0.45rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.45;
}
.monitor-modal-box .form-error {
  display: block;
  min-height: 1rem;
  color: var(--danger);
  font-weight: 600;
}
.monitor-modal-box .modal-actions .btn {
  min-width: 92px;
  justify-content: center;
}
.monitor-portal-dropdown,
.monitor-portal-dropdown .acp-dropdown-trigger {
  width: 100%;
}
.monitor-portal-dropdown .acp-dropdown-trigger {
  height: 46px;
  background: var(--surface-2);
  border-color: rgba(139,92,246,0.24);
  border-radius: 10px;
  font-weight: 700;
}
.monitor-portal-dropdown .acp-dropdown-trigger:hover {
  border-color: rgba(139,92,246,0.5);
}
.monitor-portal-dropdown .acp-dropdown-menu {
  z-index: 1002;
  background: #151c2d;
  border-color: rgba(139,92,246,0.28);
}

/* Monitor lock page (insufficient plan) */
.monitor-lock-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}
.monitor-lock-icon { font-size: 3rem; }
.monitor-lock-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.monitor-lock-sub   { color: var(--text-muted); max-width: 400px; line-height: 1.6; }

/* Monitor responsive */
@media (max-width: 640px) {
  .monitor-page { padding: 1rem; }
  .search-card-url { max-width: 220px; }
  .new-listing-item { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════
   NOTIFICATIONS — EXTENDED ICON TYPES
═══════════════════════════════════════════════════════ */

/* Additional icon type variants (extends existing .notif-icon) */
.notif-icon.price-drop      { background: rgba(34,197,94,0.1);  color: var(--success); }
.notif-icon.listing-removed { background: rgba(239,68,68,0.1);  color: var(--danger); }
.notif-icon.new-listing     { background: rgba(59,130,246,0.1); color: var(--accent-2); }

/* Notifications toolbar */
.notif-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.notif-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR — NAV BADGE (for Monitor unread count)
═══════════════════════════════════════════════════════ */
.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 50px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
  box-shadow: 0 0 6px rgba(139,92,246,0.45);
}

/* ─── Pipeline CRM (Kanban) ──────────────────────────────────────── */
.pipeline-view-root { display: flex; flex-direction: column; gap: 1.25rem; }

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
}
.pipeline-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pipeline-stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.pipeline-stat-value { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.pipeline-stat-value.pos { color: var(--success); }
.pipeline-stat-value.neg { color: var(--danger); }
.pipeline-stat-sub { font-size: 0.7rem; color: var(--text-dim); }

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.pipeline-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.pipeline-col-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  border-top: 2px solid var(--stage-color, var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
}
.pipeline-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pipeline-col-title { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.pipeline-col-count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 50px;
  padding: 0.05rem 0.45rem;
  min-width: 20px;
  text-align: center;
}
.pipeline-col-body {
  flex: 1;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: background var(--transition);
}
.pipeline-col-body.drop-hover {
  background: rgba(139, 92, 246, 0.08);
  outline: 1px dashed var(--accent);
  outline-offset: -4px;
}
.pipeline-col-empty {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem 0;
}

.pipeline-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.pipeline-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.3); transform: translateY(-1px); }
.pipeline-card.dragging { opacity: 0.45; cursor: grabbing; }
.pipeline-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pipeline-card-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pipeline-card-chip {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
}
.pipeline-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.pipeline-card-margin { font-size: 0.78rem; font-weight: 700; }
.pipeline-card-margin.pos { color: var(--success); }
.pipeline-card-margin.neg { color: var(--danger); }
.pipeline-card-margin.muted { color: var(--text-dim); font-weight: 600; font-size: 0.7rem; }
.pipeline-card-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0 0.2rem;
  cursor: pointer;
}
.pipeline-card-link:hover { color: var(--accent); }

@media (max-width: 900px) {
  .pipeline-summary { grid-template-columns: 1fr; }
  .pipeline-board { grid-template-columns: repeat(6, minmax(160px, 1fr)); }
}

/* ─── Garage: toolbar (ricerca + filtri) ──────────────────────────── */
.garage-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.garage-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 0.85rem;
}
.garage-search svg { color: var(--text-dim); flex-shrink: 0; width: 16px; height: 16px; }
.garage-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.65rem 0;
}
.garage-search input::placeholder { color: var(--text-dim); }
.garage-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0 0.85rem;
  cursor: pointer;
  outline: none;
}
.garage-select:focus { border-color: var(--accent); }

/* ─── Garage card: nota + checklist + CRM dealer ──────────────────── */
.car-nota-wrap { padding: 0 0.9rem 0.75rem; }
.car-nota {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0.5rem 0.6rem;
  resize: vertical;
  outline: none;
}
.car-nota:focus { border-color: var(--accent); }
.car-nota::placeholder { color: var(--text-dim); }

.car-crm {
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}
.car-crm > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}
.car-crm > summary::-webkit-details-marker { display: none; }
.car-crm > summary svg { width: 14px; height: 14px; }
.car-crm > summary:hover { color: var(--text); }
.car-crm[open] > summary { color: var(--accent); }
.car-crm-body { padding: 0.25rem 0.9rem 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }

.car-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
}
.car-check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.car-crm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
}
.car-crm-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  min-width: 0; /* permette alla cella grid di restringersi sotto il contenuto */
}
.car-crm-input {
  width: 100%;
  min-width: 0;       /* gli input (specie type=date) altrimenti sbordano dalla cella */
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  outline: none;
  /* Fa rendere al browser il datepicker nativo in tema scuro (calendario +
     icona indicatore), invece del popup bianco di default. */
  color-scheme: dark;
}
.car-crm-input:focus { border-color: var(--accent); }

/* ─── Datepicker custom (tema scuro) ─────────────────────────────── */
.dp-wrap { width: 100%; }
.dp-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
  width: 100%; cursor: pointer; text-align: left;
}
.dp-trigger .dp-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-trigger .dp-placeholder { color: var(--text-dim); }
.dp-trigger svg { color: var(--text-dim); flex-shrink: 0; }
.dp-trigger:hover svg { color: var(--accent); }
.dp-popup {
  position: absolute; z-index: 1000; width: 260px;
  background: var(--surface); border: 1px solid rgba(139,92,246,0.35);
  border-radius: 12px; box-shadow: 0 14px 38px rgba(0,0,0,0.55);
  padding: 0.75rem; user-select: none;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.dp-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.dp-nav { display: flex; gap: 0.25rem; }
.dp-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.dp-arrow:hover { color: var(--accent); border-color: rgba(139,92,246,0.5); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { margin-bottom: 0.25rem; }
.dp-dow-cell { text-align: center; font-size: 0.66rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; padding: 0.2rem 0; }
.dp-day {
  display: flex; align-items: center; justify-content: center;
  height: 30px; border-radius: 7px; font-size: 0.8rem; color: var(--text);
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.dp-day:hover { background: rgba(139,92,246,0.16); }
.dp-day.dp-out { color: var(--text-dim); opacity: 0.45; cursor: default; }
.dp-day.dp-out:hover { background: transparent; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1px rgba(139,92,246,0.5); color: var(--accent); font-weight: 700; }
.dp-day.dp-sel { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--border); }
.dp-link { background: none; border: none; cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); font-family: var(--font); padding: 0.2rem 0.3rem; border-radius: 5px; }
.dp-link:hover { color: var(--accent); }
.dp-today-btn { color: var(--accent); }
.car-crm-margin { font-size: 0.95rem; font-weight: 800; color: var(--text); padding: 0.35rem 0; }
.car-crm-margin.pos { color: var(--success); }
.car-crm-margin.neg { color: var(--danger); }

/* ─── Garage: layout 2 colonne (liste + griglia) ──────────────────── */
.garage-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }
.garage-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }
.garage-side-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}
.garage-side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.6rem;
}
.garage-side-add {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--success); font-size: 1rem; line-height: 1; cursor: pointer;
}
.garage-side-add:hover { border-color: var(--success); }
.garage-list-rows, .garage-alert-rows { display: flex; flex-direction: column; gap: 0.3rem; }
.garage-list-row {
  display: flex; align-items: center; gap: 0.4rem; width: 100%;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 8px;
  padding: 0.5rem 0.6rem; color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; text-align: left;
}
.garage-list-row:hover { border-color: var(--border); color: var(--text); }
.garage-list-row.active { background: rgba(139,92,246,0.12); color: var(--accent); border-color: rgba(139,92,246,0.3); }
.garage-list-row span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.garage-list-row small { color: var(--text-dim); font-weight: 700; }
.garage-list-del { color: var(--text-dim); font-size: 1rem; padding: 0 0.2rem; }
.garage-list-del:hover { color: var(--danger); }
.garage-side-empty { color: var(--text-dim); font-size: 0.78rem; padding: 0.5rem 0.2rem; }
.garage-list-create, .garage-alert-create { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.garage-list-create input, .garage-alert-create input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 0.82rem; padding: 0.45rem 0.55rem; outline: none;
}
.garage-list-create input:focus, .garage-alert-create input:focus { border-color: var(--accent); }
.btn-xs { padding: 0.35rem 0.7rem; font-size: 0.78rem; border-radius: 7px; }
.garage-alert-row {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border-radius: 8px; padding: 0.45rem 0.6rem;
}
.garage-alert-row a { flex: 1; color: var(--text-muted); font-size: 0.8rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.garage-alert-row a:hover { color: var(--accent); }
.garage-alert-del { color: var(--text-dim); font-size: 1rem; cursor: pointer; padding: 0 0.2rem; }
.garage-alert-del:hover { color: var(--danger); }

/* ─── Garage card: price signal, badge rimossa, storico, chip liste ── */
.car-price-signal {
  font-size: 0.72rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: 6px;
}
.car-price-signal.good { background: rgba(34,197,94,0.16); color: var(--success); }
.car-price-signal.fair { background: rgba(234,179,8,0.16); color: var(--warning); }
.car-price-signal.high { background: rgba(239,68,68,0.16); color: var(--danger); }
.car-price-signal.conditions { background: rgba(148,163,184,0.16); color: #94a3b8; }
.car-badge-rimossa {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(239,68,68,0.92); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 0.15rem 0.5rem; border-radius: 6px;
}
.car-price-history {
  font-size: 0.72rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.5;
  border-top: 1px solid var(--border); padding-top: 0.5rem;
}
.car-price-history .ph-label { font-weight: 700; color: var(--text-dim); text-transform: uppercase; font-size: 0.65rem; }
.car-price-history .ph-date { color: var(--text-dim); }
.car-price-history .ph-arrow { color: var(--accent); }
.car-playlist-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.9rem; }
.car-chip-pl {
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 50px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
}
.car-chip-pl:hover { color: var(--text); }
.car-chip-pl.active { background: rgba(139,92,246,0.16); color: var(--accent); border-color: rgba(139,92,246,0.35); }

@media (max-width: 900px) {
  .garage-layout { grid-template-columns: 1fr; }
  .garage-side { position: static; }
}

/* ─── Dropdown nativi (select) — look dashboard, niente stile OS ───── */
.garage-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  height: 40px;
}
.garage-select option {
  background: var(--surface-2);
  color: var(--text);
}

/* ─── Checkbox moderni (checklist venditore) ──────────────────────── */
.car-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition);
  margin: 0;
}
.car-check input[type="checkbox"]:hover { border-color: var(--accent); }
.car-check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.car-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1.5px;
  width: 4px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.car-check { transition: color var(--transition); }
.car-check:hover { color: var(--text); }

/* Aggiungi-a-lista da card: menu rapido */
.car-addlist-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.2rem 0.6rem; color: var(--text-muted);
}
.car-addlist-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Menu "+ Lista" a comparsa ───────────────────────────────────── */
.addlist-menu {
  position: absolute;
  z-index: 2000;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.addlist-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.55rem; border-radius: 7px;
  font-size: 0.82rem; color: var(--text-muted); cursor: pointer;
}
.addlist-item:hover { background: var(--surface-2); color: var(--text); }
.addlist-item.active { color: var(--accent); }
.addlist-check { width: 14px; color: var(--accent); font-weight: 800; }
.addlist-sep { height: 1px; background: var(--border); margin: 0.25rem 0; }
.addlist-new { display: flex; gap: 0.35rem; padding: 0.2rem; }
.addlist-input {
  flex: 1; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 0.8rem; padding: 0.4rem 0.5rem; outline: none;
}
.addlist-input:focus { border-color: var(--accent); }
.addlist-create {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 7px; font-size: 0.78rem; font-weight: 700;
  padding: 0 0.7rem; cursor: pointer;
}

/* ─── Dropdown custom (toolbar garage: stato + sort) ──────────────── */
.acp-dropdown { position: relative; }
.acp-dropdown-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  min-width: 150px; height: 40px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 0.85rem; font-weight: 500; font-family: var(--font);
  padding: 0 0.85rem; cursor: pointer; transition: border-color var(--transition);
}
.acp-dropdown-trigger:hover { border-color: rgba(139,92,246,0.5); }
.acp-dropdown-trigger svg { color: var(--text-dim); transition: transform var(--transition); flex-shrink: 0; }
.acp-dropdown.open .acp-dropdown-trigger { border-color: var(--accent); }
.acp-dropdown.open .acp-dropdown-trigger svg { transform: rotate(180deg); }
.acp-dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45); padding: 0.3rem;
  display: none; flex-direction: column; gap: 0.1rem;
  max-height: 280px; overflow-y: auto;
}
.acp-dropdown.open .acp-dropdown-menu { display: flex; }
.acp-dropdown-opt {
  padding: 0.5rem 0.6rem; border-radius: 7px; font-size: 0.85rem;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.acp-dropdown-opt:hover { background: var(--surface-2); color: var(--text); }
.acp-dropdown-opt.active { background: rgba(139,92,246,0.14); color: var(--accent); font-weight: 600; }

/* ─── Bottone rimuovi auto ─────────────────────────────────────────── */
/* Azioni card impilate full-width: Apri annuncio / Scheda PDF / Rimuovi,
   ognuna su una riga intera. Sempre leggibili, nessuna compressione. */
.car-actions {
  display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch;
  padding: 0.7rem 0.875rem; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
.car-actions .btn-link,
.car-actions .btn-export-scheda,
.car-actions .btn-remove-car {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; box-sizing: border-box;
  border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  padding: 0.5rem 0.7rem; cursor: pointer; font-family: var(--font);
  white-space: nowrap; transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.car-actions .btn-link {
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.car-actions .btn-link:hover { color: var(--accent); border-color: rgba(139,92,246,0.45); background: rgba(139,92,246,0.06); }
.car-actions .btn-export-scheda {
  background: rgba(139,92,246,0.12); color: var(--accent);
  border: 1px solid rgba(139,92,246,0.3);
}
.car-actions .btn-export-scheda:hover { background: rgba(139,92,246,0.2); }
.car-actions .btn-remove-car {
  background: rgba(239,68,68,0.1); color: var(--danger);
  border: 1px solid rgba(239,68,68,0.28);
}
.car-actions .btn-remove-car:hover { background: rgba(239,68,68,0.18); }
.car-actions .btn-export-scheda:disabled,
.car-actions .btn-remove-car:disabled { opacity: 0.5; cursor: default; }

/* ─── Profilo: dispositivi-estensione collegati ───────────────────── */
.ext-dev-head { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.75rem; }
.ext-dev-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.ext-dev-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.ext-dev-info { flex: 1; min-width: 0; }
.ext-dev-name { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.ext-dev-name svg { color: var(--accent); width: 15px; height: 15px; }
.ext-dev-meta { font-size: 0.74rem; color: var(--text-dim); margin-top: 0.2rem; }
.ext-dev-disconnect { flex-shrink: 0; }

/* ─── Stato auto: campo nel body card + dropdown custom ───────────── */
.car-status-field {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.car-status-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0;
}

.status-dd { position: relative; flex: 1; min-width: 0; }
.status-dd-trigger {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.82rem; font-weight: 600; font-family: var(--font);
  padding: 0.45rem 0.6rem; cursor: pointer; transition: border-color var(--transition);
}
.status-dd-trigger:hover { border-color: rgba(139,92,246,0.5); }
.status-dd.open .status-dd-trigger { border-color: var(--accent); }
.status-dd-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dd-trigger svg { color: var(--text-dim); flex-shrink: 0; transition: transform var(--transition); }
.status-dd.open .status-dd-trigger svg { transform: rotate(180deg); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dd-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 0.3rem;
  display: none; flex-direction: column; gap: 0.1rem;
}
.status-dd.open .status-dd-menu { display: flex; }
.status-dd-opt {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.55rem; border-radius: 7px; font-size: 0.82rem;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.status-dd-opt:hover { background: var(--surface-2); color: var(--text); }
.status-dd-opt.active { background: rgba(139,92,246,0.12); color: var(--accent); font-weight: 600; }

/* Tabella: celle stato + nota + azioni */
.garage-table td.td-status { min-width: 150px; }
.garage-table td.td-nota { min-width: 160px; }
.table-nota {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 0.8rem; padding: 0.4rem 0.5rem; outline: none;
}
.table-nota:focus { border-color: var(--accent); }
.garage-table td.td-actions { display: flex; gap: 0.3rem; white-space: nowrap; }
.table-remove:hover { color: var(--danger); }

/* Status dropdown: quando in fixed (tabella), z-index sopra tutto */
.status-dd-menu[style*="fixed"] { z-index: 3000; }
/* Righe tabella non più clickabili (annuncio solo dal pulsante) */
.garage-table tbody tr { cursor: default; }
.garage-table td.td-actions a.btn-ghost { gap: 0.35rem; }

/* ─── Calcolatore costi accessori (/costi) ───────────────────────── */
.costi-wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.costi-form { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.costi-row { display: flex; gap: 1rem; }
.costi-row-2 > * { flex: 1; }
.costi-row-3 > * { flex: 1; }
.costi-field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.costi-field > span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.costi-field select, .costi-field input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 0.6rem 0.75rem;
  font-size: 0.9rem; font-family: var(--font); transition: border-color var(--transition);
}
.costi-field select:focus, .costi-field input:focus { outline: none; border-color: var(--accent); }
.costi-result { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.costi-empty { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 1.5rem 0; }
.costi-section-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 0.5rem; }
.costi-line { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; font-size: 0.9rem; color: var(--text); }
.costi-line span { color: var(--text-dim); }
.costi-line b { font-weight: 700; }
.costi-total { border-top: 1px solid var(--border); margin-top: 0.3rem; padding-top: 0.6rem; }
.costi-total b { color: var(--text); }
.costi-firstyear { border-top: 2px solid var(--accent); padding-top: 0.8rem; }
.costi-grand span { color: var(--text); font-weight: 700; }
.costi-grand b { color: var(--accent); font-size: 1.15rem; }
.costi-disclaimer { font-size: 0.72rem; color: var(--text-dim); line-height: 1.5; margin: 0; padding: 0 0.25rem; }
@media (max-width: 640px) { .costi-row { flex-direction: column; } }

/* ─── Confronto affiancato (/confronto) ──────────────────────────── */
.confronto-wrap { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.confronto-picker { padding: 1.1rem 1.25rem; }
.confronto-picker-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.75rem; }
.confronto-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.confronto-chip {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 0.45rem 0.9rem; font-size: 0.82rem; cursor: pointer;
  font-family: var(--font); transition: all var(--transition); max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.confronto-chip:hover:not(:disabled) { border-color: var(--accent); }
.confronto-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.confronto-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.confronto-hint { padding: 1.5rem; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.confronto-table-wrap { padding: 0.5rem; overflow-x: auto; }
.confronto-table { width: 100%; border-collapse: collapse; }
.confronto-table th, .confronto-table td { padding: 0.7rem 0.9rem; text-align: center; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
.confronto-table thead th { font-weight: 700; color: var(--text); font-size: 0.82rem; }
.confronto-rowlabel { text-align: left !important; font-weight: 700; color: var(--text-dim); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.04em; white-space: nowrap; }
.confronto-best { background: rgba(34,197,94,0.12); color: var(--success); font-weight: 700; border-radius: 6px; }
.confronto-note { font-size: 0.72rem; color: var(--text-dim); padding: 0.5rem 0.9rem 0.2rem; margin: 0; }
.confronto-note a { color: var(--accent); }

/* --- Report dashboard (/report) ------------------------------------- */
.report-wrap {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.report-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.report-kicker,
.report-section-label,
.report-lock-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.report-header-row h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0.25rem 0 0.35rem;
  letter-spacing: -0.01em;
}
.report-header-row p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.report-stats {
  margin-bottom: 0;
}
.report-filter-card {
  padding: 0;
  overflow: visible;
}
.report-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
}
.report-filter-head h3 {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 800;
}
.report-period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 1rem 1.35rem 0;
}
.report-period-btn {
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.report-period-btn:hover {
  color: var(--text);
  border-color: rgba(139,92,246,0.4);
}
.report-period-btn.active {
  color: #fff;
  border-color: rgba(139,92,246,0.7);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(99,102,241,0.22);
}
.report-calendar-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.85rem;
  padding: 1rem 1.35rem 1.35rem;
}
.report-date-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.report-date-field span {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.report-date-field input {
  width: 100%;
  height: 42px;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(139,92,246,0.24);
  background: var(--surface-2);
  color: var(--text);
  color-scheme: dark;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.report-date-field input:hover {
  border-color: rgba(139,92,246,0.42);
}
.report-date-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.report-section {
  padding: 0;
  overflow: hidden;
}
.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--border);
}
.report-section-head h3 {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 800;
}
.report-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.24);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.report-table-wrap {
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.report-table th,
.report-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.86rem;
}
.report-table th {
  color: var(--text-dim);
  background: rgba(139,92,246,0.055);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-table tbody tr:hover {
  background: rgba(139,92,246,0.045);
}
.report-table tbody tr:last-child td {
  border-bottom: none;
}
.report-title-cell {
  font-weight: 700;
  color: var(--text);
  max-width: 360px;
}
.report-old-price {
  color: var(--text-dim);
  text-decoration: line-through;
}
.report-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.report-delta.down {
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.22);
}
.report-delta.up {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.22);
}
.report-empty-row {
  text-align: center !important;
  color: var(--text-dim);
  padding: 1.4rem !important;
}
.report-lock {
  max-width: 680px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(59,130,246,0.08));
}
.report-lock-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
}
.report-lock h3 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 800;
}
.report-lock p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.9rem;
}
@media (max-width: 720px) {
  .report-header-row {
    flex-direction: column;
  }
  .report-header-row .btn {
    width: 100%;
    justify-content: center;
  }
  .report-lock {
    flex-direction: column;
  }
  .report-calendar-row {
    grid-template-columns: 1fr;
  }
}
@media print {
  body {
    background: #fff !important;
    color: #111827 !important;
  }
  .sidebar,
  .topbar,
  .sidebar-overlay,
  .report-filter-card,
  .report-header-row .btn {
    display: none !important;
  }
  .dashboard-layout,
  .main-content,
  .view-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .report-wrap {
    max-width: none;
  }
  .card,
  .stat-card,
  .report-section {
    background: #fff !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
    box-shadow: none !important;
  }
  .report-header-row p,
  .stat-label,
  .stat-sub,
  .report-table th {
    color: #4b5563 !important;
  }
  .stat-value,
  .report-title-cell,
  .report-section-head h3 {
    color: #111827 !important;
  }
  .report-table th {
    background: #f3f4f6 !important;
  }
}

/* ─── Dropdown custom nel calcolatore costi: full width nel field ──── */
.costi-field .acp-dropdown.costi-dd { width: 100%; }
.costi-field .acp-dropdown.costi-dd .acp-dropdown-trigger { width: 100%; min-width: 0; }
.costi-field .acp-dropdown.costi-dd .acp-dropdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* (Lo stile di .btn-export-scheda è definito dentro .car-actions, vedi sopra) */

/* ─── Team / postazioni (seat usage) ──────────────────────────────── */
.team-seats { margin-bottom: 0.85rem; }
.team-seats-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.team-seats-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.team-seats-count { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.team-seats-bar { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.team-seats-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; transition: width 0.3s ease; }
.ext-dev-name { display: inline-flex; align-items: center; gap: 0.4rem; }
.ext-dev-rename {
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 0.85rem; padding: 0 0.2rem; border-radius: 4px; line-height: 1;
}
.ext-dev-rename:hover { color: var(--accent); background: rgba(139,92,246,0.12); }

/* ─── Widget feedback (FAB + modale) ──────────────────────────────── */
#fb-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(139,92,246,0.45); transition: transform 0.15s ease, box-shadow 0.2s ease;
}
#fb-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 26px rgba(139,92,246,0.55); }
.fb-overlay {
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: rgba(2,6,23,0.7); backdrop-filter: blur(4px); padding: 16px;
}
.fb-card {
  width: 100%; max-width: 560px; background: var(--surface);
  border: 1px solid rgba(139,92,246,0.35); border-radius: 18px; overflow: hidden;
}
.fb-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.6rem; font-size: 1.15rem; font-weight: 800; border-bottom: 1px solid var(--border); }
.fb-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.2rem; }
.fb-close:hover { color: var(--text); }
.fb-body { padding: 1.6rem; }
.fb-types { display: flex; gap: 0.6rem; margin-bottom: 1.1rem; }
.fb-type {
  flex: 1; padding: 0.7rem 0.5rem; border-radius: 10px; cursor: pointer; font-size: 0.88rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-family: var(--font);
}
.fb-type.active { background: rgba(139,92,246,0.18); border-color: var(--accent); color: var(--accent); }
.fb-textarea {
  width: 100%; box-sizing: border-box; min-height: 200px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: var(--font); font-size: 0.98rem; line-height: 1.6; padding: 1rem; outline: none;
}
.fb-textarea:focus { border-color: var(--accent); }
.fb-hint { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.8rem; line-height: 1.5; }
.fb-foot { display: flex; justify-content: flex-end; gap: 0.7rem; padding: 0 1.6rem 1.6rem; }
.fb-cancel, .fb-send { padding: 0.7rem 1.5rem; border-radius: 10px; font-size: 0.92rem; font-weight: 700; cursor: pointer; font-family: var(--font); }
.fb-cancel { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.fb-cancel:hover { color: var(--text); }
.fb-send { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.fb-send:disabled { opacity: 0.6; cursor: default; }

/* ─── Pagina Aiuto e community ────────────────────────────────────── */
.aiuto-wrap { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.aiuto-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 0.5rem; }
.aiuto-head p { color: var(--text-muted); font-size: 0.98rem; max-width: 580px; line-height: 1.6; }
.aiuto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.aiuto-card {
  display: flex; flex-direction: column; gap: 0.85rem; padding: 1.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.aiuto-card-soon { opacity: 0.7; }
.aiuto-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; }
.aiuto-icon.aiuto-discord { background: linear-gradient(135deg,#5865F2,#404eed); }
.aiuto-icon.aiuto-ig { background: linear-gradient(135deg,#f58529,#dd2a7b,#8134af); }
.aiuto-icon.aiuto-email { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.aiuto-card-body { flex: 1; }
.aiuto-card-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.aiuto-card-body p { color: var(--text-muted); font-size: 0.86rem; line-height: 1.55; }
.aiuto-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1rem; border-radius: 9px; font-size: 0.85rem; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none; font-family: var(--font);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.aiuto-btn.aiuto-discord { background: rgba(88,101,242,0.15); border-color: rgba(88,101,242,0.4); color: #aab4ff; }
.aiuto-btn.aiuto-discord:hover { background: rgba(88,101,242,0.25); }
.aiuto-btn.aiuto-ig { background: rgba(221,42,123,0.12); border-color: rgba(221,42,123,0.4); color: #f7a8cf; }
.aiuto-btn.aiuto-ig:hover { background: rgba(221,42,123,0.22); }
.aiuto-btn.aiuto-email { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.35); color: var(--accent); }
.aiuto-btn.aiuto-email:hover { background: rgba(139,92,246,0.2); }
.aiuto-soon { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; padding: 0.6rem 0; }
.aiuto-feedback { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; flex-wrap: wrap; }
.aiuto-feedback h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.aiuto-feedback p { color: var(--text-muted); font-size: 0.86rem; }
.aiuto-fb-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; flex-shrink: 0; }
