/*
 * GroupsCAMP design system (docs/GroupsCAMP-Konzept.md §6).
 * Dark theme, blue grid backdrop, role accents. Single UI font Geist at a 14px
 * base, matching the GroupsLINK corporate identity (no serif).
 * Geist is self-hosted (Swiss data residency — no CDN/Google Fonts request).
 */

/* --- Self-hosted fonts (Propshaft resolves the logical names) ------------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/geist-400-ef522b10.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/geist-500-6130dfc0.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/geist-600-fe000689.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/geist-700-626e99f5.woff2") format("woff2");
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --lime: #6dc30e;

  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #243044;

  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.14);

  --ink: #f1f5f9;
  --t2: #cbd5e1;
  --t3: #94a3b8;
  --t4: #64748b;

  --ok: #16a34a;
  --err: #ef4444;

  --radius: 14px;
  --accent: var(--primary);

  /* Single UI font, matching GroupsLINK's stack (no serif). */
  --font-sans: "Geist", "Helvetica Neue", Arial, sans-serif;
}

/* Role accent — set on the screen/panel via data-role. */
[data-role="team"] { --accent: #6366f1; }
[data-role="teacher"] { --accent: #2563eb; }
[data-role="parent"] { --accent: #16a34a; }

/* --- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }
/* GroupsLINK CI base size (14px). Anchors the rem scale across all pages. */
html { font-size: 14px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  /* Blue grid backdrop. */
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

a { color: var(--primary); }

/* --- Layout shells ------------------------------------------------------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
}

.auth-stack {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- Wordmark ------------------------------------------------------------ */
.wordmark {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.wordmark .mark {
  font-family: var(--font-sans);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.wordmark .mark .camp { color: var(--t2); }
.wordmark .tagline { color: var(--t3); font-size: 0.85rem; }

/* --- Role cards ---------------------------------------------------------- */
.role-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.role-card:hover {
  border-color: var(--accent);
  background: var(--panel-2);
  transform: translateY(-1px);
}
.role-card-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: color-mix(in srgb, var(--accent) 90%, black 0%);
}
.role-card-body { flex: 1 1 auto; min-width: 0; }
.role-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.role-card-desc { color: var(--t3); font-size: 0.83rem; margin-top: 0.15rem; }
.role-card-chevron { color: var(--t4); flex: 0 0 auto; }
.role-pill {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* --- Panel (login / reset) ---------------------------------------------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}
.back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}
.back-link:hover { color: var(--ink); }
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.panel-title { font-size: 1.15rem; font-weight: 600; margin: 0; }

/* --- Inputs -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--t2); }
.field-control { position: relative; display: flex; align-items: center; }
.field-control .lead-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--t4);
  pointer-events: none;
}
.field-control input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.4rem;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.95rem;
}
.field-control.has-toggle input { padding-right: 2.6rem; }
.field-control input::placeholder { color: var(--t4); }
.field-control input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
}
.eye-toggle {
  position: absolute;
  right: 0.5rem;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--t3);
  cursor: pointer;
  padding: 0.3rem;
}
.eye-toggle:hover { color: var(--ink); }

/* --- Password strength meter -------------------------------------------- */
.pw-meter { display: flex; flex-direction: column; gap: 0.3rem; }
.pw-segs { display: flex; gap: 0.3rem; }
.pw-seg {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.2s ease;
}
.pw-seg.on-1 { background: var(--err); }
.pw-seg.on-2 { background: #f59e0b; }
.pw-seg.on-3 { background: var(--lime); }
.pw-seg.on-4 { background: var(--ok); }
.pw-hint { font-size: 0.72rem; color: var(--t4); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--primary-d); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { filter: brightness(0.94); }
/* Outline / secondary button (auto width) */
.btn.ghost {
  width: auto;
  background: #fff;
  color: var(--t2, #374151);
  border: 1px solid var(--line-2);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}
.btn.ghost:hover { background: var(--surface-2, #f3f4f6); }

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.linkish {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

/* --- Boxes (info / error) ----------------------------------------------- */
.info-box,
.error-box {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.82rem;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  line-height: 1.4;
}
.info-box {
  color: #bbf7d0;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 34%, transparent);
}
.error-box {
  color: #fecaca;
  background: color-mix(in srgb, var(--err) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--err) 34%, transparent);
}
.box-icon { flex: 0 0 auto; margin-top: 1px; }

/* --- Toast --------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 50;
}
.toast .toast-icon { color: var(--ok); }

/* --- Language switch ----------------------------------------------------- */
.lang-switch { display: inline-flex; align-items: center; gap: 0.25rem; }
.lang-switch .globe { color: var(--t4); margin-right: 0.15rem; }
.lang-switch button {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--t3);
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  border-radius: 7px;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Footer -------------------------------------------------------------- */
.app-footer {
  text-align: center;
  color: var(--t4);
  font-size: 0.72rem;
}

/* --- Dashboard ----------------------------------------------------------- */
.dashboard { min-height: 100vh; display: flex; flex-direction: column; }
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.dash-brand {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dash-brand .camp { color: var(--t2); }
.dash-top-right { display: flex; align-items: center; gap: 1rem; }
.user-email { font-size: 0.82rem; color: var(--t3); }
.logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--t2);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
}
.logout:hover { border-color: var(--line-2); color: var(--ink); }
.dash-main { flex: 1; padding: 2.5rem 1.5rem; max-width: 960px; width: 100%; margin: 0 auto; }
.dash-welcome { display: flex; align-items: center; gap: 0.75rem; }
.dash-welcome .role-chip { font-size: 0.85rem; }
.dash-title { font-size: 1.6rem; font-weight: 600; margin: 0; }
.placeholder {
  margin-top: 1.25rem;
  color: var(--t3);
  background: var(--panel);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--t3);
}

/* --- Admin (superuser) --------------------------------------------------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.admin-intro { color: var(--t3); margin: 0.5rem 0 1rem; }
.admin-tiles { display: flex; flex-direction: column; gap: 0.75rem; max-width: 560px; }

/* --- Dashboard nav (tabs) ------------------------------------------------ */
.dash-nav {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
  border-bottom: 1px solid var(--line);
}
.dash-nav button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--t3);
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.dash-nav button:hover { color: var(--ink); }
.dash-nav button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* --- Stammdaten (profile) form ------------------------------------------ */
.sd-page { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.25rem; }
.sd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.sd-save { width: auto; display: inline-flex; align-items: center; gap: 0.4rem; }

.sd-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.sd-card-head { margin-bottom: 1rem; }
.sd-card-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.sd-card-sub { margin: 0.2rem 0 0; color: var(--t3); font-size: 0.82rem; }

.sd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.25rem;
}
.sd-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.sd-field.full { grid-column: 1 / -1; }
.sd-label { font-size: 0.78rem; font-weight: 600; color: var(--t2); }
.sd-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  font-size: 0.92rem;
  font-family: inherit;
}
.sd-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 32%, transparent);
}
.sd-input:disabled { opacity: 0.6; cursor: not-allowed; }
.sd-textarea { resize: vertical; min-height: 64px; }

/* Checkboxes / toggles */
.sd-checks { display: flex; flex-direction: column; gap: 0.5rem; }
.sd-check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--t2); cursor: pointer; }
.sd-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.sd-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--t3);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin: 0 0 0.9rem;
}

/* Role × function permission matrix */
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.perm-role { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; }
.perm-role-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.perm-fns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 0.75rem; }

/* Additional authorised persons */
.auth-rows { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.auth-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--surface, #fff);
}
.auth-grid { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr 1fr auto; gap: 0.5rem; align-items: end; }
.auth-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.auth-field .sd-label { font-size: 0.72rem; }
.auth-pw { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: end; }
.auth-gen {
  display: inline-flex; align-items: center; gap: 0.35rem;
  white-space: nowrap;
  align-self: end;
  height: fit-content;
}
.auth-foot {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.6rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}
.auth-status { font-size: 0.8rem; color: var(--t3); display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.auth-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; font-weight: 600;
  color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 999px; padding: 0.1rem 0.5rem;
}
.auth-remove { align-self: end; }
.icon-btn {
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--t3);
  border-radius: 8px;
  padding: 0.45rem;
  cursor: pointer;
}
.icon-btn:hover { color: var(--err); border-color: var(--err); }
.sd-add { display: inline-flex; align-items: center; gap: 0.35rem; }

@media (max-width: 720px) {
  .perm-grid, .perm-fns { grid-template-columns: 1fr; }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-pw { grid-template-columns: 1fr; }
  .auth-foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .sd-grid { grid-template-columns: 1fr; }
}

/* --- Sidebar dashboard layout (dark rail + light content) ---------------- */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden; /* the shell never scrolls; only .content does */
}

.sidebar {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem;
  background: var(--panel);
  border-right: 1px solid var(--line);
  color: var(--ink);
  min-height: 0;
  overflow-y: auto; /* fixed sidebar; scrolls internally only if it overflows */
}
.side-head { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.25rem 0.5rem 0.75rem; }
.side-head .dash-brand { font-family: var(--font-sans); font-size: 1.35rem; }
.side-sub { color: var(--t3); font-size: 0.8rem; }
.side-head .admin-badge { align-self: flex-start; margin-top: 0.3rem; }

.side-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.side-nav button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--t2);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}
.side-nav button:hover { background: var(--panel-2); color: var(--ink); }
.side-nav button.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-left-color: var(--accent);
  color: #fff;
}

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.5rem;
  border-top: 1px solid var(--line);
}
.side-bottom .user-email { font-size: 0.78rem; color: var(--t3); word-break: break-all; }

/* Light content canvas — redefine the tokens so the existing sd-* / placeholder
   styles render light automatically, while the sidebar keeps the dark tokens. */
.content {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --ink: #111827;
  --t2: #374151;
  --t3: #6b7280;
  --t4: #9ca3af;

  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 1.75rem 2rem;
  overflow-y: auto; /* only the detail page scrolls */
}
.content .dash-title { color: var(--ink); }
.content-section { display: flex; flex-direction: column; gap: 1rem; }
.content .sd-page { margin-top: 0; }

@media (max-width: 820px) {
  /* Stack and scroll normally on small screens. */
  .app-shell { flex-direction: column; height: auto; overflow: visible; }
  .sidebar { flex-basis: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; overflow: visible; }
  .content { overflow: visible; }
  .side-head { padding: 0.25rem 0.5rem; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav button { border-left: none; border-radius: 8px; }
  .side-nav button.active { border-left: none; }
  .side-bottom { margin-top: 0; border-top: none; flex-direction: row; align-items: center; flex-wrap: wrap; }
}

/* --- GroupsCAMP shell (ported 1:1 from the hi-fi prototype) -------------- */
/* Fixed dark sidebar + a light main column; only .gc-content scrolls. */
.gc-app { display: grid; grid-template-columns: 230px 1fr; height: 100vh; overflow: hidden; }

.gc-sidebar {
  background: #1e293b;
  border-right: 1px solid #0f172a;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}
.gc-brand {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.gc-brand-logo {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: #2563eb; display: flex; align-items: center; justify-content: center;
}
.gc-brand-name { font-weight: 700; font-size: 14px; color: #fff; }
.gc-brand-name span { color: #60a5fa; }
.gc-brand-sub { font-size: 11px; color: #94a3b8; margin-top: 1px; }

.gc-side-section { padding: 14px 12px 6px; }
.gc-side-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #64748b; padding: 0 4px; margin-bottom: 4px;
}
.gc-side-trips { flex: 1; }

.nav-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 7px; border: none; background: transparent;
  cursor: pointer; font-size: 13px; font-weight: 500; color: #cbd5e1;
  text-align: left; transition: background 0.12s; font-family: inherit;
}
.nav-item:hover { background: #334155; }
.nav-item.active { background: #334155; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #3b82f6; }
.nav-badge { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: #cbd5e1; }
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.2); color: #fff; }

.trip-item {
  width: 100%; display: block; padding: 8px 10px; border-radius: 7px; border: none;
  background: transparent; cursor: pointer; text-align: left; transition: background 0.12s;
  margin-bottom: 2px; font-family: inherit;
}
.trip-item:hover { background: #334155; }
.trip-item.active { background: #334155; box-shadow: inset 3px 0 0 #3b82f6; }
.trip-item-name { font-size: 12px; font-weight: 600; color: #cbd5e1; }
.trip-item.active .trip-item-name { color: #fff; }
.trip-item-meta { font-size: 11px; color: #64748b; margin-top: 1px; }
.trip-item.active .trip-item-meta { color: rgba(255, 255, 255, 0.6); }
.trip-item .truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gc-new-trip {
  width: 100%; padding: 7px 10px; border-radius: 7px; border: 1px dashed #3b82f6;
  background: transparent; cursor: pointer; font-size: 12px; color: #93c5fd;
  font-family: inherit; margin-top: 4px; text-align: left;
}
.gc-new-trip:hover { background: rgba(59, 130, 246, 0.1); }

.gc-side-foot {
  padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 8px;
}
.gc-side-foot .back-link { color: #94a3b8; }

/* Reisen aktiv/inaktiv filter — sits above the language switcher in the foot. */
.gc-trip-filter {
  display: flex; gap: 4px; padding: 3px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}
.gc-trip-filter-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 8px; border: none; border-radius: 7px; cursor: pointer;
  background: transparent; color: #94a3b8; font-family: inherit; font-size: 12px; font-weight: 600;
}
.gc-trip-filter-btn:hover { color: #e2e8f0; }
.gc-trip-filter-btn.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.gc-trip-filter-count {
  min-width: 16px; padding: 0 5px; border-radius: 999px; font-size: 10px; line-height: 16px;
  background: rgba(255, 255, 255, 0.18); color: #e2e8f0;
}

.gc-user {
  padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; gap: 8px;
}
.gc-user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.12);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.gc-user-name { font-size: 12px; font-weight: 600; color: #fff; }
.gc-user-role { font-size: 11px; color: #94a3b8; }
.gc-user .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-logout { background: transparent; border: none; color: #94a3b8; cursor: pointer; display: inline-flex; padding: 4px; }
.gc-logout:hover { color: #fff; }

.gc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gc-topbar {
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.gc-topbar-title { font-size: 15px; font-weight: 700; color: #111827; cursor: pointer; }
.gc-topbar-email { font-size: 12px; color: #6b7280; }
.gc-topbar-new {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 6px;
  border: 1px solid #1d4ed8; background: #2563eb; color: #fff; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}

/* Light content canvas — redefine tokens so sd- and placeholder styles render light. */
.gc-content {
  --bg: #eef2f7; --panel: #ffffff; --panel-2: #ffffff; --line: #e5e7eb; --line-2: #d1d5db;
  --ink: #111827; --t2: #374151; --t3: #6b7280; --t4: #9ca3af;
  flex: 1; min-height: 0; background: #fff; color: #111827; padding: 24px; overflow-y: auto;
}
.gc-content .dash-title, .gc-content .sd-page { color: #111827; }
.gc-content .sd-page { margin-top: 0; }
.gc-page-head { margin-bottom: 20px; }
.gc-page-title { font-size: 20px; font-weight: 700; color: #111827; }
.gc-page-sub { font-size: 13px; color: #6b7280; margin-top: 3px; }

@media (max-width: 820px) {
  .gc-app { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .gc-sidebar { height: auto; }
  .gc-content { overflow: visible; }
}

/* --- Smarte Suchleiste (SmartSearch) ------------------------------------- */
/* Band directly below the topline; holds the large, always-present hero bar. */
.gc-searchband { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 14px 24px; flex-shrink: 0; }
@media (max-width: 820px) { .gc-searchband { padding: 12px 16px; } }

.gcs-hero-wrap { position: relative; width: 100%; }
.gcs-hero {
  display: flex; align-items: center; gap: 11px; cursor: text;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 11px; padding: 12px 16px;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.gcs-hero.focus {
  background: #fff; border-color: var(--gcs-accent, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gcs-accent, #2563eb) 15%, transparent);
}
.gcs-hero-input { flex: 1; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 15px; color: #0f172a; }
.gcs-hero-input::placeholder { color: #94a3b8; }
.gcs-kbd {
  font-size: 11px; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 5px;
  padding: 1px 6px; background: #fff; white-space: nowrap;
}
@media (max-width: 720px) { .gcs-kbd { display: none; } }

.gcs-hero-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.18); overflow: hidden;
  display: flex; flex-direction: column; font-family: var(--font-sans);
}
.gcs-results { max-height: 52vh; overflow-y: auto; padding: 4px 0; }
.gcs-group { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; padding: 9px 16px 4px; }
.gcs-item {
  display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent;
  padding: 8px 16px; cursor: pointer; text-align: left; font-family: inherit;
}
.gcs-item.sel { background: #f1f5f9; box-shadow: inset 3px 0 0 var(--gcs-accent, #2563eb); }
.gcs-ic {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--gcs-accent, #2563eb) 13%, #fff);
  color: var(--gcs-accent, #2563eb);
}
.gcs-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.gcs-title { font-size: 13.5px; color: #0f172a; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcs-sub { font-size: 11.5px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcs-empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.gcs-foot {
  display: flex; gap: 16px; align-items: center; padding: 8px 16px; border-top: 1px solid #e5e7eb;
  font-size: 11px; color: #94a3b8; background: #fafafa;
}
.gcs-key {
  display: inline-block; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px;
  padding: 0 5px; margin-right: 3px; font-size: 10.5px; color: #475569; background: #fff;
}
@keyframes gcs-spin { to { transform: rotate(360deg); } }

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  body { background-attachment: scroll; }
}
