.sidebar-header {
  display: none;
}
.sidebar-brand {
  display: none;
}

:root {
  --bg: #060a10;
  --bg2: #0b1018;
  --surface: #0f1720;
  --surface2: #141e2a;
  --surface3: #1a2535;
  --surface4: #1f2d3d;

  --accent: #00c4a3;
  --accent2: #00a98c;
  --accent3: #008f76;
  --accent-dim: rgba(0, 196, 163, 0.07);
  --accent-glow: rgba(0, 196, 163, 0.18);

  --blue-steel: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.08);

  --text: #edf2f7;
  --text2: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #334155;

  --border: rgba(0, 196, 163, 0.14);
  --border2: rgba(255, 255, 255, 0.055);
  --border3: rgba(255, 255, 255, 0.028);
  --border-h: rgba(255, 255, 255, 0.09);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.09);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.09);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.09);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.09);
  --pink: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.09);

  --radius: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-xs: 5px;

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-accent: 0 4px 20px rgba(0, 196, 163, 0.14);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --snappy: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --sidebar-w: 248px;
  --header-h: 54px;

  --glass-bg: rgba(9, 13, 18, 0.88);
  --glass-blur: blur(8px) saturate(1.5);
  --dropdown-bg: rgba(15, 23, 32, 0.92);
  --dropdown-border: var(--border2);
  --dropdown-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

html.light-mode {
  --bg: #f5f7fa;
  --bg2: #edf2f7;
  --surface: #ffffff;
  --surface2: #ffffff;
  --surface3: #f8fafc;
  --surface4: #f8fafc;

  --accent: #00c4a3;
  --accent2: #00a98c;
  --accent3: #008f76;
  --accent-dim: rgba(0, 196, 163, 0.12);
  --accent-glow: rgba(0, 196, 163, 0.22);

  --text: #1a202c;
  --text2: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --border: rgba(0, 196, 163, 0.2);
  --border2: rgba(15, 23, 42, 0.12);
  --border3: rgba(15, 23, 42, 0.08);
  --border-h: rgba(15, 23, 42, 0.2);

  --blue-dim: rgba(59, 130, 246, 0.11);
  --green-dim: rgba(16, 185, 129, 0.16);
  --red-dim: rgba(239, 68, 68, 0.16);
  --orange-dim: rgba(249, 115, 22, 0.16);
  --purple-dim: rgba(139, 92, 246, 0.16);
  --pink-dim: rgba(236, 72, 153, 0.16);

  --shadow-xs:
    0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 1px rgba(15, 23, 42, 0.05);
  --shadow-sm:
    0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md:
    0 12px 28px rgba(15, 23, 42, 0.1), 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg:
    0 24px 60px rgba(15, 23, 42, 0.12), 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-accent: 0 6px 20px rgba(0, 196, 163, 0.18);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --glass-bg: rgba(245, 247, 250, 0.88);
  --dropdown-bg: rgba(255, 255, 255, 0.96);
  --dropdown-border: rgba(15, 23, 42, 0.14);
  --dropdown-shadow:
    0 12px 30px -8px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.9);
}

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

html {
  height: 100%;
}

body {
  font-family:
    "Sora",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14.5px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 800px 500px at -5% -5%,
      rgba(0, 196, 163, 0.055) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 500px 400px at 105% 105%,
      rgba(59, 130, 246, 0.03) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

html.light-mode body::before {
  background:
    radial-gradient(
      ellipse 800px 500px at -5% -5%,
      rgba(0, 196, 163, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 500px 400px at 105% 105%,
      rgba(59, 130, 246, 0.06) 0%,
      transparent 60%
    );
}

html.light-mode body::after {
  background-image: radial-gradient(
    circle,
    rgba(15, 23, 42, 0.04) 1px,
    transparent 1px
  );
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface4);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

::selection {
  background: rgba(0, 196, 163, 0.2);
  color: var(--text);
}

@media (min-width: 1024px) {
  #app-container {
    display: grid !important;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas:
      "sidebar header"
      "sidebar main";
    min-height: 100dvh;
  }

  .header {
    grid-area: header !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
    max-width: none !important;
    padding-right: 32px !important;
  }

  .header .header-logo {
    display: none !important;
  }

  .bottom-nav {
    grid-area: sidebar;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px 20px;
    border-top: none;
    border-right: 1px solid var(--border2);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    justify-content: flex-start;
    gap: 2px;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    min-height: 54px;
    flex-shrink: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--border2);
    margin-bottom: 12px;
  }

  .sidebar-brand {
    display: block;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 13px;
    gap: 10px;
    border-radius: var(--radius-sm);
    text-align: left;
    font-weight: 500;
    letter-spacing: 0.05px;
    min-height: 42px;
  }

  .nav-btn .icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-btn .icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.7;
  }
  .nav-btn.active::before {
    display: none;
  }

  .nav-btn.active {
    background: linear-gradient(
      135deg,
      rgba(0, 196, 163, 0.11),
      rgba(0, 196, 163, 0.05)
    );
    border: 1px solid rgba(0, 196, 163, 0.22);
    color: var(--accent);
    box-shadow: var(--shadow-inset);
  }

  .nav-btn:not(.active):hover {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border3);
  }

  .bottom-nav .nav-btn {
    flex: none !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    gap: 10px !important;
    border-radius: var(--radius-sm) !important;
    text-align: left !important;
    font-weight: 500 !important;
    min-height: 42px !important;
    width: 100% !important;
  }

  .bottom-nav .nav-btn .icon {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    font-size: inherit !important;
    transform: none !important;
  }

  .bottom-nav .nav-btn .icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .bottom-nav .nav-btn.active .icon {
    transform: none !important;
  }

  .page {
    grid-area: main;
    padding: 28px 32px 52px;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    align-self: start;
  }

  .filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }

  .filters-grid .field-group {
    margin-bottom: 14px;
  }
  .filters-grid input,
  .filters-grid select {
    margin-bottom: 0;
  }

  .search-bar input {
    padding: 11px 11px 11px 42px;
  }
}

.header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border2);
  padding: 0 18px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-logo-img {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  transition: height 0.2s;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, var(--accent), var(--accent3));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow:
    0 0 0 1px rgba(0, 196, 163, 0.28),
    var(--shadow-accent);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    transparent 55%
  );
  pointer-events: none;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  font-family: "DM Mono", "JetBrains Mono", monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.logo-text span {
  color: var(--accent);
}

.logo-sub {
  font-family: "Sora", sans-serif;
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.1px;
  line-height: 1;
  margin-top: 2px;
}

.header-badge {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 11.5px;
  font-family: "DM Mono", monospace;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-inset);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .header {
    padding: 0 10px;
  }
  .header-logo-img {
    height: 26px;
    max-width: 130px;
  }
  .header-badge {
    padding: 3px 8px;
    font-size: 10.5px;
    letter-spacing: 0;
  }
  .header-actions {
    gap: 6px;
  }
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border2);
  display: flex;
  padding: 0 4px env(safe-area-inset-bottom);
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn {
  flex: 1;
  padding: 9px 6px 7px;
  border: 1px solid transparent;
  background: none;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 500;
  transition:
    color 0.22s var(--ease),
    background 0.22s var(--ease);
  position: relative;
  letter-spacing: 0.15px;
}

.nav-btn .icon {
  transition: transform 0.28s var(--spring);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn .icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
}

.nav-btn.active {
  color: var(--accent);
}
.nav-btn.active .icon {
  transform: translateY(-2px) scale(1.07);
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.nav-btn:active .icon {
  transform: scale(0.88);
}

.page {
  display: none;
  padding: 18px 14px 96px;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
  animation: pageIn 0.28s var(--ease-out);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section-title {
  font-size: 11px;
  font-family: "DM Mono", monospace;
  color: var(--text);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 15px !important;
  margin-bottom: 8px !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 1;
}

.section-title::before {
  content: "";
  width: 2px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.7;
}

.section-title:first-child {
  margin-top: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  margin-bottom: 20px;
  padding: 15px 20px;
  box-shadow: var(--shadow-xs), var(--shadow-inset);
  transition:
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
  position: relative;
}

.card:hover {
  border-color: var(--border-h);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.card.card-teal {
  border-top: 2px solid var(--accent3);
}
.card.card-red {
  border-top: 2px solid var(--red);
}
.card.card-orange {
  border-top: 2px solid var(--orange);
}

label.field-label {
  display: block;
  font-size: 10px;
  color: var(--text2);
  font-family: "Sora", sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
  opacity: 0.9;
}

input,
select {
  width: 100%;
  height: 44px;
  padding: 10px 13px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: 13.5px !important;
  outline: none;
  transition:
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    background 0.22s var(--ease);
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 12px;
  caret-color: var(--accent);
}

input:focus,
select:focus {
  border-color: rgba(0, 196, 163, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 196, 163, 0.07);
  background: var(--surface);
}

input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5) sepia(1) hue-rotate(140deg) brightness(1.1);
  cursor: pointer;
}

select option {
  background: var(--surface2);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%234a5568' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.field-group {
  margin-bottom: 2px;
}

.field-group-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 13px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.field-group-inline:hover {
  border-color: var(--border);
}

.field-group-inline .field-label {
  margin: 0;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--text2);
  font-family: "Sora", sans-serif;
  text-transform: none;
  font-weight: 500;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 0 0 0;
  appearance: checkbox;
  -webkit-appearance: checkbox;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

@media (min-width: 500px) {
  .form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    overflow: visible !important;
  }
}

.btn {
  width: 100%;
  padding: 11px 18px;
  background: linear-gradient(145deg, var(--accent), var(--accent3));
  color: #022820;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  margin-top: 4px;
  box-shadow:
    0 4px 14px rgba(0, 196, 163, 0.2),
    var(--shadow-inset);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.1px;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    transparent 55%
  );
  opacity: 1;
  pointer-events: none;
}

.btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 196, 163, 0.26);
}
.btn:active {
  transform: scale(0.97) translateY(0);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-inset);
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--surface3);
  border-color: rgba(0, 196, 163, 0.28);
  color: var(--accent);
  filter: none;
  box-shadow: var(--shadow-inset);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.16);
  box-shadow: none;
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.32);
  filter: none;
  transform: none;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 14px 12px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs), var(--shadow-inset);
  transition:
    transform 0.25s var(--spring),
    border-color 0.22s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-h);
}

/* Top accent line */
.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.45;
}

.stat-card:nth-child(3)::after {
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.stat-num {
  font-family: "DM Mono", monospace;
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vehicle-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    transform 0.22s var(--ease);
  animation: slideIn 0.32s var(--ease) both;
  box-shadow: var(--shadow-xs);
}

.vehicle-item:hover {
  border-color: var(--border-h);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.vehicle-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-icon.ok {
  background: rgba(0, 196, 163, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 196, 163, 0.14);
}
.vehicle-icon.warn {
  background: rgba(249, 115, 22, 0.08);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.14);
}
.vehicle-icon.expired {
  background: rgba(239, 68, 68, 0.08);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.vehicle-icon svg {
  stroke: currentColor;
  stroke-width: 1.7;
  width: 18px;
  height: 18px;
}
.vehicle-icon.ok svg {
  color: var(--accent);
}
.vehicle-icon.warn svg {
  color: var(--orange);
}
.vehicle-icon.expired svg {
  color: var(--red);
}

.vehicle-info {
  flex: 1;
  min-width: 0;
}

.vehicle-targa {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.vehicle-model {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vehicle-model svg {
  display: inline;
  vertical-align: -2px;
  stroke: currentColor;
  stroke-width: 1.7;
}

.vehicle-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.badge {
  font-size: 10px;
  font-family: "DM Mono", monospace;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.ok {
  background: rgba(0, 196, 163, 0.09);
  color: var(--accent);
  border: 1px solid rgba(0, 196, 163, 0.18);
}
.badge.warn {
  background: var(--orange-dim);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.18);
}
.badge.neutral {
  background: var(--surface3);
  color: var(--text-muted);
  border: 1px solid var(--border2);
}

.badge.expired {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.18);
  animation: pulse-badge 2.5s ease infinite;
}

@keyframes pulse-badge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }
}

.progress-bar {
  width: 100%;
  height: 2.5px;
  background: var(--surface4);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.55s var(--ease);
}
.progress-fill.ok {
  background: linear-gradient(90deg, var(--accent3), var(--accent));
}
.progress-fill.warn {
  background: linear-gradient(90deg, var(--orange), #fbbf24);
}
.progress-fill.expired {
  background: linear-gradient(90deg, var(--red), #f87171);
}

.empty-state {
  text-align: center;
  padding: 44px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  background: var(--surface2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border2);
}

.empty-state .empty-icon svg {
  stroke: currentColor;
  stroke-width: 1.5;
  color: var(--text-muted);
  opacity: 0.4;
}
.empty-state p {
  font-size: 13.5px;
  color: var(--text-muted);
}
.empty-state .hint {
  font-size: 11.5px;
  color: var(--text-muted);
  opacity: 0.45;
  margin-top: 5px;
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface3);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--spring);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 1024px) {
  .toast {
    bottom: 24px;
  }
}

.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-bar input {
  padding-left: 40px;
  margin-bottom: 0;
  background: var(--surface);
  font-size: 13.5px !important;
  border-radius: var(--radius-sm);
}

.search-bar input:focus {
  background: var(--surface2);
}

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.search-bar .search-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  stroke: currentColor;
}
.search-bar:focus-within .search-icon {
  color: var(--accent);
}

.form-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text2);
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px !important;
  transition: all 0.22s var(--ease);
  box-shadow: var(--shadow-inset);
}

.form-toggle:hover {
  border-color: rgba(0, 196, 163, 0.22);
  background: var(--surface3);
  color: var(--accent);
}

.form-toggle span:first-child svg {
  vertical-align: -3px;
  stroke: currentColor;
  stroke-width: 2.5;
  color: var(--accent);
}

.form-toggle span:last-child {
  font-size: 10.5px;
  opacity: 0.45;
  transition: transform 0.22s var(--ease);
}

.form-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  margin-bottom: 0 !important;
  overflow: hidden;
  transition:
    grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    margin-bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-body > * {
  min-height: 0;
  overflow: hidden;
}

.form-body.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 12px !important;
  transform: translateY(-4px) !important;
  overflow: visible !important;
  z-index: 90; /* Sopra al contenuto della pagina ma sotto all'header (100) */
  position: relative;
}

.form-body.open > * {
  overflow: visible !important;
}

.form-body.open.visible-overflow,
.form-body.open.visible-overflow > * {
  overflow: visible !important;
}

.form-body:not(.open) {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  border: none !important;
  height: 0 !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px
  );
  background-size: 32px 32px;
  pointer-events: none;
}

.login-glow-bg {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(0, 196, 163, 0.08) 0%,
    rgba(59, 130, 246, 0.03) 40%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

.login-logo {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.login-logo img {
  width: 360px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 196, 163, 0.2));
}

.login-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  z-index: 1;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form {
  background: rgba(15, 23, 32, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
}

.login-title {
  font-family: "Sora", sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

.login-form .field-label {
  color: var(--text);
  opacity: 1;
}

.input-with-icon {
  position: relative;
  margin-bottom: 12px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: all 0.2s var(--ease);
}

.input-with-icon input {
  padding-left: 42px;
  height: 44px;
  margin-bottom: 0 !important;
}

.input-with-icon:focus-within .input-icon {
  color: var(--accent);
}

.login-btn {
  margin-top: 12px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
}

.privacy-link {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.privacy-link:hover {
  color: var(--text);
}

.login-error {
  color: var(--red);
  font-size: 12.5px;
  min-height: 20px;
  text-align: center;
  margin-top: 4px;
  font-weight: 500;
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (min-width: 600px) {
  .login-container {
    max-width: 400px;
  }
}

.btn-logout {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s var(--ease);
  flex-shrink: 0;
}

.btn-logout:hover {
  border-color: rgba(239, 68, 68, 0.28);
  background: var(--red-dim);
  color: var(--red);
}
.btn-theme {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s var(--ease);
  flex-shrink: 0;
}
.btn-theme:hover {
  border-color: rgba(0, 196, 163, 0.35);
  background: var(--accent-dim);
  color: var(--accent);
}
.btn-logout:active {
  transform: scale(0.92);
}

.btn-theme:active {
  transform: scale(0.92);
}

.btn-theme .icon-sun,
.btn-theme [data-lucide="sun"] {
  display: none;
}

.btn-theme .icon-moon,
.btn-theme [data-lucide="moon"] {
  display: block;
}

.light-mode .btn-theme .icon-sun,
.light-mode .btn-theme [data-lucide="sun"] {
  display: block;
}

.light-mode .btn-theme .icon-moon,
.light-mode .btn-theme [data-lucide="moon"] {
  display: none;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent-glow);
}
.status-dot.warn {
  background: var(--orange);
  box-shadow: 0 0 5px rgba(249, 115, 22, 0.28);
}
.status-dot.neutral {
  background: var(--text-muted);
  opacity: 0.35;
}

.status-dot.expired {
  background: var(--red);
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.28);
  animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {
  0%,
  100% {
    box-shadow: 0 0 3px rgba(239, 68, 68, 0.18);
  }
  50% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  }
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  padding: 0;
  flex-shrink: 0;
}

.btn-icon svg {
  stroke: currentColor;
  stroke-width: 2;
}

.btn-icon:hover {
  border-color: rgba(0, 196, 163, 0.28);
  color: var(--accent);
  background: rgba(0, 196, 163, 0.06);
}
.btn-icon.active-mnt {
  border-color: rgba(249, 115, 22, 0.28);
  color: var(--orange);
  background: rgba(249, 115, 22, 0.08);
}

.btn-icon.danger {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.04);
}
.btn-icon.danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.btn-icon.btn-small {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  position: absolute;
  top: 6px;
  right: 6px;
}

.btn-icon.btn-small svg {
  width: 10px;
  height: 10px;
}

.commenti-panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: -4px 0 10px 0;
  animation: slideDown 0.24s var(--ease);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.commenti-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: "DM Mono", monospace;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 10px;
}

.commenti-header svg {
  stroke: currentColor;
  stroke-width: 2;
}
.commenti-header .btn-icon {
  margin-left: auto;
  width: 22px;
  height: 22px;
}

.commenti-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.commenti-form input {
  flex: 1;
  min-width: 0;
  font-size: 12.5px !important;
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 0;
}

.commenti-form .btn {
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 78px;
  margin-top: 0;
}

@media (max-width: 480px) {
  .commenti-form {
    flex-direction: column;
  }
  .commenti-form .btn {
    max-width: 100%;
    justify-content: center;
    padding: 10px;
  }
}

.commenti-lista {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.commento-item {
  position: relative;
  padding: 8px 28px 8px 11px;
  border-radius: var(--radius-xs);
  background: var(--bg2);
  border: 1px solid var(--border2);
  transition: border-color 0.2s;
}

.commento-item:hover {
  border-color: var(--border);
}

.commento-meta {
  font-size: 9.5px;
  font-family: "DM Mono", monospace;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.commento-meta svg {
  stroke: currentColor;
  stroke-width: 2;
}
.commento-testo {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.45;
}
.empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  opacity: 0.5;
}

.manutenzione-badge,
.tachigrafo-badge,
.revisione-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 5px;
  font-family: "DM Mono", monospace;
}

.manutenzione-badge {
  background: rgba(249, 115, 22, 0.12);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.18);
  animation: mntPulse 3.5s ease infinite;
}

.tachigrafo-badge {
  background: rgba(239, 68, 68, 0.11);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.18);
  animation: tachigrafoPulse 3.5s ease infinite;
}

.revisione-badge {
  background: rgba(236, 72, 153, 0.11);
  color: var(--pink);
  border: 1px solid rgba(236, 72, 153, 0.18);
  animation: revPulse 3.5s ease infinite;
}

@keyframes mntPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
@keyframes tachigrafoPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
@keyframes revPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.vehicle-item.in-manutenzione {
  border-color: rgba(249, 115, 22, 0.15);
  border-left: 3px solid var(--orange) !important;
}
.vehicle-item.tachigrafo-scaduta {
  border-color: rgba(239, 68, 68, 0.15);
  border-left: 3px solid var(--red) !important;
}
.vehicle-item.rev-scaduta {
  border-color: rgba(236, 72, 153, 0.15);
  border-left: 3px solid var(--pink) !important;
}

.vehicle-icon.rev-expired {
  background: rgba(236, 72, 153, 0.08);
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.14);
}
.vehicle-icon.rev-expired svg {
  color: var(--pink);
}

.badge.rev-expired {
  background: rgba(236, 72, 153, 0.09);
  color: var(--pink);
  border: 1px solid rgba(236, 72, 153, 0.18);
  animation: pulse-badge-rev 2.5s ease infinite;
}

.badge.tachigrafo-expired {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.18);
  animation: pulse-badge-tachigrafo 2.5s ease infinite;
}

@keyframes pulse-badge-rev {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
  }
}

@keyframes pulse-badge-tachigrafo {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }
}

.vehicle-icon svg,
.empty-icon svg {
  stroke: currentColor;
  stroke-width: 1.7;
}
.badge svg {
  display: inline;
  vertical-align: -2px;
  stroke: currentColor;
  stroke-width: 1.7;
}
.btn-danger svg {
  stroke: currentColor;
  stroke-width: 2;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.report-table th {
  background: var(--surface2);
  padding: 9px 13px;
  text-align: left;
  font-size: 9.5px;
  font-family: "DM Mono", monospace;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border2);
}

.report-table td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--border3);
  color: var(--text2);
  vertical-align: middle;
}

.report-table tr:last-child td {
  border-bottom: none;
}
.report-table tr:hover td {
  background: rgba(255, 255, 255, 0.012);
}
.report-table .font-mono {
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

@media (min-width: 1024px) {
  .page {
    padding: 28px 32px 52px;
    max-width: 860px;
  }
}

@media (min-width: 1024px) {
  .bottom-nav {
    position: fixed;
    display: flex;
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav-btn {
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
}

.vehicle-item:nth-child(1) {
  animation-delay: 0s;
}
.vehicle-item:nth-child(2) {
  animation-delay: 0.04s;
}
.vehicle-item:nth-child(3) {
  animation-delay: 0.08s;
}
.vehicle-item:nth-child(4) {
  animation-delay: 0.12s;
}
.vehicle-item:nth-child(5) {
  animation-delay: 0.16s;
}
.vehicle-item:nth-child(6) {
  animation-delay: 0.2s;
}
.vehicle-item:nth-child(7) {
  animation-delay: 0.24s;
}
.vehicle-item:nth-child(8) {
  animation-delay: 0.28s;
}
.vehicle-item:nth-child(9) {
  animation-delay: 0.32s;
}
.vehicle-item:nth-child(10) {
  animation-delay: 0.36s;
}

@media (min-width: 1024px) {
  .nav-btn[id="nav-admin"] {
    margin-top: auto;
  }

  .nav-btn[id="nav-admin"]::after {
    content: "";
    display: none;
  }
}

.report-multi-select {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.rms-trigger {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  user-select: none;
  box-shadow: var(--shadow-inset);
}

.rms-trigger:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.rms-label {
  font-size: 13.5px;
  color: var(--text); /* Più visibile (bianco) */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rms-label.placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.rms-chevron {
  color: var(--text-muted);
  transition: transform 0.25s;
}

.report-multi-select.open {
  z-index: 900; /* Assicura che stia sopra altri field-group */
}

.report-multi-select.open .rms-chevron {
  transform: rotate(180deg);
}

.rms-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 260px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  border-radius: var(--radius-md);
  box-shadow: var(--dropdown-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 999;
  display: none;
  flex-direction: column;
  animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.report-multi-select.open .rms-dropdown {
  display: flex;
}

.rms-header {
  padding: 10px;
  border-bottom: 1px solid var(--border3);
  display: flex;
  justify-content: space-between;
}

.rms-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 6px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rms-option {
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13.5px;
  color: var(--text); /* Testo bianco per le opzioni */
}

.rms-option:hover {
  background: var(--surface3);
}

.rms-option-check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: var(--surface);
}

.rms-option.active .rms-option-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.rms-option.active {
  color: #ffffff;
  background: var(--accent);
  font-weight: 600;
}

.rms-option.active .rms-option-check {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--accent);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dash-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) {
  .dash-layout-grid {
    grid-template-columns: 1fr;
  }
}

.quick-actions-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 700px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.report-kpi {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs), var(--shadow-inset);
  transition:
    border-color 0.2s,
    transform 0.2s var(--spring);
}

.report-kpi:hover {
  border-color: var(--border-h);
  transform: translateY(-1px);
}

.rk-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rk-icon svg {
  stroke: currentColor;
  stroke-width: 1.8;
}

.rk-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.15);
}
.rk-teal {
  background: rgba(0, 196, 163, 0.1);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 196, 163, 0.15);
}
.rk-orange {
  background: rgba(249, 115, 22, 0.1);
  color: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.15);
}
.rk-red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}
.rk-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-steel);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.rk-muted {
  background: var(--surface2);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border2);
}

.rk-body {
  flex: 1;
  min-width: 0;
}

.rk-value {
  font-family: "DM Mono", monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

.rk-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.report-panel-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  font-family: "Sora", sans-serif;
}

.report-panel-header svg {
  stroke: var(--accent);
  color: var(--accent);
  stroke-width: 1.8;
}

.report-panel-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border3);
  font-size: 12px;
}

.report-alert-row:last-child {
  border-bottom: none;
}

.report-alert-targa {
  font-family: "DM Mono", monospace;
  font-weight: 600;
  color: var(--text);
  font-size: 11.5px;
  min-width: 70px;
}

.report-alert-tipo {
  flex: 1;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-alert-days {
  flex-shrink: 0;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-row-mnt {
  border-left: 3px solid var(--orange) !important;
}

.mezzi-table .vehicle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mezzi-table td {
  vertical-align: middle;
}

/* Fine */
/* ── Admin Page Layout ── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-page-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-page-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    145deg,
    rgba(0, 196, 163, 0.15),
    rgba(0, 196, 163, 0.05)
  );
  border: 1px solid rgba(0, 196, 163, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow:
    0 0 18px rgba(0, 196, 163, 0.08),
    var(--shadow-inset);
  flex-shrink: 0;
}

.admin-title-text {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.admin-title-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ── Button Variants ── */
.btn-accent-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  border: 1px solid rgba(0, 196, 163, 0.35);
  background: rgba(0, 196, 163, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent);
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.15s var(--spring);
  white-space: nowrap;
  box-shadow: var(--shadow-inset);
}
.btn-accent-outline:hover {
  background: rgba(0, 196, 163, 0.15);
  border-color: rgba(0, 196, 163, 0.5);
  transform: translateY(-1px);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  border: 1px solid rgba(0, 196, 163, 0.4);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #051a14;
  transition:
    filter 0.18s,
    transform 0.15s var(--spring);
  box-shadow: 0 2px 10px rgba(0, 196, 163, 0.2);
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: "Sora", sans-serif;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ── Form Panel ── */
.admin-form-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  width: 100%;

  /* collapsed: no height, no border, no gap */
  max-height: 0;
  opacity: 0;
  border: 0px solid var(--border2);
  margin-bottom: 0;
  pointer-events: none;
  transition:
    max-height 0.35s var(--ease),
    opacity 0.25s var(--ease),
    margin-bottom 0.35s var(--ease);
}
.admin-form-panel.open {
  max-height: 900px;
  opacity: 1;
  border: 1px solid var(--border2);
  margin-bottom: 20px;
  pointer-events: auto;
  overflow: visible; /* Permette alla tendina di uscire dal pannello */
}

.admin-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
}
.admin-form-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  font-family: "Sora", sans-serif;
  letter-spacing: 0.1px;
}
.admin-form-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.admin-form-close:hover {
  background: var(--surface3);
  border-color: var(--border2);
  color: var(--text);
}

.admin-form-body {
  padding: 20px 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
@media (max-width: 540px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border3);
}

/* ── Users Section ── */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--shadow-sm);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
.admin-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  font-family: "Sora", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-count-badge {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text-muted);
}

/* Edit form inline */
.admin-form-panel.inline-edit {
  border-radius: var(--radius-sm);
  margin: 0 18px 12px;
  border-color: rgba(0, 196, 163, 0.2);
  background: rgba(0, 196, 163, 0.02);
}

/* ── Log Link ── */
.admin-log-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  box-shadow: var(--shadow-xs);
}
.admin-log-link:hover {
  background: var(--surface2);
  border-color: var(--border-h);
  color: var(--text);
}

/* ── Users Table ── */
.utenti-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.utenti-th {
  padding: 11px 16px;
  font-family: "DM Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-align: left;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.utenti-th-check {
  width: 44px;
}
.utenti-th-actions {
  text-align: right;
  width: 110px;
}

.utenti-head-row {
  background: var(--surface2);
}

.utenti-row {
  border-bottom: 1px solid var(--border3);
  transition: background 0.13s;
}
.utenti-row:last-child {
  border-bottom: none;
}
.utenti-row:hover {
  background: var(--surface2);
}
.utenti-row.open-edit {
  background: rgba(0, 196, 163, 0.03);
  box-shadow: inset 2px 0 0 var(--accent);
}

.utenti-td {
  padding: 13px 16px;
  vertical-align: middle;
}
.utenti-td-check {
  width: 44px;
}
.utenti-td-actions {
  width: 110px;
}

/* Checkbox */
.utenti-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

/* Avatar */
.utenti-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.utenti-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.utenti-crown {
  position: absolute;
  top: -6px;
  right: -4px;
  color: #f59e0b;
  display: flex;
}
.utenti-fullname {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Handle */
.utenti-handle {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* Role badge */
.utenti-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  font-family: "Sora", sans-serif;
  letter-spacing: 0.1px;
}

/* Action buttons */
.utenti-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}
.utenti-btn-edit,
.utenti-btn-delete {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.12s var(--spring);
}
.utenti-btn-edit {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  color: var(--blue-steel);
}
.utenti-btn-edit:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}
.utenti-btn-delete {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--red);
}
.utenti-btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* Mobile: collapse handle column */
@media (max-width: 540px) {
  .utenti-td-handle,
  .utenti-th:nth-child(2) {
    display: none;
  }
}

/* ── Mezzi Page Layout ── */
.mezzi-actions-bar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 15px;
}
.mezzi-actions-bar > div {
  margin: 0;
}
#mezzi-form-section {
  flex: 1.2;
}
.mezzi-actions-bar .search-bar {
  flex: 1;
}
.mezzi-actions-bar .form-toggle,
.mezzi-actions-bar #cerca-mezzo {
  margin-bottom: 0 !important;
}

@media (max-width: 600px) {
  .mezzi-actions-bar {
    flex-direction: column;
    gap: 12px;
  }
  .mezzi-actions-bar > div {
    width: 100%;
    flex: none !important;
  }
}

/* ── Finance Layout ── */
.finance-actions-bar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.finance-actions-bar .form-toggle,
.finance-actions-bar #finance-cerca {
  margin-bottom: 0 !important;
}

.finance-actions-bar > .search-bar {
  flex: 1;
}

.finance-filter-grid {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 800px) {
  .finance-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .finance-actions-bar {
    flex-direction: column;
    gap: 12px;
  }
  .finance-actions-bar > .search-bar {
    width: 100%;
  }
}

/* ── Mezzi Table Mobile Blocks ── */
@media (max-width: 600px) {
  .mezzi-table,
  .mezzi-table tbody,
  .mezzi-table tr,
  .mezzi-table td {
    display: block;
    width: 100%;
  }

  .mezzi-table thead {
    display: none;
  }

  .mezzi-table tr {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
  }

  .mezzi-table td {
    padding: 8px 0;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: right;
  }

  .mezzi-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    text-align: left;
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* Specific handling for the first cell (Vehicle) */
  .mezzi-table td:first-child {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border3) !important;
  }
  .mezzi-table td:first-child::before {
    display: none;
  }

  /* Actions row */
  .mezzi-table td:last-child {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border3) !important;
    justify-content: flex-end;
  }
  .mezzi-table td:last-child::before {
    display: none;
  }

  /* Inline Edit Row Fix */
  .mezzi-table .inline-edit-mezzo-row {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 20px;
  }
  .mezzi-table .inline-edit-mezzo-row td {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
    text-align: left !important;
  }
  .mezzi-table .inline-edit-mezzo-row td::before {
    display: none !important;
  }
  .mezzi-table .inline-edit-mezzo-row .card {
    border-radius: var(--radius-md) !important;
  }
}

/* ── Login Light Mode Refinements ── */
html.light-mode .login-form {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}
html.light-mode .login-form::before {
  opacity: 1;
}
html.light-mode .login-title {
  color: var(--text);
}
html.light-mode .login-subtitle {
  color: var(--text2);
}
html.light-mode .login-form .field-label {
  color: var(--text);
  font-weight: 600;
}
html.light-mode .input-with-icon input {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--text);
}
html.light-mode .login-btn {
  box-shadow: 0 4px 12px rgba(0, 196, 163, 0.2);
}
