/* VeroCheck – Oberfläche (modernes Design, Stand 2026-11) */
:root {
  --bg: #f3f5f9; --card: #fff; --ink: #101828; --muted: #5b6676; --line: #e4e8ef; --line-strong: #cfd6e0;
  --brand: #0b6e79; --brand-dark: #08545d; --brand-soft: #e3f3f4; --brand-ink: #fff; --accent: #14b8a6;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #92400e; --warn-bg: #fff6e0; --warn-line: #f5d68a;
  --alarm: #b42318; --alarm-bg: #fdecea; --alarm-line: #f6c2bc; --info-bg: #e8f1fb; --focus: #2b7de9;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 32px rgba(16,24,40,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 .7rem; }
h3 { font-size: 1rem; font-weight: 650; margin: .7rem 0 .4rem; }

/* Kopfbereich */
.stage-banner { background: #fff4d6; color: #7a4b00; text-align: center; padding: .3rem 1rem; font-size: .82rem; font-weight: 600; border-bottom: 1px solid var(--warn-line); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.2rem; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); color: var(--ink); padding: .6rem 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; }
.brand #product-name { display: inline-flex; align-items: center; gap: .5rem; color: var(--brand-dark); }
.brand #product-name::before { content: ""; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.brand img { height: 30px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; border: 1px solid var(--line); }
.tenant-name { font-weight: 500; color: var(--muted); font-size: .92rem; border-left: 1px solid var(--line-strong); padding-left: .7rem; letter-spacing: 0; }
#nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
#nav a { color: var(--muted); font-weight: 600; text-decoration: none; padding: .45rem .9rem; border-radius: 999px; transition: background .15s, color .15s; }
#nav a:hover { background: #f0f3f7; color: var(--ink); }
#nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.userbox { display: flex; gap: .5rem; align-items: center; font-size: .9rem; color: var(--muted); }
.userbox #user-name { font-weight: 600; color: var(--ink); margin-right: .2rem; }
.userbox .ghost, .userbox .ghost-link { color: var(--ink); border-color: var(--line-strong); background: #fff; }

main { padding: 1.6rem 1.5rem 3rem; max-width: 1640px; margin: 0 auto; outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.card.narrow, .card.login { max-width: 420px; margin: 4rem auto; display: flex; flex-direction: column; gap: .5rem; padding: 2rem; box-shadow: var(--shadow-lg); }
.login h1 { color: var(--ink); display: flex; align-items: center; gap: .6rem; font-size: 1.5rem; }
.login h1::before { content: ""; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); flex: none; }
.login button.primary { margin-top: .6rem; padding: .7rem; }

/* Formulare */
label { font-weight: 600; font-size: .86rem; color: #344054; }
input, select, textarea, button, .button { font: inherit; }
input, select, textarea { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .7rem; background: #fff; color: var(--ink); min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b3bdca; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,110,121,.15); }
button:focus-visible, a:focus-visible, .clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input.needs { border-color: #e0a100; background: #fffbf0; }
input:disabled, select:disabled { background: #f4f6f9; color: #475467; }

/* Schaltflächen */
button, .button { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); padding: .5rem 1rem; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-block; font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: background .15s, border-color .15s, transform .05s; }
button:hover, .button:hover { background: #f5f7fa; border-color: #b3bdca; }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 1px 2px rgba(16,24,40,.1), inset 0 1px 0 rgba(255,255,255,.12); }
button.primary:hover, .button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button.danger { background: var(--alarm); color: #fff; border-color: var(--alarm); }
button.danger:hover { background: #912018; }
button.ghost { background: transparent; box-shadow: none; }
.ghost-link { text-decoration: none; padding: .4rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 600; }
.small-btn { padding: .3rem .7rem; font-size: .85rem; }
.button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.mr { margin-right: .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn-text { color: var(--warn); }
.alarm-text { color: var(--alarm); }
.form-error { color: var(--alarm); min-height: 1.2em; margin: .2rem 0; font-weight: 500; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Import */
.dropzone { border: 2px dashed #b6c6d4; border-radius: var(--radius); background: linear-gradient(180deg, #fff, #f8fbfc); padding: 2.6rem 2rem; text-align: center; margin-bottom: 1.2rem; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--brand-soft); border-color: var(--brand); }
.dropzone .big { font-size: 1.25rem; font-weight: 700; margin: 0 0 .3rem; }
.dropzone .row { justify-content: center; }

/* Tabellen */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; background: #f8fafc; }
.table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; transition: background .1s; }
.table tr.clickable:hover td { background: #f3f8f9; }
.table tr.review td { background: #fffcf3; }
.table tr.alarm-row td { background: #fff7f6; }

/* Statusmarken */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; margin-right: .3rem; white-space: nowrap; border: 1px solid transparent; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st-wartet { background: #f0f2f5; color: #475467; }
.st-verarbeitung { background: var(--info-bg); color: #1c4f7a; }
.st-erkannt { background: var(--ok-bg); color: var(--ok); }
.st-pruefen { background: var(--warn-bg); color: var(--warn); border-color: #f8e2a8; }
.st-fehler, .st-abgelehnt { background: var(--alarm-bg); color: var(--alarm); }
.st-vorhanden { background: #f0eafb; color: #4b2a83; }
.st-manuell { background: #e8f0ff; color: #1d4ea0; }
.st-fall { background: var(--alarm-bg); color: var(--alarm); border-color: var(--alarm-line); }
.kind-doppelfahrt { background: var(--alarm); color: #fff; }
.kind-doppelverordnung { background: var(--warn-bg); color: var(--warn); }
.kind-manuell { background: #f0f2f5; color: #475467; }

/* Hinweise */
.notice { border-radius: var(--radius-sm); padding: .85rem 1.1rem; margin-bottom: 1.1rem; border: 1px solid; border-left-width: 5px; }
.notice ul { margin: .3rem 0 0 1.2rem; padding: 0; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: #e0a100; }
.notice.ok { background: var(--ok-bg); border-color: #b4e0c3; border-left-color: var(--ok); }
.notice.alarm { background: var(--alarm-bg); border-color: var(--alarm-line); border-left-color: var(--alarm); color: #6d1710; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; padding: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters input[type=search] { min-width: 240px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.split.two { grid-template-columns: 1fr 1fr; }
.split .left { position: sticky; top: 4.5rem; }

/* Formularansicht */
.viewer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; box-shadow: var(--shadow); }
.tabs { display: inline-flex; gap: .2rem; flex-wrap: wrap; margin-bottom: .6rem; background: #f0f3f7; padding: .25rem; border-radius: 12px; }
.tabs button { border: 0; background: transparent; box-shadow: none; color: var(--muted); padding: .4rem .9rem; border-radius: 9px; }
.tabs button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.tabs button.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.stage { position: relative; line-height: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 82vh; overflow: auto; background: #fafbfc; }
.page-img { width: 100%; height: auto; display: block; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; border: 2px solid rgba(43,125,233,.5); background: rgba(43,125,233,.05); border-radius: 4px; }
.mark.review { border-color: rgba(224,161,0,.85); background: rgba(255,200,0,.10); }
.mark.active { border: 3px solid #e8590c; background: rgba(232,89,12,.10); box-shadow: 0 0 0 3px rgba(255,255,255,.8); }
.mark span { position: absolute; left: 0; top: -1.4em; background: #e8590c; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.35; padding: 0 .35rem; border-radius: 4px; white-space: nowrap; }
.viewer-foot { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; padding: .5rem; border-radius: var(--radius-sm); transition: background .15s; }
.field:focus-within { background: #f6fafb; }
.field.review { background: #fffaf0; box-shadow: inset 0 0 0 1px var(--warn-line); }
.field .meta { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; min-height: 1.4em; font-size: .82rem; color: var(--muted); }
.facts { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.facts > * { background: #f4f6f9; border-radius: 999px; padding: .2rem .7rem; }
.trips input[type=date] { width: 9.5rem; }
.add-trip { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.case-side h3 a { word-break: break-all; }
.decision textarea { width: 100%; }
.decision .row button { min-width: 11rem; }
.check { font-weight: 500; display: inline-flex; gap: .3rem; align-items: center; margin-right: .8rem; font-size: .88rem; }
.logo-preview { height: 40px; }
input.wide { width: 100%; margin: .3rem 0; }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; background: #1d2939; color: #fff; padding: .8rem 1.1rem; border-radius: 12px; max-width: 420px; box-shadow: var(--shadow-lg); z-index: 50; font-weight: 500; }
.toast.ok { background: var(--ok); } .toast.warn { background: #8a5a00; } .toast.err { background: var(--alarm); }
.error h2 { color: var(--alarm); }
.err-text { color: var(--alarm); font-weight: 600; }
@media (max-width: 1100px) { .split, .split.two { grid-template-columns: 1fr; } .split .left { position: static; } .fields { grid-template-columns: 1fr; } }

/* Korrekturen nach Oberflächentest */
[hidden] { display: none !important; }
.pagebox { position: relative; }
.pagebox .overlay { position: absolute; inset: 0; pointer-events: none; }
.card { overflow-x: auto; }
.table input, .table select { max-width: 10rem; }
body { overflow-x: hidden; }
@media (max-width: 700px) {
  main, section { max-width: 100vw; }
  main { padding: 1rem .8rem 2rem; }
  .topbar { gap: .5rem; padding: .5rem .8rem; position: static; }
  #nav { order: 3; flex-basis: 100%; }
  .table { font-size: .85rem; }
  .table th, .table td { padding: .45rem .35rem; }
  .filters { display: grid; grid-template-columns: 1fr; gap: .45rem; }
  .filters input, .filters select, .filters button { width: 100%; }
  .card { padding: .8rem; }
  h1 { font-size: 1.35rem; }
}
