/* FTT – eigene, kleine Stilbasis. Keine Build-Toolchain, keine externen Schriften. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2128;
  --muted: #5d6673;
  --line: #dde1e6;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --ok: #1e7f4f;
  --warn: #a35d00;
  --err: #b42318;
  --err-bg: #fdecea;
  --ok-bg: #e6f4ec;
  --info-bg: #e8f0fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --surface: #171b21; --text: #e6e9ee; --muted: #9aa4b2; --line: #2a3139;
    --accent: #6ea0ff; --accent-ink: #0b1020; --err-bg: #3a1d1b; --ok-bg: #16301f; --info-bg: #1b2738;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.45; min-height: 100vh;
       display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
       background: color-mix(in srgb, var(--line) 50%, transparent); padding: .05em .35em; border-radius: 4px; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem;
          background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--text); font-size: 1.1rem; }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav a { padding: .4rem .7rem; border-radius: 6px; color: var(--text); }
.nav a.active, .nav a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.tenant-name { font-weight: 600; }
.tenant-switch select { padding: .35rem .5rem; border-radius: 6px; border: 1px solid var(--line);
                        background: var(--surface); color: var(--text); font: inherit; }

/* Layout */
.container { width: min(1100px, 100% - 2rem); margin: 1.25rem auto; flex: 1; }
.container.narrow { width: min(440px, 100% - 2rem); margin-top: 8vh; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.auth-card { padding: 1.75rem; }
.brand-big { font-size: 2rem; letter-spacing: .06em; margin-bottom: .25rem; }
.footer { padding: 1rem 1.25rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

/* Formulare */
.form { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; }
.form label { font-size: .875rem; color: var(--muted); margin-top: .5rem; }
.form input[type=text], .form input[type=password], .form input[type=email], .form input[type=number],
.form select, .form textarea {
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit;
  background: var(--surface); color: var(--text); }
.form input:focus, .form select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
                                        border-color: var(--accent); }
.btn { display: inline-block; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line);
       background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); margin-top: .75rem; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { padding: .3rem .6rem; font-size: .875rem; }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
form.inline { display: inline; }

/* Meldungen */
.flash { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .75rem; background: var(--info-bg);
         border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.flash-error { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err); }
.flash-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }

/* Kacheln, Tabellen, Listen */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: .9rem 1rem; color: var(--text); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile-zero { opacity: .55; }
.tile-n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tile-l { font-size: .85rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card { min-width: 0; }
code { overflow-wrap: anywhere; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tr.current { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem;
         background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }

/* TOTP */
.qr-wrap { display: flex; justify-content: center; margin: 1rem 0; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.secret { font-size: 1.05rem; letter-spacing: .08em; user-select: all; }
details summary { cursor: pointer; }

/* Posteingang, Belege */
.container.wide { width: min(1400px, 100% - 2rem); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1rem; }
.filters input[type=search], .filters select { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px;
                                                font: inherit; background: var(--surface); color: var(--text); }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters .check { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .9rem; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.pager { display: flex; gap: .5rem; margin-top: .75rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.preview-card { padding: .5rem; min-height: 60vh; }
.preview { width: 100%; height: 80vh; border: 0; border-radius: 6px; background: #525659; }
.preview-img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.status-line { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.timeline li { border-left: 2px solid var(--line); padding-left: .6rem; }
.upload-form input[type=file] { padding: .5rem; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); }
textarea { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit;
           background: var(--surface); color: var(--text); resize: vertical; }

/* Kontierung */
.kv.compact { gap: .15rem 1rem; margin-bottom: .75rem; }
.reasoning { background: var(--info-bg); border-radius: 8px; padding: .5rem .7rem; }
.question { background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.question form { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .3rem; }
.lines input, .lines select { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.lines td { padding: .3rem .3rem; }
.lines tr.extra input, .lines tr.extra select { opacity: .7; }
.decide .actions { margin-top: .5rem; }
.decide label { margin-top: .5rem; }
