:root {
  color-scheme: dark;
  --bg: #080c0e;
  --sidebar: #0b1012;
  --surface: #111719;
  --surface-2: #151d20;
  --surface-3: #1a2326;
  --line: #263135;
  --line-soft: #1d272a;
  --text: #f5f6f0;
  --muted: #909c98;
  --muted-2: #67736f;
  --accent: #d9f45f;
  --accent-soft: #29351c;
  --warning: #f1bc63;
  --warning-soft: #302717;
  --danger: #ff8f7d;
  --shadow: 0 26px 70px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #10150c; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.ambient-glow { position: fixed; z-index: 0; width: 540px; height: 540px; border-radius: 50%; filter: blur(110px); opacity: .12; pointer-events: none; }
.glow-one { top: -350px; right: 4%; background: var(--accent); }
.glow-two { bottom: -430px; left: -240px; background: #3a8d75; opacity: .08; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .19em; }
.muted { color: var(--muted); }

/* Login */
.login-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, 520px); align-items: center; gap: clamp(48px, 8vw, 130px); width: min(1220px, calc(100% - 64px)); margin: 0 auto; padding: 56px 0; }
.login-intro { display: flex; min-height: 610px; flex-direction: column; justify-content: space-between; padding: 20px 0; }
.login-brand { display: flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 850; letter-spacing: .18em; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent); box-shadow: 0 12px 35px rgba(217, 244, 95, .15); color: #10150c; font-weight: 950; letter-spacing: -.07em; }
.login-copy { max-width: 690px; padding: 70px 0 54px; }
.login-copy h1 { max-width: 680px; margin: 0; font-size: clamp(44px, 5.3vw, 76px); line-height: .99; letter-spacing: -.062em; text-wrap: balance; }
.login-copy > p:last-child { max-width: 600px; margin: 28px 0 0; color: #a5b0ac; font-size: 17px; line-height: 1.7; }
.login-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding: 25px 0 0; border-top: 1px solid var(--line); list-style: none; }
.login-features li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-features li > i { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(217, 244, 95, .45); }
.login-features span { display: grid; gap: 3px; }
.login-features b { color: #dce1dc; font-size: 12px; }
.login-card { padding: 38px; border: 1px solid #303b3e; border-radius: 24px; background: linear-gradient(150deg, rgba(23, 31, 33, .98), rgba(13, 19, 21, .98)); box-shadow: var(--shadow); }
.login-card-head h2 { margin: 22px 0 7px; font-size: 34px; letter-spacing: -.04em; }
.login-card-head p { margin: 0; color: var(--muted); }
.secure-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #3b4930; border-radius: 999px; background: #1a2216; color: #cce886; font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.secure-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.login-card form { display: grid; grid-template-columns: 1fr; margin-top: 32px; }
.login-card label { margin: 0 0 8px; color: #cbd1cd; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.input-shell { margin-bottom: 20px; }
input { width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; background: #0b1012; color: var(--text); outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
input::placeholder { color: #58635f; }
input:hover { background: #0e1416; }
input:focus { border-color: #9fb640; box-shadow: 0 0 0 3px rgba(217, 244, 95, .1); }
.login-card form > button { display: flex; min-height: 52px; align-items: center; justify-content: space-between; margin-top: 4px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); box-shadow: 0 12px 30px rgba(217, 244, 95, .1); color: #11160d; font-size: 12px; font-weight: 900; letter-spacing: .06em; transition: transform .18s, filter .18s; }
.login-card form > button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.login-card form > button:disabled { opacity: .65; transform: none; }
.login-card form > button span { font-size: 20px; font-weight: 500; }
.form-error { min-height: 20px; margin: 13px 0 0; color: var(--danger); font-size: 12px; }
.shared-login-note { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; margin: 2px 0 0; padding: 13px 14px; border: 1px solid #344129; border-radius: 10px; background: rgba(217, 244, 95, .045); color: var(--muted); font-size: 11px; line-height: 1.45; }
.shared-login-note > i { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #26331b; color: var(--accent); font-style: normal; font-weight: 900; }
.shared-login-note > span { display: grid; gap: 2px; }
.shared-login-note b { color: #e6eadf; font-size: 11px; }
.login-card footer { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 10px; letter-spacing: .07em; }

/* Application shell */
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 19px 20px; border-right: 1px solid var(--line-soft); background: rgba(11, 16, 18, .94); backdrop-filter: blur(18px); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin: 0 7px 22px; }
.sidebar-brand > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #11160d; font-weight: 950; letter-spacing: -.07em; }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand b { font-size: 13px; letter-spacing: .1em; }
.sidebar-brand small { color: var(--muted-2); font-size: 9px; letter-spacing: .16em; }
.environment-chip { display: flex; align-items: center; gap: 8px; margin: 0 7px 32px; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: #101618; color: #9ca7a3; font-size: 10px; }
.environment-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(217, 244, 95, .6); }
.nav-label { margin: 0 12px 10px; color: #525e5a; font-size: 9px; font-weight: 850; letter-spacing: .18em; }
nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #7f8b87; text-align: left; font-size: 13px; font-weight: 720; transition: color .18s, background .18s, border-color .18s; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:first-child svg { fill: currentColor; stroke: none; opacity: .85; }
.nav-item:hover { background: #11181a; color: #cbd2ce; }
.nav-item.active { border-color: #33402c; background: linear-gradient(90deg, #202a1b, #151d19); box-shadow: inset 3px 0 var(--accent); color: var(--text); }
.nav-item.active svg { color: var(--accent); }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px; border: 1px solid #34402c; border-radius: 11px; background: linear-gradient(145deg, #1d2719, #151c16); }
.privacy-icon { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border-radius: 50%; background: var(--accent); color: #13180f; font-size: 11px; font-weight: 900; }
.privacy-note div { display: grid; gap: 5px; }
.privacy-note b { color: #d0e69a; font-size: 9px; letter-spacing: .12em; }
.privacy-note div span { color: #99a590; font-size: 10px; line-height: 1.5; }
.logout-button { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 11px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #66726e; font-size: 11px; transition: color .18s, border-color .18s, background .18s; }
.logout-button:hover { border-color: var(--line); background: #111719; color: #cfd5d1; }

.workspace { width: 100%; max-width: 1510px; margin: 0 auto; padding: 36px clamp(28px, 4.5vw, 70px) 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 31px; }
.page-heading h1 { margin: 0; font-size: clamp(31px, 4vw, 46px); line-height: 1.06; letter-spacing: -.05em; }
.page-heading > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.icon-button { display: grid; width: 41px; height: 41px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #a7b1ad; transition: border-color .18s, color .18s, transform .18s; }
.icon-button:hover { border-color: #44514d; color: var(--accent); transform: rotate(12deg); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-chip { display: flex; align-items: center; gap: 11px; padding: 4px 4px 4px 0; }
.admin-chip > span { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #374238; border-radius: 12px; background: #1c261b; color: var(--accent); font-weight: 900; }
.admin-chip div { display: grid; gap: 2px; text-align: right; }
.admin-chip b { font-size: 12px; }
.admin-chip small { color: var(--muted-2); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.view-panel { animation: view-in .32s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Overview */
.status-ribbon { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; padding: 11px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(16, 22, 24, .75); color: var(--muted); font-size: 11px; }
.live-status { display: flex; align-items: center; gap: 9px; color: #bcc6c1; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(217, 244, 95, .5); }
.live-status i.error { background: var(--danger); box-shadow: 0 0 12px rgba(255, 143, 125, .45); }
.last-update { color: var(--muted-2); }
.last-update time { color: #99a49f; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card, .system-card, .fleet-card, .table-card { border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(20, 27, 29, .98), rgba(14, 20, 22, .98)); box-shadow: 0 12px 35px rgba(0, 0, 0, .12); }
.metric-card { position: relative; min-height: 172px; display: flex; flex-direction: column; overflow: hidden; padding: 21px 22px; transition: border-color .2s, transform .2s; }
.metric-card::after { position: absolute; right: -35px; bottom: -55px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent); content: ""; filter: blur(55px); opacity: 0; transition: opacity .2s; }
.metric-card:hover { border-color: #3a4649; transform: translateY(-2px); }
.metric-card:hover::after { opacity: .07; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #6d7975; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.metric-card strong { margin: auto 0 6px; font-size: clamp(40px, 4vw, 54px); line-height: .95; letter-spacing: -.055em; }
.metric-card small { color: var(--muted-2); font-size: 11px; }
.metric-card.accent { border-color: #43502f; background: linear-gradient(145deg, #1c2719, #111814); }
.metric-card.accent strong { color: var(--accent); }
.metric-card.warning strong { color: #f0c87a; }
.live-pill { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .75fr); gap: 13px; margin-top: 13px; }
.system-card, .fleet-card { padding: 26px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading h2, .table-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.outline-badge { padding: 7px 9px; border: 1px solid #364238; border-radius: 7px; color: #96a690; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: .07em; }
.system-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 26px 0 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.system-facts div { padding: 21px 16px 21px 0; }
.system-facts div + div { padding-left: 21px; border-left: 1px solid var(--line-soft); }
.system-facts dt { color: var(--muted-2); font-size: 10px; }
.system-facts dd { margin: 7px 0 3px; font-size: 18px; font-weight: 780; }
.system-facts small { color: #697570; font-size: 9px; }
.platform-note { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.platform-note > span { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 900; }
.platform-note p { display: grid; gap: 3px; margin: 0; }
.platform-note b { font-size: 11px; }
.platform-note small { color: var(--muted-2); font-size: 9px; }
.fleet-card { display: flex; flex-direction: column; }
.fleet-visual { position: relative; display: grid; width: 164px; height: 164px; place-items: center; margin: 17px auto 12px; }
.fleet-visual svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 8; }
.ring-track { stroke: #212a2d; }
.ring-value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .7s ease; filter: drop-shadow(0 0 5px rgba(217, 244, 95, .22)); }
.fleet-number { position: absolute; display: grid; place-items: center; }
.fleet-number strong { font-size: 32px; letter-spacing: -.05em; }
.fleet-number span { color: var(--muted-2); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.fleet-legend { display: grid; gap: 9px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); list-style: none; }
.fleet-legend li { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.fleet-legend i { width: 6px; height: 6px; border-radius: 50%; }
.online-dot { background: var(--accent); }
.offline-dot { background: #586360; }
.pending-dot { background: var(--warning); }
.fleet-legend b { color: #dfe3df; font-size: 11px; }

/* Users */
.table-card { overflow: hidden; }
.table-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 27px 21px; }
.table-heading > div:first-child > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; align-items: center; gap: 9px; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; top: 50%; left: 12px; width: 15px; height: 15px; fill: none; stroke: #74807c; stroke-width: 1.7; transform: translateY(-50%); }
.search-box input { width: 210px; min-height: 38px; padding-left: 36px; font-size: 11px; }
.secondary-button, .pagination button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: #111719; color: #c4cbc7; font-size: 9px; font-weight: 850; letter-spacing: .07em; transition: border-color .18s, color .18s, background .18s; }
.secondary-button:hover, .pagination button:hover:not(:disabled) { border-color: #46524e; background: #172023; color: var(--accent); }
.privacy-banner { display: flex; align-items: center; gap: 12px; margin: 0 27px 19px; padding: 12px 14px; border: 1px solid #34412b; border-radius: 9px; background: #192117; }
.privacy-banner > span { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: var(--accent); color: #13180f; font-size: 10px; font-weight: 900; }
.privacy-banner p { display: grid; gap: 2px; margin: 0; color: #8f9c89; font-size: 10px; }
.privacy-banner b { color: #ccdd9f; font-size: 10px; }
.table-wrap { min-height: 325px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 27px; border-top: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: #68736f; background: #0f1517; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
td { color: #c9d0cc; font-size: 12px; transition: background .15s; }
tbody tr:hover td { background: #151d1f; }
td:first-child { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; background: #202a1d; color: #cfe794; font-size: 8px; font-weight: 850; letter-spacing: .04em; }
.status-badge.offline { background: #222729; color: #8e9995; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 27px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 10px; }
.pagination div { display: flex; gap: 7px; }
.pagination button:disabled { opacity: .35; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: 360px; padding: 13px 16px; border: 1px solid #3c4945; border-radius: 10px; background: #172023; box-shadow: var(--shadow); color: #dce1dd; font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .fleet-card { display: grid; grid-template-columns: 1fr 190px 1fr; align-items: center; }
  .fleet-card .card-heading { align-self: start; }
  .fleet-visual { grid-column: 2; grid-row: 1 / 3; }
  .fleet-legend { align-self: end; border-top: 0; }
  .login-features { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; width: min(520px, calc(100% - 40px)); padding: 32px 0; }
  .login-intro { min-height: auto; padding: 0; }
  .login-copy { padding: 45px 0 25px; }
  .login-copy h1 { font-size: clamp(38px, 10vw, 58px); }
  .login-features { display: none; }
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 5; height: auto; padding: 14px 18px 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .sidebar-brand { margin: 0; }
  .environment-chip, .nav-label, .privacy-note { display: none; }
  nav { grid-template-columns: 1fr 1fr; margin-top: 12px; }
  .nav-item { justify-content: center; padding: 9px 12px; }
  .logout-button { position: absolute; top: 18px; right: 18px; width: auto; margin: 0; }
  .logout-button span:first-child { display: none; }
  .workspace { padding: 27px 18px 50px; }
}

@media (max-width: 650px) {
  .topbar { align-items: flex-start; }
  .admin-chip { display: none; }
  .page-heading h1 { font-size: 34px; }
  .status-ribbon { align-items: flex-start; gap: 8px; }
  .last-update { display: none; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 145px; padding: 17px; }
  .metric-card strong { font-size: 40px; }
  .metric-head { font-size: 10px; }
  .system-facts { grid-template-columns: 1fr; }
  .system-facts div { padding: 16px 0; }
  .system-facts div + div { padding-left: 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .fleet-card { display: flex; }
  .fleet-visual { width: 150px; height: 150px; }
  .fleet-legend { width: 100%; border-top: 1px solid var(--line-soft); }
  .table-heading { align-items: flex-start; flex-direction: column; padding: 21px 18px 17px; }
  .table-actions { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .privacy-banner { margin: 0 18px 16px; }
  th, td { padding-right: 18px; padding-left: 18px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .pagination { padding: 14px 18px; }
  .pagination > span { max-width: 120px; }
}

@media (max-width: 430px) {
  .login-shell { width: min(100% - 26px, 500px); }
  .login-card { padding: 27px 23px; border-radius: 18px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; }
  .pagination { align-items: flex-start; gap: 12px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
