/* Order a Tiger – App-Styles (Portal, Admin, Login). Farben wie auf der Website. */
:root {
  --bg: #F2F4F3;
  --surface: #FFFFFF;
  --raised: #E7ECEB;
  --line: #D3DBDA;
  --field-line: #7F8E92;
  --ink: #142024;
  --text: #142024;
  --muted: #4C5A5E;
  --steel: #1B2B30;
  --tiger: #F16513;
  --tiger-hover: #FF7A2E;
  --tiger-text: #A8410A;
  --tiger-soft: rgb(241 101 19 / .12);
  --ok: #1C6B45;
  --ok-soft: #E2F1E8;
  --warn: #8A5A00;
  --warn-soft: #FFF1D6;
  --danger: #B3261E;
  --danger-soft: #FBE7E5;
  --info: #1F5D8C;
  --info-soft: #E3EEF7;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --r: 6px;
  --r-control: 4px;
  --shadow: 0 1px 2px rgb(20 32 36 / .06), 0 2px 8px rgb(20 32 36 / .04);
  --sidebar: 232px;
  --topbar: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--steel); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.75rem; letter-spacing: -0.025em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
a { color: var(--tiger-text); text-underline-offset: 2px; }
a:hover { color: var(--tiger); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--tiger); outline-offset: 2px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: .92em; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* App-Shell */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--steel); color: #fff; }
.topbar .brand { color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--steel); font-weight: 600; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand:hover { color: inherit; }
.brand img { width: 32px; height: 32px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-user form { margin: 0; }
.topbar-name { font-size: .9rem; text-align: right; line-height: 1.2; color: #fff; text-decoration: none; }
.topbar-name:hover { color: #fff; text-decoration: underline; }
.topbar-name small { display: block; color: #AFC0C4; font-size: .78rem; }
.topbar .btn-ghost { color: #fff; border-color: rgb(255 255 255 / .3); }
.topbar .btn-ghost:hover { background: rgb(255 255 255 / .1); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; padding: 6px; cursor: pointer; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; position: sticky; top: calc(var(--topbar) + 16px); }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-control); color: var(--muted); text-decoration: none; font-weight: 500; }
.sidebar a i { font-size: 1.2rem; }
.sidebar a:hover { background: var(--bg); color: var(--steel); }
.sidebar a[aria-current="page"] { background: var(--tiger-soft); color: var(--tiger-text); }
.content { padding: 28px clamp(16px, 3vw, 40px) 64px; max-width: 1280px; width: 100%; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: var(--topbar); left: 0; bottom: 0; width: min(280px, 85vw); z-index: 25; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .topbar-name { display: none; }
  .topbar-user .btn { padding: 6px 8px; font-size: 0; gap: 0; }
  .topbar-user .btn i { font-size: 1.15rem; }
  .brand span { font-size: .98rem; }
}

/* Seitenkopf und Raster */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 24px; }
.page-header .actions, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.section { margin-top: 28px; }

/* Karten und Kennzahlen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; font-size: 1.05rem; }
.card > :last-child { margin-bottom: 0; }
.stat { display: grid; gap: 2px; }
.stat-value { font-size: 1.9rem; font-weight: 500; color: var(--steel); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-accent .stat-value { color: var(--tiger-text); }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); color: var(--steel); font: 500 .94rem/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--field-line); color: var(--steel); }
.btn i { font-size: 1.1em; }
.btn-primary { background: var(--tiger); border-color: var(--tiger); color: var(--ink); }
.btn-primary:hover { background: var(--tiger-hover); border-color: var(--tiger-hover); color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--tiger-text); font: inherit; text-decoration: underline; cursor: pointer; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 500; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; background: #F8FAF9; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFB; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { font-weight: 500; }
.card > .table-wrap { border: 0; margin: -4px -20px -20px; border-radius: 0 0 var(--r) var(--r); }

/* Formulare */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label { font-weight: 500; font-size: .9rem; color: var(--steel); }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--field-line); border-radius: var(--r-control); background: var(--surface); color: var(--text); font: 400 .95rem/1.4 var(--sans);
}
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); border-color: var(--line); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--tiger); width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hint { font-size: .84rem; color: var(--muted); }
.field-error { font-size: .84rem; color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 500; white-space: nowrap; background: var(--raised); color: var(--muted); }
.badge-green { background: var(--ok-soft); color: var(--ok); }
.badge-orange { background: var(--tiger-soft); color: var(--tiger-text); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-gray { background: var(--raised); color: var(--muted); }
.badge-yellow { background: var(--warn-soft); color: var(--warn); }

/* Meldungen */
.flash-list { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); border: 1px solid; font-size: .93rem; }
.flash i { font-size: 1.2rem; flex: none; margin-top: 1px; }
.flash-success { background: var(--ok-soft); border-color: #B5D9C4; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: #EBB8B3; color: var(--danger); }
.flash-info { background: var(--info-soft); border-color: #B8D0E4; color: var(--info); }
.auth-card .flash { margin-bottom: 16px; }

/* Leerzustand, Listen */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: 8px; color: var(--field-line); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }

/* Login-Seiten */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--tiger-soft), transparent 60%), var(--bg); }
.auth-wrap { width: min(420px, 100%); display: grid; gap: 20px; justify-items: center; }
.auth-brand { font-size: 1.25rem; }
.auth-brand img { width: 44px; height: 44px; }
.auth-card { width: 100%; padding: 28px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .form { margin-top: 18px; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: .92rem; }
.auth-foot { font-size: .85rem; color: var(--muted); }
.auth-foot a { color: var(--muted); }

/* Fehlerseite */
.error-page { text-align: center; padding: 32px 8px; }
.error-code { font: 500 3rem/1 var(--sans); color: var(--tiger); margin-bottom: 8px; }
.error-page h1 { margin-bottom: 8px; }

/* Impressum und Datenschutz */
body.legal-page { background: var(--bg); }
.legal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px clamp(16px, 4vw, 48px); background: var(--surface); border-bottom: 1px solid var(--line); }
.legal-top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .94rem; }
.legal-top nav a { color: var(--muted); text-decoration: none; }
.legal-top nav a:hover, .legal-top nav a[aria-current="page"] { color: var(--tiger-text); }
.legal-body { max-width: 760px; margin: 0 auto; padding: 40px 16px 80px; line-height: 1.65; }
.legal-body h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 8px; }
.legal-body h2 { font-size: 1.15rem; margin: 0 0 10px; }
.legal-body section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.legal-body address { font-style: normal; margin-bottom: .75em; }
.legal-body ul { padding-left: 1.2em; margin: 0 0 .75em; }
.legal-body li { margin-bottom: 6px; }
.legal-body code { font-family: var(--mono); font-size: .9em; background: var(--raised); padding: 1px 5px; border-radius: 3px; }
.legal-lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 24px; }
.legal-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin-bottom: 8px; }
.legal-toc ol { margin: 0; padding-left: 1.3em; columns: 2 240px; column-gap: 32px; }
.legal-toc li { margin-bottom: 4px; break-inside: avoid; }
.legal-meta { color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); padding-top: 16px; }
mark.todo { background: var(--tiger-soft); color: var(--tiger-text); padding: 1px 5px; border-radius: 3px; font-weight: 500; }

@media print {
  .topbar, .sidebar, .no-print { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}
