/* toFace School – Portal-Design 2026: ruhige, neutrale Fläche, Schulfarben gezielt als Akzent.
   Wird nach style.css und sign.css geladen und überschreibt nur die Optik – Aufbau und Klassen bleiben gleich.
   Zum Zurückschalten genügt es, diese Datei in inc/layout.php nicht mehr einzubinden. */
:root {
  --ink: #131d2a;
  --text: #2a3542;
  --muted: #6b7684;
  --line: #e5e8ed;
  --line-strong: #d4d9e1;
  --bg: #f5f6f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 29, 42, .05);
  --shadow-lg: 0 1px 2px rgba(17, 29, 42, .04), 0 12px 32px -8px rgba(17, 29, 42, .14);
  --ring: 0 0 0 3px color-mix(in srgb, var(--green) 28%, transparent);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --top: 60px;
  --sidebar: 256px;
}
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 27px; letter-spacing: -.02em; }
h2 { font-size: 18px; }
h4 { color: var(--muted); }
a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--navy-dark); text-decoration-color: currentColor; }
::selection { background: color-mix(in srgb, var(--green) 30%, transparent); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Kopfzeile: weiß, mit feinem Streifen in der Schulfarbe ---------- */
.topbar { background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--navy); padding: 3px 20px 0; }
.brand, .brand:hover { color: var(--ink); }
.brand-text { border-left-color: var(--line); }
.brand-text b { font-size: 16px; color: var(--ink); }
.brand-text small { color: var(--muted); letter-spacing: .02em; }
.brand-logo-box { height: 40px; box-shadow: none; border: 1px solid var(--line); border-radius: 10px; }
.topbar-user .who { color: var(--ink); font-weight: 700; }
.topbar-user .who small { color: var(--muted); font-weight: 600; }
.topbar .btn-ghost { color: var(--text); border-color: var(--line); background: #fff; }
.topbar .btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.menu-btn { border-radius: 8px; }
.menu-btn svg { stroke: var(--ink); }

/* ---------- Seitenleiste ---------- */
.sidebar { background: #fbfbfc; border-right-color: var(--line); padding: 16px 12px; gap: 1px; scrollbar-width: thin; }
.sidebar a { padding: 8px 12px; border-radius: 9px; font-weight: 600; color: var(--text); transition: background-color .12s ease, color .12s ease; }
.sidebar a svg { width: 18px; height: 18px; stroke: #8a94a1; transition: stroke .12s ease; }
.sidebar a:hover { background: #eff1f4; color: var(--ink); }
.sidebar a:hover svg { stroke: var(--ink); }
.sidebar a.active { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(17,29,42,.06); position: relative; }
.sidebar a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--navy); }
.sidebar a.active svg { stroke: var(--navy); }
.nav-group { margin-top: 10px; }
.nav-group summary { padding: 6px 12px; font-size: 11px; letter-spacing: .08em; color: #8a94a1; }
.nav-group summary:hover { background: transparent; color: var(--ink); }
.nav-group summary svg { display: none; }
.nav-group[data-has-active] summary { color: var(--ink); }
.nav-group .chev { width: 6px; height: 6px; border-width: 1.5px; opacity: .7; }
.nav-items { padding-left: 0; margin-left: 0; border-left: 0; gap: 1px; }
.nav-items a { padding: 8px 12px; }
.sidebar-foot { padding-top: 22px; }
.sidebar-foot span { color: #9aa3ae; }
.wa-help { border-radius: 12px; }
.pill { background: var(--navy); }

/* ---------- Inhalt ---------- */
.content { padding: calc(var(--top) + 30px) 36px 56px; }
.page-head { margin-bottom: 20px; align-items: center; }
.page-head + p, .page-head + .muted { margin-top: -10px; }
.back { font-weight: 600; transition: color .12s ease; }
.back:hover { color: var(--ink); }

.card { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 24px; }
.card-head { margin-bottom: 16px; }
.card-head a { font-weight: 700; }
.card-highlight { border: 1px solid color-mix(in srgb, var(--orange) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 12%, transparent); }

/* Begrüßung auf der Übersicht */
.hero { border-radius: 18px; padding: 30px 34px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--green) 35%, transparent), transparent 55%), linear-gradient(135deg, var(--navy), var(--navy-dark)); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--navy-dark) 70%, transparent); }
.hero::after { width: 340px; height: 340px; right: -110px; top: -170px; background: #fff; opacity: .06; }
.hero h1 { font-size: 26px; }
.hero p { color: rgba(255,255,255,.78); }

/* Kennzahlen-Kacheln: statt farbiger Oberkante ein kurzer Akzentstrich */
.tiles { gap: 14px; }
.tile, .kpi { border: 1px solid var(--line); border-top: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 18px 20px; position: relative; transition: border-color .15s ease, box-shadow .2s var(--ease-out), transform .2s var(--ease-out); }
.tile::before { content: ''; position: absolute; left: 20px; top: -1px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--tile-c, var(--navy)); }
.tile-orange { --tile-c: var(--orange); } .tile-blue { --tile-c: var(--blue); } .tile-green { --tile-c: var(--green); } .tile-purple { --tile-c: var(--purple); } .tile-red { --tile-c: var(--red); }
.tile b, .kpi b { color: var(--ink); font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span, .kpi span { font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  a.tile:hover, a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
}

/* Hinweise und Meldungen */
.notice { position: relative; background: color-mix(in srgb, var(--green) 9%, #fff); border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line)); border-left-width: 1px; border-radius: 12px; padding: 11px 16px 11px 36px; color: var(--text); }
.notice::before { content: ''; position: absolute; left: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.notice-orange { background: var(--orange-soft); border-color: #f3d9a8; }
.notice-orange::before { background: var(--orange); box-shadow: 0 0 0 3px rgba(224,138,0,.2); }
.notice a { font-weight: 700; }
.flash { border-radius: 12px; padding: 12px 16px 12px 44px; position: relative; }
.flash::before { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.flash-success::before { content: '✓'; background: #6a9a12; }
.flash-error::before { content: '!'; background: var(--red); }
.impersonate-bar { border-radius: 12px; }

/* ---------- Schaltflächen ---------- */
.btn { border-radius: 10px; padding: 9px 16px; min-height: 40px; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .16s var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 1px 2px rgba(17,29,42,.12); }
.btn-secondary { background: var(--navy); box-shadow: 0 1px 2px rgba(17,29,42,.12); }
.btn-ghost { color: var(--ink); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(17,29,42,.04); }
.btn-ghost:hover { border-color: #b9c0ca; background: #fafbfc; color: var(--ink); }
.btn-ghost.danger:hover { border-color: color-mix(in srgb, var(--red) 50%, #fff); }
.btn-sm { min-height: 32px; padding: 5px 12px; border-radius: 8px; }
.btn-lg { min-height: 48px; border-radius: 12px; }
.btn-icon { border-radius: 8px; transition: background-color .12s ease, color .12s ease; }

/* ---------- Formulare ---------- */
label { color: var(--ink); font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], input[type=tel], select, textarea {
  border-color: var(--line-strong); border-radius: 10px; padding: 9px 12px; min-height: 40px; background-color: #fff; box-shadow: 0 1px 2px rgba(17,29,42,.03);
}
input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, input[type=number]:hover, input[type=date]:hover, input[type=time]:hover, input[type=search]:hover, input[type=url]:hover, input[type=tel]:hover, select:hover, textarea:hover { border-color: #b9c0ca; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #a0a8b3; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select[multiple] { background-image: none; padding-right: 12px; }
input[type=file] { font: inherit; font-size: 14px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
input[type=file]::file-selector-button:hover { background: var(--bg); border-color: #b9c0ca; }
.check, .radio { color: var(--text); }
.check input, .radio input, .radio-card input { accent-color: var(--navy); }
.radio-card { border-color: var(--line-strong); border-radius: 12px; transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease; }
.radio-card:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); box-shadow: inset 0 0 0 1px var(--navy); }
.radio-card b { color: var(--ink); }
.filters { gap: 10px; }

/* ---------- Tabellen ---------- */
.table { font-size: 14px; }
.table th { font-size: 11.5px; letter-spacing: .06em; color: #7d8794; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table th:first-child { border-top-left-radius: 10px; } .table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 13px 12px; border-bottom-color: #eef0f3; }
.table tbody tr { transition: background-color .1s ease; }
@media (hover: hover) and (pointer: fine) { .table tbody tr:hover td { background: #fafbfc; } }
.table td a:not(.btn) { font-weight: 700; color: var(--ink); }
.table td a:not(.btn):hover { color: var(--navy); }
.table tr.total td { color: var(--ink); }
.group-row td { background: var(--bg); }
.group-row .big { color: var(--ink); }
.pager a { border-radius: 8px; color: var(--text); }
.pager a.active { background: var(--ink); border-color: var(--ink); }

/* ---------- Abzeichen, Schalter, Reiter, Chips ---------- */
.badge { font-weight: 700; padding: 2px 9px; border-radius: 6px; font-size: 12px; line-height: 1.6; }
.badge-grey { background: #eff1f4; color: #5c6672; }
.badge-green { background: #ecf5d9; color: #4d6c0a; }
.switch { transition: background-color .15s ease; }
.switch::after { box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .18s var(--ease-out); }
.switch.on { background: var(--navy); }
.tabs { border-bottom: 1px solid var(--line); gap: 2px; }
.tabs a { padding: 10px 14px; font-size: 14px; border-bottom-width: 2px; margin-bottom: -1px; transition: color .12s ease; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--navy); }
.chip { border-color: var(--line-strong); transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
.chip:hover { border-color: #b9c0ca; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { border-color: var(--line-strong); border-radius: 10px; }
.empty { padding: 36px 16px; }
.bar { height: 6px; background: #eceff3; }
.bar i { background: var(--navy); border-radius: 3px; }
details > summary { cursor: pointer; }

/* ---------- Übersicht (Schul-Zugänge) ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head h1 { margin: 2px 0 4px; font-size: 30px; }
.dash-head p { margin: 0; }
.dash-date { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.dash-status { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 30px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s ease; }
.dash-status:hover { color: var(--ink); border-color: var(--line-strong); }
.dash-status i { width: 8px; height: 8px; border-radius: 50%; background: #3fa34d; box-shadow: 0 0 0 3px rgba(63,163,77,.18); }
.dash-status.warn i { background: var(--orange); box-shadow: 0 0 0 3px rgba(224,138,0,.2); }
.dash-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: 'Mulish', sans-serif; margin: 6px 0 12px; }
.dash-grid { margin-top: 24px; }
.dash-more { margin: 10px 0 0; }
.dash-progress { margin: -4px 0 14px; }
.empty .btn { margin-top: 12px; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.quick:has(> :nth-child(5):last-child), .quick:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .quick:has(> :nth-child(5):last-child), .quick:has(> :nth-child(6):last-child) { grid-template-columns: repeat(2, 1fr); } }
.quick-item { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s ease, box-shadow .2s var(--ease-out), transform .16s var(--ease-out); }
.quick-item:active { transform: scale(.98); }
.quick-item b { display: block; color: var(--ink); font-size: 15px; }
.quick-item small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.quick-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--navy-soft); }
.quick-ico svg { width: 21px; height: 21px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-item.danger .quick-ico { background: var(--red-soft); }
.quick-item.danger .quick-ico svg { stroke: var(--red); }
.quick-item.danger b { color: #b42318; }
@media (hover: hover) and (pointer: fine) {
  .quick-item:hover { color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
  .quick-item.danger:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
}

.screen-list, .live-list { list-style: none; margin: 0; padding: 0; }
.screen-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #eef0f3; }
.screen-list li:first-child { border-top: 0; padding-top: 2px; }
.screen-list b { display: block; color: var(--ink); font-size: 14.5px; }
.screen-list small { color: var(--muted); }
.screen-list .dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c9d1; }
.screen-list .dot.on { background: #3fa34d; box-shadow: 0 0 0 3px rgba(63,163,77,.16); }
.screen-list .dot.off { background: var(--orange); }
.screen-list em { font-style: normal; font-size: 12.5px; font-weight: 700; color: #a86400; text-align: right; }
.screen-list em.on { color: #2f7d3a; }
.live-list li { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c) 7%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); margin-bottom: 8px; }
.live-tag { font-size: 12px; font-weight: 800; color: var(--c); }
.live-list p { margin: 4px 0 2px; color: var(--ink); font-weight: 600; }
.live-list small { color: var(--muted); }

/* ---------- Anmeldeseiten ---------- */
body.bare { background: color-mix(in srgb, var(--navy-dark) 55%, #020812); background-image: radial-gradient(60% 50% at 85% 0%, color-mix(in srgb, var(--green) 28%, transparent), transparent 70%), linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: auto, 56px 56px, 56px 56px; }
.auth-card { border-radius: 20px; padding: 40px 36px 32px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }
.auth-card h1 { color: var(--ink); font-size: 26px; }
.auth-card .btn { min-height: 46px; }
.auth-wrap > .flash { border-radius: 12px; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  :root { --top: 58px; }
  .content { padding: calc(var(--top) + 20px) 16px 40px; }
  .sidebar { transition: transform .28s var(--ease-out); box-shadow: none; }
  body.nav-open .sidebar { box-shadow: 0 0 60px rgba(17,29,42,.25); }
  body.app::after { content: ''; position: fixed; inset: var(--top) 0 0 0; background: rgba(17,29,42,.35); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 15; }
  body.nav-open::after { opacity: 1; pointer-events: auto; }
  .card { padding: 18px; }
  .hero { padding: 24px; }
  .dash-head h1 { font-size: 25px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick-item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
  .sidebar { transition: none; }
  a.tile:hover, a.kpi:hover { transform: none; }
}
@media print {
  body { background: #fff; }
  .tile, .kpi, .card { box-shadow: none; }
}
