/*
 * digitaloneinbox — Aurora.
 * A warm-sunrise northern-lights skin: drifting peach/lavender/mint/coral light
 * over warm paper, frosted glass surfaces, a Bricolage Grotesque display paired
 * with Hanken Grotesk. The glow lives on the body; every surface is glass.
 */

:root {
  /* Aurora sunrise palette — the source of truth. */
  --au-bg:         #fff8f1;
  --au-surface:    rgba(255,255,255,.72);
  --au-surface-2:  rgba(255,255,255,.88);
  --au-line:       rgba(26,21,48,.12);
  --au-line-soft:  rgba(26,21,48,.07);
  --au-text:       #1a1530;
  --au-soft:       #6b6580;
  --au-faint:      #aba5c0;
  --au-peach:      #ffc9a8;
  --au-lavender:   #c9b8ff;
  --au-mint:       #a8e6cf;
  --au-coral:      #ff9b7a;
  --au-coral-deep: #f07a55;

  /* Legacy tokens remapped onto Aurora so existing markup needs no edits. */
  --paper:      var(--au-bg);
  --paper-2:    rgba(201,184,255,.14);   /* lavender-tinted muted fill */
  --surface:    var(--au-surface-2);     /* frosted glass card */
  --ink:        var(--au-text);
  --ink-soft:   var(--au-soft);
  --muted:      var(--au-faint);
  --line:       var(--au-line);
  --accent:     var(--au-coral);
  --accent-2:   var(--au-coral-deep);
  --accent-ink: #6b2a12;                 /* readable ink on coral */
  --danger:     #d9534f;
  --radius:     16px;
  --radius-sm:  11px;
  --shadow:     0 1px 2px rgba(26,21,48,.04), 0 18px 44px -20px rgba(255,155,122,.32);
  --glow-coral:    0 12px 30px -14px rgba(255,155,122,.55);
  --glow-lavender: 0 12px 30px -14px rgba(201,184,255,.6);
  --display: "Bricolage Grotesque", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--au-text);
  background: var(--au-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* App-wide aurora sky: drifting ribbons of light, fixed behind all content. */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 85vh;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 60% at 18% 30%, rgba(255,201,168,.55), transparent 70%),
    radial-gradient(46% 56% at 64% 16%, rgba(201,184,255,.50), transparent 70%),
    radial-gradient(40% 52% at 86% 40%, rgba(168,230,207,.45), transparent 70%),
    radial-gradient(52% 62% at 42% 6%,  rgba(255,155,122,.40), transparent 70%);
  filter: blur(48px) saturate(140%);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
/* Fine grain so the gradients read as atmosphere, not banding. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin: 0 0 .4rem;
}
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h2 { font-size: 1.3rem; margin-top: 2rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: .3rem 0 1rem; }
.muted { color: var(--muted); font-weight: 500; }

/* ---------- Flash + errors ---------- */
.flash {
  padding: .85rem 1.25rem;
  text-align: center;
  font-weight: 600;
  font-size: .92rem;
}
.flash-notice { background: #10231a; color: #d6f5e4; }
.flash-alert  { background: #2a0f08; color: #ffd9cc; }
.errors {
  background: #fbeae3;
  color: var(--danger);
  border: 1px solid #f0c4b4;
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-weight: 500;
  font-size: .92rem;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 1.05rem; display: flex; flex-direction: column; gap: .4rem; }
.field label, .field-label {
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--au-text);
  background: var(--au-surface);
  backdrop-filter: blur(8px);
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23aba5c0' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--au-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--au-coral);
  box-shadow: 0 0 0 3px rgba(255,155,122,.2);
}
textarea { resize: vertical; min-height: 2.6rem; }
input[type="file"] { font: inherit; font-size: .9rem; color: var(--muted); }

/* Quantity stepper: −/+ buttons flanking a narrow, centered number input.
   Hides the browser's native spinner so the custom arrows are the only ones. */
.stepper { display: inline-flex; align-items: stretch; gap: .5rem; }
.stepper input[type="number"] {
  width: 4.5rem;
  text-align: center;
  padding: .7rem .4rem;
  -moz-appearance: textfield;
}
.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-button {
  width: 2.8rem;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--au-surface);
  color: var(--au-text);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.stepper-button:hover { border-color: var(--au-coral); color: var(--au-coral); }

input[type="submit"], button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .72rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--au-coral), var(--au-coral-deep));
  color: #fff;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--glow-coral);
  transition: transform .12s, filter .15s, box-shadow .15s;
}
input[type="submit"]:hover, button:hover, .button:hover {
  filter: brightness(1.05);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(240,122,85,.65);
}
.button-ghost {
  background: var(--au-surface);
  backdrop-filter: blur(8px);
  color: var(--au-text);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.button-ghost:hover { background: var(--paper-2); color: var(--au-text); filter: none; box-shadow: none; }
/* Destructive action — outlined in red at rest, fills in on hover so the intent
   is unmistakable before the click. */
.button-danger {
  background: transparent;
  color: #c0392b;
  border: 1.5px solid #e09b91;
  box-shadow: none;
}
.button-danger:hover { background: #c0392b; color: #fff; filter: none; box-shadow: none; }

/* ---------- Auth + wizard card ---------- */
.auth-card, .wizard {
  max-width: 600px;
  margin: clamp(1.5rem, 6vh, 4.5rem) auto;
  background: var(--au-surface-2);
  backdrop-filter: blur(16px) saturate(140%);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.auth-card { max-width: 420px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wizard-steps {
  display: flex;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  counter-reset: step;
}
.wizard-steps li { flex: 1; }
.wizard-steps li a, .wizard-steps li span {
  display: block;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  padding: 0 0 .6rem;
  border-bottom: 3px solid var(--line);
  text-decoration: none;
}
.wizard-steps li.done a { color: var(--ink-soft); border-color: var(--ink-soft); }
.wizard-steps li.active a, .wizard-steps li.active span { color: var(--accent); border-color: var(--accent); }
.wizard-steps li a:hover { color: var(--ink); }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
}
.wizard-actions:only-child, .wizard form .wizard-actions { margin-top: 1.5rem; }

/* ---------- Autocomplete (dropdown sits BELOW the input) ---------- */
.autocomplete-field { position: relative; }
.suggestions {
  list-style: none;
  margin: 0;
  padding: .3rem;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 50;
  background: var(--au-surface-2);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.suggestions:empty { display: none; }
.suggestions li {
  padding: .55rem .65rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 500;
}
.suggestions li:hover { background: var(--paper-2); }
.suggestion-name { font-weight: 600; }

/* ---------- Cars ---------- */
.new-car-form {
  background: var(--paper-2);
  backdrop-filter: blur(10px);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
  border: 1px solid var(--au-line-soft);
}
.cars-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.car-card {
  background: var(--au-surface-2);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(26,21,48,.03), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .14s, box-shadow .14s;
}
.car-card:hover { transform: translateY(-2px); box-shadow: var(--glow-lavender), inset 0 1px 0 rgba(255,255,255,.6); }
.car-thumbs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .7rem; }
.car-thumbs img { border-radius: 8px; object-fit: cover; height: 80px; width: auto; }
.car-info { display: flex; flex-direction: column; gap: .1rem; }
.car-info strong { font-family: var(--display); font-size: 1.08rem; font-weight: 700; }
.car-qty { color: var(--au-coral); font-weight: 700; }
.car-actions { display: flex; gap: .9rem; align-items: center; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.car-actions form { margin: 0; }
.car-actions a { font-weight: 700; font-size: .88rem; }
.car-actions button {
  background: transparent;
  color: var(--danger);
  padding: 0;
  font-size: .88rem;
  font-weight: 700;
}
.car-actions button:hover { background: transparent; color: var(--accent-2); transform: none; box-shadow: none; text-decoration: underline; }

/* Drop zone */
.field label.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover { border-color: var(--accent); color: var(--ink-soft); }
.dropzone.is-dragging { border-color: var(--accent); background: #fbeee7; color: var(--accent); }
.dropzone strong { color: var(--ink); font-weight: 700; }
.dropzone-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 1.2rem;
  margin-bottom: .35rem;
}
.dropzone.is-dragging .dropzone-icon { background: var(--accent); color: #fff; }
.dropzone-hint { font-size: .78rem; opacity: .7; }
.dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Instant upload previews (media-library style) */
.preview-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .2rem; }
.preview-grid:empty { display: none; }
.preview-box {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.preview-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(26,21,48,.78);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}
.preview-remove:hover { background: var(--accent); transform: none; box-shadow: none; }

/* Marked-for-removal photo hides until save; checkbox stays in the form. */
.is-removing { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }

/* ---------- Signed-in shell: full-height dark sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(26,21,48,.92), rgba(26,21,48,.8));
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 64px -32px rgba(26,21,48,.6), inset 0 1px 0 rgba(255,255,255,.06);
  color: #efe9f5;
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sidebar-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-shadow: 0 0 24px rgba(201,184,255,.4);
}
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar-nav a {
  color: #c6bfdb;
  text-decoration: none;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .14s, color .14s, box-shadow .14s;
}
.sidebar-nav a:hover {
  background: rgba(255,155,122,.12);
  color: #fff;
  text-decoration: none;
  box-shadow: inset 2px 0 0 var(--au-coral);
}
.sidebar-logout {
  margin-top: auto;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.22);
  color: #efe9f5;
  border-radius: 999px;
  box-shadow: none;
}
.sidebar-logout:hover {
  background: linear-gradient(120deg, var(--au-coral), var(--au-coral-deep));
  border-color: transparent;
  color: #fff;
  filter: none;
  box-shadow: var(--glow-coral);
}
.app-main { flex: 1; padding: clamp(1.5rem, 4vw, 3rem); display: flex; justify-content: center; }

/* Centered dashboard column */
.dash { width: 100%; max-width: 820px; margin: 0 auto; }
.dash-narrow { max-width: 520px; }
.dash-head { text-align: center; margin-bottom: 1.75rem; }
.dash-head h1 { margin-bottom: .25rem; }
.dash-empty { text-align: center; margin-top: 2rem; }

/* "Add new car" reveals the form (native <details>) */
.add-car { text-align: center; margin-bottom: 2rem; }
.add-car > summary {
  list-style: none;
  display: inline-flex;
  margin: 0 auto;
}
.add-car > summary::-webkit-details-marker { display: none; }
.add-car[open] > summary { background: var(--ink); }
.add-car[open] > summary:hover { background: var(--ink-soft); box-shadow: none; }
.add-car .new-car-form { text-align: left; margin-top: 1.25rem; }
/* Photos are optional — the upload area reveals via a native <details> toggle */
.photos-disclosure { margin: 1.25rem 0; }
.photos-disclosure > summary { list-style: none; display: inline-flex; cursor: pointer; }
.photos-disclosure > summary::-webkit-details-marker { display: none; }
.photos-disclosure[open] > summary { margin-bottom: 1rem; }
/* Center the cards in the dashboard column (fixed tracks so few items don't hug left) */
.dash .cars-list { grid-template-columns: repeat(auto-fit, 250px); justify-content: center; }

/* ---------- Admin ---------- */
.car-agency { font-size: .82rem; color: var(--accent); font-weight: 600; margin-top: .15rem; }

/* Support chat — Slack-style rows (avatar + author + message) */
.chat { text-align: left; max-width: 720px; margin: 0 auto; }
.messages { display: flex; flex-direction: column; padding: .5rem 0; }
.chat-empty { text-align: center; padding: 2rem 0; }
.msg { display: flex; gap: .65rem; padding: .5rem .6rem; border-radius: 10px; }
.msg:hover { background: rgba(26,21,48,.035); }
.msg-avatar {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
}
.msg-agency .msg-avatar { background: var(--ink); }
.msg-admin  .msg-avatar { background: var(--accent); }
.msg-content { min-width: 0; flex: 1; }
.msg-meta { display: flex; align-items: baseline; gap: .5rem; }
.msg-author { font-weight: 700; }
.msg-time { font-size: .72rem; color: var(--muted); }
.msg-text { white-space: pre-wrap; }
.msg-text p { margin: .1rem 0 0; }
.msg-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.msg-files img { border-radius: 8px; max-height: 180px; display: block; border: 1px solid var(--line); }
.msg-file { display: inline-block; padding: .35rem .7rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--ink); }

/* Slack-style composer: one bordered box with the actions on a footer row */
.composer { position: sticky; bottom: 0; background: var(--paper); padding: .6rem 0; margin-top: .5rem; }
.composer form { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); padding: .5rem .65rem; display: flex; flex-direction: column; gap: .4rem; transition: border-color .15s, box-shadow .15s; }
.composer form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,155,122,.15); }
.composer textarea { border: none; background: transparent; padding: .3rem; min-height: 2.2rem; resize: none; }
.composer textarea:focus { outline: none; box-shadow: none; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--line); padding-top: .45rem; }
.composer-actions input[type="file"] { font-size: .82rem; }

/* Admin inbox list */
.inbox-list { display: grid; gap: .6rem; max-width: 640px; margin: 0 auto; text-align: left; }
.inbox-item { display: block; background: var(--au-surface-2); backdrop-filter: blur(12px) saturate(140%); border: 1px solid var(--au-line-soft); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: var(--au-text); transition: border-color .14s, transform .14s, box-shadow .14s; }
.inbox-item:hover { border-color: rgba(255,155,122,.5); transform: translateY(-1px); text-decoration: none; box-shadow: var(--glow-coral); }
.inbox-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.inbox-time { font-size: .8rem; }
.inbox-preview { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.inbox-who { font-weight: 700; color: var(--ink-soft); }
.inbox-empty {
  width: 100%;
  padding: 2.5rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

/* Admin: centered column, lighter typography */
.admin-page { max-width: 960px; margin: 0 auto; text-align: center; }
.admin-page h1 { font-weight: 500; font-size: 1.9rem; letter-spacing: -.015em; }
.admin-page h2 { font-weight: 500; font-size: 1.25rem; letter-spacing: -.01em; }
.admin-head { margin: 2.25rem 0 1.1rem; }
.admin-head:first-of-type { margin-top: 0; }
.admin-head p { margin: .15rem 0 0; font-size: .9rem; }
.admin-page .admin-table { text-align: left; } /* tables read better left-aligned */
.admin-page .cars-list { grid-template-columns: repeat(auto-fit, 250px); justify-content: center; }
form[data-controller="search-form"] { max-width: 440px; margin: 0 auto 1.5rem; }

.admin-bar { max-width: 960px; margin: 0 auto 1.75rem; display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.admin-brand { font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--au-surface-2);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--paper-2); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td a { font-weight: 700; }
/* Admin agency detail — centered column with icon chips */
.agency-show { max-width: 900px; margin: 0 auto; text-align: center; }
.agency-show .back-link { display: inline-block; margin-bottom: .75rem; font-weight: 600; }
.agency-meta {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}
.agency-meta li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--au-surface-2);
  backdrop-filter: blur(10px);
  border: 1px solid var(--au-line-soft);
  border-radius: 999px;
  padding: .45rem .95rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.meta-icon { width: 17px; height: 17px; color: var(--accent); flex: none; }
.agency-show .cars-list { grid-template-columns: repeat(auto-fit, 250px); justify-content: center; margin-top: 1rem; }
.danger-zone { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-brand { border: none; padding: 0; }
  .sidebar-logout { margin: 0 0 0 auto; }
}

/* ============================================================
 * Support console — the hero treatment of the Aurora system.
 * Inherits the global --au-* tokens; adds a full-height floating
 * glass panel with its own concentrated glow and per-sender bubbles.
 * ============================================================ */

/* The console panel: a glass card floating on the warm paper. */
.aurora .chat {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: clip;                 /* clips the aurora glow without breaking sticky */
  min-height: calc(100vh - 6rem);
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid var(--au-line-soft);
  border-radius: 22px;
  color: var(--au-text);
  background:
    radial-gradient(150% 120% at 50% -25%, #ffffff 0%, transparent 60%),
    var(--au-surface-2);
  backdrop-filter: blur(12px);
  box-shadow:
    0 24px 64px -24px rgba(255,155,122,.30),
    inset 0 1px 0 rgba(255,255,255,.7);
}

/* Drifting aurora ribbons. */
.aurora .chat::before {
  content: "";
  position: absolute;
  inset: -35% -12% auto -12%;
  height: 75%;
  pointer-events: none;
  background:
    radial-gradient(42% 60% at 18% 32%, rgba(255,201,168,.55), transparent 70%),
    radial-gradient(46% 56% at 64% 18%, rgba(201,184,255,.50), transparent 70%),
    radial-gradient(40% 52% at 86% 42%, rgba(168,230,207,.45), transparent 70%),
    radial-gradient(52% 62% at 42% 8%,  rgba(255,155,122,.40), transparent 70%);
  filter: blur(42px) saturate(140%);
  animation: aurora-drift 20s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(-5%, 0, 0) scale(1.05); opacity: .85; }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.18); opacity: 1; }
  100% { transform: translate3d(6%, 2%, 0) scale(1.1);  opacity: .9; }
}

/* Fine grain so the gradients read as atmosphere, not banding. */
.aurora .chat::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Header sits above the glow. */
.aurora .chat-head { position: relative; z-index: 1; padding: .4rem .35rem 1.1rem; }
.aurora .chat-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--au-coral-deep);
}
.aurora .chat-status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--au-coral);
  box-shadow: 0 0 10px 1px rgba(255,155,122,.8);
  animation: aurora-pulse 2.4s ease-in-out infinite;
}
@keyframes aurora-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.aurora .chat-head h1 {
  margin: .3rem 0 .15rem;
  color: var(--au-text);
  text-shadow: 0 0 28px rgba(255,155,122,.30);
}
.aurora .chat-sub { margin: 0; color: var(--au-soft); }

/* Message stream fills the panel; composer rides the bottom. */
.aurora .messages { position: relative; z-index: 1; flex: 1; gap: .1rem; padding: .35rem 0; }
.aurora .chat-empty { color: var(--au-soft); }
.aurora .msg { border-radius: 14px; padding: .55rem .55rem; }
.aurora .msg:hover { background: rgba(26,21,48,.04); }
.aurora .msg-author { color: var(--au-text); }
.aurora .msg-time { color: var(--au-faint); }

/* Glowing glass bubbles, tinted by sender. */
.aurora .msg-text {
  display: inline-block;
  margin-top: .3rem;
  padding: .5rem .75rem;
  border: 1px solid var(--au-line-soft);
  border-radius: 13px;
  background: var(--au-surface);
  backdrop-filter: blur(6px);
  color: var(--au-text);
}
.aurora .msg-admin  .msg-text { border-color: rgba(255,155,122,.35); box-shadow: 0 10px 26px -14px rgba(255,155,122,.55); }
.aurora .msg-agency .msg-text { border-color: rgba(201,184,255,.5);  box-shadow: 0 10px 26px -14px rgba(201,184,255,.6); }

/* Avatars glow in the sender's colour. */
.aurora .msg-avatar { border-radius: 13px; }
.aurora .msg-admin .msg-avatar {
  background: linear-gradient(140deg, var(--au-peach), var(--au-coral));
  color: #6b2a12;
  box-shadow: 0 0 0 1px rgba(255,155,122,.4), 0 8px 22px -8px rgba(255,155,122,.6);
}
.aurora .msg-agency .msg-avatar {
  background: linear-gradient(140deg, var(--au-lavender), #b39bff);
  color: #2e2456;
  box-shadow: 0 0 0 1px rgba(201,184,255,.5), 0 8px 22px -8px rgba(201,184,255,.7);
}

/* Attachments on dark. */
.aurora .msg-files img { border-color: var(--au-line); border-radius: 12px; }
.aurora .msg-file {
  background: var(--au-surface);
  border-color: var(--au-line);
  color: var(--au-text);
  backdrop-filter: blur(6px);
}

/* Glassmorphic composer. */
.aurora .composer { z-index: 1; background: transparent; padding: .6rem 0 .9rem; }
.aurora .composer form {
  border: 1px solid var(--au-line);
  border-radius: 18px;
  background: var(--au-surface-2);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 18px 44px -22px rgba(255,155,122,.35);
}
.aurora .composer form:focus-within {
  border-color: rgba(255,155,122,.6);
  box-shadow: 0 0 0 3px rgba(255,155,122,.18), 0 18px 44px -22px rgba(255,155,122,.35);
}
.aurora .composer textarea { color: var(--au-text); }
.aurora .composer textarea::placeholder { color: var(--au-faint); }
.aurora .composer-actions { border-top: 1px solid var(--au-line-soft); }
.aurora .composer-actions input[type="file"] { color: var(--au-soft); }

/* Send button: an aurora-gradient pill. */
.aurora .composer input[type="submit"] {
  background: linear-gradient(120deg, var(--au-coral), var(--au-coral-deep));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(255,155,122,.6);
}
.aurora .composer input[type="submit"]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -8px rgba(240,122,85,.7);
}

/* Slim cool-toned scrollbar inside the console. */
.aurora .chat ::-webkit-scrollbar { width: 9px; height: 9px; }
.aurora .chat ::-webkit-scrollbar-thumb { background: rgba(201,184,255,.45); border-radius: 999px; }
.aurora .chat ::-webkit-scrollbar-thumb:hover { background: rgba(255,155,122,.6); }

@media (prefers-reduced-motion: reduce) {
  .aurora .chat::before,
  .aurora .chat-status::before { animation: none; }
}

/* ============================================================
 * Reservations — car availability chips + the month timeline.
 * ============================================================ */

/* Availability chip on inventory cards (shown only when not available). */
.car-status {
  display: inline-block;
  width: fit-content;
  margin-top: .25rem;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.car-status-maintenance { background: rgba(255,201,168,.55); color: #8a4a22; }
.car-status-hidden { background: rgba(26,21,48,.1); color: var(--au-soft); }

/* The reservations page is a full-height app calendar: it fills the main area
 * (viewport minus the app-main padding), and the grid scrolls inside itself. */
.reservations {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 2 * clamp(1.5rem, 4vw, 3rem));
  min-height: 0;
}
.cal-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Single compact toolbar: title left, month nav centered, new-booking right. */
.res-toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex: none; }
.res-title { margin: 0; font-size: 1.5rem; }

/* Airbnb-style range date picker (Stimulus: date_range_controller). Day cells
 * are <button>s, so these rules override the global gradient-pill button base. */
.dp-summary { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.dp-pill {
  flex: 1;
  padding: .6rem .85rem;
  border: 1.5px solid var(--au-line);
  border-radius: var(--radius-sm);
  background: var(--au-surface);
  backdrop-filter: blur(8px);
  font-weight: 600; font-size: .88rem;
  color: var(--au-text);
  text-align: center;
}
.dp-arrow { color: var(--au-faint); font-weight: 700; flex: none; }
.dp-cal {
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  background: var(--au-surface-2);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--shadow);
  padding: .85rem;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.dp-month { font-family: var(--display); font-weight: 700; font-size: 1.02rem; color: var(--au-text); }
.dp-nav {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--au-surface);
  border: 1px solid var(--au-line-soft);
  color: var(--au-text); font-size: 1.1rem; line-height: 1;
  box-shadow: none;
}
.dp-nav:hover { background: var(--paper-2); transform: none; filter: none; box-shadow: none; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-dow { text-align: center; font-size: .66rem; font-weight: 700; letter-spacing: .03em; color: var(--au-faint); padding: .3rem 0 .5rem; }
.dp-empty { aspect-ratio: 1 / 1; }
.dp-day {
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  display: grid; place-items: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--au-text);
  font-size: .85rem; font-weight: 600;
  box-shadow: none;
  cursor: pointer;
  transition: background .12s;
}
.dp-day:hover { background: rgba(255,155,122,.2); transform: none; filter: none; box-shadow: none; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--au-line); }
.dp-day.is-disabled { color: var(--au-faint); opacity: .38; cursor: default; pointer-events: none; }
.dp-day.is-in-range { background: rgba(201,184,255,.3); border-radius: 0; }
.dp-day.is-start, .dp-day.is-end {
  background: linear-gradient(120deg, var(--au-coral), var(--au-coral-deep));
  color: #fff;
}
.dp-day.is-start { border-radius: 999px 0 0 999px; }
.dp-day.is-end { border-radius: 0 999px 999px 0; }
.dp-day.is-start.is-end { border-radius: 999px; }

/* Month switcher. */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0 auto; }
.cal-step {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--au-surface-2);
  backdrop-filter: blur(10px);
  border: 1px solid var(--au-line-soft);
  color: var(--au-text);
  font-size: 1.3rem; line-height: 1;
  box-shadow: var(--shadow);
}
.cal-step:hover { text-decoration: none; border-color: rgba(255,155,122,.5); box-shadow: var(--glow-coral); }
.cal-title { font-family: var(--display); font-weight: 700; font-size: 1.15rem; min-width: 10rem; text-align: center; }

/* The timeline: a glass panel that fills the height and scrolls internally.
 * The whole month fits the width (no horizontal scrollbar) — months are
 * navigated with the ‹ › arrows in the toolbar instead. */
.calendar {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  background: var(--au-surface-2);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}
/* Header and every car row share one column template: a fixed label column
 * plus one fluid track per day of the month (--days is set inline per page).
 * minmax(0, 1fr) lets all days fit the width however many there are. */
.cal-grid {
  display: grid;
  grid-template-columns: 180px repeat(var(--days), minmax(0, 1fr));
}
/* Header stays pinned to the top as the rows scroll under it. */
.cal-head { flex: none; position: sticky; top: 0; z-index: 4; border-bottom: 1px solid var(--au-line); }
.cal-corner, .cal-label {
  position: sticky; left: 0; z-index: 3;
  background: var(--au-surface-2);
  backdrop-filter: blur(14px) saturate(140%);
  border-right: 1px solid var(--au-line);
}
.cal-dayhead {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: .5rem 0; gap: .1rem;
  border-left: 1px solid var(--au-line-soft);
}
.cal-dow { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; color: var(--au-faint); }
.cal-dom { font-size: .85rem; font-weight: 700; color: var(--au-text); }
.cal-dayhead.is-weekend { background: rgba(201,184,255,.1); }
.cal-dayhead.is-today { background: rgba(255,155,122,.18); }
.cal-dayhead.is-today .cal-dom { color: var(--au-coral-deep); }

/* Car rows: label + faint day cells + reservation bars, all on grid-row 1.
 * They grow to share the panel height; with many cars they keep their min
 * height and the panel scrolls vertically instead. */
.cal-row { border-top: 1px solid var(--au-line-soft); flex: 1 0 auto; }
.cal-label {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem;
}
.cal-thumb { width: 56px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; }
.cal-thumb-empty { display: grid; place-items: center; background: var(--paper-2); font-size: 1.1rem; }
.cal-carname { font-weight: 600; font-size: .9rem; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.cal-chip {
  width: fit-content;
  padding: .05rem .45rem;
  border-radius: 999px;
  background: rgba(255,201,168,.55);
  color: #8a4a22;
  font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.cal-cell { grid-row: 1; min-height: 56px; border-left: 1px solid var(--au-line-soft); }
.cal-cell.is-weekend { background: rgba(201,184,255,.06); }
.cal-cell.is-today { background: rgba(255,155,122,.1); }
.cal-row.is-maintenance .cal-cell {
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,201,168,.18) 6px 12px);
}

.cal-bar {
  grid-row: 1;
  z-index: 2;
  align-self: center;
  margin: 5px 3px;
  display: flex; align-items: center; gap: .4rem;
  min-width: 0;
  padding: .22rem .5rem .22rem .22rem;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(201,184,255,.92), rgba(168,230,207,.92));
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--glow-lavender), inset 0 1px 0 rgba(255,255,255,.6);
  color: var(--au-text);
  font-size: .8rem; font-weight: 600;
  overflow: hidden;
}
.cal-bar-link { display: flex; align-items: center; gap: .4rem; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.cal-bar-link:hover { text-decoration: none; }
.cal-bar-thumb { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; flex: none; }
.cal-bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar-days { margin-left: auto; padding-left: .2rem; font-size: .66rem; font-weight: 700; color: var(--au-soft); flex: none; }
.cal-bar form { margin: 0; display: inline-flex; flex: none; }
.cal-bar-x {
  width: 18px; height: 18px;
  padding: 0;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(26,21,48,.12);
  color: var(--au-text);
  font-size: .9rem; line-height: 1;
  box-shadow: none;
}
.cal-bar-x:hover { background: var(--au-coral-deep); color: #fff; transform: none; box-shadow: none; filter: none; }

/* Car picker: radio cards with thumbnails, replacing the plain <select>. */
.car-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.car-pick {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem;
  border: 1.5px solid var(--au-line);
  border-radius: var(--radius-sm);
  background: var(--au-surface);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.car-pick:hover { border-color: rgba(255,155,122,.5); }
.car-pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.car-pick:has(:checked) {
  border-color: var(--au-coral);
  background: var(--au-surface-2);
  box-shadow: var(--glow-coral);
}
.car-pick-thumb { flex: none; width: 56px; height: 42px; }
.car-pick-thumb img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; display: block; }
.car-pick-thumb-empty {
  display: grid; place-items: center;
  width: 56px; height: 42px;
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 1.1rem;
}
.car-pick-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.car-pick-name { font-weight: 600; font-size: .9rem; }

/* Reservation detail page. */
.res-show { max-width: 620px; margin: 0 auto; }
.res-show .back-link { display: inline-block; margin-bottom: .75rem; font-weight: 600; }
.res-show-card {
  background: var(--au-surface-2);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  padding: clamp(1.25rem, 4vw, 2rem);
}
.res-show-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.res-show-head h1 { margin: 0; }
.res-show-head p { margin: .2rem 0 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.res-show-thumb { width: 120px; height: 84px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }
.res-show-thumb-empty { display: grid; place-items: center; background: var(--paper-2); font-size: 2rem; }

.res-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--au-line-soft);
  border-bottom: 1px solid var(--au-line-soft);
}
.res-facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--au-faint); margin-bottom: .2rem; }
.res-facts dd { margin: 0; font-weight: 600; }

.res-docs { margin-bottom: 1.5rem; }
.res-doc-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.res-doc { display: block; border-radius: var(--radius-sm); text-decoration: none; }
.res-doc-thumb { width: 120px; height: 90px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--au-line); display: block; }
.res-doc-file {
  display: inline-block;
  padding: .55rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--au-surface);
  border: 1px solid var(--au-line);
  font-weight: 600; font-size: .88rem;
  color: var(--au-text);
}
.res-doc-file:hover { border-color: rgba(255,155,122,.5); }
.res-show-actions { display: flex; justify-content: flex-end; }
.res-show-actions .button { background: transparent; color: var(--danger); border: 1.5px solid var(--au-line); box-shadow: none; }
.res-show-actions .button:hover { background: var(--danger); color: #fff; filter: none; box-shadow: none; }

/* ============================================================
 * Call Center — reservations as rows, tags shown as leaves.
 * ============================================================ */
.center { width: 100%; max-width: 860px; margin: 0 auto; }
.center-rows { display: flex; flex-direction: column; gap: .5rem; }
.center-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
  border: 1px solid var(--au-line-soft);
  border-radius: var(--radius-sm);
  background: var(--au-surface-2);
  backdrop-filter: blur(8px);
  text-decoration: none;
  color: var(--au-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .12s, box-shadow .12s;
}
.center-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.center-leaves { flex: none; width: 148px; display: flex; flex-wrap: wrap; gap: .3rem; }
.center-renter { flex: 1 1 0; min-width: 88px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center-car { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .5rem; color: var(--au-soft); font-size: .9rem; }
.center-carname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center-thumb { flex: none; width: 44px; height: 32px; border-radius: 7px; object-fit: cover; }
.center-dates { color: var(--au-soft); font-size: .85rem; flex: none; }
.center-days { flex: none; font-weight: 700; font-size: .8rem; color: var(--au-soft); }

/* A tag leaf: green→blue gradient (set inline), pointed on one diagonal. */
.leaf {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 0 100% 0 100% / 0 100% 0 100%;
  color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 2px 6px -2px rgba(26,21,48,.35);
}
.leaf.is-untagged { background: var(--au-line) !important; color: var(--au-soft); box-shadow: none; }

/* Live leaf preview under the tags input on the booking form. */
.tag-leaves { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.tag-leaves:empty { display: none; }
