/* ============================================================
   FleetDesk — modern UI theme
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #e8ebf3;
  --border-2: #dfe3ee;
  --text: #10151f;
  --text-2: #5a6478;
  --muted: #8a93a6;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-dark: #0b5a54;
  --brand-soft: #d7f2ee;
  --sidebar: #0c2233;
  --sidebar-2: #123047;
  --sidebar-text: #9fb2c4;
  --green: #16a34a; --green-soft: #e7f7ee;
  --amber: #d97706; --amber-soft: #fdf2e0;
  --orange: #ea580c; --orange-soft: #fdeee2;
  --red: #e11d48; --red-soft: #fde8ee;
  --blue: #2563eb; --blue-soft: #e8f0fe;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,21,31,.04), 0 4px 14px rgba(16,21,31,.05);
  --shadow-lg: 0 8px 30px rgba(16,21,31,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
::selection { background: var(--brand-soft); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #2a3170 0%, transparent 60%), linear-gradient(150deg, #10132a 0%, #262d63 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px 40px 34px; width: 400px; max-width: 94vw;
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
}
.login-card .logo { text-align: center; margin-bottom: 8px; font-size: 42px; }
.login-card h1 { text-align: center; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 15px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.login-card select, .login-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-2); border-radius: 11px; font-size: 15px; background: #fbfbfe;
}
.login-card input:focus, .login-card select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pin-input { text-align: center; letter-spacing: 12px; font-size: 24px !important; font-weight: 700; }
.login-btn {
  width: 100%; margin-top: 24px; padding: 14px; background: var(--brand); color: #fff; border: none;
  border-radius: 11px; font-size: 15.5px; font-weight: 600; transition: background .15s, transform .05s;
}
.login-btn:hover { background: var(--brand-dark); }
.login-btn:active { transform: scale(.99); }
.login-err { color: var(--red); text-align: center; margin-top: 14px; font-size: 13.5px; min-height: 18px; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; background: var(--sidebar); color: var(--sidebar-text); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 22px 22px 18px; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; }
.sidebar nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px;
  color: var(--sidebar-text); text-decoration: none; font-size: 14px; margin-bottom: 2px; transition: background .12s, color .12s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(79,70,229,.35); }
.sidebar nav a .badge { margin-left: auto; }
.sidebar .userbox { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .userbox .uname { color: #fff; font-weight: 600; }
.sidebar .userbox .urole { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; margin-top: 1px; }
.sidebar .userbox button {
  margin-top: 10px; width: 100%; background: rgba(255,255,255,.08); color: #fff; border: none;
  padding: 9px; border-radius: 9px; font-size: 13px; transition: background .12s;
}
.sidebar .userbox button:hover { background: rgba(255,255,255,.16); }
.main { flex: 1; padding: 28px 34px 70px; max-width: 1320px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- Components ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-pad { padding: 18px 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 10px;
  border: 1.5px solid var(--border-2); background: #fff; color: var(--text); font-weight: 600; font-size: 13.5px; transition: all .12s;
}
.btn:hover { border-color: #c9cfe0; background: #fafbff; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.28); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #be123c; }
.btn.ghost-danger { color: var(--red); border-color: #fbccd7; background: #fff; }
.btn.ghost-danger:hover { background: var(--red-soft); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.search-input {
  padding: 10px 14px 10px 38px; border: 1.5px solid var(--border-2); border-radius: 11px; width: 300px; max-width: 100%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='%238a93a6' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat 13px center;
}
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
select.filter { padding: 9px 12px; border: 1.5px solid var(--border-2); border-radius: 10px; background: #fff; font-weight: 500; }
select.filter:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 12px 15px; border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap;
}
table.grid td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr { transition: background .1s; }
table.grid tbody tr:hover td { background: #fafbff; }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.badge.green { background: var(--green-soft); color: #15803d; }
.badge.blue { background: var(--blue-soft); color: #1d4ed8; }
.badge.gray { background: #eef0f5; color: #55627a; }
.badge.amber { background: var(--amber-soft); color: #b45309; }
.badge.orange { background: var(--orange-soft); color: #c2410c; }
.badge.red { background: var(--red-soft); color: #be123c; }
.badge.red-solid { background: var(--red); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 18px 16px;
  box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-2); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d3d9ea; }
.stat .n { font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: var(--text); }
.stat .l { color: var(--muted); font-size: 11.5px; font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.stat.accent-blue::before { background: var(--brand); } .stat.accent-blue .n { color: var(--brand); }
.stat.accent-green::before { background: var(--green); } .stat.accent-green .n { color: var(--green); }
.stat.accent-amber::before { background: var(--amber); } .stat.accent-amber .n { color: var(--amber); }
.stat.accent-red::before { background: var(--red); } .stat.accent-red .n { color: var(--red); }

/* dashboard company focus bar */
.dash-focus {
  background: radial-gradient(800px 300px at 90% -40%, #2b3382 0%, transparent 55%), linear-gradient(120deg, #10132a, #262d63);
  color: #fff; border-radius: 16px; padding: 20px 24px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; box-shadow: var(--shadow-lg);
}
.dash-focus .df-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.dash-focus .df-sub { font-size: 12.5px; color: #b4bce0; margin-top: 3px; }
.dash-focus .df-select {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22);
  border-radius: 11px; padding: 11px 15px; font-size: 14px; font-weight: 600; min-width: 250px; cursor: pointer;
}
.dash-focus .df-select option { color: #10151f; }

/* dashboard grid + panels */
.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.panel-title .muted { font-weight: 400; }

/* notification feed */
.notif { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.notif:hover { background: #fafbff; }
.notif:last-child { border-bottom: none; }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.notif .dot.expired { background: var(--red); } .notif .dot.critical { background: var(--orange); }
.notif .dot.warning { background: var(--amber); } .notif .dot.notice { background: #d4a017; }
.notif .n-main { font-size: 13px; font-weight: 600; }
.notif .n-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* progress bar (platform split) */
.bar { height: 9px; border-radius: 99px; background: #eef0f5; overflow: hidden; display: flex; }
.bar > span { height: 100%; }

/* alert banner */
.alert-banner { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; font-weight: 600; }
.alert-banner.expired { background: var(--red-soft); border: 1.5px solid #f7b6c6; color: #9f1239; }
.alert-banner.critical { background: var(--orange-soft); border: 1.5px solid #fdba74; color: #9a3412; }
.alert-banner.warning { background: var(--amber-soft); border: 1.5px solid #fde68a; color: #92400e; }
.alert-banner .ic { font-size: 22px; }

/* modal */
#modal-root .overlay {
  position: fixed; inset: 0; background: rgba(10,14,26,.5); backdrop-filter: blur(3px); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 20px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 18px; width: 540px; max-width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 90px rgba(0,0,0,.35); animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .m-head { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.modal .m-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal .m-head .x { background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; }
.modal .m-head .x:hover { color: var(--text); }
.modal .m-body { padding: 16px 24px 22px; }
.modal .m-foot { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.frow { margin-bottom: 14px; }
.frow label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.frow input, .frow select, .frow textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border-2); border-radius: 10px; background: #fbfbfe;
}
.frow input:focus, .frow select:focus, .frow textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: #fff; }
.frow .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* toasts */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #10132a; color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; max-width: 440px; animation: slidein .25s ease;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* assign page */
.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .assign-grid { grid-template-columns: 1fr; } .sidebar { width: 66px; } .sidebar .brand span, .sidebar nav a span.txt, .sidebar .userbox { display: none; } .main { padding: 18px 14px; } .dash-focus .df-select { min-width: 100%; } }
.pick-list { max-height: 340px; overflow-y: auto; border: 1.5px solid var(--border-2); border-radius: 11px; margin-top: 10px; }
.pick-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; transition: background .1s; }
.pick-item:hover { background: var(--brand-soft); }
.pick-item.selected { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.pick-item:last-child { border-bottom: none; }
.pick-item .p1 { font-weight: 600; }
.pick-item .p2 { color: var(--muted); font-size: 12.5px; }
.assign-summary { border: 1.5px dashed var(--border-2); border-radius: 14px; padding: 20px; text-align: center; margin-top: 18px; background: #fbfbfe; }
.assign-summary .big { font-size: 18px; font-weight: 700; margin: 4px 0; }

.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty .ic { font-size: 42px; margin-bottom: 10px; }

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 600; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* import/export */
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .io-grid { grid-template-columns: 1fr; } }
.drop {
  border: 2px dashed #c9d0e2; border-radius: 13px; padding: 26px; text-align: center; color: var(--muted);
  margin-top: 12px; cursor: pointer; transition: all .12s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
