/* Portal-Basistheme – Design-Tokens der Busverwaltung (voller Ausbau in M3) */
:root {
  --accent-solid: #c1182e; --accent-dark: #9e1426; --accent-light: #fdf2f4;
  --sidebar-bg: #1a0a0c;
  --bg: #f8fafc; --surface: #ffffff; --border: #e2e8f0;
  --text: #0f172a; --text-muted: #64748b;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}
*,*::before,*::after{box-sizing:border-box}
body{font-family:'DM Sans',system-ui,sans-serif;color:var(--text);margin:0;line-height:1.6;min-height:100vh;
  background:
    linear-gradient(rgba(248,250,252,.88), rgba(248,250,252,.93)),
    url('../img/hero-login.jpg') center/cover no-repeat fixed;}
.portal-header{display:flex;justify-content:space-between;align-items:center;background:var(--sidebar-bg);color:#fff;padding:.75rem 1.25rem;border-bottom:3px solid var(--accent-solid);min-height:3.5rem}
.portal-header a{color:#c4a0a5}
.portal-title{font-weight:700}
.portal-head-left{display:flex;align-items:center;gap:.75rem;min-width:0}
.portal-head-left .portal-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Konstante Zurück-Kachel (alle Portalseiten außer Bus) */
.portal-back{display:inline-flex;align-items:center;gap:.3rem;background:rgba(255,255,255,.12);color:#fff !important;border:1px solid rgba(255,255,255,.28);padding:.32rem .72rem;border-radius:999px;font-size:.85rem;font-weight:600;text-decoration:none;white-space:nowrap;flex:0 0 auto}
.portal-back:hover{background:rgba(255,255,255,.22)}
/* ── Breadcrumb (konsistent über alle Portalseiten, nicht Bus) ──── */
.breadcrumb{background:var(--surface);border-bottom:1px solid var(--border)}
.breadcrumb-bar{display:flex;align-items:center;gap:.5rem 1rem;flex-wrap:wrap;max-width:1100px;margin:0 auto;padding:.45rem 1.75rem}
/* Rücksprung zur Trefferliste (erscheint auf Zielseiten einer Suche) */
.bc-backsearch{display:inline-flex;align-items:center;gap:.3rem;flex:0 0 auto;background:var(--accent-light);color:var(--accent-dark);border:1px solid #f3ced3;border-radius:999px;padding:.2rem .65rem;font-size:.8rem;font-weight:700;text-decoration:none;white-space:nowrap}
.bc-backsearch:hover{background:#fce8eb}
.breadcrumb ol{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem;margin:0;padding:0;font-size:.85rem;flex:1 1 auto;min-width:0}
/* Portalweite Suche in der Leiste */
.bc-search{display:flex;align-items:stretch;flex:0 0 auto;margin-left:auto}
.bc-search input{width:180px;max-width:44vw;padding:.34rem .7rem;border:1px solid var(--border);border-right:0;border-radius:999px 0 0 999px;font:inherit;font-size:.85rem;background:#fff}
.bc-search input:focus{outline:none;border-color:var(--accent-solid);box-shadow:0 0 0 3px var(--accent-light)}
.bc-search button{border:1px solid var(--border);border-radius:0 999px 999px 0;background:#fff;color:var(--text);padding:.34rem .6rem;cursor:pointer;font-size:.95rem;line-height:1}
.bc-search button:hover{background:var(--accent-light)}
.breadcrumb li{display:flex;align-items:center;min-width:0}
.breadcrumb li+li::before{content:"›";color:var(--text-muted);padding:0 .35rem;flex:0 0 auto}
.breadcrumb a{color:var(--accent-dark);text-decoration:none;white-space:nowrap}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb span[aria-current]{color:var(--text-muted);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46vw}

/* ── Tabs (CSS-only, radio-basiert – funktioniert ohne JS) ──────── */
/* Basis-Styling; die „aktiv"-Regeln (welcher Reiter/Panel sichtbar ist)
   stehen seitenweise inline, da sie die konkreten Radio-IDs brauchen. */
.tabs{margin-top:1rem}
.tabs .tabradio{position:absolute;left:0;width:auto;opacity:0;pointer-events:none}
.tabs .tablabels{display:flex;gap:.35rem;flex-wrap:wrap;border-bottom:2px solid var(--border)}
.tabs .tablabels label{padding:.5rem .95rem;cursor:pointer;font-weight:600;font-size:.9rem;color:var(--text-muted);border:1px solid transparent;border-bottom:none;border-radius:var(--radius-sm) var(--radius-sm) 0 0;margin-bottom:-2px}
.tabs .tablabels label:hover{color:var(--text)}
.tabs .tabpanels>.tabpanel{display:none;padding-top:1rem}

/* Gesperrte Kachel (z. B. Abteilung ohne Zugriff) */
.tile.is-locked{opacity:.55;cursor:not-allowed;pointer-events:none;background:#f1f5f9}
.tile.is-locked::before{display:none}

/* ── Kachel-Raster (Icon-Badge, luftig · Variante A) ─────────── */
.tile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1.25rem;padding:1.5rem 1.75rem;max-width:1100px;margin:0 auto}
.tile{display:flex;flex-direction:column;gap:1rem;align-items:flex-start;min-height:180px;background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:1.5rem;text-decoration:none;color:var(--text);transition:box-shadow .2s,transform .2s,border-color .2s;-webkit-tap-highlight-color:transparent}
.tile:hover{box-shadow:var(--shadow-md);transform:translateY(-4px);border-color:#f0c4ca}
.tile-badge{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:58px;height:58px;border-radius:16px;font-size:1.9rem;line-height:1;background:var(--accent-light);border:1px solid #f3ced3;color:var(--accent-dark);overflow:hidden}
.tile-badge.has-img{background:#fff}
.tile-badge img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit}
/* Kachel mit Vollbild-Foto (z. B. Abteilung mit eigenem Motiv) – Text unten über dunklem Verlauf */
.tile.has-bg{position:relative;flex-direction:column;justify-content:flex-end;align-items:stretch;min-height:164px;border:none;color:#fff;background-size:cover;background-position:center 32%;overflow:hidden}
.tile.has-bg::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(15,23,42,0) 22%,rgba(15,23,42,.58) 58%,rgba(15,23,42,.96) 100%)}
.tile.has-bg .tile-body{position:relative;z-index:1}
.tile.has-bg .tile-name{color:#fff}
.tile.has-bg .tile-desc{color:rgba(255,255,255,.92)}
.tile.has-bg:hover{border:none;box-shadow:var(--shadow-md)}
.tile-body{display:flex;flex-direction:column;gap:.25rem;min-width:0}
.tile-name{font-weight:700;font-size:1.12rem;line-height:1.25}
.tile-desc{color:var(--text-muted);font-size:.92rem;line-height:1.45}
.tile-admin{border-color:#f0c4ca}
.tile-admin .tile-badge{background:var(--accent-solid);border-color:var(--accent-dark);color:#fff}
.tile.is-locked .tile-badge,.tile.tile-missing .tile-badge{background:#eef2f7;border-color:#dbe2ea;color:#94a3b8}

/* ── Bereichs-Navigation „Burger" (CSS-only, kein JS) – standardmäßig nur mobil ── */
.portal-menu{display:none}
.portal-menu-btn{cursor:pointer;color:#fff;font-size:1.35rem;line-height:1;padding:.12rem .5rem;border:1px solid rgba(255,255,255,.28);border-radius:10px;background:rgba(255,255,255,.12);-webkit-user-select:none;user-select:none}
.portal-menu-btn:hover{background:rgba(255,255,255,.22)}
.portal-menu-panel{display:none;position:absolute;right:0;top:calc(100% + .45rem);min-width:230px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-md);padding:.35rem;z-index:60}
.pm-link{display:flex;align-items:center;gap:.65rem;padding:.62rem .7rem;border-radius:10px;color:var(--text);text-decoration:none;font-weight:600;font-size:.95rem;white-space:nowrap}
.pm-link:hover,.pm-link.is-active{background:var(--accent-light);color:var(--accent-dark)}
.pm-ic{font-size:1.15rem;line-height:1;width:1.4rem;text-align:center;flex:0 0 auto}
.portal-menu-backdrop{display:none;position:fixed;inset:0;z-index:50;background:transparent}
.portal-menu-toggle:checked ~ .portal-menu-panel{display:block}
.portal-menu-toggle:checked ~ .portal-menu-backdrop{display:block}

/* Handy: Variante B – alle Kacheln als einheitliche kompakte Zeilen */
@media (max-width:560px){
  .tile-grid{grid-template-columns:1fr;gap:.5rem;padding:.8rem}
  .tile{flex-direction:row;align-items:center;gap:.9rem;min-height:76px;padding:.6rem .9rem;border-radius:14px}
  .tile-badge{width:46px;height:46px;font-size:1.45rem;border-radius:12px}
  .tile-name{font-size:1rem}
  .tile-desc{font-size:.82rem}
  /* Foto-Kacheln als schmale Banner mit seitlichem Verlauf (Text links lesbar) */
  .tile.has-bg{min-height:76px;flex-direction:row;align-items:center;justify-content:flex-start;padding:0;background-position:center 38%}
  .tile.has-bg .tile-body{padding:.55rem .95rem;gap:.1rem}
  .tile.has-bg::before{background:linear-gradient(90deg,rgba(15,23,42,.82) 0%,rgba(15,23,42,.5) 52%,rgba(15,23,42,.12) 100%)}
  /* Kopfzeile: zwei Zeilen (Titel oben, Nutzer/Links darunter) + Platz oben rechts für den Burger */
  .portal-header{position:relative;padding:.55rem 3.4rem .55rem .8rem;flex-wrap:wrap;align-items:flex-start;row-gap:.2rem}
  .portal-head-left,.portal-header>.portal-title{flex:1 1 100%;min-width:0}
  .portal-header>.portal-title{white-space:normal;line-height:1.25}
  .portal-user{flex:1 1 100%;text-align:left;font-size:.82rem;line-height:1.55}
  .breadcrumb-bar{padding:.45rem .9rem}
  /* Suchfeld bricht unter die Krumen und wird volle Breite */
  .bc-search{flex:1 1 100%;margin-left:0}
  .bc-search input{flex:1 1 auto;width:auto;max-width:none}
  /* Burger sichtbar & oben rechts fixiert */
  .portal-menu{display:inline-flex;align-items:center;position:absolute;top:.5rem;right:.7rem;z-index:60}
}

/* ── Login / Auth ────────────────────────────────────────────── */
.auth-page{
  display:flex;min-height:100vh;align-items:center;justify-content:center;padding:1.5rem;
  background:
    linear-gradient(135deg, rgba(26,10,12,.34) 0%, rgba(26,10,12,.18) 45%, rgba(193,24,46,.22) 100%),
    url('../img/hero-login.jpg') center/cover no-repeat fixed;
}

/* Hintergrundmotiv liegt global auf body (jede Seite). .portal-landing bleibt
   als No-op erhalten, damit index.php unverändert gültig bleibt. */
.portal-landing{min-height:100vh}
.auth-card{
  background:rgba(255,255,255,.97);
  border:1px solid rgba(255,255,255,.6);
  border-radius:16px;
  box-shadow:0 24px 60px -18px rgba(0,0,0,.55);
  padding:2rem 2rem 1.75rem;
  width:min(400px,94vw);
  backdrop-filter:blur(3px);
}
.auth-card h1{font-size:1.2rem;margin:.25rem 0 .35rem;text-align:center}
.auth-card h1::after{content:"";display:block;width:44px;height:3px;background:var(--accent-solid);border-radius:2px;margin:.5rem auto 1rem}
.auth-logo{height:40px;display:block;margin:0 auto .5rem}
.auth-card .btn-primary{width:100%;text-align:center;padding:.65rem 1.1rem;margin-top:.25rem}

/* ── Formular-Basiselemente ─────────────────────────────────── */
label{display:block;margin-bottom:.9rem;font-weight:600;font-size:.9rem}
input{width:100%;padding:.55rem .7rem;margin-top:.25rem;border:1px solid var(--border);border-radius:var(--radius-sm);font:inherit}
input:focus{outline:none;border-color:var(--accent-solid);box-shadow:0 0 0 3px var(--accent-light)}
.btn{display:inline-block;border:0;border-radius:var(--radius-sm);padding:.6rem 1.1rem;font:inherit;font-weight:600;cursor:pointer;text-decoration:none}
.btn-primary{background:var(--accent-solid);color:#fff}
.btn-primary:hover{background:var(--accent-dark)}
.alert{padding:.6rem .8rem;border-radius:var(--radius-sm);font-size:.9rem}
.alert-error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.alert-success{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0}
.alert-info{background:var(--accent-light);color:var(--accent-dark);border:1px solid #f5c6cd}
