/* ============================================================
   CARCLUB MANAGER — LIQUID GLASS DESIGN SYSTEM
   Replaces "Neon Carbon" industrial brutalism with a modern
   frosted-glass aesthetic: translucent surfaces, ambient
   auroras, soft specular highlights, rounded geometry.
   ============================================================ */

:root {
  /* Base — deep indigo-black with slight warm bias */
  --bg-0: #070810;
  --bg-1: #0C0E1A;
  --bg-2: #111426;

  /* Ink */
  --ink-1: #F4F5FA;      /* primary text */
  --ink-2: #B8BCCF;      /* secondary */
  --ink-3: #7A7E95;      /* tertiary / labels */
  --ink-4: #4A4D63;      /* disabled / hairlines */

  /* Accents — kept from original IA but desaturated */
  --acc-magenta: #FF3EA5;
  --acc-cyan:    #3FE0FF;
  --acc-lime:    #9FFF7A;
  --acc-amber:   #FFC85B;

  /* Glass tokens */
  --glass-bg:    rgba(255, 255, 255, 0.045);
  --glass-bg-2:  rgba(255, 255, 255, 0.07);
  --glass-bg-3:  rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.16);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---------- AMBIENT AURORA BACKGROUND ---------- */
.aurora-bg::before,
.aurora-bg::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.55;
  border-radius: 50%;
}
.aurora-bg::before {
  top: -10%;
  left: -5%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(255, 62, 165, 0.35), transparent 60%);
}
.aurora-bg::after {
  bottom: -15%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(63, 224, 255, 0.30), transparent 60%);
}
.aurora-third {
  position: fixed;
  top: 40%;
  right: 30%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(159, 255, 122, 0.15), transparent 70%);
  filter: blur(100px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Page content sits above aurora */
main, nav, header, aside, .app-layer { position: relative; z-index: 1; }

/* ---------- GLASS PRIMITIVE ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.5),
    0 8px 24px -8px rgba(0, 0, 0, 0.3);
  position: relative;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 30%, transparent 70%, rgba(255,255,255,0.02) 100%);
  pointer-events: none;
  opacity: 0.6;
}

.glass-strong {
  background: var(--glass-bg-2);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 40px 80px -24px rgba(0, 0, 0, 0.6);
}

.glass-inset {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--r-md);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.glass-chip {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- CHROMATIC ACCENT CHIPS ---------- */
.chip-magenta { background: rgba(255,62,165,0.12); border-color: rgba(255,62,165,0.3); color: #FFB3D9; }
.chip-cyan    { background: rgba(63,224,255,0.12); border-color: rgba(63,224,255,0.3); color: #B3F0FF; }
.chip-lime    { background: rgba(159,255,122,0.12); border-color: rgba(159,255,122,0.3); color: #D8FFC4; }
.chip-amber   { background: rgba(255,200,91,0.14); border-color: rgba(255,200,91,0.3); color: #FFE0A8; }

/* ---------- NAVIGATION ---------- */
.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 10px 20px;
  border-radius: var(--r-pill);
  background: rgba(12, 14, 26, 0.55);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 20px 50px -10px rgba(0, 0, 0, 0.5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 16px;
  color: var(--ink-1);
  text-decoration: none;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(255, 62, 165, 0.35));
}
.brand-logo--lg {
  height: 64px;
}

/* ---------- AUTH CARDS (login / register) ---------- */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}
.auth-card h1 {
  margin: 0 0 8px;
}
.auth-card .lead {
  color: var(--ink-2);
  margin: 0 0 28px;
  font-size: 14px;
}
.field {
  margin-bottom: 18px;
}
/* Only the field's own label is the uppercase eyebrow — not nested labels
   like radio/checkbox option rows. */
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.field .input {
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 12px;
}
.field-errors {
  color: #ff7196;
  font-size: 12px;
  margin-top: 6px;
}
.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 14px 16px;
  font-size: 14px;
}
.auth-alert {
  background: rgba(255, 80, 120, 0.12);
  border: 1px solid rgba(255, 80, 120, 0.3);
  color: #ffbac8;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}
.auth-alert--ok   { background: rgba(36,200,140,0.12); border-color: rgba(36,200,140,0.3); color: #9ce8c2; }
.auth-alert--info { background: rgba(80,180,255,0.12); border-color: rgba(80,180,255,0.3); color: #a8d6ff; }
.auth-alert--warn { background: rgba(255,180,0,0.12);  border-color: rgba(255,180,0,0.3);  color: #ffd98a; }
.link-strong { font-weight: 500; }

/* Pill nav */
.pill-nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.04);
}
.pill-nav a {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  border-radius: var(--r-pill);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill-nav a:hover { color: var(--ink-1); background: rgba(255,255,255,0.04); }
.pill-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-1);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 4px 12px rgba(0,0,0,0.3);
}

/* Icon button */
.ibtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s;
}
.ibtn:hover { background: rgba(255,255,255,0.08); color: var(--ink-1); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 2px rgba(7,8,16,0.8);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, #FF5AB5, #E8288C);
  color: #180012;
  border-color: rgba(255,255,255,0.25);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset,
    0 10px 30px -8px rgba(255, 62, 165, 0.5);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-glass {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,0.12);
  color: var(--ink-1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
}
.btn-glass:hover { background: rgba(255,255,255,0.1); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: rgba(255,255,255,0.08);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: var(--ink-1); }

/* ---------- INPUTS ---------- */
.input {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-1);
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.input:focus { border-color: rgba(255,255,255,0.2); background: rgba(0,0,0,0.4); }
.input::placeholder { color: var(--ink-3); }
.input-wrap { position: relative; display: inline-block; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 18px;
  pointer-events: none;
}
/* Icon clearance only when an icon is present (input wrapped in .input-wrap).
   The .field override re-sets padding, so it needs the explicit rule too. */
.input-wrap .input,
.field .input-wrap .input { padding-left: 38px; }
.field .input-wrap { display: block; }
/* Trailing in-field action (e.g. password show/hide) */
.input-action {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
}
.input-action:hover { color: var(--ink-1); }
.input--with-action { padding-right: 80px; }

/* ---------- FORM LAYOUT (shared across all forms) ---------- */
.form-page { max-width: 640px; margin: 60px auto; padding: 0 24px; }
.form-card { padding: 40px; }
.form-lead { color: var(--ink-2); margin: 0 0 24px; }
.form-stack { display: grid; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; align-items: center; }
.form-actions-danger { margin-right: auto; color: var(--acc-magenta); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-hint { display: block; color: var(--ink-3); font-size: 12px; margin-top: 6px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-row { display: flex; gap: 8px; align-items: center; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; font-size: 13px; }
.auth-foot { text-align: center; color: var(--ink-2); font-size: 13px; margin: 24px 0 0; }
.link-cyan { color: var(--acc-cyan); text-decoration: none; }
.link-cyan:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* ---------- MODAL (shared host; CRUD overlays, UI-UX-Guide §5) ---------- */
.modal-host { display: none; position: fixed; inset: 0; z-index: 200; }
.modal-host.is-open { display: block; }
.modal-shell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
  overflow-y: auto;
  background: rgba(4, 5, 12, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade 0.2s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: rgba(17, 20, 38, 0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 40px 100px -20px rgba(0,0,0,0.7);
  padding: 28px;
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; }
.modal-lead { color: var(--ink-2); font-size: 13px; margin: 4px 0 0; }
input[type="datetime-local"].input { color-scheme: dark; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* Mobile: dock the modal to the bottom as a sheet */
@media (max-width: 600px) {
  .modal-shell { padding: 0; align-items: flex-end; }
  .modal-card { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; }
}

/* ---------- TYPE ---------- */
.display {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}
.h1 { font-size: clamp(32px, 5vw, 54px); }
.h2 { font-size: 28px; letter-spacing: -0.025em; font-weight: 600; }
.h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  position: fixed;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: 240px;
  padding: 12px 12px 16px;
  border-radius: var(--r-xl);
  background: rgba(12, 14, 26, 0.5);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 30px 60px -20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
  overflow-y: auto;
}
/* Top row: brand + collapse toggle share one flex row so the toggle keeps a
   stable position (no flex-end→center jump between states). */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-brand {
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
}
.sidebar-brand-logo {
  height: 26px;
}
.sidebar-search {
  width: 100%;
  margin: 8px 0 6px;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}
/* Profile + logout share a row; profile flexes, logout sits at the end. */
.sidebar-account { display: flex; align-items: center; gap: 6px; }
.sidebar-account .sidebar-profile { flex: 1; min-width: 0; }
/* form wrapper disappears so the logout button is a direct flex child */
.sidebar-logout-form { display: contents; }
.sidebar-logout { flex-shrink: 0; color: var(--ink-3); }
.sidebar-logout:hover { color: var(--ink-1); background: rgba(255,255,255,0.08); }
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink-1);
  transition: background 0.2s;
}
.side-section { padding: 12px 14px 4px; }
.sidebar-profile:hover { background: rgba(255,255,255,0.04); }
.sidebar-profile .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sidebar-profile-meta { min-width: 0; flex: 1; }
.sidebar-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-handle {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-promo {
  padding: 14px;
  border-radius: 18px;
  margin-top: 12px;
}
.sidebar-promo-eyebrow { margin-bottom: 6px; }
.sidebar-promo-body {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--ink-2);
}
.sidebar-promo-cta { width: 100%; }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.side-link:hover { color: var(--ink-1); background: rgba(255,255,255,0.04); }
.side-link.active {
  color: var(--ink-1);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}
.side-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc-magenta);
  margin-left: auto;
  box-shadow: 0 0 10px var(--acc-magenta);
}
.side-section {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 16px 14px 6px;
  font-weight: 600;
}

/* Main column offset for sidebar. Wird sowohl auf turbo-frame#page (auto)
   als auch auf einzelne Page-Wrapper angewendet — display:block ist nötig
   weil <turbo-frame> default-inline ist und sonst padding-left ignoriert. */
.with-sidebar {
  display: block;
  padding-left: 272px;
  padding-top: 24px;
  padding-right: 16px;
  padding-bottom: 40px;
}

/* ---------- UTILITY ---------- */
.hair { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); }
.dotgrid {
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 0);
  background-size: 22px 22px;
}
.spec-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 30%);
  mix-blend-mode: screen;
  opacity: 0.5;
}

/* Card hover */
.lift { transition: transform 0.3s ease, border-color 0.3s ease; }
.lift:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.18); }

/* Status LED */
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.led-lime { background: var(--acc-lime); box-shadow: 0 0 12px var(--acc-lime), 0 0 0 3px rgba(159,255,122,0.15); }
.led-cyan { background: var(--acc-cyan); box-shadow: 0 0 12px var(--acc-cyan), 0 0 0 3px rgba(63,224,255,0.15); }
.led-magenta { background: var(--acc-magenta); box-shadow: 0 0 12px var(--acc-magenta), 0 0 0 3px rgba(255,62,165,0.15); }
.led-off { background: var(--ink-4); }

/* Material symbols */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
}

/* Progress bar */
.progress { height: 4px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; width: var(--w, 0%); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* Placeholder image — striped, to indicate where real imagery goes */
.ph-img {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 12px, rgba(255,255,255,0.02) 12px 24px),
    linear-gradient(135deg, #1A1D30, #0E101C);
  position: relative;
  overflow: hidden;
}
.ph-img::after {
  content: attr(data-ph);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

/* ---------- SIDEBAR RAIL-COLLAPSE (desktop) ---------- */
.brand-icon { display: none; }
.sidebar-brand-icon { height: 34px; width: 34px; object-fit: contain; }
/* Collapse control = a nav row pinned to the sidebar bottom (GitLab-style).
   Reuses .side-link; just reset the button chrome + animate the icon. */
/* font-family only (not the `font` shorthand, which would also reset font-size
   and make the label larger than the other nav links). */
button.side-link { width: 100%; background: transparent; border: 0; font-family: inherit; cursor: pointer; }
.sidebar-collapse .material-symbols-rounded { transition: transform 0.2s; }

/* Rail-Modus greift nur am Desktop — auf Mobile ist die Sidebar ohnehin aus. */
@media (min-width: 961px) {
  html.sidebar-collapsed .sidebar { width: 72px; }
  html.sidebar-collapsed .with-sidebar { padding-left: 104px; }
  html.sidebar-collapsed .sidebar-account { flex-direction: column; }
  html.sidebar-collapsed .sidebar-collapse .material-symbols-rounded { transform: rotate(180deg); }
  html.sidebar-collapsed .side-label,
  html.sidebar-collapsed .side-section,
  html.sidebar-collapsed .sidebar-search,
  html.sidebar-collapsed .sidebar-profile-meta,
  html.sidebar-collapsed .sidebar-promo,
  html.sidebar-collapsed .sidebar-brand-logo,
  html.sidebar-collapsed .side-link .dot { display: none; }
  html.sidebar-collapsed .sidebar-brand-icon { display: block; }
  html.sidebar-collapsed .side-link,
  html.sidebar-collapsed .sidebar-profile { justify-content: center; padding-left: 0; padding-right: 0; }
}

/* ---------- RAIL SEARCH AFFORDANCE (collapsed only) ---------- */
/* Eingeklappt ist die Volltext-Suche aus; diese Lupe klappt sie wieder auf. */
.sidebar-search-rail { display: none; }
@media (min-width: 961px) {
  html.sidebar-collapsed .sidebar-search-rail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 2px auto 6px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--ink-3);
    cursor: pointer;
    transition: all 0.2s;
  }
  html.sidebar-collapsed .sidebar-search-rail:hover {
    color: var(--ink-1);
    background: rgba(255,255,255,0.08);
  }
  html.sidebar-collapsed .sidebar-search-rail .material-symbols-rounded { font-size: 20px; }
}

/* ---------- RAIL TOOLTIPS (collapsed only) ----------
   Ersetzt native title-Tooltips durch gestylte, die nur im Rail erscheinen
   (expandiert sind die Labels ohnehin sichtbar). :focus-visible deckt
   Tastatur-Navigation mit ab. overflow:visible nötig, damit der Tooltip aus
   der Rail herausragen darf (sonst klippt das auto-overflow-x). */
@media (min-width: 961px) {
  html.sidebar-collapsed .sidebar { overflow: visible; }
  html.sidebar-collapsed [data-tooltip] { position: relative; }
  html.sidebar-collapsed [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 7px 11px;
    background: var(--bg-2);
    color: var(--ink-1);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 10px 30px -8px rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    z-index: 60;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  html.sidebar-collapsed [data-tooltip]:hover::after,
  html.sidebar-collapsed [data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* ---------- BOTTOM NAV (mobile, authed) ---------- */
.bottom-nav { display: none; }
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
.bottom-nav-item .material-symbols-rounded { font-size: 22px; }
.bottom-nav-item.active {
  color: var(--ink-1);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
}
button.bottom-nav-item { background: transparent; border: 0; font-family: inherit; cursor: pointer; }

/* "More" bottom sheet — secondary nav on mobile (full sidebar parity). */
.more-sheet { position: fixed; inset: 0; z-index: 110; display: none; }
.more-sheet.is-open { display: block; }
.more-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 12, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: more-fade 0.2s ease;
}
.more-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: more-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.more-handle { width: 40px; height: 4px; border-radius: var(--r-pill); background: rgba(255,255,255,0.2); margin: 4px auto 16px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.more-link:hover { color: var(--ink-1); background: rgba(255,255,255,0.06); }
.more-link.active { color: var(--ink-1); border-color: rgba(255,62,165,0.3); background: rgba(255,62,165,0.10); }
.more-link .material-symbols-rounded { font-size: 24px; }
@keyframes more-fade { from { opacity: 0; } }
@keyframes more-up { from { transform: translateY(100%); } }

/* ---------- PUBLIC TOPBAR NAV (anonymous) ---------- */
/* Flash zone under the fixed .topbar: clear its height only when a flash is
   present, so the message isn't hidden behind the bar. Collapses to nothing
   when empty (:empty) so the centered auth layout is untouched. */
.public-flash:not(:empty) {
  padding: 88px 16px 0;
}

.public-nav { display: flex; gap: 4px; align-items: center; }
.public-nav a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-pill);
  transition: all 0.2s;
}
.public-nav a:hover { color: var(--ink-1); background: rgba(255,255,255,0.05); }
.public-auth { display: flex; gap: 8px; align-items: center; }

/* Anker-Ziele dürfen nicht hinter der fixen Topbar verschwinden. */
.section-anchor { scroll-margin-top: 100px; }

/* Featured-Clubs Empty-State (kein öffentlicher Club vorhanden) */
.featured-clubs-empty {
  padding: 48px 32px;
  border-radius: var(--r-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.featured-clubs-empty-icon {
  font-size: 40px;
  color: var(--ink-3);
  background: linear-gradient(135deg, var(--acc-magenta), var(--acc-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.featured-clubs-empty-title { font-size: 18px; font-weight: 700; color: var(--ink-1); margin: 0; }
.featured-clubs-empty-body { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; max-width: 420px; line-height: 1.55; }

/* Responsive */
@media (max-width: 720px) {
  .public-nav { display: none; }
}
@media (max-width: 960px) {
  .sidebar { display: none; }
  .with-sidebar { padding-left: 16px; padding-bottom: 88px; }
  .pill-nav { display: none; }

  /* FAB weicht der Bottom-Nav (überschreibt das Inline-display:flex). */
  #fab-new-build { display: none !important; }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 45;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px;
    border-radius: var(--r-xl);
    background: rgba(12,14,26,0.7);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.08) inset,
      0 20px 50px -10px rgba(0,0,0,0.5);
  }
}

/* ============================================================
   DASHBOARD (member home)
   Strict 3-column grid; every rule lives here (templates carry
   no inline styling). Kept in the global stylesheet so it
   survives Turbo-frame navigation into #page.
   ============================================================ */

/* Header row */
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-head .eyebrow { margin-bottom: 10px; }
.dash-sub { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.dash-actions { display: flex; gap: 8px; align-items: center; }

/* Three-column grid → graceful collapse */
.dash-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .dash-col--left { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .dash-col--left > * { flex: 1 1 240px; }
}
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-col--left { flex-direction: column; }
  /* undo the row-mode flex-basis so stacked cards size to content (else the
     240px basis applies to height and leaves a gap) */
  .dash-col--left > * { flex: 0 1 auto; }
}

/* Reusable card padding / heading */
.card-pad { padding: 18px; }
.card-title { margin: 0 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

/* System announcement */
.announce { padding: 20px; }
.announce-meta { flex: 1; min-width: 0; }
.announce-name { font-size: 13px; font-weight: 500; }
.announce-sub { font-size: 11px; color: var(--ink-3); }
.announce-body { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.card-cta { width: 100%; margin-top: 14px; display: block; text-align: center; }
.ibtn--sm { width: 28px; height: 28px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 40px; height: 40px; }

/* Generic empty-state inside a glass card */
.dash-empty { padding: 32px; text-align: center; color: var(--ink-3); }
.dash-empty .material-symbols-rounded { font-size: 28px; display: block; margin: 0 auto 8px; }

/* Featured-event hero */
.event-hero { overflow: hidden; padding: 0; border-radius: var(--r-xl); }
.event-hero-media { position: relative; height: 180px; }
.event-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-hero-cover {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(255, 62, 165, 0.30), transparent 55%),
    radial-gradient(130% 150% at 100% 100%, rgba(63, 224, 255, 0.24), transparent 55%),
    var(--bg-2);
}
.event-hero-cover .material-symbols-rounded { font-size: 68px; color: rgba(255, 255, 255, 0.16); }
.event-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(7, 8, 16, 0.92));
  pointer-events: none;
}
.event-hero-chips { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.event-hero-body { padding: 22px; }
.event-eyebrow { color: var(--acc-magenta); margin-bottom: 8px; }
.event-title { font-size: 26px; margin: 0 0 8px; }
.event-summary { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.event-meta { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; flex-wrap: wrap; }
.event-meta-count { font-size: 12px; color: var(--ink-3); }
.event-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.event-date { font-size: 12px; color: var(--ink-3); }

/* Overlapping confirmed-pilot avatars */
.avatar-stack { display: flex; }
.avatar-stack .avatar {
  width: 28px;
  height: 28px;
  margin-left: -6px;
  border: 2px solid var(--bg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  font-size: 11px;
}
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Section heading + 'see all' link above a grid */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.section-link { font-size: 12px; color: var(--ink-3); text-decoration: none; }

/* New part drops */
.part-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.part-card { padding: 14px; }
.part-card .eyebrow { margin-bottom: 4px; }
.part-media { position: relative; height: 140px; border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; }
.part-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.part-badge { position: absolute; top: 10px; left: 10px; }
.part-name { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.part-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.part-stat { color: var(--acc-lime); }
.part-price { font-weight: 500; }

/* Friends-live */
.friend-list { display: flex; flex-direction: column; gap: 6px; }
.friend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.friend.is-offline { background: transparent; opacity: 0.55; }
.friend-avatar { position: relative; }
.friend-led { position: absolute; bottom: -1px; right: -1px; }
.friend-meta { flex: 1; min-width: 0; }
.friend-name { font-size: 13px; font-weight: 500; }
.friend-status { font-size: 11px; color: var(--ink-3); }
.friend.is-offline .friend-status { color: var(--ink-4); }
.friend-action { color: var(--ink-3); font-size: 18px; }

/* Network telemetry metrics */
.metric + .metric { margin-top: 14px; }
.metric-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.metric-label { color: var(--ink-2); }
.metric-value { font-weight: 500; }
.progress-fill--speed { background: linear-gradient(90deg, var(--acc-lime), var(--acc-cyan)); }
.progress-fill--flow  { background: linear-gradient(90deg, var(--acc-cyan), var(--acc-magenta)); }
.progress-fill--loss  { background: linear-gradient(90deg, var(--acc-amber), var(--acc-magenta)); }

/* Global ranking */
.rank-card { padding: 20px; overflow: hidden; position: relative; }
.rank-watermark {
  position: absolute;
  right: -10px;
  bottom: -40px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 140px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: -0.05em;
  line-height: 1;
  pointer-events: none;
}
.rank-value { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.rank-tier { font-size: 12px; color: var(--ink-3); }

/* Messages preview */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg { text-decoration: none; color: inherit; display: block; }
.msg-card { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.04); }
.msg-card.is-urgent {
  background: linear-gradient(180deg, rgba(255, 62, 165, 0.10), rgba(255, 62, 165, 0.03));
  border-color: rgba(255, 62, 165, 0.25);
}
.msg-row { display: flex; align-items: center; gap: 10px; }
.msg-card.is-urgent .msg-row { margin-bottom: 8px; }
.msg-meta { flex: 1; min-width: 0; }
.msg-name { font-size: 13px; font-weight: 500; }
.msg-preview { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 10px; color: var(--ink-4); }
.msg-card.is-urgent .msg-time { font-weight: 600; color: var(--acc-magenta); }
.msg-replies { display: flex; gap: 6px; }
.msg-reply { flex: 1; }
.msg-reply button { width: 100%; padding: 6px 10px; font-size: 11px; }

/* ============================================================
   SEARCH OVERLAY (#47) — global omnibox results panel
   The sidebar form swaps results into <turbo-frame id="search-results">.
   Empty frame => hidden (no JS toggle); the search_overlay controller only
   dismisses an open panel. Anchored under the sidebar search box.
   ============================================================ */
.search-overlay:empty { display: none; }
.search-overlay {
  position: fixed;
  left: 16px;
  top: 92px;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  z-index: 50;
}
.search-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgba(12, 14, 26, 0.72);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.search-group { display: flex; flex-direction: column; }
.search-group + .search-group { margin-top: 4px; }
.search-group-label {
  padding: 8px 10px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink-1);
  text-decoration: none;
}
.search-row:hover { background: var(--glass-bg-2); }
.search-row-icon { font-size: 18px; color: var(--ink-3); }
.search-row-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.search-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row-meta { flex-shrink: 0; font-size: 12px; color: var(--ink-3); }
.search-empty { padding: 16px 12px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* Collapsed rail: search box hidden → anchor the panel to the rail edge. */
html.sidebar-collapsed .search-overlay { left: 88px; }

/* Mobile (<960px): sidebar hidden, omnibox not shown → full-width top sheet
   if it is ever invoked programmatically. */
@media (max-width: 960px) {
  .search-overlay { left: 16px; right: 16px; top: 16px; width: auto; }
}
