/* =========================================================
   Mein Dashboard – Stylesheet
   Design-Tokens für Dark (Standard) und Light Mode.
   ========================================================= */

:root {
    --bg:        #050506;
    --bg-2:      #0e0e12;
    --card:      #1a1a21;
    --card-2:    #24242d;
    --border:    #38383f;
    --text:      #f7f7f9;
    --text-dim:  #b6b6c0;
    --text-mut:  #78787f;
    --accent:    #ff8319;   /* kräftiges Orange */
    --accent-2:  #ffb066;   /* helles Orange/Amber */
    --danger:    #f26a54;
    --ok:        #f2953b;
    --warn:      #f7bd60;
    --shadow:    0 8px 26px rgba(0,0,0,.55);
    --radius:    14px;
    --gap:       16px;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg:        #d8d1c4;   /* wärmerer, dunklerer Grund -> Karten heben sich klar ab */
    --bg-2:      #c7bfb0;
    --card:      #ffffff;
    --card-2:    #f4f1ec;
    --border:    #bfb8aa;
    --text:      #121214;
    --text-dim:  #4a4a51;
    --text-mut:  #7d7d85;
    --accent:    #e35700;   /* sattes Orange auf hell */
    --accent-2:  #a8560f;
    --danger:    #bf3c30;
    --ok:        #a86215;
    --warn:      #a97722;
    --shadow:    0 8px 22px rgba(40,28,15,.18);
    color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: radial-gradient(1200px 600px at 80% -10%, var(--bg-2), var(--bg)) fixed;
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */
.topbar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: var(--gap);
    padding: 12px 22px;
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in oklab, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar__left { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.topbar__right { justify-self: end; }
.topbar__title { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.topbar__title [data-icon] { display: inline-flex; }
.topbar__right { display: flex; align-items: center; gap: 10px; }

/* Dashboard-Umschalter (mehrere Ansichten) */
.viewswitch { display: flex; flex-wrap: wrap; gap: 6px; }
.viewpill {
    display: inline-flex; align-items: center; padding: 6px 13px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--card); color: var(--text-dim);
    font-size: 13px; font-weight: 600; text-decoration: none;
    line-height: 1; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.viewpill:hover { background: var(--card-2); color: var(--text); }
.viewpill.is-active {
    color: #fff; border-color: transparent;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
}
@media (pointer: coarse) {
    .viewpill { padding: 9px 16px; font-size: 14px; }
}
.grid-empty {
    grid-column: 1 / -1; text-align: center; color: var(--text-dim);
    padding: 40px 20px; font-size: 15px;
}
.grid-empty a { color: var(--accent); }

.clock { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; }
.clock__time { font-size: 30px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.clock__meta { font-size: 13px; color: var(--text-dim); margin-top: 1px; }
@media (max-width: 720px) {
    .topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px; }
    .topbar__title span:not([data-icon]) { display: none; }
    .clock__time { font-size: 22px; }
    .clock__meta { font-size: 11px; }
}

.iconbtn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card);
    color: var(--text); font-size: 17px; cursor: pointer;
    transition: background .15s, transform .1s;
}
.iconbtn:hover { background: var(--card-2); }
.iconbtn:active { transform: scale(.94); }

/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    padding: var(--gap) 22px 40px;
    max-width: 1500px; margin: 0 auto;
}
.card { grid-column: span var(--span, 1); }

@media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .card { grid-column: span min(var(--span, 1), 2); }
}
@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; padding: var(--gap) 14px 40px; }
    .card { grid-column: span 1; }
    .topbar { padding: 12px 14px; }
}

/* ---------- Card ---------- */
.card {
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex; flex-direction: column;
    min-height: 140px;
    position: relative;
}
.card__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.card__title { font-size: 15.5px; margin: 0; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.card__title .ic { color: var(--accent); }

/* ---------- Icons ---------- */
.ic {
    display: inline-block; width: 1.2em; height: 1.2em;
    vertical-align: -0.2em; flex: none;
}
.card__title [data-icon] { display: inline-flex; }
.topbar__title .ic { color: var(--accent); width: 1.25em; height: 1.25em; }
.iconbtn .ic { width: 19px; height: 19px; }
.card__sub { font-size: 12px; color: var(--text-dim); }
.card__actions { display: flex; align-items: center; gap: 8px; }
.card__state { font-size: 12.5px; color: var(--text-mut); margin-top: auto; padding-top: 8px; }
.card__state.is-error { color: var(--danger); }
.card__state:empty { display: none; padding: 0; }

.badge {
    font-size: 11px; color: var(--text-dim);
    background: var(--card-2); border: 1px solid var(--border);
    padding: 1px 8px; border-radius: 20px;
}
.linkbtn {
    background: none; border: none; color: var(--text-mut);
    font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.linkbtn:hover { color: var(--accent); }

.minisel {
    background: var(--card-2); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 4px 8px; font-size: 12.5px; cursor: pointer;
}
button.minisel.is-on {
    color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
    background: color-mix(in oklab, var(--accent) 12%, var(--card-2));
}

/* ---------- ToDos ---------- */
.todo-add { display: flex; gap: 8px; margin-bottom: 10px; }
.todo-add input {
    flex: 1; background: var(--bg-2); color: var(--text);
    border: 1px solid var(--border); border-radius: 9px;
    padding: 9px 11px; font-size: 14px;
}
.todo-add input:focus { outline: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); border-color: var(--accent); }
.todo-add button {
    width: 40px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--accent); color: #fff; font-size: 20px; cursor: pointer;
}
.todo-add button:hover { filter: brightness(1.08); }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: 340px; }
.todo-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px; border-radius: 8px;
}
.todo-item:hover { background: var(--card-2); }
.todo-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; }
.todo-item__text { flex: 1; word-break: break-word; }
.todo-item.done .todo-item__text { color: var(--text-mut); text-decoration: line-through; }
.todo-item__handle {
    cursor: grab; color: var(--text-mut); flex: none; font-size: 14px; line-height: 1;
    padding: 0 2px; opacity: 0; user-select: none; touch-action: none;
}
.todo-item:hover .todo-item__handle { opacity: .65; }
.todo-item__handle:active { cursor: grabbing; }
.todo-item.dragging { opacity: .55; background: var(--card-2); border-radius: 8px; }
.todo-item.dragging .todo-item__handle { cursor: grabbing; }

.todo-item__edit,
.todo-item__del { opacity: 0; background: none; border: none; color: var(--text-mut); cursor: pointer; font-size: 15px; flex: none; padding: 0 2px; }
.todo-item:hover .todo-item__edit,
.todo-item:hover .todo-item__del { opacity: 1; }
.todo-item__edit:hover { color: var(--accent); }
.todo-item__del:hover { color: var(--danger); }
.todo-item__edit-input {
    flex: 1; min-width: 0; background: var(--bg-2); color: var(--text);
    border: 1px solid var(--accent); border-radius: 7px; padding: 5px 8px; font: inherit;
}
.todo-item__edit-input:focus { outline: 2px solid color-mix(in oklab, var(--accent) 40%, transparent); }
/* Touch-Geräte: Aktionen dauerhaft sichtbar */
@media (hover: none) {
    .todo-item__handle, .todo-item__edit, .todo-item__del { opacity: .6; }
}
.todo-item__date { font-size: 11px; color: var(--text-mut); font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }

/* Archiv */
.todo-archive { margin-top: 6px; }
.archive-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: none; border: none; border-top: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; padding: 10px 4px 8px; font: inherit;
}
.archive-toggle:hover { color: var(--text); }
.archive-caret { color: var(--accent); font-size: 12px; width: 12px; }
.archive-count {
    margin-left: auto; font-size: 11px; color: var(--text-dim);
    background: var(--card-2); border: 1px solid var(--border);
    padding: 1px 8px; border-radius: 20px;
}
.archive-list { max-height: 300px; margin-top: 2px; }
.archive-list .todo-item__text { color: var(--text-mut); }

/* ---------- Wetter ---------- */
.wx-top { display: grid; grid-template-columns: minmax(150px, 1fr) 1.4fr; gap: 16px; margin-bottom: 14px; align-items: center; }
@media (max-width: 560px) { .wx-top { grid-template-columns: 1fr; } }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-now__icon { color: var(--accent); line-height: 0; flex: none; }
.wx-now__icon .ic { width: 56px; height: 56px; }
.wx-now__temp { font-size: 44px; font-weight: 700; line-height: 1; }
.wx-now__max { font-size: 22px; font-weight: 600; color: var(--accent-2); margin-left: 6px; }
.wx-now__desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.wx-now__hl { display: flex; gap: 10px; font-size: 12px; color: var(--text-mut); margin-top: 4px; font-variant-numeric: tabular-nums; }

.wx-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.wx-det { display: flex; align-items: center; gap: 9px; }
.wx-det__ic { color: var(--accent-2); line-height: 0; flex: none; }
.wx-det__ic .ic { width: 18px; height: 18px; }
.wx-det__v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wx-det__l { font-size: 10.5px; color: var(--text-mut); }

.weather-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wday {
    background: var(--card-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 4px; text-align: center;
}
.wday__d { font-size: 11px; color: var(--text-dim); }
.wday__i { margin: 4px 0; color: var(--accent); line-height: 0; }
.wday__i .ic { width: 24px; height: 24px; }
.wday__t { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wday__t b { color: var(--text); }
.wday__p { font-size: 10.5px; color: var(--accent-2); display: inline-flex; align-items: center; gap: 2px; justify-content: center; }
.wday__p .ic { width: 11px; height: 11px; }
.wx-rain { display: flex; align-items: center; gap: 8px; padding: 8px 11px; margin-bottom: 14px; border-radius: 10px; font-size: 13px;
    background: color-mix(in oklab, var(--accent) 11%, var(--card-2)); border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border)); }
.wx-rain.is-dry { background: var(--card-2); border-color: var(--border); }
.wx-rain__ic { color: var(--accent); line-height: 0; flex: none; }
.wx-rain__ic .ic { width: 18px; height: 18px; }
.wx-rain__ic--dry { color: var(--accent-2); }
.wx-rain__t { font-weight: 600; }
.wx-rain__d { color: var(--text-dim); font-size: 12px; }

/* ---------- Mittagskarte ---------- */
.lunch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.resto {
    background: var(--card-2); border: 1px solid var(--border);
    border-radius: 11px; padding: 11px 12px;
}
.resto__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.resto__name { font-weight: 640; font-size: 14px; }
.resto__name a { color: inherit; text-decoration: none; }
.resto__name a:hover { color: var(--accent); }
.resto__tags { font-size: 10px; color: var(--text-mut); white-space: nowrap; }
.resto__tag { border: 1px solid var(--border); border-radius: 12px; padding: 0 6px; margin-left: 4px; }
.resto__tag.on { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 50%, var(--border)); }
.dish { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--border); }
.dish:first-of-type { border-top: none; }
.dish__name { font-size: 13px; color: var(--text); }
.dish__note { font-size: 11px; color: var(--text-mut); }
.dish__price { font-size: 12.5px; color: var(--accent-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.resto__empty { font-size: 12px; color: var(--text-mut); font-style: italic; }
.resto__general { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); }

/* ---------- News ---------- */
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; overflow-y: auto; max-height: 420px; }
.news-item { padding: 9px 4px; border-top: 1px solid var(--border); }
.news-item:first-child { border-top: none; }
.news-item a { color: var(--text); text-decoration: none; font-weight: 560; font-size: 14px; }
.news-item a:hover { color: var(--accent); }
.news-item__meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.news-item__src { font-size: 10.5px; color: var(--accent); background: color-mix(in oklab, var(--accent) 14%, transparent); padding: 1px 7px; border-radius: 20px; }
.news-item__cat { font-size: 10.5px; color: var(--accent-2); background: color-mix(in oklab, var(--accent-2) 14%, transparent); padding: 1px 7px; border-radius: 20px; }
.news-item__time { font-size: 11px; color: var(--text-mut); }
.news-item__sum { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

/* ---------- Geburtstage & Feiertage ---------- */
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; overflow-y: auto; max-height: 340px; }
.ev-item { display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-top: 1px solid var(--border); }
.ev-item:first-child { border-top: none; }
.ev-item__ico { color: var(--accent); line-height: 0; flex: none; }
.ev-item__ico .ic { width: 20px; height: 20px; }
.ev-item--holiday .ev-item__ico { color: var(--accent-2); }
.ev-item__body { flex: 1; min-width: 0; }
.ev-item__name { font-size: 14px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-item__sub { font-size: 12px; color: var(--text-dim); }
.ev-item__when {
    font-size: 11.5px; color: var(--text-dim); white-space: nowrap; flex: none;
    background: var(--card-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 20px;
}
.ev-item__when.is-soon { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.ev-link { color: var(--accent); text-decoration: none; }
.ev-link:hover { text-decoration: underline; }

/* ---------- Nekrolog (kompakt, einzeilig) ---------- */
.nk-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 340px; }
.nk-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 2px; border-top: 1px solid var(--border); }
.nk-item:first-child { border-top: none; }
.nk-item__l { display: flex; align-items: baseline; gap: 7px; flex: 1; min-width: 0; }
.nk-item__name { font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; flex: none; }
a.nk-item__name:hover { color: var(--accent); }
.nk-item__desc { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nk-item__meta { font-size: 11px; color: var(--text-mut); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }

/* ---------- Abfall ---------- */
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-top: 1px solid var(--border); }
.ab-row:first-child { border-top: none; }
.ab-when { display: flex; flex-direction: column; line-height: 1.15; min-width: 84px; flex: none; }
.ab-when b { font-size: 13px; font-weight: 650; color: var(--text); }
.ab-when small { font-size: 11px; color: var(--text-mut); font-variant-numeric: tabular-nums; }
.ab-row.is-next .ab-when b { color: var(--accent); }
.ab-frs { display: flex; flex-wrap: wrap; gap: 5px; }
.ab-chip {
    font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
    border: 1px solid transparent; white-space: nowrap;
    background: color-mix(in oklab, var(--chipc) 18%, var(--card-2));
    border-color: color-mix(in oklab, var(--chipc) 45%, var(--border));
    color: color-mix(in oklab, var(--chipc) 72%, var(--text));
}
.ab-chip--rest   { --chipc: #8a8f98; }
.ab-chip--bio    { --chipc: #6ab04c; }
.ab-chip--papier { --chipc: #4a90d9; }
.ab-chip--gelb   { --chipc: #e0b000; }
.ab-chip--schad  { --chipc: #e0552b; }

/* ---------- Veranstaltungen ---------- */
.va-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 360px; }
.va-day { margin-bottom: 10px; }
.va-day__h {
    font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .4px;
    color: var(--accent); padding: 2px 0 5px; position: sticky; top: 0;
    background: linear-gradient(180deg, var(--card) 70%, transparent);
}
.va-ev { display: flex; gap: 11px; padding: 5px 2px; align-items: baseline; border-top: 1px solid var(--border); }
.va-day .va-ev:first-of-type { border-top: none; }
.va-ev__time { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; min-width: 44px; }
.va-ev__body { flex: 1; min-width: 0; }
.va-ev__title { font-size: 13.5px; }
.va-ev__title a { color: var(--text); text-decoration: none; }
.va-ev__title a:hover { color: var(--accent); }
.va-ev__meta { font-size: 11.5px; color: var(--text-mut); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 1px; }
.va-ev__cat { border: 1px solid var(--border); border-radius: 20px; padding: 0 7px; color: var(--text-dim); }
.va-empty { font-size: 12.5px; color: var(--text-mut); font-style: italic; padding: 8px 2px; list-style: none; }
.nk-item__date { font-size: 11px; color: var(--text-mut); margin-top: 1px; }

/* ---------- Stundenpläne (EduPage) ---------- */
.edu-synctime { font-size: 11px; color: var(--text-mut); font-variant-numeric: tabular-nums; }
.edupage-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.edu-kid { background: var(--card-2); border: 1px solid var(--border); border-top: 3px solid var(--kid, var(--border)); border-radius: 12px; padding: 11px 13px 12px; }
.edu-kid__err { font-size: 12.5px; color: var(--danger); }

/* Kopfzeile: Name + Navigation + Umschalter (tablet-tauglich) */
.edu-kid__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.edu-kid__name { font-weight: 700; font-size: 15px; margin-right: auto; color: var(--kid, var(--text)); }
.edu-nav { display: inline-flex; align-items: center; gap: 4px; }
.edu-nav__label { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 132px; text-align: center; }
.edu-navbtn {
    background: var(--card); border: 1px solid var(--border); color: var(--text-dim);
    border-radius: 8px; min-width: 34px; height: 34px; padding: 0 10px; font: inherit; font-size: 15px; cursor: pointer;
}
.edu-navbtn:hover { color: var(--text); border-color: var(--accent); }
.edu-navbtn--today { font-size: 12px; }
.edu-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 30px; }
.edu-tab { background: var(--card-2); border: none; color: var(--text-dim); font: inherit; font-size: 12px; padding: 0 12px; cursor: pointer; }
.edu-tab:hover { color: var(--text); }
.edu-tab.is-on { background: var(--accent); color: #fff; }
.edu-kid.is-loading { opacity: .55; }

/* Globaler Layout-Umschalter (Spalten/Zeilen) im Karten-Kopf */
.edu-layout { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 30px; }
.edu-ltab { background: var(--card-2); border: none; color: var(--text-dim); font: inherit; font-size: 12px; padding: 0 11px; cursor: pointer; }
.edu-ltab:hover { color: var(--text); }
.edu-ltab.is-on { background: var(--accent); color: #fff; }

/* Rasteransicht (Spalten): klassischer Stundenplan */
.edu-gridwrap { overflow-x: auto; }
.edu-grid { border-collapse: separate; border-spacing: 3px; width: 100%; }
.edu-grid th, .edu-grid td { vertical-align: top; }
.edu-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--card-2); }
.edu-gcorner { width: 52px; }
.edu-gcol { text-align: center; padding: 2px 4px 5px; }
.edu-gcol__wd { display: block; font-size: 11px; font-weight: 700; color: var(--text); }
.edu-gcol.is-today .edu-gcol__wd { color: var(--accent); }
.edu-gcol__dt { display: block; font-size: 10px; color: var(--text-mut); font-variant-numeric: tabular-nums; }
.edu-gtime { width: 50px; padding: 4px 8px 0 0; white-space: nowrap; }
.edu-gtime > span { display: block; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.edu-gt-a { font-size: 11px; font-weight: 650; color: var(--text); }
.edu-gt-b { font-size: 10px; color: var(--text-mut); padding-top: 1px; border-top: 1px solid var(--border); margin-top: 1px; }
.edu-gc { min-width: 58px; }
.edu-cell {
    background: color-mix(in oklab, var(--lc, var(--border)) 16%, var(--card));
    border-left: 3px solid var(--lc, var(--border)); border-radius: 5px;
    padding: 4px 6px; margin-bottom: 3px;
}
.edu-cell:last-child { margin-bottom: 0; }
.edu-cell__subj { display: block; font-size: 12px; font-weight: 600; line-height: 1.18; }
.edu-cell__room { display: block; font-size: 10px; color: var(--text-mut); margin-top: 1px; }
.edu-cell__till { display: block; font-size: 10px; font-weight: 600; color: var(--text-dim); margin-top: 1px; opacity: .85; }
/* Tagesansicht: breite Einzelzelle – Fach + Meta einzeilig (kompakt) */
.edu-cell--wide { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 5px 9px; }
.edu-cell--wide .edu-cell__subj { font-size: 13px; }
.edu-cell__meta { font-size: 11px; color: var(--text-mut); }
.edu-cell.is-now { outline: 2px solid var(--accent); background: color-mix(in oklab, var(--accent) 18%, var(--card)); }
.edu-cell.is-now .edu-cell__subj { color: var(--accent); }
.edu-cell.is-changed .edu-cell__subj { color: var(--warn); }

.edu-view--week { display: flex; flex-direction: column; gap: 9px; }
.edu-day__h { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); padding: 2px 0 3px; }
.edu-day__h.is-today { color: var(--accent); }

/* Eine Zeile pro Stunde: Zeit | Fach | Raum/Lehrer */
.edu-lesson {
    display: grid; grid-template-columns: auto minmax(70px, auto) 1fr; gap: 10px; align-items: baseline;
    padding: 5px 6px 5px 9px; border-left: 3px solid var(--lc, var(--border)); border-radius: 5px; margin-bottom: 3px;
    background: color-mix(in oklab, var(--lc, var(--border)) 11%, transparent);
}
.edu-lesson:hover { background: color-mix(in oklab, var(--lc, var(--text)) 20%, transparent); }
.edu-lesson.is-now { background: color-mix(in oklab, var(--accent) 14%, transparent); border-left-color: var(--accent); }
.edu-lesson__time { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.edu-lesson__to { color: var(--text-mut); }
.edu-lesson__subj { font-size: 13.5px; font-weight: 560; white-space: nowrap; }
.edu-lesson.is-changed .edu-lesson__subj { color: var(--warn); }
.edu-lesson.is-now .edu-lesson__subj { color: var(--accent); }
.edu-lesson__meta { font-size: 11.5px; color: var(--text-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edu-chip { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); border: 1px solid color-mix(in oklab, var(--warn) 50%, var(--border)); border-radius: 20px; padding: 0 5px; margin-left: 5px; vertical-align: 1px; }
.edu-chip--now { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 55%, var(--border)); }
.edu-empty { font-size: 12.5px; color: var(--text-mut); font-style: italic; padding: 8px 4px; }
.edu-ferien { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.edu-ferien__h { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); margin-bottom: 8px; }
.edu-ferien__h [data-icon] { display: inline-flex; color: var(--accent-2); }
.edu-ferien__h .ic { width: 14px; height: 14px; }
/* Ferien als Spalten pro Jahr */
.edu-ferien__years { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 20px; }
.edu-ferien__year { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.edu-ferien__yh {
    font-size: 12px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border); padding-bottom: 3px;
}
.ferien-item { display: flex; flex-direction: column; min-width: 0; }
.ferien-item__name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ferien-item__info { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ferien-item__rel { color: var(--text-mut); }
.ferien-item.is-now .ferien-item__name { color: var(--accent-2); }
.ferien-item.is-now .ferien-item__rel { color: var(--accent-2); font-weight: 700; }

/* ---------- Kalender ---------- */
/* Kalender-Umschalt-Badges */
.cal-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cal-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--card-2);
    color: var(--text-dim); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, background .15s, color .15s;
}
.cal-badge:hover { background: var(--card); color: var(--text); }
.cal-badge__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--accent)); flex: none; }
.cal-badge.is-off { opacity: .5; }
.cal-badge.is-off .cal-badge__dot { background: var(--text-mut); }

.cal-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 340px; }
.cal-day { margin-bottom: 10px; }
.cal-day__head {
    font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .4px;
    color: var(--accent); padding: 2px 0 5px; position: sticky; top: 0;
    background: linear-gradient(180deg, var(--card) 70%, transparent);
}
.cal-day__list { list-style: none; margin: 0; padding: 0; }
.cal-ev { display: flex; gap: 11px; padding: 6px 2px 6px 9px; align-items: baseline; border-left: 2px solid color-mix(in oklab, var(--cc, transparent) 70%, transparent); }
.cal-ev__time { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; min-width: 58px; }
.cal-ev__body { flex: 1; min-width: 0; }
.cal-ev__title { font-size: 13.5px; }
.cal-ev__title a { color: var(--text); text-decoration: none; }
.cal-ev__title a:hover { color: var(--accent); }
.cal-ev__loc { font-size: 11.5px; color: var(--text-mut); }

/* ---------- Matomo ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
    background: var(--card-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px; text-align: center;
}
.stat__v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.spark { height: 46px; margin-bottom: 12px; }
.spark svg { width: 100%; height: 100%; display: block; }

.matomo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.matomo-col__h { font-size: 12px; color: var(--text-dim); margin: 0 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12.5px; border-top: 1px solid var(--border); }
.rank li:first-child { border-top: none; }
.rank__label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__val { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.matomo-note { font-size: 12.5px; color: var(--warn); }

/* Matomo – alle Seiten kompakt (füllt die Widget-Höhe) */
#matomo { display: flex; flex-direction: column; }
/* Matomo-Karte nicht auf Nachbarhöhe strecken – nur so hoch wie ihr Inhalt */
#matomo { align-self: start; }
.mnav { display: inline-flex; align-items: center; gap: 2px; }
.mnav__btn {
    width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--card-2); color: var(--text); font-size: 15px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: background .15s, opacity .15s;
}
.mnav__btn:hover:not(:disabled) { background: var(--card); color: var(--accent); }
.mnav__btn:disabled { opacity: .35; cursor: default; }
.mnav__label {
    min-width: 96px; text-align: center; padding: 0 8px; height: 26px;
    border: 1px solid var(--border); border-radius: 7px; background: var(--card-2);
    color: var(--text-dim); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;
    white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s;
}
.mnav__label:hover { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.msites { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.msite { display: grid; grid-template-columns: minmax(64px, 1.1fr) 1fr 48px minmax(56px, auto); gap: 10px; align-items: center; padding: 4px 2px; border-top: 1px solid var(--border); }
.msite:first-child { border-top: none; }
.msite__name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msite__bar { height: 5px; background: var(--card-2); border-radius: 20px; overflow: hidden; }
.msite__bar > span { display: block; height: 100%; background: var(--accent); border-radius: 20px; }
.msite__spark-wrap { display: flex; align-items: center; justify-content: center; height: 16px; }
.msite__spark { width: 48px; height: 16px; }
.msite__spark polyline { fill: none; stroke: var(--text-mut); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.msite__spark.up polyline { stroke: #34c759; }
.msite__spark.down polyline { stroke: color-mix(in oklab, #ff453a 80%, var(--text)); }
.msite__v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; padding-left: 4px; line-height: 1.1; }
.msite__v small { font-weight: 400; font-size: 10px; color: var(--text-mut); margin-left: 5px; }
.mdelta { font-weight: 600; }
.mdelta.up { color: #34c759; }
.mdelta.down { color: color-mix(in oklab, #ff453a 80%, var(--text)); }
.mdelta.flat { color: var(--text-mut); }
.msite--more { display: block; padding: 6px 2px 0; font-size: 11.5px; color: var(--text-mut); border-top: 1px solid var(--border); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 10px; font-size: 11.5px; color: var(--text-mut); }

/* ---------- Utility ---------- */
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
