/* ZUGFeRD Validator — Portal-Design
   Farbwelt der künftigen LIONHEART-IT-Website: #2E5A8F, #8AA4C6, #E8EDF2, #1A1A1A
   Hell/Dunkel über CSS-Variablen, Startwert aus prefers-color-scheme. */

:root {
  --bg: #F5F8FB;
  --surface: #FFFFFF;
  --surface-2: #EDF2F8;
  --border: #D8E0E8;
  --border-strong: #B8CBE3;
  --text: #1A1A1A;
  --muted: #5D6A7A;
  --primary: #2E5A8F;
  --primary-hover: #234A73;
  --primary-soft: #E4EBF5;
  --accent: #8AA4C6;
  --ok: #1F7A4D;
  --ok-soft: #E3F2EA;
  --warn: #8A5A00;
  --warn-soft: #FCF1DA;
  --err: #B4262B;
  --err-soft: #FBE7E8;
  --shadow: 0 1px 2px rgba(26, 52, 84, .06), 0 8px 24px -16px rgba(26, 52, 84, .25);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 258px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0E151D;
  --surface: #151F29;
  --surface-2: #1B2733;
  --border: #26333F;
  --border-strong: #35485A;
  --text: #E8EDF2;
  --muted: #8A9AAB;
  --primary: #2E5A8F;
  --primary-hover: #3A6EA8;
  --primary-soft: #1B2C3E;
  --accent: #8AA4C6;
  --ok: #4CC38A;
  --ok-soft: rgba(76, 195, 138, .12);
  --warn: #E0B341;
  --warn-soft: rgba(224, 179, 65, .12);
  --err: #F2707A;
  --err-soft: rgba(242, 112, 122, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .92rem; }

p { margin: 0; }

.sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.mono { font-family: var(--mono); font-size: .84em; }
.break { word-break: break-all; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }

/* ── Gerüst ─────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.1rem .85rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); padding: .25rem .4rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #1E4269);
  color: #fff; display: grid; place-items: center;
  font-weight: 750; font-size: .82rem; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .98rem; letter-spacing: .01em; }
.brand-text small { color: var(--muted); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.brand.big .brand-mark { width: 46px; height: 46px; font-size: .95rem; }
.brand.big .brand-text strong { font-size: 1.15rem; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: .9rem .6rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--text); font-size: .9rem; font-weight: 500;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .55; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .nav-item.active { color: #A8C4E4; }
.nav-item.active svg { opacity: .9; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; border-top: 1px solid var(--border); padding-top: .9rem; }
.who { display: flex; align-items: center; gap: .55rem; padding: 0 .3rem .2rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  flex: 0 0 32px;
}
.who-text { min-width: 0; display: flex; flex-direction: column; }
.who-text strong { font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.4rem 2rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-actions { display: flex; align-items: center; gap: .55rem; }

.content { padding: 1.5rem 2rem 2rem; max-width: 1320px; width: 100%; }

.foot { margin-top: 2.5rem; color: var(--muted); font-size: .74rem; border-top: 1px solid var(--border); padding-top: .8rem; }

/* ── Karten & Raster ────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
}
.card.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .9rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.15rem; }

.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .95rem 1.1rem; display: flex; flex-direction: column; gap: .1rem;
  box-shadow: var(--shadow);
}
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat-note { font-size: .78rem; color: var(--muted); }
.stat.tone-ok .stat-value { color: var(--ok); }
.stat.tone-warn .stat-value { color: var(--warn); }
.stat.tone-err .stat-value { color: var(--err); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: .58rem 1rem; font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn.danger:hover { background: var(--err-soft); }
.btn.small { padding: .4rem .7rem; font-size: .8rem; }
.btn.tiny { padding: .28rem .55rem; font-size: .75rem; font-weight: 600; }
.btn.full { width: 100%; }
.btn.icon { padding: .45rem; width: 38px; height: 38px; border-color: var(--border); }
.btn.icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.btn.icon .i-moon { display: none; }
[data-theme="dark"] .btn.icon .i-sun { display: none; }
[data-theme="dark"] .btn.icon .i-moon { display: block; }

.button-col { display: flex; flex-direction: column; gap: .5rem; }

/* ── Formulare ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, .input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: .9rem;
  padding: .55rem .7rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, .input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; align-items: end; }
.form-grid .submit-field { margin-bottom: .75rem; }
.stack-form { display: flex; flex-direction: column; }
.inline-form { display: inline-flex; align-items: center; gap: .35rem; }
.tiny-num { width: 74px; padding: .3rem .4rem; font-size: .8rem; }
.input { display: inline-block; width: auto; }

/* ── Upload ─────────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 2.1rem 1rem;
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type="file"] { display: none; }
.dz-icon svg { width: 34px; height: 34px; fill: var(--primary); opacity: .8; }
.dz-title { font-weight: 600; font-size: .95rem; }
.dz-hint { color: var(--muted); font-size: .8rem; }
.dropzone.has-file .dz-title { color: var(--primary); }
.upload-actions { display: flex; align-items: center; gap: .9rem; margin-top: .9rem; flex-wrap: wrap; }

/* ── Tabellen ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -.2rem; }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th {
  text-align: left; font-size: .71rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: .45rem .55rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: .6rem .55rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table.compact td { padding: .45rem .5rem; }
.table .right, .right { text-align: right; }

/* ── Badges & Marker ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .73rem; font-weight: 650; letter-spacing: .01em;
  padding: .18rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid transparent;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.muted { background: var(--surface-2); color: var(--muted); }
.badge.big { font-size: .82rem; padding: .3rem .8rem; }
[data-theme="dark"] .badge.ok { color: #6FDCA4; }
[data-theme="dark"] .badge.warn { color: #E8C266; }
[data-theme="dark"] .badge.err { color: #F58C94; }

.pill {
  font-size: .73rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: .22rem .6rem; background: var(--surface);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }

/* ── Job-Ansicht ────────────────────────────────────────── */
.status-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.status-card.ok { border-left: 4px solid var(--ok); }
.status-card.warn { border-left: 4px solid var(--warn); }
.status-card.err { border-left: 4px solid var(--err); }
.status-main { display: flex; align-items: center; gap: .9rem; }
.status-main h2 { font-size: 1rem; }
.status-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.zone-title { display: flex; align-items: center; gap: .45rem; margin: 1.1rem 0 .5rem; }
.zone-title.err { color: var(--err); }
.zone-title.warn { color: var(--warn); }
.zone-title:first-of-type { margin-top: .2rem; }
.plain-list, .phase-list, .mini-list, .steps ol { margin: .3rem 0 0; padding-left: 1.1rem; }
.plain-list li, .mini-list li { margin-bottom: .3rem; }
.phase-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.phase-list li { display: flex; align-items: center; gap: .55rem; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin: 0; }
.meta-grid.tight { gap: .5rem .8rem; }
.meta-grid dt { font-size: .71rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.meta-grid dd { margin: .1rem 0 0; font-size: .88rem; }

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.file-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .55rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
}
.file-ico {
  flex: 0 0 auto; font-size: .6rem; font-weight: 700; letter-spacing: .04em;
  padding: .3rem .35rem; border-radius: 6px; background: var(--primary-soft); color: var(--primary);
  min-width: 40px; text-align: center;
}
.file-ico.pdf { background: var(--err-soft); color: var(--err); }
.file-ico.html { background: var(--warn-soft); color: var(--warn); }
.file-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-text strong { font-size: .84rem; font-weight: 600; }
.file-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty {
  display: flex; flex-direction: column; gap: .2rem; align-items: center; text-align: center;
  padding: 2rem 1rem; color: var(--muted); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface-2);
}
.empty strong { color: var(--text); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: .6rem; }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 700;
  display: grid; place-items: center;
}
.steps strong { font-size: .87rem; }
.steps span { grid-column: 2; color: var(--muted); font-size: .82rem; margin-top: -.15rem; }

/* ── Hinweise ───────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: .86rem;
  margin-bottom: .9rem; border: 1px solid transparent;
}
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.err { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
[data-theme="dark"] .alert.ok { color: #7FE0B0; }
[data-theme="dark"] .alert.err { color: #F79AA1; }

.pw-box {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  background: var(--surface-2); border: 1px dashed var(--primary);
  border-radius: var(--radius-sm); padding: .7rem .9rem;
}
.pw-box code { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .04em; color: var(--text); }
.qr { border-radius: 8px; background: #fff; padding: 6px; }

/* ── Anmeldung ──────────────────────────────────────────── */
.login-body { min-height: 100vh; }
.login-split { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-brand {
  background: linear-gradient(150deg, #234A73 0%, #2E5A8F 55%, #5E7EA6 100%);
  color: #fff; padding: 3rem; display: flex; align-items: center; position: relative; overflow: hidden;
}
.login-brand::after {
  content: ""; position: absolute; right: -160px; bottom: -160px; width: 420px; height: 420px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.login-brand .brand-text strong, .login-brand .brand-text small { color: #fff; }
.login-brand .brand-mark { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.login-brand-inner { max-width: 460px; position: relative; z-index: 1; }
.login-brand h2 { font-size: 1.85rem; line-height: 1.25; margin: 2.2rem 0 1.4rem; font-weight: 650; }
.login-points { list-style: none; padding: 0; margin: 0 0 2.4rem; display: flex; flex-direction: column; gap: .7rem; }
.login-points li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; color: rgba(255,255,255,.9); }
.login-legal { font-size: .76rem; color: rgba(255,255,255,.6); letter-spacing: .04em; text-transform: uppercase; }

.login-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.9rem 1.8rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.login-card-head { margin-bottom: 1.2rem; }
.login-card-head h1 { font-size: 1.3rem; }
.login-hint { margin-top: .9rem; font-size: .78rem; color: var(--muted); text-align: center; }

.centered-body { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.error-card {
  max-width: 420px; text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem; align-items: center;
}
.error-code { font-size: .8rem; font-weight: 700; letter-spacing: .2em; color: var(--primary); }

/* ── Responsiv ──────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .login-split { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: .6rem; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .brand-text, .nav-label, .sidebar-foot { display: none; }
  .nav { flex-direction: row; gap: .2rem; }
  .nav-item { white-space: nowrap; padding: .45rem .6rem; }
  .topbar { padding: 1rem 1.1rem .8rem; }
  .content { padding: 1rem 1.1rem 1.5rem; }
  .meta-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .status-main { flex-direction: column; align-items: flex-start; }
}
