:root {
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --surface-3: #eef0f8;
  --border: #e8eaf2;
  --border-strong: #dcdfeb;
  --text: #161a26;
  --text-soft: #6c7488;
  --primary: #5b54f0;
  --primary-soft: #ecebfe;
  --primary-dark: #4339d4;
  --primary-grad: linear-gradient(135deg, #6d65f5 0%, #8b5cf6 100%);
  --green: #15a34a;
  --green-soft: #e6f7ec;
  --red: #e23b3b;
  --red-soft: #fdebeb;
  --amber: #e0820a;
  --amber-soft: #fdf3e3;
  --shadow-xs: 0 1px 2px rgba(20, 27, 52, .05);
  --shadow: 0 1px 2px rgba(20, 27, 52, .04), 0 10px 28px -10px rgba(20, 27, 52, .14);
  --shadow-lg: 0 20px 50px -16px rgba(20, 27, 52, .26);
  --ring: 0 0 0 3px var(--primary-soft);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 520px at 100% -8%, #e9e7fe 0%, rgba(233,231,254,0) 55%),
    radial-gradient(900px 480px at -5% 0%, #e6eefe 0%, rgba(230,238,254,0) 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.1px;
}
button { font-family: inherit; cursor: pointer; }

/* Schlanke, moderne Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #d3d7e6 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d3d7e6; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #bcc1d6; background-clip: content-box; }

/* ---------- Layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-logo {
  font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--primary-grad); border-radius: 12px; box-shadow: 0 6px 16px -6px rgba(109,101,245,.7);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.4px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  border: none; background: transparent; color: var(--text-soft);
  padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600; text-align: left; width: 100%;
  transition: background .16s, color .16s;
}
.nav-item span { font-size: 18px; width: 22px; text-align: center; transition: transform .16s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover span { transform: scale(1.08); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.nav-item.active::before {
  content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 999px; background: var(--primary-grad);
}

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: 11.5px; color: var(--text-soft); margin: 0; padding: 0 4px; line-height: 1.45; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 15px 24px; background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -0.5px; }
.topbar-spacer { flex: 1; }
.today-chip {
  background: var(--surface); color: var(--primary-dark); border: 1px solid var(--border);
  font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow-xs);
}
.content { flex: 1; overflow-y: auto; padding: 24px; }

.menu-toggle { display: none; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 11px; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-grad); color: #fff; border: none;
  padding: 10px 17px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; letter-spacing: -0.1px;
  box-shadow: 0 6px 16px -7px rgba(109,101,245,.8);
  transition: transform .08s, box-shadow .16s, filter .16s;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 10px 22px -8px rgba(109,101,245,.9); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost.small, .btn.small { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: var(--red-soft); color: var(--red); border: none; box-shadow: none; }
.btn-danger:hover { filter: brightness(.98); }

/* ---------- Cards & Grid ---------- */
.grid { display: grid; gap: 18px; }
.dash-row { grid-template-columns: minmax(0, 500px) 270px minmax(220px, 1fr); align-items: start; justify-content: start; }
.note-add { display: flex; gap: 8px; }
.note-add input {
  flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.note-add input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 12px; letter-spacing: -0.4px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.4px; }

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { position: relative; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--primary-soft); opacity: .55;
}
.stat .num {
  font-size: 32px; font-weight: 800; letter-spacing: -1.4px;
  background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; z-index: 1;
}
.stat .label { color: var(--text-soft); font-size: 13px; font-weight: 600; position: relative; z-index: 1; }

.empty {
  text-align: center; color: var(--text-soft); padding: 32px 16px;
  font-size: 14px;
}
.empty .big { font-size: 42px; display: block; margin-bottom: 8px; opacity: .9; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.list-row.clickable:hover { border-color: var(--primary); box-shadow: var(--shadow); cursor: pointer; transform: translateY(-1px); }
.list-row .time-badge {
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 9px;
  white-space: nowrap; text-align: center;
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; }
.list-row .sub { color: var(--text-soft); font-size: 13px; margin-top: 2px; }

.tag {
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-soft);
}
.tag.subject { background: var(--primary-soft); color: var(--primary-dark); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }

/* Termin-Art als farbiges Label */
.ev-cat { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ev-tag-row { margin-top: 6px; }
.ev-tag-row .ev-cat { display: inline-block; }
/* Sondertag / Feiertag im Kalender */
.special-day { padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }

/* ---------- Kalender ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--text-soft);
  padding: 7px 15px; border-radius: 9px; font-weight: 700; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.seg button.active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-xs); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { font-weight: 800; font-size: 16px; min-width: 180px; text-align: center; letter-spacing: -0.4px; }

/* Monat */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.month-grid .dow { text-align: center; font-weight: 700; color: var(--text-soft); font-size: 12px; padding: 4px 0; }
.day-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; min-height: 94px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.day-cell.clickable:hover { border-color: var(--primary); box-shadow: var(--shadow); cursor: pointer; }
.day-cell.other { background: var(--surface-2); opacity: .5; }
.day-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.day-cell .dnum { font-weight: 700; font-size: 13px; }
.day-cell .pill {
  font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-cell .pill.event { background: var(--amber-soft); color: var(--amber); }

/* Woche */
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.week-col { display: flex; flex-direction: column; gap: 8px; }
.week-col .col-head { font-weight: 700; font-size: 13px; text-align: center; padding: 7px; border-radius: 10px; background: var(--surface-3); }
.week-col .col-head.today { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Stundenplan ---------- */
.timetable-wrap { overflow-x: auto; }
table.timetable { border-collapse: separate; border-spacing: 7px; min-width: 640px; width: 100%; }
table.timetable th { font-size: 13px; color: var(--text-soft); font-weight: 700; padding: 6px; }
table.timetable td.slot {
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px;
  height: 64px; vertical-align: top; padding: 9px; transition: border-color .15s, background .15s;
}
table.timetable td.slot:hover { border-color: var(--primary); background: var(--primary-soft); cursor: pointer; }
table.timetable td.slot.filled { border-style: solid; background: var(--surface); }
.tt-period { font-weight: 700; font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.tt-period small { display: block; font-weight: 500; font-size: 11px; }
.tt-entry .s { font-weight: 800; font-size: 14px; letter-spacing: -0.2px; }
.tt-entry .m { font-size: 12px; color: var(--text-soft); }

/* ---------- Tabellen (Noten/Anwesenheit) ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { color: var(--text-soft); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.grade-badge { font-weight: 800; }

.att-btns { display: inline-flex; gap: 6px; }
.att-btn {
  border: 1px solid var(--border); background: var(--surface);
  padding: 6px 11px; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: var(--text-soft);
  transition: transform .08s;
}
.att-btn:active { transform: scale(.94); }
.att-btn.active.present { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.att-btn.active.absent { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.att-btn.active.late { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.att-btn.active.early { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary); }

/* Eingeklappter Anwesenheits-Schalter */
.att-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 11px 14px; border-radius: var(--radius-sm); text-align: left;
  font-weight: 700; font-size: 14.5px; color: var(--text); transition: background .15s, border-color .15s;
}
.att-toggle:hover { background: var(--surface-3); border-color: var(--border-strong); }
.att-chev { font-size: 12px; color: var(--text-soft); transition: transform .18s; }
.att-toggle.open .att-chev { transform: rotate(90deg); }
.att-toggle-lbl { white-space: nowrap; }
.att-toggle-sum { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.att-body { margin-top: 12px; }
.att-time {
  border: 1px solid var(--border); border-radius: 9px; padding: 5px 8px; font-size: 13px;
  font-family: inherit; background: var(--surface); color: var(--text);
}
.att-time:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- Formulare / Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,20,40,.42);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: 20px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); padding: 26px;
  animation: pop .2s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-close {
  position: absolute; top: 16px; right: 16px; border: none; background: var(--surface-2);
  width: 32px; height: 32px; border-radius: 9px; font-size: 14px; color: var(--text-soft);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal h2 { margin: 0 0 18px; padding-right: 30px; font-size: 20px; letter-spacing: -0.4px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--surface);
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* Material-Items im Modal */
.mat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.mat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.mat-item .ic { font-size: 18px; }
.mat-item .grow { flex: 1; min-width: 0; }
.mat-item a { color: var(--primary-dark); text-decoration: none; font-weight: 600; font-size: 13.5px; word-break: break-all; }
.mat-item .mtitle { font-weight: 700; font-size: 14px; }
.mini-del { border: none; background: transparent; color: var(--red); font-size: 16px; padding: 4px; border-radius: 8px; transition: background .12s; }
.mini-del:hover { background: var(--red-soft); }

/* Vorhaben / Inhaltspunkte (Checkliste) im Modal */
.item-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.item-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.item-row .grow { flex: 1; min-width: 0; }
.item-row .itext { font-size: 14px; font-weight: 600; }
.item-row .itext.done { text-decoration: line-through; color: var(--text-soft); font-weight: 500; }
.itext-input {
  width: 100%; border: none; background: transparent; padding: 2px 0;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
}
.itext-input::placeholder { font-weight: 500; color: var(--text-soft); }
.itext-input:focus { outline: none; }
.itext-input.done { text-decoration: line-through; color: var(--text-soft); font-weight: 500; }
.item-attach {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 15px; transition: background .12s, border-color .12s;
}
.item-attach:hover { background: var(--surface-3); border-color: var(--border-strong); }
.item-att {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer;
  background: var(--primary-soft); color: var(--primary-dark);
  padding: 4px 6px 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; max-width: 100%;
}
.item-att .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-att .att-x {
  border: none; background: rgba(0,0,0,.06); color: inherit; width: 18px; height: 18px;
  border-radius: 999px; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.item-att .att-x:hover { background: rgba(0,0,0,.14); }
.stoff-classes { display: flex; flex-wrap: wrap; gap: 8px; }
.stoff-cls {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
}
.stoff-cls input { width: auto; margin: 0; }

/* Fach auf einen Blick */
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.series-card {
  text-align: left; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.series-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.series-name { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; }
.series-sub { color: var(--text-soft); font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.series-list { display: flex; flex-direction: column; }
.series-month {
  font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--primary-dark); padding: 14px 10px 6px;
}
.series-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: 10px; cursor: pointer; transition: background .12s;
}
.series-row:hover { background: var(--surface-2); }
.series-row.is-today { background: var(--primary-soft); }
.series-date { flex: 0 0 96px; font-weight: 700; font-size: 13px; line-height: 1.25; }
.series-date small { display: block; font-weight: 500; color: var(--text-soft); font-size: 11px; }
.series-topic { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.series-topic.empty { color: var(--text-soft); font-weight: 500; }
.series-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.stoff-cls.no-subj { opacity: .65; }
.no-subj-note { font-weight: 500; color: var(--text-soft); font-size: 11px; }
.item-row .carry-note { display: block; font-size: 11px; color: var(--primary-dark); font-weight: 600; margin-top: 1px; }
.chk {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  width: 28px; height: 28px; border-radius: 9px; font-size: 14px; font-weight: 800;
  flex: 0 0 auto; cursor: pointer; line-height: 1; transition: transform .08s, background .12s;
}
.chk:active { transform: scale(.9); }
.chk.done.active { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.chk.open.active { background: var(--red-soft); color: var(--red); border-color: var(--red); }

/* Strafarbeiten im Modal */
.det-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.det-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.det-row.reminder { background: var(--amber-soft); border-color: #f8ddc0; }
.det-row .det-ic { font-size: 17px; flex: 0 0 auto; }
.det-row .grow { flex: 1; min-width: 0; }
.det-row .dtitle { font-size: 13.5px; }
.det-row .dtitle.done { text-decoration: line-through; color: var(--text-soft); }
.det-row .dtask { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }

/* Arbeitsblätter (Liste mit Datei + ✓/✗) */
.ws-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.ws-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.ws-row .ws-ic { font-size: 18px; flex: 0 0 auto; cursor: pointer; }
.ws-row .grow { flex: 1; min-width: 0; }
.ws-row .ws-name { font-size: 14px; font-weight: 700; cursor: pointer; word-break: break-word; }
.ws-row .ws-name.done { text-decoration: line-through; color: var(--text-soft); font-weight: 500; }

/* Anwesenheit im Stunden-Modal */
.att-mini-list { display: flex; flex-direction: column; gap: 7px; }
.att-mini-row {
  display: flex; flex-direction: column; gap: 7px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
}
.att-mini-row .grow { font-size: 14px; font-weight: 600; }
.att-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- Login-Bildschirm ---------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(800px 500px at 80% 10%, #e3def9 0%, rgba(227,222,249,0) 55%),
    radial-gradient(700px 500px at 10% 90%, #dde7fb 0%, rgba(221,231,251,0) 55%),
    linear-gradient(135deg, #eef0ff 0%, #f4f5fb 100%);
}
.auth-screen[hidden] { display: none; }
.auth-card {
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 32px 30px; width: 100%; max-width: 384px;
  display: flex; flex-direction: column;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.auth-sub { color: var(--text-soft); font-size: 14px; margin: 10px 0 22px; }
.auth-card label { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.auth-card input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 15px; margin-bottom: 14px; font-family: inherit; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.auth-card .btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.auth-card .btn:disabled { opacity: .6; cursor: default; }
.auth-msg { min-height: 20px; font-size: 13px; margin-top: 10px; text-align: center; color: var(--text-soft); }
.auth-msg.error { color: var(--red); font-weight: 600; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--text-soft); margin: 18px 0 0; }

.account-box { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 2px; }
.account-email { font-size: 12px; color: var(--text-soft); font-weight: 600; word-break: break-all; }

/* ---------- Planer (Wochenplaner) ---------- */
.planer-table td.slot { height: auto; min-height: 78px; }
.planer-table th.pl-today { color: var(--primary-dark); }
.planer-table .tt-hol { font-weight: 700; font-size: 10.5px; color: var(--amber); margin-top: 3px; }
.holiday-slot { background: #fff8f1 !important; border-color: #f8ddc0 !important; border-style: solid !important; text-align: center; }
.pl-holtext { font-size: 20px; opacity: .7; }
.pl-topic { font-size: 12px; color: var(--text); margin-top: 4px; font-weight: 600; line-height: 1.3; }
.pl-add { font-size: 11.5px; color: var(--text-soft); margin-top: 4px; }
.ref-bar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Uploads / Pläne ---------- */
.upload-img {
  width: 100%; max-height: 480px; object-fit: contain;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: zoom-in; display: block;
}
.upload-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.upload-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); transition: box-shadow .15s, transform .1s; }
.upload-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.upload-tile img { width: 100%; height: 110px; object-fit: cover; cursor: zoom-in; display: block; background: var(--surface-2); }
.pdf-thumb {
  height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: var(--red-soft); color: var(--red); cursor: pointer;
}
.pdf-thumb span { font-size: 34px; line-height: 1; }
.pdf-thumb small { font-weight: 700; font-size: 12px; }
.upload-tile-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.upload-tile-foot .grow { flex: 1; min-width: 0; }

/* Ferien-Markierungen */
.day-cell.holiday { background: #f3f4f6; border-color: #d1d5db; }
.pill.holiday { background: #1f293718; color: #1f2937; }
.holiday-banner {
  background: #1f2937; color: #fff; font-weight: 700; font-size: 13px;
  padding: 9px 13px; border-radius: 11px; text-align: center;
}

/* ---------- Responsiv ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: 264px;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    background: rgba(255,255,255,.96);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .content { padding: 16px; }
  .today-chip { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .dash-row { grid-template-columns: 1fr; }
}
.scrim { position: fixed; inset: 0; background: rgba(16,20,40,.35); z-index: 39; backdrop-filter: blur(2px); }
@media (min-width: 861px) { .scrim { display: none; } }
