/* ============================================================
   VidaRent — glass

   The interface over a polished-concrete floor: an off-white page
   with the soft light of a showroom on it, frosted panes for the
   cards, a smoked-glass sidebar along the window's edge, and each
   section's glass-tile icon. Loaded last, it changes surfaces — colour,
   translucency, corners, shadow — and never the layout of a screen.

   Real blur (backdrop-filter) only where something passes beneath:
   the sidebar, the top bar, the fleet's sticky filter, popovers and
   toasts. Cards are translucent over a still page, which looks the
   same and costs nothing on a phone.
   ============================================================ */

:root {
  --sb: 248px;

  --bg:           #e4e5e1;                  /* the page: an off-white with a mineral cast */
  --bg-bloom:     #f7f8f5;                  /* the light pooling on it */
  --bg-shade:     #d3d7da;                  /* the cool shade away from the light */

  --glass:        rgba(255, 255, 255, .6);
  --glass-strong: rgba(255, 255, 255, .84);
  --glass-edge:   rgba(255, 255, 255, .9);
  --glass-line:   rgba(11, 11, 13, .07);
  --glass-hover:  rgba(255, 255, 255, .7);
  --glass-hi:     inset 0 1px 0 rgba(255, 255, 255, .95);
  --glass-shadow: 0 1px 1px rgba(20, 24, 28, .04), 0 12px 32px -12px rgba(20, 24, 28, .2);
  --blur:         saturate(1.7) blur(22px);

  --smoke:        rgba(11, 12, 15, .93);    /* the sidebar's smoked glass */
  --sheen:        linear-gradient(165deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 36%);
  --smoke-edge:   rgba(255, 255, 255, .09);

  --field-bg:     rgba(255, 255, 255, .82);
  --field-line:   rgba(11, 11, 13, .14);

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;
  --radius: var(--r-lg);
  --card-line: var(--glass-edge);
  --card-shadow: var(--glass-shadow), var(--glass-hi);

  /* liquid glass: a rim that catches the light at two corners and fades along the sides,
     a sheen across the pane, and a shadow in layers — close and soft, then long and low */
  --rim:          linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, .6) 14%, rgba(255, 255, 255, .12) 40%,
                                          rgba(20, 24, 28, .13) 64%, rgba(255, 255, 255, .55) 88%, rgba(255, 255, 255, 1));
  --rim-smoke:    linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .06) 28%, rgba(255, 255, 255, .02) 60%, rgba(255, 255, 255, .16));
  --pane-sheen:   linear-gradient(170deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .08) 42%, rgba(255, 255, 255, .2) 100%);
  --pane-shadow:  0 1px 1px rgba(20, 24, 28, .04), 0 3px 8px -3px rgba(20, 24, 28, .08), 0 24px 46px -26px rgba(20, 24, 28, .36),
                  inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35), inset 0 0 0 2px rgba(255, 255, 255, .22);
  --pane-lift:    0 1px 1px rgba(20, 24, 28, .04), 0 6px 14px -4px rgba(20, 24, 28, .1), 0 34px 56px -26px rgba(20, 24, 28, .42),
                  inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35);
}

:root[data-theme="dark"] {
  --bg:           #0f1013;
  --bg-bloom:     #1d2027;
  --bg-shade:     #08090b;

  --glass:        rgba(32, 33, 40, .56);
  --glass-strong: rgba(30, 31, 38, .86);
  --glass-edge:   rgba(255, 255, 255, .08);
  --glass-line:   rgba(255, 255, 255, .06);
  --glass-hover:  rgba(255, 255, 255, .05);
  --glass-hi:     inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 16px 36px -14px rgba(0, 0, 0, .7);

  --smoke:        rgba(8, 9, 11, .78);
  --smoke-edge:   rgba(255, 255, 255, .08);

  --field-bg:     rgba(0, 0, 0, .24);
  --field-line:   rgba(255, 255, 255, .13);

  --rim:          linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .09) 20%, rgba(255, 255, 255, .02) 50%,
                                          rgba(255, 255, 255, .06) 78%, rgba(255, 255, 255, .24));
  --pane-sheen:   linear-gradient(170deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, .025) 100%);
  --pane-shadow:  0 1px 1px rgba(0, 0, 0, .35), 0 24px 46px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .07);
  --pane-lift:    0 1px 1px rgba(0, 0, 0, .35), 0 34px 56px -24px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .09);
}

/* ---------- the floor ---------- */

html { background: var(--bg); }
body {
  background:
    radial-gradient(1100px 680px at 8% -12%, var(--bg-bloom), transparent 62%),
    radial-gradient(800px 560px at 108% 8%, var(--bg-bloom), transparent 58%),
    radial-gradient(1200px 900px at 62% 125%, var(--bg-shade), transparent 66%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- the smoked-glass sidebar ---------- */

/* flush with the window's edge, full height; only the side facing the content catches the light */
.sidebar {
  margin: 0;
  border-radius: 0;
  background: var(--sheen), var(--smoke);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .1), 10px 0 34px -16px rgba(0, 0, 0, .45);
}
.nav { padding: 4px 10px; }
.nav__group { padding: 16px 12px 6px; }
.nav a {
  border-left: 0;
  border-radius: 12px;
  padding: 6px 10px;
  margin: 1px 0;
  gap: 11px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); }
.nav a.on {
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 18px -10px rgba(0, 0, 0, .7);
}
.nav a .ic { width: 26px; height: 26px; opacity: 1; flex: none; }
.sicon { display: block; object-fit: contain; }
.nav a .sicon {
  width: 24px; height: 24px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
  transition: transform .2s ease;
}
.nav a:hover .sicon, .nav a.on .sicon { transform: translateY(-1px) scale(1.07); }
.sidebar__user { border-top-color: var(--smoke-edge); }
.sidebar__user .avatar { border-radius: 9px; }

/* ---------- the top bar: a pane of glass with the section's icon ---------- */

.topbar {
  margin: 12px 12px 0;
  height: 58px;
  padding: 0 16px 0 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), var(--glass-hi);
}
.topbar h1 { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar h1 .sicon { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 3px 4px rgba(20, 24, 28, .22)); }
.topbar h1 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- panes ---------- */

.card, .stat, .vcard, .kpi, .dash-hero, .empty {
  position: relative;
  background: var(--pane-sheen), var(--glass);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--pane-shadow);
}
.card { overflow: clip; }
/* a car's state is a lit stripe on the pane's edge, not a painted border */
.vcard::after {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; z-index: 2;
  border-radius: 0 4px 4px 0; background: var(--st); box-shadow: 0 0 14px 1px var(--st);
  pointer-events: none;
}
.vcard:hover { box-shadow: var(--pane-lift); }
.card__hd { border-bottom-color: var(--glass-line); }
.stat { padding: 18px 20px; }

.tbl th { border-bottom-color: var(--glass-line); }
.tbl td { border-bottom-color: var(--glass-line); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover, .alert-row:hover { background: var(--glass-hover); }
.kv dt, .kv dd { border-bottom-color: var(--glass-line); }

.empty { color: var(--g-60); }
.msg { border-radius: var(--r-md); }
.panel { border-radius: var(--r-md); }

/* the rim: a gradient ring, one pixel wide, laid over each pane's edge */
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .card::before, .stat::before, .vcard::before, .kpi::before, .dash-hero::before, .empty::before,
  .topbar::before, .acct-pop::before, .sup__box::before, .picker__box::before, .sidebar::before, .login__panel::before {
    content: ""; position: absolute; inset: 0; z-index: 2;
    border-radius: inherit; padding: 1px;
    background: var(--rim);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
  }
  .sidebar::before { content: none; }
  .topbar, .acct-pop, .sup__box, .picker__box, .login__panel { border-color: transparent; }
}
.topbar, .picker__box, .login__panel { position: relative; }
@media (min-width: 901px) { .sidebar { position: relative; } }

/* ---------- controls ---------- */

.btn { border-radius: var(--r-sm); transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn--solid { box-shadow: 0 8px 18px -10px rgba(var(--ink-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn--ghost { background: var(--field-bg); border-color: var(--field-line); }
.btn--ghost:hover { background: var(--glass-strong); }

.field {
  border-radius: var(--r-sm);
  border-color: var(--field-line);
  background: var(--field-bg);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(var(--ink-rgb), .12); }

.seg, .lang { border-radius: var(--r-sm); overflow: clip; border-color: var(--field-line); background: var(--field-bg); }
.seg button + button, .lang button + button { border-left-color: var(--field-line); }

.pill, .score, .fpill { border-radius: 999px; }
.chk { border-radius: 5px; }
.avatar { border-radius: 10px; }
.dhead { border-bottom-color: var(--glass-line); }
.dhead .id { border-radius: 16px; box-shadow: 0 10px 22px -12px rgba(var(--ink-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .15); }

/* ---------- what floats: popovers, panels, toasts, the support button ---------- */

.acct-pop, .sup__box, .picker__box {
  border-radius: var(--r-lg);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45), var(--glass-hi);
}
.sup__ft { background: transparent; }
.sup__opt { border-radius: var(--r-sm); }
.sup-fab, .toast { border-radius: 14px; }
/* the support button is a chip of the sidebar's smoked glass, in either theme */
.sup-fab, .sup-fab:hover {
  gap: 9px; padding: 0 16px 0 11px;
  background: var(--sheen), var(--smoke); color: #fff; border-color: var(--smoke-edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.sup-fab:hover { background: linear-gradient(165deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 40%), var(--smoke); }
.sup-fab .sicon { width: 22px; height: 22px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.toast { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

/* the fleet's filter stays on top while the cars scroll under it */
.fbar {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.fbar::after { background: var(--glass-line); }
.fpill { background: var(--pane-sheen), var(--field-bg); box-shadow: 0 6px 14px -10px rgba(20, 24, 28, .4), inset 0 1px 0 rgba(255, 255, 255, .7); }

/* the save bar fades into the floor, not into white */
.savebar { background: linear-gradient(transparent, var(--bg) 45%); }

/* ---------- the dashboard ---------- */

.dash { display: grid; gap: 18px; }

/* the opening pane: a greeting, the next 24 hours in a sentence, the fleet now — and the car on the floor */
.dash-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px;
  padding: 26px 30px; border-radius: 24px; overflow: clip;
  background: radial-gradient(420px 260px at 92% 30%, rgba(255, 255, 255, .7), transparent 70%), var(--pane-sheen), var(--glass);
}
:root[data-theme="dark"] .dash-hero { background: radial-gradient(420px 260px at 92% 30%, rgba(255, 255, 255, .06), transparent 70%), var(--pane-sheen), var(--glass); }
.dash-hero__h { font-size: 26px; font-weight: 650; letter-spacing: -.025em; line-height: 1.22; margin: 6px 0 8px; max-width: 30em; }
.dash-hero__date { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--g-60); }
.dash-hero__date .pill { text-decoration: none; }
.dash-hero__art { position: relative; width: 156px; height: 150px; display: grid; place-items: center; }
.dash-hero__art img {
  position: relative; z-index: 1; width: 116px; height: 116px;
  transform: perspective(520px) rotateY(-16deg) rotateX(8deg);
  filter: drop-shadow(0 18px 16px rgba(4, 120, 87, .32));
}
.dash-hero__art::after {              /* its shadow on the floor */
  content: ""; position: absolute; left: 50%; bottom: 14px; width: 120px; height: 18px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 24, 28, .32), transparent);
}

.fleetnow { margin-top: 20px; max-width: 660px; }
.fleetnow__hd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.fleetbar {
  display: flex; gap: 3px; height: 16px; padding: 3px; border-radius: 999px;
  background: rgba(var(--ink-rgb), .06); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12), inset 0 -1px 0 rgba(255, 255, 255, .5);
}
.fleetbar__seg {
  min-width: 10px; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 8px -2px var(--c);
}
.fleetnow__legend { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px; }
.fleetkey {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px;
  border: 1px solid var(--field-line); border-radius: 999px; background: var(--field-bg);
  font: inherit; font-size: 12.5px; color: var(--ink-soft);
}
button.fleetkey { cursor: pointer; transition: background .15s, transform .08s; }
button.fleetkey:hover { background: var(--glass-strong); }
button.fleetkey:active { transform: translateY(1px); }
.fleetkey strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.fleetkey__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.fleetbar__seg--available, .fleetkey--available { --c: var(--status-available); }
.fleetbar__seg--pickup_soon, .fleetkey--pickup_soon { --c: var(--status-pickup-soon); }
.fleetbar__seg--rented, .fleetkey--rented { --c: var(--status-rented); }
.fleetbar__seg--in_service, .fleetkey--in_service { --c: var(--status-service); }

/* the four figures: each a pane with its 3D icon and a faint glow of the icon's colour */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  display: flex; flex-direction: column; gap: 3px; min-height: 132px; padding: 18px 20px;
  border-radius: 20px; overflow: clip; color: inherit; text-decoration: none;
  background: radial-gradient(180px 150px at 100% 0%, var(--tint), transparent 70%), var(--pane-sheen), var(--glass);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi--amber { --tint: rgba(255, 178, 92, .42); }
.kpi--violet { --tint: rgba(167, 139, 250, .4); }
.kpi--red   { --tint: rgba(255, 99, 120, .38); }
.kpi--green { --tint: rgba(92, 206, 140, .4); }
:root[data-theme="dark"] .kpi--amber { --tint: rgba(255, 178, 92, .16); }
:root[data-theme="dark"] .kpi--violet { --tint: rgba(167, 139, 250, .17); }
:root[data-theme="dark"] .kpi--red   { --tint: rgba(255, 99, 120, .16); }
:root[data-theme="dark"] .kpi--green { --tint: rgba(92, 206, 140, .15); }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--pane-lift); }
.kpi__ic { position: absolute; top: 14px; right: 14px; }
.kpi .eyebrow { padding-right: 54px; line-height: 1.4; }
.kpi__ic .sicon { width: 46px; height: 46px; filter: drop-shadow(0 7px 8px rgba(20, 24, 28, .24)); }
.kpi__v { margin-top: 8px; font-size: 42px; font-weight: 700; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__s { font-size: 12px; color: var(--g-60); }
.kpi--alert .kpi__v { color: var(--alert); }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; }
.card__hd > .sicon { width: 26px; height: 26px; flex: none; margin: -3px 0; filter: drop-shadow(0 3px 4px rgba(20, 24, 28, .2)); }

@media (max-width: 1180px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .dash-hero { padding: 20px; gap: 12px; }
  .dash-hero__h { font-size: 20px; }
  .dash-hero__art { width: 96px; height: 96px; }
  .dash-hero__art img { width: 84px; height: 84px; }
  .dash-hero__art::after { width: 76px; bottom: 6px; }
}
@media (max-width: 560px) {
  .dash-hero { grid-template-columns: minmax(0, 1fr); }
  .dash-hero__art { position: absolute; top: 10px; right: 10px; width: 64px; height: 64px; }
  .dash-hero__art img { width: 56px; height: 56px; }
  .dash-hero__art::after { display: none; }
  .dash-hero__txt > .eyebrow, .dash-hero__h { padding-right: 64px; }
  .kpi { min-height: 112px; padding: 14px 16px; }
  .kpi__v { font-size: 34px; }
  .kpi__ic { top: 10px; right: 10px; }
  .kpi__ic .sicon { width: 30px; height: 30px; }
  .kpi .eyebrow { padding-right: 32px; letter-spacing: .12em; }
}

/* ---------- sign-in ---------- */

.login__brand { margin: 12px; border-radius: 26px; background: var(--sheen), var(--sb-bg); box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .5); }
/* the form is a pane of glass on the floor */
.login__panel {
  align-self: center; justify-self: center;
  width: min(540px, calc(100% - 48px));
  margin: 24px; padding: 40px 44px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), var(--glass-hi);
}

/* ---------- phone ---------- */

@media (max-width: 900px) {
  .login__panel { width: auto; margin: 0 12px 12px; padding: 28px 22px; justify-self: stretch; }
  .sidebar { margin: 0; top: 0; bottom: 0; left: 0; border-radius: 0 20px 20px 0; }
  body:not(.nav-open) .sidebar { transform: translateX(calc(-100% - 40px)); }
  .topbar { margin: 8px 8px 0; border-radius: 14px; padding: 6px 10px; }
  .topbar h1 .sicon { width: 26px; height: 26px; }
}

/* without blur, the panes simply turn more opaque */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, .86); --glass-strong: #fbfbfa; --smoke: #0d0e11; }
  :root[data-theme="dark"] { --glass: rgba(32, 33, 40, .92); --glass-strong: #1e1f26; --smoke: #0a0b0d; }
}

@media (prefers-reduced-motion: reduce) {
  .nav a .sicon, .btn, .kpi, button.fleetkey { transition: none; }
  a.kpi:hover { transform: none; }
  .nav a:hover .sicon, .nav a.on .sicon { transform: none; }
}
