/* Verwaltung — fürs Handy gebaut (Daumen-Bedienung, große Flächen), passt auch am Computer */
:root {
  --bg: #14151a; --card: #1e2027; --card-2: #262934; --line: #33384a;
  --text: #f2f3f7; --muted: #9aa0ae; --accent: #ff4d6d; --accent-2: #ff8fa3;
  --ok: #3ecf8e; --warn: #ffc857; --danger: #ff5c7a; --radius: 14px;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); line-height: 1.5;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent-2); }
main { flex: 1; width: min(860px, 100% - 24px); margin: 0 auto; padding: 0.5rem 0 3rem; }
h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); letter-spacing: -0.02em; margin: 0.6rem 0 0.4rem; }
h2 { font-size: 1.1rem; margin-bottom: 0.6rem; }
h3 { font-size: 1rem; margin-bottom: 0.3rem; }
p + p { margin-top: 0.5rem; }
.lead { color: var(--muted); margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Kopfzeile + Menü */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.6rem 12px; padding-top: max(0.6rem, env(safe-area-inset-top));
  background: rgba(20, 21, 26, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand small { color: var(--muted); font-weight: 500; font-size: 0.8rem; margin-left: 0.3rem; }
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; padding: 0.55rem 0.9rem; border-radius: 999px;
  background: var(--card-2); font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 0.4rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(320px, 92vw);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.4rem; display: flex; flex-direction: column; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  max-height: 80vh; overflow: auto;
}
.menu nav a, .menu nav button {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.8rem; border-radius: 10px;
  color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.menu nav a:hover, .menu nav a.active, .menu nav button:hover { background: var(--card-2); }
.menu nav form { border-top: 1px solid var(--line); margin-top: 0.3rem; padding-top: 0.3rem; }
.count {
  margin-left: auto; min-width: 1.5rem; padding: 0 0.45rem; border-radius: 999px; text-align: center;
  background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 700;
}
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Hinweise */
.flash { border-radius: 10px; padding: 0.75rem 1rem; margin: 0.75rem 0 0; font-size: 0.95rem; }
.flash-ok { background: #123326; color: #b6f3d6; }
.flash-info { background: #1d2a40; color: #cfe0ff; }
.flash-error, .errors { background: #3d1820; color: #ffc9d2; }
.errors { border-radius: 10px; padding: 0.75rem 1rem 0.75rem 2rem; margin: 0.75rem 0; }
.setup-banner { background: #2b2440; color: #e4dcff; padding: 0.65rem 12px; font-size: 0.92rem; text-align: center; }
.setup-banner a { color: inherit; font-weight: 700; }
.warn-box { border-left: 4px solid var(--warn); background: #2a2415; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.93rem; margin: 0.75rem 0; }
.ok-box { border-left: 4px solid var(--ok); background: #12261d; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.93rem; margin: 0.75rem 0; }

/* Karten, Listen, Kacheln */
.card { background: var(--card); border-radius: var(--radius); padding: 1rem; margin: 0.75rem 0; }
.card > h2:first-child { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; margin: 0.75rem 0; }
.tile { background: var(--card); border-radius: var(--radius); padding: 0.9rem; text-decoration: none; color: var(--text); display: block; }
.tile strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 0.85rem; }
a.tile:hover { outline: 2px solid var(--accent); }
.list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.list > li { background: var(--card); border-radius: 12px; padding: 0.8rem 0.9rem; }
.list a.row-link { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; color: var(--text); text-decoration: none; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.steps a { display: flex; align-items: center; gap: 0.8rem; background: var(--card); border-radius: 12px; padding: 0.85rem; color: var(--text); text-decoration: none; }
.steps a:hover { outline: 2px solid var(--accent); }
.step-icon { font-size: 1.3rem; width: 2rem; text-align: center; flex: none; }
.step-text { flex: 1; }
.step-text small { display: block; color: var(--muted); }
.flags { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 1rem; }
.flags dt { color: var(--muted); }
.flags dd { margin: 0; text-align: right; }

.badge { display: inline-block; font-size: 0.75rem; padding: 0.12rem 0.55rem; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: #123326; color: #b6f3d6; }
.badge-warn { background: #3a2a10; color: #ffe3a8; }
.badge-danger { background: #3d1820; color: #ffc9d2; }
.badge-accent { background: var(--accent); color: #fff; }
.req { font-size: 0.72rem; color: var(--warn); font-weight: 600; margin-left: 0.3rem; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > label { font-size: 0.95rem; font-weight: 600; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 0.8rem 0.9rem; font-size: 1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); font-family: inherit; min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
textarea.long { min-height: 320px; font-size: 0.92rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[readonly], textarea[readonly], select:disabled { opacity: 0.7; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.05rem; flex: none; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 0.85rem; }
.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; }
.inline > * { flex: 1 1 140px; }
.inline > .btn { flex: 0 0 auto; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.75rem 1.1rem;
  border-radius: 12px; border: 0; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 700;
  cursor: pointer; text-decoration: none; min-height: 44px; font-family: inherit;
}
.btn:hover { background: var(--accent-2); color: #14151a; }
.btn-ghost { background: var(--card-2); color: var(--text); }
.btn-ghost:hover { background: var(--line); color: var(--text); }
.btn-ok { background: #1f8a5b; }
.btn-danger { background: #a3243b; }
.btn-small { padding: 0.45rem 0.8rem; min-height: 36px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.sticky-save { position: sticky; bottom: 0; padding: 0.7rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
details.more summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 0.3rem 0; }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.tabs a { padding: 0.45rem 0.85rem; border-radius: 999px; background: var(--card); color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.tabs a.active { background: var(--accent); color: #fff; }

/* Tabellen (werden am Handy zu Karten) */
table.grid { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.grid th, table.grid td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  table.grid.stack thead { display: none; }
  table.grid.stack tr { display: block; background: var(--card-2); border-radius: 10px; margin-bottom: 0.5rem; padding: 0.4rem 0.6rem; }
  table.grid.stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.25rem 0; }
  table.grid.stack td::before { content: attr(data-label); color: var(--muted); }
  table.grid.stack td.num { text-align: right; }
}
.qr { background: #fff; display: inline-block; padding: 0.4rem; border-radius: 10px; }
.qr svg { display: block; width: 210px; height: 210px; }
code.big { font-size: 1.3rem; background: var(--card-2); padding: 0.3rem 0.6rem; border-radius: 8px; letter-spacing: 0.05em; word-break: break-all; }
pre.box { white-space: pre-wrap; background: var(--card-2); border-radius: 10px; padding: 0.8rem; font-family: inherit; font-size: 0.93rem; }

.login { max-width: 420px; margin: 8vh auto 0; }
.footer { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 1.2rem 12px 2rem; }
.footer a { color: var(--muted); }

/* Hilfe */
.help-body { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.6rem; }
.help-body ul, .help-body ol { padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.35rem; }
.help-body code, .help code { background: var(--card-2); padding: 0.05rem 0.35rem; border-radius: 6px; font-size: 0.88em; word-break: break-word; }
details.help summary { cursor: pointer; list-style: none; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::after { content: " ›"; color: var(--muted); }
details.help[open] summary::after { content: " ⌄"; }

/* Hoster-Bereich: eigene Akzentfarbe, damit man nie verwechselt, wo man gerade ist */
.portal-hoster { --accent: #3fa7ff; --accent-2: #8cc8ff; }
.portal-hoster .topbar { border-bottom-color: #2b5d8a; }
.portal-hoster .brand small { color: var(--accent-2); }
