/* =========================================================
   Murphy Motion • styles.css (3 themes + density toggle)
   Themes: dark | light | emerald
   Density: comfortable | compact
   ========================================================= */

:root{
  /* Default theme + density (overridden by html[data-*]) */
  --bg0:#05050a;
  --bg1:#0a0a14;

  --card:rgba(15,16,32,.88);
  --card2:rgba(20,21,50,.88);

  --text:#f5f7ff;
  --muted:#a7a9c2;

  --border:rgba(255,255,255,.09);
  --border2:rgba(255,255,255,.14);

  --accent:#5eead4;
  --accent2:#22c55e;

  --danger:#fb7185;
  --warn:#fbbf24;

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --shadow2: 0 12px 30px rgba(0,0,0,.35);

  --radius: 18px;
  --ring: 0 0 0 6px rgba(94,234,212,.10);

  /* density */
  --pad-card: 14px;
  --pad-btn-y: 10px;
  --pad-btn-x: 12px;
  --pad-input-y: 11px;
  --pad-input-x: 12px;
  --pad-td-y: 11px;
  --pad-td-x: 12px;

  --fs-h1: 26px;
  --fs-body: 15px;
  --fs-small: 13px;
}

/* =========================
   Themes (set on <html>)
   ========================= */

/* DARK */
html[data-theme="dark"]{
  --bg0:#05050a;
  --bg1:#0a0a14;

  --card:rgba(15,16,32,.88);
  --card2:rgba(20,21,50,.88);

  --text:#f5f7ff;
  --muted:#a7a9c2;

  --border:rgba(255,255,255,.09);
  --border2:rgba(255,255,255,.14);

  --accent:#5eead4;
  --accent2:#22c55e;

  --danger:#fb7185;
  --warn:#fbbf24;

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --shadow2: 0 12px 30px rgba(0,0,0,.35);
  --ring: 0 0 0 6px rgba(94,234,212,.10);
}

/* LIGHT */
html[data-theme="light"]{
  --bg0:#f6f7fb;
  --bg1:#eef1f8;

  --card:rgba(255,255,255,.78);
  --card2:rgba(255,255,255,.92);

  --text:#0e1020;
  --muted:#4c5168;

  --border:rgba(14,16,32,.10);
  --border2:rgba(14,16,32,.16);

  --accent:#0ea5e9;
  --accent2:#22c55e;

  --danger:#e11d48;
  --warn:#d97706;

  --shadow: 0 14px 34px rgba(18,24,40,.10);
  --shadow2: 0 10px 24px rgba(18,24,40,.10);
  --ring: 0 0 0 6px rgba(14,165,233,.14);
}

/* EMERALD (dark-ish, green premium) */
html[data-theme="emerald"]{
  --bg0:#04080a;
  --bg1:#071012;

  --card:rgba(10,18,20,.88);
  --card2:rgba(10,24,22,.88);

  --text:#f2fffb;
  --muted:#9bb7b0;

  --border:rgba(242,255,251,.10);
  --border2:rgba(242,255,251,.16);

  --accent:#34d399;   /* emerald */
  --accent2:#22c55e;

  --danger:#fb7185;
  --warn:#fbbf24;

  --shadow: 0 18px 60px rgba(0,0,0,.52);
  --shadow2: 0 12px 30px rgba(0,0,0,.40);
  --ring: 0 0 0 6px rgba(52,211,153,.14);
}

/* =========================
   Density (set on <html>)
   ========================= */
html[data-density="comfortable"]{
  --pad-card: 14px;
  --pad-btn-y: 10px;
  --pad-btn-x: 12px;
  --pad-input-y: 11px;
  --pad-input-x: 12px;
  --pad-td-y: 11px;
  --pad-td-x: 12px;
  --fs-body: 15px;
  --fs-small: 13px;
}
html[data-density="compact"]{
  --pad-card: 12px;
  --pad-btn-y: 8px;
  --pad-btn-x: 10px;
  --pad-input-y: 9px;
  --pad-input-x: 10px;
  /* Compact permanent, dar lizibil (fara zoom) */
  --pad-td-y: 10px;
  --pad-td-x: 12px;
  --fs-body: 14.5px;
  --fs-small: 13px;
}

/* =========================
   Base
   ========================= */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  font-size: var(--fs-body);
  background:
    radial-gradient(1200px 700px at 18% -20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    radial-gradient(900px 600px at 92% 0%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 55%),
    radial-gradient(900px 500px at 50% 120%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 65%, color-mix(in srgb, var(--bg1) 70%, #000 30%));
}

a{ color:inherit; text-decoration:none }
.container{ max-width:1360px; margin:0 auto; padding:16px; }

/* Layout mai lat pe desktop, fara a forta zoom */
@media (min-width: 1400px){
  .container{ max-width:1460px; }
}

/* Card auth modern (Profil) */
.auth-shell{
  max-width: 520px;
  margin: 22px auto;
}
.auth-card{
  overflow: hidden;
}
.auth-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.auth-tabs{
  display:flex;
  gap:8px;
  padding:8px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card2) 70%, transparent);
}
.auth-tab{
  border:0;
  cursor:pointer;
  color:var(--muted);
  padding:8px 12px;
  border-radius: 999px;
  background: transparent;
  font-weight:700;
}
.auth-tab.is-active{
  color:var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}
.auth-footlinks{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.link{
  color: color-mix(in srgb, var(--accent) 80%, var(--text));
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
}
.link:hover{ text-decoration: underline; }

/* Segmented controls (PFA/CIM, NET/BRUT) */
.segmented{
  display:inline-flex;
  gap:6px;
  padding:4px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: color-mix(in srgb, var(--card2) 70%, transparent);
}
.segmented button{
  border:0;
  cursor:pointer;
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.1;
  min-width: 58px;
}
.segmented button.is-active{
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}

/* Remove number spinners ("butoanele" din inputurile numerice) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"]{
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Password input group (toggle visibility) */
.input-group{
  position: relative;
}
.input-group .input{
  padding-right: 44px;
}
.pw-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
}
.pw-toggle:hover{
  background: rgba(90, 220, 170, .10);
  color: var(--text);
}

/* Search bar */
.search-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.search-row .input{ min-width: 260px; }

/* Stabilitate tabele cand apar texte lungi */
.table{ table-layout: fixed; }
.table td, .table th{ overflow:hidden; text-overflow: ellipsis; }
.nowrap{ white-space: nowrap; }

/* Meniu actiuni "portal" (nu mai e taiat de container) */
.menu-portal{
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  background: color-mix(in srgb, var(--card2) 92%, transparent);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 8px;
  backdrop-filter: blur(10px);
}
/* Unified <select> style (same as inputs) */
select.input, select{
  -webkit-appearance:none;
  appearance:none;
}
select.input{
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,.7) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}
html[data-theme="light"] select.input{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(14,16,32,.65) 50%),
    linear-gradient(135deg, rgba(14,16,32,.65) 50%, transparent 50%);
}

.menu-portal .menu__item{ width:100%; }
.menu-portal{ z-index: 9999; }
.menu__item{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor:pointer;
  font: inherit;
}
.menu__item:hover{ background: rgba(255,255,255,.08); border-color: var(--border2); }
html[data-theme="light"] .menu__item:hover{ background: rgba(14,16,32,.08); }
.menu__item span{ opacity:.9; }

/* Alerts */
.alert{
  border:1px solid var(--border2);
  background: color-mix(in srgb, var(--card2) 75%, transparent);
  padding:10px 12px;
  border-radius:14px;
  font-size: var(--fs-small);
}
.alert--warn{ border-color: color-mix(in srgb, var(--warn) 55%, var(--border2)); }

/* =========================
   Topbar / Nav
   ========================= */
.topbar{
  position:sticky; top:0; z-index:20;
  background: color-mix(in srgb, var(--bg0) 70%, transparent);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border);
}
html[data-theme="light"] .topbar{
  background: rgba(246,247,251,.72);
}

.topbar__inner{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}

/* Mobile nav: use hamburger + portal menu */
#mobileNavBtn{ display:none; }
@media (max-width: 820px){
  #mobileNavBtn{ display:inline-flex; }
  .nav{ display:none; }
}

/* Profile: keep it compact (similar to login card) */
.profile-page{ max-width: 760px; margin: 0 auto; }

/* Dropdowns must appear above cards/modals */
.dd__menu{ z-index: 9999; }
.modal{ overflow: visible; }

.brand{ display:flex; align-items:center; gap:12px; }
.brand__mark{
  width:44px; height:44px; border-radius:16px;
  display:grid; place-items:center;
  font-weight:950; letter-spacing:.5px;
  background:
    radial-gradient(120px 60px at 20% 10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent2) 14%, transparent));
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
}

.brand__title{ font-weight:950; line-height:1.1; letter-spacing:.2px }
.brand__subtitle{ font-size:12px; color:var(--muted); margin-top:2px }

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

.nav{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.nav__item{
  display:flex; align-items:center; gap:9px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  color:var(--muted);
  font-size:14px;
  transition: .15s ease;
}
.nav__item svg{ width:16px; height:16px; opacity:.92 }
.nav__item:hover{
  background: rgba(255,255,255,.09);
  color: var(--text);
}
html[data-theme="light"] .nav__item:hover{
  background: rgba(14,16,32,.09);
}
.nav__item.is-active{
  color: var(--text);
  background: rgba(255,255,255,.07);
  border-color: var(--border);
}
html[data-theme="light"] .nav__item.is-active{
  background: rgba(14,16,32,.09);
}
.nav__item.is-active::after{
  content:"";
  width:8px; height:8px; border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  margin-left:6px;
}
html[data-theme="light"] .nav__item.is-active::after{
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* =========================
   Page header
   ========================= */
.page-head{
  display:flex; align-items:flex-end; justify-content:space-between; gap:12px;
  padding-top:14px;
}
.page-head h1{ margin:0; font-size: var(--fs-h1); letter-spacing:.2px }
.page-head p{ margin:6px 0 0; color:var(--muted); line-height:1.45; max-width:72ch }
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.view{ margin-top:14px; display:grid; gap:14px; }

/* =========================
   Layout helpers
   ========================= */
.grid{ display:grid; gap:14px; }
.grid-2{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (max-width:900px){ .grid-2{ grid-template-columns:1fr; } }

.row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.row--between{ justify-content:space-between; }

.hr{ height:1px; background:var(--border); margin:12px 0; }

/* =========================
   Card
   ========================= */
.card{
  background:
    radial-gradient(900px 260px at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%),
    linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card__title{ font-weight:950; letter-spacing:.2px }
.card__desc{ margin-top:6px; color:var(--muted); font-size:13px; line-height:1.5 }

/* =========================
   Buttons
   ========================= */
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: var(--pad-btn-y) var(--pad-btn-x);
  border-radius: 14px;
  cursor:pointer;
  font-weight:950;
  font-size:14px;
  transition: .15s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
html[data-theme="light"] .btn{
  background: rgba(14,16,32,.05);
  box-shadow: 0 8px 16px rgba(18,24,40,.10);
}
.btn:hover{ background: rgba(255,255,255,.10); border-color: var(--border2); transform: translateY(-1px); }
html[data-theme="light"] .btn:hover{ background: rgba(14,16,32,.08); }
.btn:active{ transform: translateY(0px); }

.btn--primary{
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 96%, transparent), color-mix(in srgb, var(--accent2) 92%, transparent));
  color: color-mix(in srgb, var(--text) 8%, #000 92%);
  border-color: transparent;
}
.btn--primary:hover{ filter: brightness(1.03); }
.btn--ghost{ background: transparent; box-shadow:none; }
html[data-theme="light"] .btn--ghost{ background: transparent; }

.btn--danger{
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn--danger:hover{ background: color-mix(in srgb, var(--danger) 18%, transparent); }

.btn--warn{
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.btn--warn:hover{ background: color-mix(in srgb, var(--warn) 18%, transparent); }

.btn--icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  padding:0;
  font-size:16px;
}

/* =========================
   Inputs / Select
   ========================= */
.input, select{
  background: rgba(255,255,255,.09);
  border:1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: var(--pad-input-y) var(--pad-input-x);
  outline:none;
  transition: .15s ease;
}
html[data-theme="light"] .input,
html[data-theme="light"] select{
  background: rgba(255,255,255,.85);
}
.input:focus, select:focus{
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--ring);
}
.input::placeholder{ color: color-mix(in srgb, var(--muted) 70%, transparent); }

select{
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--text) 60%, transparent) 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--text) 60%, transparent) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
  padding-right:32px;
}

/* Modern file input */
input[type="file"].input{
  padding: var(--pad-input-y) var(--pad-input-x);
}
input[type="file"].input::file-selector-button{
  border:1px solid var(--border);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: var(--pad-btn-y) var(--pad-btn-x);
  border-radius: 12px;
  font-weight:950;
  cursor:pointer;
  margin-right:10px;
  transition: .15s ease;
}
html[data-theme="light"] input[type="file"].input::file-selector-button{
  background: rgba(14,16,32,.09);
}
input[type="file"].input::file-selector-button:hover{
  background: rgba(255,255,255,.12);
  border-color: var(--border2);
}

/* =========================
   Badges
   ========================= */
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.badge--ok{ border-color: color-mix(in srgb, var(--accent2) 35%, transparent); color: color-mix(in srgb, var(--accent2) 55%, var(--text)); }
.badge--off{ border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: color-mix(in srgb, var(--danger) 55%, var(--text)); }

/* =========================
   Tables
   ========================= */
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow:hidden;
  border-radius: 16px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.12);
}
html[data-theme="light"] .table{
  background: rgba(255,255,255,.92);
}
.table th, .table td{
  padding: var(--pad-td-y) var(--pad-td-x);
  border-bottom:1px solid var(--border);
  text-align:left;
  font-size: var(--fs-body);
}
.table th{
  background: rgba(255,255,255,.09);
  color: color-mix(in srgb, var(--text) 92%, #fff 8%);
  font-weight: 950;
}
html[data-theme="light"] .table th{
  background: rgba(14,16,32,.04);
}
.table tr:hover td{ background: rgba(255,255,255,.03); }
html[data-theme="light"] .table tr:hover td{ background: rgba(14,16,32,.03); }
.table tr:last-child td{ border-bottom:none; }

.small{ font-size: var(--fs-small); color:var(--muted) }

/* =========================
   Modal
   ========================= */
.modal{
  position: relative;
  border:none;
  border-radius: 18px;
  max-width: 880px;
  width: calc(100% - 24px);
  padding:0;
  background:
    radial-gradient(900px 260px at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%),
    linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid var(--border);
  box-shadow: 0 30px 90px rgba(0,0,0,.70);
  overflow:hidden;
  backdrop-filter: blur(12px);
}
.modal::backdrop{ background: rgba(0,0,0,.62); }
html[data-theme="light"] .modal::backdrop{ background: rgba(16,20,32,.35); }

.modal__head{
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--border);
}
.modal__title{ font-weight: 950; letter-spacing:.2px }
.modal__body{ padding:14px; }
.modal__foot{
  padding:12px 14px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.form{ display:grid; gap:10px; }
.form-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width:820px){ .form-2{ grid-template-columns:1fr; } }

.top-select{
  height:44px;
  min-width:160px;
  padding-top:10px;
  padding-bottom:10px;
}

@media (max-width: 820px){
  .top-select{ min-width: 140px; }
}

/* Smooth theme transitions */
html, body, .topbar, .card, .btn, .input, select, .table, .modal, .nav__item{
  transition:
    background-color .28s ease,
    color .28s ease,
    border-color .28s ease,
    box-shadow .28s ease,
    filter .28s ease,
    transform .18s ease;
}

/* Gradient transition trick (reduce "flash") */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  opacity:.9;
  transition: opacity .28s ease, filter .28s ease;
}
html[data-theme="dark"] body::before{
  background:
    radial-gradient(1200px 700px at 18% -20%, rgba(94,234,212,.18), transparent 55%),
    radial-gradient(900px 600px at 92% 0%, rgba(34,197,94,.12), transparent 55%),
    linear-gradient(180deg, #05050a, #0a0a14 65%, #020205);
}
/* ===== LIGHT THEME (SOFT / EYE FRIENDLY) ===== */
html[data-theme="light"]{
  --bg0:#f1f2f4;
  --bg1:#e7e9ee;

  --card:#f7f8fa;
  --card2:#ffffff;

  --text:#1f2933;
  --muted:#6b7280;

  --border:rgba(15,23,42,.08);
  --border2:rgba(15,23,42,.12);

  --accent:#22c55e;
  --accent2:#16a34a;

  --danger:#ef4444;
  --warn:#f59e0b;

  --shadow: 0 10px 28px rgba(0,0,0,.08);
}

/* Background soft, fara alb orbitor */
html[data-theme="light"] body{
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(34,197,94,.08), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(14,165,233,.06), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 70%);
}

/* Eliminam glow-ul agresiv */
html[data-theme="light"] body::before{
  opacity:.55;
  filter: blur(0px);
}

html[data-theme="emerald"] body::before{
  background:
    radial-gradient(1200px 700px at 18% -20%, rgba(52,211,153,.22), transparent 55%),
    radial-gradient(900px 600px at 92% 0%, rgba(34,197,94,.10), transparent 55%),
    linear-gradient(180deg, #04080a, #071012 65%, #010405);
}

/* Make icon buttons look premium */
.btn--icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  padding:0;
  font-size:16px;
  line-height:1;
}
.btn--icon:hover{ transform: translateY(-1px); }
.btn--icon:active{ transform: translateY(0px); }

/* Density indicator subtle */
html[data-density="compact"] .btn#densityToggle{
  border-color: var(--border2);
}

/* ===== Drivers table upgrades ===== */
.table--drivers th:nth-child(1){ width: 180px; }
.table--drivers th:nth-child(2),
.table--drivers th:nth-child(3){ width: 220px; }
.table--drivers th:nth-child(4){ width: 220px; }
.table--drivers th:nth-child(5){ width: 90px; }
.table--drivers th:nth-child(6),
.table--drivers th:nth-child(7){ width: 110px; }
.table--drivers th:nth-child(8){ width: 110px; }
.table--drivers th:nth-child(9){ width: 130px; }

.cell-wrap{ display:flex; flex-direction:column; gap:6px; }
.cell-inline{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  max-width: 100%;
}
.pill--muted{ color: var(--muted); }
.pill code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: color-mix(in srgb, var(--text) 85%, transparent);
}

.icon-btn{
  width:32px; height:32px;
  display:grid; place-items:center;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  transition: .15s ease;
}
.icon-btn:hover{ background: rgba(255,255,255,.10); border-color: var(--border2); transform: translateY(-1px); }
.icon-btn:active{ transform: translateY(0); }

.actions{
  position:relative;
  display:flex;
  justify-content:flex-end;
}
.menu{
  position:absolute;
  right:0;
  top:42px;
  min-width: 190px;
  background: linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow2);
  padding:8px;
  display:none;
  z-index:50;
}
.menu.is-open{ display:block; }

.menu .menu__item{
  width:100%;
  text-align:left;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:1px solid transparent;
  background: transparent;
  color: var(--text);
  padding:10px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:900;
}
.menu .menu__item:hover{
  background: rgba(255,255,255,.06);
  border-color: var(--border);
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

/* ===== Table container (internal scroll) + Sticky header ===== */
.table-wrap{
  border:1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;              /* ca sa "taie" colturile sticky */
  background: rgba(0,0,0,.10);
}

html[data-theme="light"] .table-wrap{
  background: rgba(255,255,255,.92);
}

.table-scroll{
  max-height: 520px;             /* poti modifica: 420 / 520 / 650 */
  overflow:auto;
}

.table-scroll::-webkit-scrollbar{ height:10px; width:10px; }
.table-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}
html[data-theme="light"] .table-scroll::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.18);
}

.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;                 /* borderul e pe .table-wrap */
  border-radius: 0;
  background: transparent;
}

.table thead th{
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .table thead th{
  background: rgba(14,16,32,.04);
}

/* optional: prima coloana sticky (utile la multe coloane) */
.table--sticky-first th:first-child,
.table--sticky-first td:first-child{
  position: sticky;
  left: 0;
  z-index: 6;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.18));
}

html[data-theme="light"] .table--sticky-first th:first-child,
html[data-theme="light"] .table--sticky-first td:first-child{
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.95));
}

/* =========================
   Profil / Auth helpers
   ========================= */
.label{
  display:block;
  font-size:12px;
  color: var(--muted);
  margin: 2px 2px 6px;
}
.check{
  display:flex;
  gap:10px;
  align-items:center;
  font-size:13px;
  color: var(--text);
}
.check input{ transform: translateY(1px); }

.divider{
  height:1px;
  background: var(--border);
  margin: 18px 0;
  opacity:.8;
}

.nav__item.is-disabled{
  opacity:.65;
}
.nav__item.is-disabled span{
  opacity:.85;
}
.nav__meta{
  font-size:12px;
  color: var(--muted);
  margin-left:6px;
  white-space:nowrap;
}

/* =========================
   Custom dropdown (global)
   Replaces native <select> UI
   ========================= */
.select--hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

.dd{
  display:inline-block;
  max-width:100%;
}

.dd__btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(120,160,200,.18);
  background: linear-gradient(180deg, rgba(20,28,40,.85), rgba(12,18,26,.95));
  color: var(--text);
  font: inherit;
  cursor:pointer;
  user-select:none;

  transition: border .15s ease, box-shadow .15s ease, transform .05s ease, background .15s ease;
}
.dd__btn:hover{
  border-color: rgba(80,200,160,.45);
  box-shadow: 0 0 0 2px rgba(60,180,140,.12);
}
.dd__btn:active{ transform: translateY(1px); }

.dd__label{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.dd__chev{ opacity:.85; flex:0 0 auto; }
.dd__chev svg{ width:18px; height:18px; }

.dd__menu{
  position: fixed;
  min-width: 220px;
  border-radius: 16px;
  border: 1px solid rgba(120,160,200,.20);
  background: linear-gradient(180deg, rgba(18,24,36,.96), rgba(10,14,22,.98));
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding: 8px;
  z-index: 99999;
}

.dd__item{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align:left;
}
.dd__item:hover{ background: rgba(90, 220, 170, .12); }
.dd__item.is-active{
  background: rgba(90, 220, 170, .18);
  outline: 1px solid rgba(90, 220, 170, .25);
}

/* Select sizing helpers */
.dd--sm .dd__btn{ padding: 8px 10px; border-radius: 12px; font-size: 13px; }

/* =========================
   Profile layout helpers
   ========================= */
.profile-page .form--narrow{
  max-width: 560px;
}
.profile-page .input{
  max-width: 560px;
}
@media (max-width: 820px){
  .profile-page .form--narrow,
  .profile-page .input{ max-width: 100%; }
}

/* =========================
   Profil polish
   ========================= */
.profile-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.profile-hero__left{ display:flex; align-items:center; gap:14px; }
.profile-avatar{
  width:46px; height:46px; border-radius: 16px;
  display:grid; place-items:center;
  background: radial-gradient(circle at 30% 30%, rgba(80,220,170,.35), rgba(12,18,26,.1)),
              linear-gradient(180deg, rgba(20,28,40,.85), rgba(12,18,26,.95));
  border: 1px solid rgba(120,160,200,.18);
  color: var(--text);
  font-weight: 800;
}
.profile-title{ font-size: 18px; font-weight: 800; }
.profile-sub{ color: var(--muted); font-size: 13px; }

/* Make hover states more visible (buttons/links) */
.btn:hover{
  filter: brightness(1.05);
}
.btn:active{
  transform: translateY(1px);
}
.link:hover{ text-decoration: underline; }



/* === FleetBalance: dropdown theme + layering fix (CSS-only) === */
/* IMPORTANT: Only overrides .dd dropdown styles (theme-aware) + ensure it renders above surrounding boxes. */
.dd{ overflow: visible; }

.dd__btn{
  border: 1px solid var(--border2) !important;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--card2) 86%, transparent),
    color-mix(in srgb, var(--card2) 96%, transparent)
  ) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow2) !important;
}
.dd__btn:hover{
  border-color: color-mix(in srgb, var(--border2) 65%, var(--accent) 35%) !important;
  box-shadow: var(--ring), var(--shadow2) !important;
}

.dd__menu{
  /* make sure it is ALWAYS above cards/modals */
  position: fixed !important;
  z-index: 2147483647 !important;
  border: 1px solid var(--border2) !important;
  background: color-mix(in srgb, var(--card2) 92%, transparent) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(12px);
}

.dd__item{
  color: var(--text) !important;
}
.dd__item:hover{
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
}
.dd__item.is-active{
  background: color-mix(in srgb, var(--accent) 18%, transparent) !important;
  outline: 1px solid color-mix(in srgb, var(--accent) 28%, transparent) !important;
}
