/* ===========================================================
   Austrian Board — Portal
   Cleanes Dashboard-Layout mit linkem Seitenmenü
   =========================================================== */

:root {
  --red: #c8102e;
  --red-dark: #9b0c23;
  --red-tint: #fdeaec;
  --ink: #1a1c22;
  --ink-soft: #5b6170;
  --ink-faint: #9aa0ad;
  --bg: #f4f5f7;
  --paper: #ffffff;
  --line: #e7e8ec;
  --radius: 12px;
  --sidebar-w: 248px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Flaggenband -------------------------------------------- */
.flag-band { display: flex; height: 4px; }
.flag-band span { flex: 1; }
.flag-band span:nth-child(odd) { background: var(--red); }
.flag-band span:nth-child(2) { background: #fff; }

/* --- Markenzeichen ------------------------------------------ */
.brand-mark { width: 30px; height: 30px; display: block; flex-shrink: 0; }

/* --- Formulare ---------------------------------------------- */
label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.hint { font-weight: 400; color: var(--ink-soft); }

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
input:disabled { background: var(--bg); color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--red); color: #fff; width: 100%; }
.btn--primary:hover { background: var(--red-dark); }
.btn--inline { width: auto; }

/* --- Hinweise ----------------------------------------------- */
.alert { padding: 11px 14px; border-radius: 9px; font-size: 0.9rem; margin-bottom: 18px; }
.alert--error { background: var(--red-tint); color: var(--red-dark); border: 1px solid #f3c0c7; }
.alert--success { background: #e9f6ec; color: #1f7a35; border: 1px solid #bfe3c7; }

/* --- Auth-Seiten -------------------------------------------- */
.auth {
  min-height: calc(100vh - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.auth__card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 18px 48px -24px rgba(26, 28, 34, 0.45);
}
.auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth__brand strong { font-size: 1.05rem; }
.auth h1 { font-size: 1.5rem; margin-bottom: 20px; }
.auth__alt { margin-top: 18px; font-size: 0.92rem; color: var(--ink-soft); }

/* --- Layout ------------------------------------------------- */
.layout { display: flex; min-height: calc(100vh - 4px); }

/* --- Seitenmenü --------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 4px);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.sidebar__brand:hover { text-decoration: none; }

.sidebar__nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 14px 14px 6px;
}
.sidebar__label:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav-item:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--red-tint); color: var(--red); font-weight: 600; }
.nav-item__icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item--soon { color: var(--ink-faint); cursor: default; }
.nav-item--soon:hover { background: transparent; color: var(--ink-faint); }
.nav-item__soon {
  margin-left: auto;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 7px;
}

.sidebar__foot { border-top: 1px solid var(--line); padding: 14px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.sidebar__user-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar__user-info strong { font-size: 0.88rem; }
.sidebar__user-info small {
  font-size: 0.76rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* --- Hauptbereich ------------------------------------------- */
.main { flex: 1; min-width: 0; }
.main__inner { max-width: 960px; padding: 40px; }

.page__head { margin-bottom: 28px; }
.page__head h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
.page__head p { color: var(--ink-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { font-size: 0.88rem; color: var(--ink-soft); }
.card__tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-tint);
  border-radius: 999px;
  padding: 3px 9px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  max-width: 520px;
}
.panel h2 { font-size: 1.1rem; margin-bottom: 16px; }

/* --- Admin-Navigation --------------------------------------- */
.sidebar__badge {
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--red);
  color: #fff;
  border-radius: 4px;
  padding: 2px 5px;
  vertical-align: 2px;
}
.adm-nav__link,
.adm-nav__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.adm-nav__link:hover,
.adm-nav__summary:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.adm-nav__link.is-active,
.adm-nav__summary.is-active { color: var(--red); }
.adm-nav__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.adm-nav__summary { list-style: none; }
.adm-nav__summary::-webkit-details-marker { display: none; }
.adm-nav__chevron {
  width: 15px;
  height: 15px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.15s ease;
}
.adm-nav__group[open] > .adm-nav__summary .adm-nav__chevron { transform: rotate(180deg); }
.adm-nav__sub { display: flex; flex-direction: column; padding: 2px 0 6px 30px; }
.adm-nav__sublink {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.adm-nav__sublink:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.adm-nav__sublink.is-active { background: var(--red-tint); color: var(--red); font-weight: 600; }

.adm-back {
  display: block;
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-soft);
  padding: 8px;
  margin-bottom: 8px;
}
.adm-back:hover { color: var(--red); text-decoration: none; }

/* --- Admin-Inhalte ------------------------------------------ */
.breadcrumb { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 6px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat__label { display: block; font-size: 0.8rem; color: var(--ink-soft); }
.stat__value { display: block; font-size: 1.85rem; font-weight: 700; margin-top: 4px; }

.placeholder-box {
  background: var(--paper);
  border: 1px dashed #d4d0c8;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
}

/* --- "Zurück zum Portal" im Admin-Menü ---------------------- */
.adm-nav__portal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.adm-nav__portal:hover { background: var(--bg); color: var(--red); text-decoration: none; }
.adm-nav__divider { height: 1px; background: var(--line); margin: 8px 6px 10px; }

/* --- Buttons (ergänzend) ------------------------------------ */
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); }

/* --- Formulare (ergänzend) ---------------------------------- */
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel__meta { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 12px; }

.page__head--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

/* --- Tabellen ----------------------------------------------- */
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row--inactive td { opacity: 0.5; }

/* --- Badges ------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--role { background: var(--bg); color: var(--ink-soft); }
.badge--active { background: #e9f6ec; color: #1f7a35; }
.badge--inactive { background: var(--red-tint); color: var(--red-dark); }

/* --- Zeilen-Aktionen ---------------------------------------- */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; margin: 0; }
.rowbtn {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--ink);
  cursor: pointer;
}
.rowbtn:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.rowbtn--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* --- Hinweis-Box (Info) ------------------------------------- */
.alert--info { background: #eef3fb; color: #1f4f8b; border: 1px solid #c5d8ef; }
.alert__hint { font-size: 0.8rem; margin-top: 6px; opacity: 0.85; }
.pw-code {
  display: inline-block;
  margin-top: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1rem;
  background: #fff;
  border: 1px solid #c5d8ef;
  border-radius: 6px;
  padding: 5px 12px;
  letter-spacing: 0.04em;
}

/* --- Testverwaltung ----------------------------------------- */
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  resize: vertical;
  min-height: 80px;
}
textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
input[type="number"]:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

.label-like { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 8px; }

.opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.opt-row input[type="text"] { margin-top: 0; }
.opt-row input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}

.q-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.q-card__head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.q-card__text { font-weight: 600; font-size: 1rem; margin-bottom: 12px; }
.q-card .row-actions { margin-top: 14px; }

.q-options { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.q-option {
  font-size: 0.9rem;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.q-option--correct {
  border-color: #bfe3c7;
  background: #e9f6ec;
  color: #1f7a35;
  font-weight: 600;
}
.q-option--correct::before { content: "\2713\00a0\00a0"; }

.q-explanation {
  font-size: 0.86rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.badge--diff { background: #eef0f4; color: var(--ink-soft); text-transform: capitalize; }

/* --- APIs & Integrationen ----------------------------------- */
.panel--wide { max-width: 720px; }
.integration { border-top: 1px solid var(--line); padding: 14px 0; }
.integration:first-of-type { border-top: none; padding-top: 4px; }
.integration__info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.integration__preview {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.integration__form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.integration__form input { margin-top: 0; flex: 1; min-width: 220px; }

/* --- Versionsanzeige im Seitenmenü -------------------------- */
.sidebar__version {
  margin-top: 10px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* --- Filterleiste ------------------------------------------- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.filterbar select,
.filterbar input[type="search"] {
  margin-top: 0;
  width: auto;
  flex: 1;
  min-width: 160px;
}
.filterbar input[type="search"] {
  display: block;
  padding: 11px 13px;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.filterbar input[type="search"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-tint);
}

/* --- Registrierungsformular --------------------------------- */
.auth__card--wide { max-width: 560px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.reg-section {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px 16px 4px;
  margin-bottom: 14px;
}
.reg-section legend {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 6px;
  color: var(--ink-soft);
}

.radio-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 9px;
}
.check-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 12px;
}
.radio-opt input,
.check-opt input {
  width: 17px;
  height: 17px;
  margin-top: 0;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}
.check-list-roles { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.agb-placeholder { color: var(--ink-soft); line-height: 1.6; margin-bottom: 12px; }

/* --- Rollen-Umschalter im Seitenmenü ------------------------ */
.role-switch { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.role-switch__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.role-switch__btn {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 0.84rem;
  color: var(--ink);
  cursor: pointer;
}
.role-switch__btn:hover { border-color: var(--red); color: var(--red); }
.role-switch__btn.is-active {
  background: var(--red-tint);
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

/* --- Einzeilige Tabellenzellen ------------------------------ */
.cell-nowrap { white-space: nowrap; }
.row-actions--nowrap { flex-wrap: nowrap; }

/* --- Hilfsklassen ------------------------------------------- */
.u-narrow { max-width: 520px; }
.u-spaced { margin-top: 16px; }

/* --- Responsiv ---------------------------------------------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
  }
  .sidebar__nav.adm-nav { display: block; }
  .sidebar__label { display: none; }
  .nav-item__soon { display: none; }
  .main__inner { padding: 28px 22px; }
  .form-grid { grid-template-columns: 1fr; }
}
