*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────── */
.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #1a1a2e;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-logo  { color: #25ae7c; text-decoration: none; font-weight: 700; font-size: 14px; }
.admin-title { flex: 1; font-weight: 800; font-size: 18px; }

/* ── Layout ─────────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100vh - 56px);
}

.admin-nav {
  background: #fff;
  border-right: 1px solid #e8ecf0;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s;
}
.tab-btn:hover  { background: #f0f9f5; color: #25ae7c; }
.tab-btn.active { background: #e8f8f1; color: #1a9e6e; border-right: 3px solid #25ae7c; }

.admin-main { padding: 28px 32px; max-width: 960px; }

/* ── Section ────────────────────────────────────────────────────── */
.tab-section.hidden { display: none; }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 20px; font-weight: 800; flex: 1; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-primary { background: #25ae7c; color: #fff; border-color: #25ae7c; }
.btn-primary:hover { background: #1a9e6e; }
.btn-outline { background: transparent; color: #25ae7c; border-color: #25ae7c; }
.btn-outline:hover { background: #e8f8f1; }
.btn-danger  { background: #e74c3c; color: #fff; border-color: #e74c3c; font-size: 12px; padding: 5px 10px; }
.btn-danger:hover { background: #c0392b; }
.btn-reset   { background: #f39c12; color: #fff; border-color: #f39c12; font-size: 12px; padding: 5px 10px; }
.btn-reset:hover { background: #d68910; }

/* ── Form ───────────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.form-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-col { display: flex; flex-direction: column; gap: 10px; }
.form-col label { font-size: 13px; font-weight: 700; color: #555; margin-top: 4px; }

input[type="text"], input[type="password"], select, textarea {
  padding: 8px 12px;
  border: 1.5px solid #d0d7de;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #1a1a2e;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #25ae7c;
}
select { cursor: pointer; }
.form-hint { font-size: 12px; color: #888; margin-top: 8px; }

.hidden { display: none !important; }

/* ── Tabellen ───────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8ecf0;
  font-size: 14px;
}
.data-table th {
  background: #f5f7fa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e8ecf0;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcfb; }

.badge-admin   { background: #fde8d8; color: #c0392b; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-schueler{ background: #e8f8f1; color: #1a9e6e; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-seen    { color: #888; font-size: 12px; }
.badge-unseen  { color: #e67e22; font-weight: 700; font-size: 12px; }
.muted { color: #aaa; font-size: 13px; }

.btn-group { display: flex; gap: 6px; }

/* ── Navigation Editor ──────────────────────────────────────────── */
#nav-editor {
  width: 100%;
  height: 500px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  border: 1.5px solid #d0d7de;
  border-radius: 8px;
  resize: vertical;
  background: #1e1e2e;
  color: #cdd6f4;
}

/* ── Dialog ─────────────────────────────────────────────────────── */
.dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.dialog {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}
.dialog h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.pw-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 12px 0;
}

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
