/*
 * MoGoNo-Portal — Vorschlag "C · Kontrastreich" mit linker Seitenleiste.
 * Wird nach Bulma geladen und überschreibt gezielt Farben, Typografie und
 * Layout. Bulma bleibt Basis für Grid, Formulare und Utility-Klassen.
 * Quelle: mogono-css-vorschlaege.html (Option C, Navigation links).
 */

:root{
  color-scheme:light;
  --ci-blue:#0070A2; --ci-blue-dark:#004D70; --ci-blue-light:#E6F1F7;
  --gold:#C49A36; --gold-soft:#F2E6C4;
  --navy:#0E2538; --navy-2:#163148;
  --text:#1A2D3E; --text-2:#48637B;
  --bg:#F5F7FA; --paper:#FAF8F3;
  --ok:#1F7A48; --warn:#C97A1E; --danger:#A82424;
  --ok-ink: color-mix(in srgb, var(--ok) 82%, black 18%);
  --warn-ink: color-mix(in srgb, var(--warn) 70%, black 30%);
  --danger-ink: color-mix(in srgb, var(--danger) 88%, black 12%);
  --line:#DCE3EB;
  --radius:6px;
  --prod-font:"Hanken Grotesk","Helvetica Neue",Arial,sans-serif;
  --bulma-arrow-color: var(--ci-blue);
  --primary: var(--ci-blue);
}

html{ font-size:17px; }
body{
  font-family:var(--prod-font);
  background:var(--bg);
  color:var(--text);
}
a{ color:var(--ci-blue-dark); }

:focus-visible{ outline:3px solid var(--ci-blue-dark); outline-offset:2px; border-radius:3px; }

/* ===================== Layout: Seitenleiste + Inhalt ===================== */
.app-shell{ display:flex; align-items:stretch; min-height:100vh; }
.app-main{ flex:1; min-width:0; display:flex; flex-direction:column; }

.sidebar{
  flex:0 0 232px; width:232px; display:flex; flex-direction:column;
  background:var(--navy); color:#fff;
  border-right:1px solid var(--navy-2);
  /* Leiste bleibt beim Scrollen stehen, damit Nutzername und "Abmelden"
     unten immer sichtbar sind – auch bei langer Seite (Dashboard offen). */
  position:sticky; top:0; align-self:flex-start; height:100vh;
}
.sidebar-brand{
  display:flex; flex-direction:column; align-items:center; gap:.65rem;
  padding:1.5rem 1rem 1.25rem;
  text-decoration:none; color:#fff;
  border-bottom:1px solid color-mix(in srgb, white 14%, transparent);
}
.logo-plate{
  display:inline-flex; align-items:center; justify-content:center;
  width:100%; max-width:168px;
  line-height:0;
}
.logo-plate .brand-logo{ display:block; height:auto; width:100%; }
.sidebar-brand-text{ font-weight:800; font-size:1.02rem; color:#fff; text-decoration:none; text-align:center; }

.sidebar-menu{ display:flex; flex-direction:column; gap:.15rem; padding:.5rem; flex:1; min-height:0; overflow-y:auto; }
.sidebar-item{
  color:#fff; text-decoration:none; font-weight:600; font-size:.92rem;
  display:flex; align-items:center; min-height:44px; padding:.6rem .85rem;
  border-radius:4px; position:relative;
}
.sidebar-item:hover{ background:var(--navy-2); color:#fff; }
.sidebar-item[aria-current="page"]{
  font-weight:800;
  text-decoration:underline; text-decoration-thickness:3px; text-underline-offset:6px;
}

.sidebar-foot{
  display:flex; flex-direction:column; align-items:stretch; gap:.35rem;
  padding:.75rem .75rem 1rem; margin-top:auto;
  border-top:1px solid color-mix(in srgb, white 14%, transparent);
}
.sidebar-foot .sidebar-item{ font-size:.85rem; }
.sidebar-user{ color:color-mix(in srgb, white 82%, var(--navy) 18%); font-weight:600; }

/* Burger-Button nur auf dem Handy (siehe Media Query unten). */
.sidebar-burger{
  display:none; align-items:center; justify-content:center;
  width:44px; height:44px; margin:auto .75rem auto auto; padding:0;
  background:none; color:#fff; border:1px solid color-mix(in srgb, white 30%, transparent);
  border-radius:var(--radius); cursor:pointer;
}
.sidebar-burger:hover{ background:var(--navy-2); }
.sidebar-burger:focus-visible{ outline:3px solid #fff; outline-offset:2px; }
.sidebar-burger .sidebar-burger-zu{ display:none; }
.sidebar.is-open .sidebar-burger .sidebar-burger-auf{ display:none; }
.sidebar.is-open .sidebar-burger .sidebar-burger-zu{ display:inline; }

@media (max-width:720px){
  .app-shell{ flex-direction:column; }
  .sidebar{ width:100%; flex:none; flex-direction:row; flex-wrap:wrap; border-right:none; border-bottom:1px solid var(--navy-2); }
  /* Kopfleiste bleibt beim Scrollen oben; aufgeklapptes Menü scrollt in sich. */
  .sidebar{ position:sticky; top:0; z-index:30; height:auto; max-height:100vh; overflow-y:auto; align-self:stretch; }
  .sidebar-menu{ overflow-y:visible; }
  /* Auf dem Handy trägt die Kopfleiste schon Logo und Namen – Hero entfällt. */
  .landing-hero{ display:none; }
  .sidebar-brand{ flex-direction:row; align-items:center; gap:.85rem; padding:1rem; border-bottom:none; }
  .logo-plate{ width:auto; max-width:none; }
  .logo-plate .brand-logo{ height:40px; width:auto; }
  .sidebar-brand-text{ text-align:left; }
  .sidebar-menu{ flex-direction:row; flex-wrap:wrap; padding:0 .5rem .5rem; }
  .sidebar-foot{ flex-direction:row; margin-top:0; margin-left:auto; border-top:none; padding:.5rem .75rem; }

  /* Mit JS: Menü als Burger einklappen, aufgeklappt als Liste untereinander. */
  .js .sidebar-burger{ display:inline-flex; }
  .js .sidebar:not(.is-open) .sidebar-menu,
  .js .sidebar:not(.is-open) .sidebar-foot{ display:none; }
  .js .sidebar.is-open .sidebar-menu{ flex-basis:100%; flex-direction:column; flex-wrap:nowrap; }
  .js .sidebar.is-open .sidebar-foot{
    flex-basis:100%; margin-left:0;
    border-top:1px solid color-mix(in srgb, white 14%, transparent);
  }
}

/* ===================== Bulma-Bausteine neu eingefärbt ===================== */
.hero.is-primary{ background:var(--navy); color:#fff; }
.hero.is-primary .title{ color:#fff; }
.hero.is-primary .subtitle{ color:color-mix(in srgb, white 82%, var(--navy) 18%); }

.button.is-primary{ background:var(--ci-blue-dark); color:#fff; border-radius:var(--radius); }
.button.is-primary:hover{ background:var(--navy); color:#fff; }
.button.is-primary:focus-visible{ outline:3px solid var(--ci-blue-dark); outline-offset:2px; }

.notification.is-danger{ background:color-mix(in srgb, var(--danger) 14%, white); color:var(--danger-ink); border:1px solid color-mix(in srgb, var(--danger) 35%, white); }
.notification.is-warning{ background:color-mix(in srgb, var(--warn) 20%, white); color:var(--warn-ink); border:1px solid color-mix(in srgb, var(--warn) 40%, white); }
.notification.is-info{ background:var(--ci-blue-light); color:var(--ci-blue-dark); border:1px solid color-mix(in srgb, var(--ci-blue) 35%, white); }
.notification.is-success{ background:color-mix(in srgb, var(--ok) 14%, white); color:var(--ok-ink); border:1px solid color-mix(in srgb, var(--ok) 35%, white); }

.tag.is-primary{ background:var(--ci-blue-dark); color:#fff; }
.tag.is-danger{ background:color-mix(in srgb, var(--danger) 15%, white); color:var(--danger-ink); }
.tag.is-warning{ background:color-mix(in srgb, var(--warn) 20%, white); color:var(--warn-ink); }
.tag.is-info{ background:var(--ci-blue-light); color:var(--ci-blue-dark); }
.tag.is-success{ background:color-mix(in srgb, var(--ok) 16%, white); color:var(--ok-ink); }

.box{ border:1.5px solid var(--line); border-radius:var(--radius); box-shadow:none; }
.card{ border:1.5px solid var(--line); border-radius:var(--radius); box-shadow:none; }
.card:hover{ border-color:var(--ci-blue-dark); box-shadow:0 0 0 2px var(--ci-blue-dark); }

.input, .textarea, .select select{
  border:1.5px solid color-mix(in srgb, var(--text-2) 55%, var(--line) 45%);
  border-radius:var(--radius); color:var(--text);
}
.input:focus, .input.is-focused, .textarea:focus, .select select:focus{
  border-color:var(--ci-blue-dark); box-shadow:0 0 0 3px color-mix(in srgb, var(--ci-blue-dark) 25%, transparent);
}

.table thead th{ color:var(--text-2); text-transform:uppercase; font-size:.75rem; letter-spacing:.05em; }
.table td, .table th{ border-color:var(--line); }

.title{ color:var(--text); }
.subtitle{ color:var(--text-2); }

/* ===================== Modul-Karten (Startseite) ===================== */
.module-ico{ font-size:1.7rem; margin:0 0 .55rem; line-height:1; }
/* Raster richtet sich nach der tatsächlich verfügbaren Breite (neben der
   Seitenleiste), nicht nach Bulmas Fenster-Breakpoints. */
.module-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(15rem, 1fr)); gap:1.5rem; }
.module-card{ display:block; height:100%; text-decoration:none; color:inherit; }
/* Lange Komposita in schmalen Karten trennen; Titel nur an gesetzten &shy;. */
.module-card .subtitle{ hyphens:auto; }
@media (max-width:768px){
  .app-main .section{ padding:1.5rem .75rem; }
  .module-grid{ gap:.75rem; }
}

/* ===================== Auswahlkarten (z.B. Einsatztyp-Wahl) ===================== */
label.box:has(input:checked){ border-color:var(--ci-blue-dark); box-shadow:0 0 0 2px var(--ci-blue-dark); }
label.box:hover{ border-color:var(--ci-blue-dark); }

/* ===================== Status-Chip — Status nie nur über Farbe ===================== */
.status-chip{
  display:inline-flex; align-items:center; gap:.35rem;
  font-size:.78rem; font-weight:700; padding:.3rem .65rem; border-radius:5px;
  white-space:nowrap;
}
.status-chip--neutral{ background:var(--bg); color:var(--text-2); border:1px solid var(--line); }
.status-chip--info{ background:var(--ci-blue-light); color:var(--ci-blue-dark); }
.status-chip--warn{ background:color-mix(in srgb, var(--warn) 20%, white); color:var(--warn-ink); }
.status-chip--ok{ background:color-mix(in srgb, var(--ok) 16%, white); color:var(--ok-ink); }
.status-chip--danger{ background:color-mix(in srgb, var(--danger) 15%, white); color:var(--danger-ink); }
.status-chip--neutral::before{ content:"◌"; }
.status-chip--info::before{ content:"◔"; }
.status-chip--warn::before{ content:"▶"; }
.status-chip--ok::before{ content:"✓"; }
.status-chip--danger::before{ content:"✕"; }

/* ===================== Dashboard-Legende (Quoten als Linie, nicht als Fläche) ===================== */
.dashboard-box{ position:relative; }
/* Schließen-Lasche: hängt rechts außen am Dashboard-Kasten. */
.dashboard-schliessen{
  /* Oberkante und Höhe wie der "Anzeigen"-Button in der Kopfzeile. */
  position:absolute; top:var(--bulma-box-padding, 1.25rem); left:100%;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:1rem; width:2.25rem; height:var(--bulma-control-height, 2.5em); padding:0;
  background:var(--ci-blue-dark); color:#fff; border:none;
  border-radius:0 var(--radius) var(--radius) 0;
  cursor:pointer;
}
.dashboard-schliessen:hover{ background:var(--navy); }
.dashboard-schliessen:focus-visible{ outline:3px solid var(--ci-blue-dark); outline-offset:2px; }
/* Unterhalb von Desktop fehlt der Platz neben dem Kasten – Lasche nach innen. */
@media (max-width:1023px){
  .dashboard-box{ padding-right:3.25rem; }
  .dashboard-schliessen{ left:auto; right:var(--bulma-box-padding, 1.25rem); border-radius:var(--radius); }
}
/* Titel und Filter brechen um, sobald der Platz nicht reicht. */
.dashboard-kopf{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.75rem 1.5rem; }
.dashboard-kopf .title{ min-width:0; overflow-wrap:break-word; }
/* Mobil: Titel allein in der ersten Zeile, nur er weicht dem X aus –
   Filter, Kennzahlen und Diagramm nutzen die volle Breite. */
@media (max-width:768px){
  .dashboard-box{ padding-right:var(--bulma-box-padding, 1.25rem); }
  .dashboard-kopf .title{ flex-basis:100%; padding-right:3rem; }
}
.dashboard-kennzahlen{ display:grid; grid-template-columns:repeat(auto-fit, minmax(9.5rem, 1fr)); gap:1rem 1.5rem; }
.dashboard-filter{ display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; min-width:0; max-width:100%; }
.dashboard-filter .select{ max-width:100%; min-width:0; }
.dashboard-filter .select select{ max-width:100%; }
/* Diagramm behält eine Mindestbreite und scrollt auf schmalen Bildschirmen
   horizontal, statt bis zur Unlesbarkeit zu schrumpfen. */
.dashboard-chart-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.dashboard-chart-flaeche{ position:relative; min-width:640px; aspect-ratio:2.7; max-height:420px; }
.dashboard-legende{ display:flex; gap:.4rem 1.25rem; flex-wrap:wrap; justify-content:center; font-size:.85rem; color:var(--text-2); }
.dashboard-legende-eintrag{ display:inline-flex; align-items:center; gap:.4rem; }
.dashboard-legende-symbol{ display:inline-block; width:22px; }
.dashboard-legende-flaeche{ height:12px; border-radius:3px; border:1.5px solid; }
.dashboard-legende-linie{ height:0; border-top:2px solid; }
.dashboard-legende-linie--punkte{ border-top-style:dotted; }
.dashboard-legende-linie--striche{ border-top-style:dashed; }
