/* ==========================================================================
   Portal: Anmeldung, Adminbereich, Mitarbeiterportal, Owner-Bereich
   ========================================================================== */

/* ---------------------------------------------------------------- Fehler-/Hinweisseiten */

body.plain { background: radial-gradient(900px 500px at 50% -10%, var(--brand-50), transparent 70%), var(--bg); }
.plain-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 20px; }
.plain-card { width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 44px 40px; text-align: center; }
.plain-code { font-family: var(--font-display); font-weight: 800; font-size: 4.2rem; letter-spacing: -0.05em; line-height: 1; margin-bottom: 14px; background: linear-gradient(120deg, var(--brand), #14a085 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plain-card h1 { font-size: 1.5rem; }
.plain-card p { color: var(--muted); }
.plain-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------------------------------------------------------------- Anmeldung / Registrierung */

body.auth { background: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.auth-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  color: #c4d2e1;
  background:
    radial-gradient(700px 420px at 90% 0%, rgba(14, 124, 102, 0.5), transparent 62%),
    radial-gradient(520px 380px at 0% 100%, rgba(29, 78, 216, 0.25), transparent 60%),
    linear-gradient(180deg, #081828, #0b1f33);
}
.auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 90% 70% at 40% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 40% 40%, #000 20%, transparent 78%);
}
.auth-side > * { position: relative; }
.auth-side h2 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -0.03em; margin-bottom: 14px; }
.auth-side p { font-size: 1.05rem; max-width: 440px; }
.auth-points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 16px; }
.auth-points li { display: flex; gap: 14px; align-items: center; color: #dbe6f1; font-size: 0.98rem; }
.auth-points .ap-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(94, 234, 212, 0.12); color: var(--mint); }
.auth-side small { color: #7f93a8; font-size: 0.85rem; }
.auth-side small a { color: #a9bace; }

.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 28px; }
.auth-box { width: 100%; max-width: 460px; margin: 0 auto; animation: rise 0.6s var(--ease) both; }
.auth-box.wide { max-width: 560px; }
.auth-box h1 { font-size: 1.9rem; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-box .sub { color: var(--muted); margin-bottom: 28px; }
.auth-foot { margin-top: 24px; text-align: center; color: var(--muted); font-size: 0.94rem; }
.auth-mobile-logo { display: none; margin-bottom: 32px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.plan-pick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); margin-bottom: 24px; }
.plan-pick .pp-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.plan-pick b { display: block; color: var(--ink); }
.plan-pick span { font-size: 0.88rem; color: var(--brand-700); }
.plan-pick a { margin-left: auto; font-size: 0.88rem; font-weight: 600; white-space: nowrap; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-logo { display: inline-flex; }
  .auth-main { justify-content: flex-start; padding-top: 40px; }
}

/* ---------------------------------------------------------------- App-Grundgerüst */

body.app { background: var(--bg); }
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a1c2e, #0b1f33 40%, #0c2238);
  color: #a9bace;
  padding: 22px 16px 18px;
  overflow-y: auto;
  z-index: 60;
}
.sidebar .logo { padding: 4px 8px 22px; }
.side-company { margin: 0 4px 18px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); }
.side-company small { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #6f859b; font-weight: 700; margin-bottom: 2px; }
.side-company b { display: block; color: #fff; font-size: 0.93rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: grid; gap: 3px; }
.side-label { font-size: 0.7rem; letter-spacing: 0.13em; text-transform: uppercase; color: #5f7790; font-weight: 700; padding: 16px 12px 6px; }
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #a9bace;
  font-weight: 500;
  font-size: 0.94rem;
  text-decoration: none;
  transition: background-color 0.18s, color 0.18s;
}
.side-nav a .icon { width: 19px; height: 19px; opacity: 0.85; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a.is-active { background: rgba(94, 234, 212, 0.12); color: #fff; }
.side-nav a.is-active .icon { color: var(--mint); opacity: 1; }
.side-nav a.is-active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint); }
.side-nav .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.74rem; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; padding-top: 18px; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.side-user .avatar { background: rgba(94, 234, 212, 0.16); color: var(--mint); }
.side-user .who { min-width: 0; flex: 1; line-height: 1.3; }
.side-user .who b { display: block; color: #fff; font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who small { font-size: 0.76rem; color: #7f93a8; }
.side-user button { background: none; border: 0; color: #7f93a8; cursor: pointer; padding: 7px; border-radius: 8px; display: grid; }
.side-user button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--brand-700); background: var(--brand-50); text-transform: uppercase; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.2rem; }
.thumb { flex: none; width: 48px; height: 48px; border-radius: 11px; object-fit: cover; border: 1px solid var(--line); background: #eef2f6; }
.thumb-lg { width: 68px; height: 68px; border-radius: 14px; }

/* Bilder einer Unterweisung (Owner) */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; padding: 24px; }
.media-item { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.media-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg); border-radius: 10px; }
.media-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.88rem; }
.media-item .input { font-size: 0.78rem; padding: 8px 10px; }
.media-actions { display: flex; justify-content: space-between; gap: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
  height: 66px;
  background: rgba(244, 246, 249, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.12rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.topbar .bell:hover { color: var(--ink); border-color: var(--line-strong); }
.topbar .bell .dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); border-radius: 11px; width: 40px; height: 40px; place-items: center; color: var(--ink); cursor: pointer; }

.content { padding: 30px 32px 64px; width: 100%; max-width: 1280px; animation: rise 0.45s var(--ease) both; }
.content.narrow { max-width: 860px; }

.sidebar-backdrop { display: none; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 31, 51, 0.5); z-index: 50; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 56px; }
}

/* ---------------------------------------------------------------- Seitenkopf, Karten */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head h2 { font-size: 1.65rem; letter-spacing: -0.03em; margin: 0 0 4px; }
.page-head p { color: var(--muted); margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 500; margin-bottom: 14px; text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card + .card { margin-top: 22px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 1.06rem; margin: 0; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.card-body { padding: 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }

.grid { display: grid; gap: 22px; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 22px; }
.mb { margin-bottom: 22px; }

/* Kennzahlen */
.kpi { position: relative; overflow: hidden; padding: 22px 22px 20px; }
.kpi .kpi-label { display: flex; align-items: center; gap: 9px; font-size: 0.86rem; color: var(--muted); font-weight: 500; padding-right: 52px; min-height: 40px; line-height: 1.3; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); line-height: 1.1; margin-top: 10px; }
.kpi .kpi-value small { font-size: 0.95rem; font-weight: 600; color: var(--faint); letter-spacing: 0; margin-left: 4px; }
.kpi .kpi-sub { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }
.kpi .kpi-icon { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.kpi.tone-green .kpi-icon { background: var(--green-bg); color: var(--green-text); }
.kpi.tone-yellow .kpi-icon { background: var(--yellow-bg); color: var(--yellow-text); }
.kpi.tone-red .kpi-icon { background: var(--red-bg); color: var(--red-text); }

.meter { height: 8px; border-radius: 999px; background: var(--grey-bg); overflow: hidden; margin-top: 14px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #14a085); transition: width 0.9s var(--ease); }
.meter.is-warn i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.meter.is-full i { background: linear-gradient(90deg, #dc2626, #f87171); }
.meter-split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--grey-bg); margin-top: 14px; }
.meter-split i { display: block; height: 100%; transition: width 0.9s var(--ease); }

/* ---------------------------------------------------------------- Tabellen & Listen */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.15s; }
.table tbody tr:hover { background: #fafbfc; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn, .table .actions form + form, .table .actions .btn + form { margin-left: 4px; }
.table .actions form { display: inline; }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-user .who { min-width: 0; line-height: 1.35; }
.cell-user .who b, .cell-user .who a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.cell-user .who a:hover { color: var(--brand-600); }
.cell-user .who small { color: var(--muted); font-size: 0.83rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.nowrap { white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; line-height: 1.4; }
.list .grow b, .list .grow a.strong { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.list .grow small { color: var(--muted); font-size: 0.85rem; }
.list .aside { text-align: right; font-size: 0.86rem; color: var(--muted); white-space: nowrap; }

.lights-mini { display: inline-flex; align-items: center; gap: 12px; font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lights-mini span { display: inline-flex; align-items: center; gap: 6px; }
.lights-mini .light { width: 9px; height: 9px; box-shadow: none; }

.empty { text-align: center; padding: 52px 24px; color: var(--muted); }
.empty .empty-icon { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 1.15rem; margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 20px; }

/* ---------------------------------------------------------------- Filterleiste, Reiter */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; padding: 9px 12px; font-size: 0.92rem; }
.toolbar .select { padding-right: 36px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.search .input { width: 100%; padding-left: 38px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 0.94rem; text-decoration: none; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--brand-700); }
.tabs a.is-active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.tabs .pill { padding: 1px 8px; border-radius: 999px; background: var(--grey-bg); font-size: 0.76rem; color: var(--muted); }

.seg { display: inline-flex; padding: 4px; background: var(--grey-bg); border-radius: 11px; }
.seg a { padding: 7px 14px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.seg a.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- Flash-Meldung (oben rechts) */

.toast-wrap { position: fixed; top: 82px; right: 24px; z-index: 120; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 0.93rem; line-height: 1.45; animation: toast-in 0.45s var(--ease) both; }
.toast .icon { width: 22px; height: 22px; margin-top: 0; }
.toast.toast-success .icon { color: var(--green); }
.toast.toast-error .icon { color: var(--red); }
.toast.toast-warning .icon { color: var(--yellow); }
.toast.toast-info .icon { color: var(--blue-text); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 2px; display: grid; }
.toast.is-leaving { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------------------------------------------------------------- Dialoge */

dialog.modal { border: 0; padding: 0; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--text); overflow: hidden; }
dialog.modal.wide { width: min(720px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(11, 31, 51, 0.55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in 0.3s var(--ease); display: flex; flex-direction: column; }
dialog.modal[open]::backdrop { animation: fade-in 0.3s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 0; }
.modal-head h3 { font-size: 1.25rem; margin: 0; }
.modal-head .x { background: var(--grey-bg); border: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.modal-head .x:hover { color: var(--ink); background: var(--line); }
.modal-body { padding: 18px 26px 6px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 18px 26px 24px; }
.modal-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 16px; }
.modal-icon .icon { width: 28px; height: 28px; }
.modal-icon.danger { background: var(--red-bg); color: var(--red); }
.modal-icon.warn { background: var(--yellow-bg); color: var(--yellow-text); }

.statement { padding: 18px 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); font-size: 1rem; line-height: 1.6; color: var(--ink); margin-bottom: 18px; }
.statement strong { color: var(--brand-700); }

/* ---------------------------------------------------------------- Auswahl-Kacheln (Checkbox-Karten) */

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pick { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.pick:hover { border-color: var(--line-strong); }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-glow); }
.pick .grow { min-width: 0; line-height: 1.35; }
.pick .grow b { display: block; font-weight: 600; color: var(--ink); font-size: 0.93rem; }
.pick .grow small { color: var(--muted); font-size: 0.82rem; }
.pick-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }

.date-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: 0.87rem; }
.date-chip button { background: rgba(8, 85, 69, 0.12); border: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; padding: 0; }
.date-chip button .icon { width: 12px; height: 12px; stroke-width: 3; }

/* ---------------------------------------------------------------- Mitarbeiterportal: Unterweisungskarten */

.hello { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 30px; border-radius: var(--radius-xl); margin-bottom: 26px; color: #c4d2e1; background: radial-gradient(520px 260px at 100% 0%, rgba(94, 234, 212, 0.25), transparent 60%), linear-gradient(120deg, #0b1f33, #0e3b45); }
.hello h2 { color: #fff; font-size: 1.6rem; letter-spacing: -0.03em; margin-bottom: 4px; }
.hello p { margin: 0; }
.hello-stats { display: flex; gap: 10px; }
.hello-stat { min-width: 92px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.09); }
.hello-stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: #fff; line-height: 1.1; }
.hello-stat span { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #a9bace; margin-top: 3px; }
.hello-stat .light { width: 8px; height: 8px; box-shadow: none; }

.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.task { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; overflow: hidden; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.task:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.task::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--grey); }
.task.is-green::before { background: var(--green); }
.task.is-yellow::before { background: var(--yellow); }
.task.is-red::before { background: var(--red); }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.task-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--ink); color: var(--mint); }
.task-icon .icon { width: 22px; height: 22px; }
.task h3 { font-size: 1.1rem; line-height: 1.3; margin-bottom: 6px; }
.task p { color: var(--muted); font-size: 0.92rem; margin: 0 0 16px; flex: 1; }
.task-meta { display: grid; gap: 8px; font-size: 0.88rem; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--line); }
.task-meta div { display: flex; align-items: center; gap: 9px; }
.task-meta .icon { width: 17px; height: 17px; color: var(--faint); }
.task-meta b { color: var(--ink); font-weight: 600; }
.task-meta .is-late { color: var(--red-text); font-weight: 600; }
.task-meta .is-late .icon { color: var(--red); }
.tries { display: inline-flex; gap: 5px; margin-left: auto; }
.tries i { width: 22px; height: 6px; border-radius: 3px; background: var(--brand); }
.tries i.used { background: var(--line-strong); }

/* ---------------------------------------------------------------- Lese- und Testmodus (ohne Ablenkung) */

body.focus { background: var(--bg); }
.focus-bar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.focus-bar .inner { display: flex; align-items: center; gap: 18px; max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 64px; }
.focus-bar .ftitle { flex: 1; min-width: 0; line-height: 1.3; }
.focus-bar .ftitle small { display: block; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.focus-bar .ftitle b { display: block; color: var(--ink); font-family: var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-progress { height: 4px; background: var(--grey-bg); }
.focus-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--mint)); transition: width 0.2s linear; }

.reader { max-width: 800px; margin: 0 auto; padding: 44px 24px 190px; }
.reader-intro { margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.reader-intro h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -0.035em; margin: 14px 0 12px; }
.reader-intro p { font-size: 1.1rem; color: var(--muted); margin: 0 0 18px; }
.reader-intro.has-cover { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 34px; align-items: center; }
.reader-cover img { display: block; width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
@media (max-width: 720px) {
  .reader-intro.has-cover { grid-template-columns: 1fr; }
  .reader-cover { max-width: 360px; }
}
.reader-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.9rem; color: var(--muted); }
.reader-facts span { display: inline-flex; align-items: center; gap: 7px; }
.reader-facts .icon { color: var(--brand); width: 17px; height: 17px; }
.reader-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 46px 52px; box-shadow: var(--shadow-sm); }
@media (max-width: 640px) { .reader-paper { padding: 28px 22px; border-radius: var(--radius-lg); } }

.reader-end { margin-top: 30px; padding: 34px; border-radius: var(--radius-xl); text-align: center; background: #fff; border: 1.5px dashed var(--line-strong); transition: border-color 0.4s, background-color 0.4s, box-shadow 0.4s; }
.reader-end.is-ready { border-style: solid; border-color: var(--brand); background: linear-gradient(180deg, var(--brand-50), #fff); box-shadow: 0 16px 40px -18px var(--brand-glow); }
.reader-end h2 { font-size: 1.35rem; margin-bottom: 8px; }
.reader-end p { color: var(--muted); max-width: 500px; margin: 0 auto 20px; }

.read-dock { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 16px; width: min(560px, calc(100vw - 28px)); padding: 12px 18px 12px 14px; border-radius: 18px; background: var(--ink); color: #c4d2e1; box-shadow: var(--shadow-lg); font-size: 0.9rem; transition: background-color 0.4s; }
.read-dock.is-ready { background: var(--brand-700); }
.read-dock .rd-ring { position: relative; width: 44px; height: 44px; flex: none; }
.read-dock .rd-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.read-dock .rd-ring circle { fill: none; stroke-width: 4; }
.read-dock .rd-ring .bg { stroke: rgba(255, 255, 255, 0.14); }
.read-dock .rd-ring .fg { stroke: var(--mint); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset 0.9s linear; }
.read-dock .rd-ring .icon { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; color: #fff; }
.read-dock .rd-text { flex: 1; min-width: 0; line-height: 1.35; }
.read-dock .rd-text b { display: block; color: #fff; font-weight: 600; }
.read-dock .rd-text small { color: #a9bace; }
.read-dock.is-paused .rd-ring .fg { stroke: var(--accent); }

.quiz { max-width: 760px; margin: 0 auto; padding: 36px 24px 80px; }
.quiz-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 38px 40px 30px; }
@media (max-width: 640px) { .quiz-card { padding: 26px 20px 22px; border-radius: var(--radius-lg); } }
.quiz-steps { display: flex; gap: 8px; margin-bottom: 30px; }
.quiz-steps button { flex: 1; height: 8px; border-radius: 999px; border: 0; background: var(--grey-bg); cursor: pointer; padding: 0; transition: background-color 0.25s, transform 0.2s; }
.quiz-steps button:hover { transform: scaleY(1.4); }
.quiz-steps button.is-answered { background: var(--brand-100); }
.quiz-steps button.is-current { background: var(--brand); }
.q-page { display: none; }
.q-page.is-active { display: block; animation: q-in 0.4s var(--ease); }
.q-page.is-active.from-left { animation-name: q-in-left; }
@keyframes q-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes q-in-left { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.q-count { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.q-text { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.35; margin-bottom: 26px; letter-spacing: -0.02em; }
.q-options { display: grid; gap: 12px; }
.q-option { position: relative; display: flex; align-items: center; gap: 16px; padding: 17px 18px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 1.02rem; line-height: 1.45; transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s, transform 0.18s; }
.q-option:hover { border-color: var(--line-strong); transform: translateX(3px); }
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-option .q-letter { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grey-bg); color: var(--muted); font-weight: 700; font-size: 0.9rem; transition: background-color 0.18s, color 0.18s; }
.q-option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-glow); }
.q-option:has(input:checked) .q-letter { background: var(--brand); color: #fff; }
.q-option:has(input:focus-visible) { outline: 3px solid var(--brand-glow); outline-offset: 2px; }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.quiz-nav .save-state { font-size: 0.84rem; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.quiz-hint { text-align: center; color: var(--muted); font-size: 0.88rem; margin-top: 20px; }

.clock { display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px 8px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; transition: background-color 0.4s; }
.clock .icon { width: 18px; height: 18px; color: var(--mint); }
.clock.is-low { background: #b45309; }
.clock.is-low .icon { color: #fff; }
.clock.is-critical { background: var(--red); animation: clock-pulse 1s ease-in-out infinite; }
.clock.is-critical .icon { color: #fff; }
@keyframes clock-pulse { 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.18); } }

.timeup { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: rgba(11, 31, 51, 0.7); backdrop-filter: blur(4px); padding: 20px; }
.timeup.is-shown { display: grid; animation: fade-in 0.3s ease; }
.timeup-card { background: #fff; border-radius: var(--radius-xl); padding: 40px; text-align: center; max-width: 420px; box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------------- Ergebnis */

.result { max-width: 640px; margin: 10px auto 0; text-align: center; }
.result-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 46px 40px 38px; position: relative; overflow: hidden; }
.result-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--grey); }
.result-card.is-green::before { background: linear-gradient(90deg, var(--green), #4ade80); }
.result-card.is-yellow::before { background: linear-gradient(90deg, var(--yellow), #fcd34d); }
.result-card.is-red::before { background: linear-gradient(90deg, var(--red), #f87171); }
.result-badge { width: 92px; height: 92px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; animation: pop 0.6s var(--ease) both 0.1s; }
.result-badge .icon { width: 46px; height: 46px; stroke-width: 2.4; }
.is-green .result-badge { background: var(--green-bg); color: var(--green); box-shadow: 0 0 0 10px rgba(21, 163, 74, 0.08); }
.is-yellow .result-badge { background: var(--yellow-bg); color: var(--yellow); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.1); }
.is-red .result-badge { background: var(--red-bg); color: var(--red); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0.08); }
@keyframes pop { from { opacity: 0; transform: scale(0.5); } 60% { transform: scale(1.08); } to { opacity: 1; transform: none; } }
.result-card h2 { font-size: 1.8rem; letter-spacing: -0.03em; margin-bottom: 8px; }
.result-card > p { color: var(--muted); max-width: 460px; margin: 0 auto 26px; }
.score-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.score { padding: 16px 10px; border-radius: 14px; background: var(--bg); }
.score b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); letter-spacing: -0.03em; }
.score span { font-size: 0.8rem; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------------------------------------------------------------- Abo-Seite */

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 26px 24px 24px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease); }
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.is-selected, .plan-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.plan-card h3 { font-size: 1.2rem; margin-bottom: 2px; }
.plan-card .tagline { color: var(--muted); font-size: 0.88rem; margin-bottom: 16px; }
.plan-card .price b { font-size: 2.3rem; }
.plan-card ul { list-style: none; margin: 16px 0 22px; padding: 0; display: grid; gap: 8px; font-size: 0.9rem; flex: 1; align-content: start; }
.plan-card li { display: flex; gap: 9px; align-items: flex-start; }
.plan-card li .icon { color: var(--brand); width: 17px; height: 17px; margin-top: 3px; stroke-width: 2.6; }
.plan-card .flag { position: absolute; top: -12px; right: 18px; padding: 4px 12px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price b { font-family: var(--font-display); letter-spacing: -0.04em; color: var(--ink); line-height: 1; }
.price span { color: var(--muted); font-size: 0.9rem; }
.paypal-box { min-height: 48px; margin-top: 4px; }
.summary { display: grid; gap: 10px; font-size: 0.94rem; }
.summary div { display: flex; justify-content: space-between; gap: 16px; }
.summary .total { padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 44px; height: 46px; border: 0; background: #fff; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover { background: var(--grey-bg); }
.stepper input { width: 72px; height: 46px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-weight: 700; font-size: 1.1rem; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--brand-50); }

.dl { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 10px 20px; font-size: 0.94rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- Matrix */

.matrix { border-collapse: separate; border-spacing: 0; font-size: 0.9rem; min-width: 100%; }
.matrix th, .matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix thead th { position: sticky; top: 0; background: #fafbfc; font-size: 0.78rem; font-weight: 600; color: var(--muted); vertical-align: bottom; max-width: 130px; min-width: 96px; line-height: 1.3; }
.matrix th.name, .matrix td.name { position: sticky; left: 0; background: #fff; text-align: left; padding-left: 24px; min-width: 210px; z-index: 1; border-right: 1px solid var(--line); }
.matrix thead th.name { background: #fafbfc; z-index: 2; }
.matrix td.name a { color: var(--ink); font-weight: 600; text-decoration: none; }
.matrix td.name small { display: block; color: var(--muted); font-size: 0.8rem; }
.matrix .cell { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grey-bg); }
.matrix .cell.green { background: var(--green-bg); }
.matrix .cell.yellow { background: var(--yellow-bg); }
.matrix .cell.red { background: var(--red-bg); }
.matrix .cell.none { background: transparent; color: var(--line-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.86rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- Verlauf / Versuche */

.attempts { display: grid; gap: 6px; margin-top: 8px; }
.attempt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 9px 12px; border-radius: 10px; background: var(--bg); font-size: 0.87rem; }
.attempt-row .grow { flex: 1; min-width: 160px; color: var(--muted); }
.attempt-row b { color: var(--ink); font-weight: 600; }

.notif { display: flex; gap: 14px; align-items: flex-start; padding: 16px 24px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background-color 0.15s; }
.notif:last-child { border-bottom: 0; }
a.notif:hover { background: #fafbfc; text-decoration: none; }
.notif.is-unread { background: #f3faf8; }
.notif .n-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--blue-bg); color: var(--blue-text); }
.notif .n-icon.success { background: var(--green-bg); color: var(--green-text); }
.notif .n-icon.warning { background: var(--yellow-bg); color: var(--yellow-text); }
.notif .n-icon.danger { background: var(--red-bg); color: var(--red-text); }
.notif .grow { flex: 1; min-width: 0; }
.notif b { display: block; color: var(--ink); font-weight: 600; }
.notif p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.notif time { font-size: 0.8rem; color: var(--faint); white-space: nowrap; }

/* ---------------------------------------------------------------- Owner: Fragenkatalog, Editor */

.q-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; overflow: hidden; }
.q-item.is-inactive { opacity: 0.6; }
.q-item summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.q-item summary::-webkit-details-marker { display: none; }
.q-item summary .q-no { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; }
.q-item summary .grow { flex: 1; font-weight: 600; color: var(--ink); }
.q-item summary > .icon { color: var(--faint); transition: transform 0.25s; }
.q-item[open] summary > .icon { transform: rotate(180deg); }
.q-item .q-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.answer-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.answer-row .input { flex: 1; }
.answer-row label.check { flex: none; font-size: 0.82rem; color: var(--muted); align-items: center; }
.answers-view { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.92rem; }
.answers-view li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); }
.answers-view li.ok { color: var(--green-text); font-weight: 600; }
.answers-view .icon { width: 16px; height: 16px; margin-top: 4px; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } }
.textarea.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.88rem; line-height: 1.6; min-height: 560px; tab-size: 2; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--line); color: var(--muted); transition: all 0.15s; }
.icon-pick input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.icon-pick input:focus-visible + span { outline: 3px solid var(--brand-glow); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.93rem; }
.checklist .icon { width: 20px; height: 20px; margin-top: 1px; }
.checklist .ok .icon { color: var(--green); }
.checklist .todo .icon { color: var(--yellow); }
.checklist small { display: block; color: var(--muted); }

pre.mail { margin: 10px 0 0; padding: 14px; border-radius: 10px; background: var(--bg); font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; white-space: pre-wrap; word-break: break-word; color: var(--text); }
