:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #172130;
  --muted: #647084;
  --line: #dce2ea;
  --blue: #2266c2;
  --blue-dark: #184f9a;
  --green: #12805c;
  --red: #b42318;
  --amber: #b76e00;
  --violet: #6b4bb3;
  --ink-soft: #eef2f6;
  --shadow: 0 10px 24px rgba(24, 33, 47, 0.08);
}

.update-dropzone {
  min-height: 150px;
  border: 2px dashed #8ba8c2;
  border-radius: 16px;
  background: #f5f9fc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.update-dropzone.dragging {
  border-color: #174ea6;
  background: #e8f1ff;
  transform: translateY(-2px);
}

.update-dropzone input { max-width: 100%; }
.inactive-item { opacity: .62; }

#adminUsers .panel,
#adminUpdates .panel {
  background: #17263a;
  color: #f3f7fb;
  border-color: #2f4660;
}

#adminUsers .list-item,
#adminUpdates .list-item {
  background: #20344b;
  border-color: #3b536d;
}

#adminUsers input,
#adminUsers select,
#adminUpdates input {
  background: #0f1d2c;
  color: #f3f7fb;
  border-color: #55708c;
}

#adminUsers .room-meta,
#adminUsers .muted-text,
#adminUpdates .room-meta,
#adminUpdates .muted-text,
#adminUpdates .muted {
  color: #b8c9da;
}

#adminUpdates .update-dropzone {
  background: #102338;
  border-color: #6687a7;
}

#adminUpdates .update-dropzone.dragging {
  background: #17385a;
  border-color: #8ec5ff;
}

/* Lesegeräte-API: bewusst als eigener, dunkler Arbeitsbereich gestaltet. */
.rfids-admin {
  --rfids-bg: #07111f;
  --rfids-panel: #0d1b2d;
  --rfids-panel-2: #12243a;
  --rfids-line: #27405d;
  --rfids-text: #eef6ff;
  --rfids-muted: #9bb0c7;
  --rfids-blue: #4da3ff;
  margin: 0 -2px;
  padding: clamp(16px, 3vw, 30px);
  color: var(--rfids-text);
  background:
    radial-gradient(circle at 90% 0%, rgba(32, 112, 196, 0.22), transparent 34%),
    var(--rfids-bg);
  border: 1px solid #152a42;
  border-radius: 14px;
}

.rfids-admin .eyebrow,
.rfids-muted {
  color: var(--rfids-muted);
}

.rfids-admin code {
  padding: 2px 6px;
  border: 1px solid var(--rfids-line);
  border-radius: 5px;
  color: #b9dcff;
  background: #081525;
}

.rfids-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}

.rfids-hero h2 {
  margin-bottom: 7px;
  font-size: clamp(25px, 4vw, 38px);
}

.rfids-hero p {
  max-width: 700px;
  margin: 0;
  color: var(--rfids-muted);
}

.rfids-hero-links,
.rfids-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rfids-panel {
  margin-bottom: 16px;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid var(--rfids-line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(18, 36, 58, 0.96), rgba(10, 25, 42, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.rfids-admin .panel-heading {
  margin-bottom: 15px;
}

.rfids-admin label > span,
.rfids-admin legend {
  color: #c5d7ea;
}

.rfids-admin input,
.rfids-admin select,
.rfids-admin textarea {
  color: var(--rfids-text);
  background: #081524;
  border-color: var(--rfids-line);
}

.rfids-admin input:focus,
.rfids-admin select:focus,
.rfids-admin textarea:focus {
  outline-color: var(--rfids-blue);
  border-color: var(--rfids-blue);
}

.rfids-admin select option {
  color: var(--rfids-text);
  background: #081524;
}

.rfids-admin input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
}

.rfids-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.rfids-setting-card {
  display: grid;
  align-content: start;
  gap: 11px;
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--rfids-line);
  border-radius: 10px;
  background: rgba(5, 17, 30, 0.58);
}

.rfids-setting-card legend {
  padding: 0 8px;
  font-weight: 800;
}

.rfids-color-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rfids-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 11px;
}

.rfids-device-card,
.rfids-list-item {
  padding: 14px;
  border: 1px solid var(--rfids-line);
  border-radius: 9px;
  background: rgba(6, 18, 32, 0.72);
}

.rfids-list-item.critical {
  border-color: #b83d4d;
  box-shadow: inset 4px 0 0 #ff5f68;
}

.rfids-device-top,
.rfids-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rfids-device-card h4,
.rfids-list-item h4 {
  margin: 0 0 4px;
}

.rfids-device-meta,
.rfids-list-meta {
  display: grid;
  gap: 4px;
  margin-top: 11px;
  color: var(--rfids-muted);
  font-size: 13px;
}

.rfids-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.rfids-status::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.rfids-status.online,
.rfids-http-ok {
  color: #6de7a9;
  background: rgba(27, 126, 83, 0.2);
}

.rfids-status.offline,
.rfids-http-error {
  color: #ff8b92;
  background: rgba(177, 45, 57, 0.2);
}

.rfids-status.pending {
  color: #ffd76a;
  background: rgba(197, 142, 16, 0.22);
}

.rfids-device-card.pending {
  border-color: #c99a25;
  background: rgba(106, 75, 7, 0.32);
  box-shadow: inset 4px 0 0 #efbd45;
}

.rfids-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.rfids-list {
  display: grid;
  gap: 9px;
  max-height: 520px;
  margin-top: 13px;
  overflow: auto;
}

.rfids-list-item p {
  margin: 8px 0 0;
  color: #cfdeee;
}

.rfids-list-item .button,
.rfids-list-item .danger-button {
  min-height: 34px;
  padding: 7px 10px;
}

.rfids-filter-row {
  margin-bottom: 12px;
}

.rfids-filter-row > * {
  min-width: min(190px, 100%);
}

.rfids-admin table {
  color: var(--rfids-text);
}

.rfids-admin th {
  color: #acc3da;
  background: #0a1727;
}

.rfids-admin th,
.rfids-admin td {
  border-color: var(--rfids-line);
}

.rfids-admin tbody tr:hover {
  background: rgba(45, 98, 151, 0.12);
}

.rfids-log-wrap {
  max-height: 560px;
  overflow: auto;
}

.rfids-empty {
  padding: 18px;
  border: 1px dashed var(--rfids-line);
  border-radius: 9px;
  color: var(--rfids-muted);
  text-align: center;
}

@media (max-width: 1050px) {
  .rfids-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rfids-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .rfids-admin {
    padding: 14px;
  }

  .rfids-hero,
  .rfids-admin .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .rfids-settings-grid,
  .rfids-color-row {
    grid-template-columns: 1fr;
  }

  .rfids-hero-links > *,
  .rfids-filter-row > * {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px clamp(16px, 4vw, 44px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.brand-text {
  min-width: 0;
}

.school-logo {
  width: clamp(118px, 15vw, 172px);
  max-height: 58px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.1;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 16px;
}

.top-actions,
.panel-heading,
.section-heading,
.filters,
.form-row,
.tabs,
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions,
.section-heading,
.panel-heading {
  justify-content: space-between;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 44px) 44px;
}

.view[hidden],
.admin-tab[hidden],
.teacher-tab[hidden] {
  display: none;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.role-card,
.panel,
.login-panel,
.room-card,
.person-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.role-card {
  min-height: 220px;
  padding: 22px;
  text-align: left;
  color: var(--text);
}

.role-card span {
  display: inline-flex;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.role-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.panel,
.login-panel {
  padding: 18px;
}

.gate {
  display: grid;
  place-items: center;
  min-height: 54vh;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

.button,
.tab,
.segmented button,
.danger-button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 800;
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.button.primary {
  color: #ffffff;
  background: var(--blue);
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.secondary,
.tab,
.segmented button {
  color: var(--text);
  background: var(--ink-soft);
}

.tab.active,
.segmented button.active {
  color: #ffffff;
  background: var(--blue);
}

.danger-button {
  min-height: 32px;
  color: var(--red);
  background: #fff7f7;
  border: 1px solid #f0b8b4;
}

.sync-pill,
.notice,
.muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-actions,
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-actions {
  margin-top: 2px;
}

.item-actions {
  justify-content: flex-end;
}

.sync-pill,
.notice {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink-soft);
}

.sync-pill.online {
  color: var(--green);
  background: #e7f4ef;
}

.sync-pill.offline {
  color: var(--red);
  background: #fdebea;
}

.section-heading {
  margin-bottom: 16px;
}

.student-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.student-main {
  min-width: 0;
}

.daily-notice-board {
  position: sticky;
  top: 18px;
  border-top: 4px solid var(--amber);
  background: #fffdf7;
}

.daily-notice-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid #eadfca;
}

.daily-notice-date {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #704300;
  background: #fff0cf;
  font-size: 12px;
  font-weight: 800;
}

.daily-notice-content {
  padding-top: 16px;
}

.daily-notice-list {
  display: grid;
  gap: 14px;
}

.daily-notice-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.daily-notice-marker {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.daily-notice-meta {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #eadfca;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.daily-notice-empty {
  min-height: 110px;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
  color: var(--muted);
}

.daily-notice-empty strong {
  color: var(--text);
}

.daily-notice-empty span {
  font-size: 13px;
}

.daily-notice-editor {
  width: min(780px, 100%);
  display: grid;
  gap: 16px;
}

.daily-notice-editor textarea {
  min-height: 190px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

#studentRoomGrid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.room-card {
  min-height: 178px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

#studentRoomGrid .room-card {
  min-height: 128px;
  padding: 12px;
  gap: 8px;
}

#studentRoomGrid .room-card h3 {
  font-size: 15px;
}

#studentRoomGrid .room-meta,
#studentRoomGrid .muted-text {
  font-size: 12px;
}

#studentRoomGrid .capacity-meter {
  height: 7px;
}

#studentRoomGrid .badge {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.room-card.closed {
  background: #fafbfc;
}

#studentRoomGrid .room-card.closed {
  opacity: 0.62;
  filter: grayscale(0.2);
}

.room-top,
.capacity-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.room-meta,
.muted-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.capacity-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--ink-soft);
  overflow: hidden;
}

.capacity-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

.capacity-meter.full span {
  background: var(--amber);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.open,
.badge.present {
  background: var(--green);
}

.badge.closed,
.badge.absent,
.badge.unknown {
  background: var(--red);
}

.badge.excused {
  background: var(--violet);
}

.badge.late,
.badge.out,
.badge.denied {
  background: var(--amber);
}

.badge.pending {
  color: #4a3200;
  background: #f2c94c;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd4df;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(34, 102, 194, 0.18);
  border-color: var(--blue);
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar label {
  min-width: min(220px, 100%);
  flex: 1;
}

.student-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.room-occupancy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.room-occupancy-card {
  min-height: 136px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  gap: 12px;
}

.occupancy-list {
  display: grid;
  gap: 8px;
}

.occupancy-person {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink-soft);
  font-size: 13px;
}

.occupancy-person span {
  color: var(--muted);
  font-weight: 800;
}

.person-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #dbe7f6;
  color: var(--blue-dark);
  border: 4px solid transparent;
  font-weight: 900;
}

.avatar.status-present {
  border-color: var(--green);
}

.avatar.status-missing {
  border-color: var(--red);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-info {
  min-width: 0;
}

.person-info strong {
  display: block;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

#adminRooms .forms-grid {
  grid-template-columns: minmax(420px, 760px);
}

#roomScheduleForm {
  order: -1;
}

.compact-form {
  display: grid;
  gap: 12px;
}

.management-grid .panel {
  align-content: start;
}

.inline-management-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.management-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.form-row {
  align-items: stretch;
}

.form-row label {
  flex: 1;
}

.check-label {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 40px;
  gap: 8px;
}

.check-label input {
  width: auto;
  min-height: auto;
}

.weekly-schedule {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.week-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) repeat(5, minmax(132px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 760px;
}

.week-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.week-head {
  padding: 0 0 2px;
}

.week-head span {
  font-size: 12px;
  text-transform: uppercase;
}

.mini-check {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-check input {
  width: auto;
  min-height: auto;
}

.slot-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.slot-pair input {
  min-width: 0;
  padding-inline: 7px;
}

.tabs {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-tab > .panel,
.admin-tab > .room-grid {
  margin-top: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.small-input {
  min-width: 160px;
}

.small-select {
  min-width: 120px;
}

.list,
.scan-feed {
  display: grid;
  gap: 10px;
}

.list-item,
.scan-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.list-item.reader-pending {
  border-color: #d9a514;
  background: #fff4bf;
  box-shadow: inset 4px 0 0 #e5ad10;
}

.reader-discovery-info code {
  padding: 2px 5px;
  border-radius: 4px;
  color: #704d00;
  background: #fff0ad;
}

.reader-edit-meta {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #f7f9fb;
  font-size: 13px;
  font-weight: 700;
}

.scan-feed {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.scan-item {
  border-left: 4px solid var(--blue);
}

.scan-item.denied,
.scan-item.unknown {
  border-left-color: var(--red);
}

.scan-item.out {
  border-left-color: var(--amber);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.week-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.week-controls label {
  min-width: 180px;
}

.block-week {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 10px;
}

.block-week-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) repeat(8, minmax(112px, 1fr));
  gap: 8px;
  align-items: stretch;
  min-width: 1070px;
}

.block-week-row > strong,
.block-week-row > span {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.block-week-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.block-day {
  display: grid;
  gap: 5px;
  min-height: 56px;
}

.block-day-empty {
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.block-slot-empty {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.block-toggle {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.block-toggle span {
  font-size: 13px;
  font-weight: 900;
}

.block-toggle small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.block-toggle.open {
  border-color: #b8dccf;
  background: #effaf5;
}

.block-toggle.blocked {
  border-color: #f0b8b4;
  background: #fff7f7;
}

.block-toggle.open {
  border-color: #bfe0d4;
  background: #f0faf6;
}

.block-toggle.blocked {
  border-color: #f0b8b4;
  background: #fff7f7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #172130;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .role-grid,
  .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-occupancy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .top-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-nav,
  .week-controls {
    justify-content: stretch;
  }

  .role-grid,
  .room-grid,
  .room-occupancy-grid,
  .forms-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .student-dashboard {
    grid-template-columns: 1fr;
  }

  .daily-notice-board {
    position: static;
  }

  .student-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-card-grid .person-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .student-card-grid .segmented {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .form-row,
  .person-card {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .inline-management-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    background: #ffffff;
  }

  .topbar {
    gap: 12px;
    padding: 12px;
  }

  .brand {
    grid-template-columns: auto 1fr;
  }

  .school-logo {
    width: 92px;
    max-height: 44px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 17px;
  }

  .shell {
    padding: 12px 10px 28px;
  }

  .top-actions,
  .toolbar,
  .panel-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-nav,
  .tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quick-nav .button,
  .tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .button,
  .tab,
  .danger-button {
    min-height: 44px;
  }

  .role-card {
    min-height: 132px;
    padding: 16px;
  }

  .role-card span {
    margin-bottom: 16px;
  }

  .role-card strong {
    font-size: 24px;
  }

  .panel,
  .login-panel,
  .room-card,
  .person-card {
    border-radius: 8px;
    box-shadow: none;
  }

  .student-card-grid {
    grid-template-columns: 1fr;
  }

  .room-card {
    min-height: 150px;
  }

  .room-top,
  .capacity-row,
  .list-item,
  .scan-item,
  .occupancy-person {
    align-items: stretch;
    flex-direction: column;
  }

  .list-item,
  .scan-item {
    grid-template-columns: 1fr;
  }

  .item-actions,
  .form-actions {
    justify-content: stretch;
  }

  .item-actions > *,
  .form-actions > * {
    flex: 1;
  }

  .weekly-schedule,
  .block-week,
  .table-wrap {
    overflow-x: visible;
  }

  .week-head,
  .block-week-head {
    display: none;
  }

  .week-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .week-row > span {
    font-size: 15px;
    color: var(--text);
  }

  .slot-pair {
    grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }

  .slot-pair::before {
    content: attr(data-slot-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .slot-pair input {
    min-height: 42px;
  }

  .mini-check {
    justify-content: flex-start;
  }

  .mini-check::before {
    content: "Tag geschlossen";
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .block-week-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .block-week-row > strong {
    min-height: auto;
    font-size: 16px;
  }

  .block-day,
  .block-day-empty {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
  }

  .block-day::before,
  .block-day-empty::before {
    content: attr(data-date-label);
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .block-toggle {
    min-height: 44px;
  }

  table {
    min-width: 760px;
  }
}
