/* Lagergrad – Oberfläche. Dunkelblaue Navigation, helle Arbeitsflächen, türkise Akzente. */
:root {
  --navy-900: #071a33; --navy-800: #0b2545; --navy-700: #13345f; --navy-600: #1d4677;
  --teal-700: #0a7285; --teal-600: #0b879c; --teal-500: #0ea5b7; --teal-100: #d5f3f6;
  --bg: #f3f6f9; --surface: #ffffff; --surface-2: #f8fafc; --border: #dbe3ec; --border-strong: #c3cfdc;
  --text: #0f1f33; --text-2: #415166; --text-3: #6a7a8f;
  --green: #166534; --green-bg: #dcfce7; --blue: #1e40af; --blue-bg: #dbeafe;
  --violet: #5b21b6; --violet-bg: #ede9fe; --orange: #9a3412; --orange-bg: #ffedd5;
  --red: #991b1b; --red-bg: #fee2e2; --grey: #334155; --grey-bg: #e2e8f0;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(15, 31, 51, .06), 0 2px 8px rgba(15, 31, 51, .05);
  --touch: 44px; --sidebar: 256px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--teal-700); }
a:hover { color: var(--teal-600); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy-800); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--teal-500); outline-offset: 2px; }
.muted { color: var(--text-3); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Logo */
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; }
.logo-mark { font-weight: 800; letter-spacing: -.03em; font-size: 1.55rem; line-height: 1; color: #fff; }
.logo-mark .lg-g { color: var(--teal-500); }
.logo-mark sup { font-size: .6em; vertical-align: .55em; margin-left: .03em; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; }
.logo-claim { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; margin-top: .2rem; }
.logo--dark .logo-mark { color: var(--navy-800); }
.logo--large .logo-mark { font-size: 3.4rem; }
.logo--large .logo-name { font-size: 1.9rem; }
.logo--large .logo-claim { font-size: .78rem; }
.logo--stack { flex-direction: column; gap: .4rem; text-align: center; }
.logo--stack .logo-text { align-items: center; }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--navy-800); color: #dce6f2; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; overflow-y: auto; }
.sidebar-head { padding: 1.1rem 1.1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; }
.sidebar-head .logo { color: #fff; }
.sidebar-head .logo-claim { letter-spacing: .08em; font-size: .56rem; }
.sidebar-head .logo-name { font-size: 1.15rem; }
.nav { list-style: none; margin: 0; padding: .6rem .6rem 1rem; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #8ea3bf; padding: .9rem .75rem .3rem; }
.nav a { display: flex; align-items: center; gap: .7rem; min-height: var(--touch); padding: .45rem .75rem; border-radius: var(--radius-sm); color: #dce6f2; text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--navy-700); color: #fff; }
.nav a.is-active { background: var(--teal-600); color: #fff; }
.nav a .icon { opacity: .9; }
.sidebar-foot { margin-top: auto; padding: 1rem 1.1rem; font-size: .72rem; color: #8ea3bf; letter-spacing: .14em; text-transform: uppercase; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy-800); color: #fff; display: flex; align-items: center; gap: .75rem; padding: .55rem 1.25rem; min-height: 60px; }
.topbar .search { flex: 1; max-width: 560px; position: relative; }
.topbar .search input { width: 100%; min-height: var(--touch); border-radius: 999px; border: 0; padding: .5rem 1rem .5rem 2.6rem; font-size: .95rem; background: #fff; color: var(--text); }
.topbar .search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.topbar .btn-icon { color: #fff; background: transparent; border-color: transparent; }
.topbar .btn-icon:hover { background: var(--navy-700); }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; min-height: var(--touch); padding: 0 .5rem; border-radius: 999px; }
.user-chip:hover { background: var(--navy-700); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-500); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.btn.menu-toggle { display: none; }
.content { padding: 1.5rem 1.5rem 3rem; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-2); margin: .2rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { font-size: .85rem; color: var(--text-3); margin-bottom: .35rem; }
.breadcrumb a { color: var(--text-3); }
.backdrop { display: none; }

/* ---------------------------------------------------------------- Karten, Raster */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.1rem; }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { padding: .8rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.kpi { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); min-height: 84px; }
.kpi:hover { border-color: var(--teal-500); color: var(--text); }
.kpi-icon { width: 46px; height: 46px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
.kpi-icon .icon { width: 24px; height: 24px; }
.kpi-value { font-size: 1.55rem; font-weight: 750; line-height: 1.1; }
.kpi-label { color: var(--text-2); font-size: .85rem; }
.c-teal { background: var(--teal-600); } .c-green { background: #15803d; } .c-blue { background: #1d4ed8; } .c-violet { background: #6d28d9; } .c-orange { background: #c2410c; } .c-red { background: #b91c1c; } .c-navy { background: var(--navy-700); } .c-grey { background: #475569; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; padding: .9rem .6rem; min-height: 92px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--navy-800); font-weight: 600; font-size: .9rem; }
.quick a:hover { border-color: var(--teal-500); background: var(--teal-100); }
.quick a .icon { width: 28px; height: 28px; color: var(--teal-600); }
.quick a.primary { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.quick a.primary .icon { color: #fff; }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--touch); padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy-800); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); border-color: var(--navy-600); color: var(--navy-800); }
.btn-primary { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.btn-dark { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); color: #fff; }
.btn-danger { background: #fff; border-color: #f1b4b4; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .88rem; }
.btn-lg { min-height: 52px; padding: .7rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: var(--touch); padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1.1rem; }
.pager-links { display: flex; flex-wrap: wrap; gap: .3rem; }
.pager .is-current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pager-info { color: var(--text-3); font-size: .88rem; margin: 0; }

/* ---------------------------------------------------------------- Badges (Farbe + Text + Symbol) */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; line-height: 1.35; white-space: nowrap; border: 1px solid transparent; }
.badge-icon { font-size: .7em; }
.badge-green { background: var(--green-bg); color: var(--green); border-color: #a7e3bb; }
.badge-blue { background: var(--blue-bg); color: var(--blue); border-color: #b4cbf5; }
.badge-violet { background: var(--violet-bg); color: var(--violet); border-color: #cdbff5; }
.badge-orange { background: var(--orange-bg); color: var(--orange); border-color: #f8c69a; }
.badge-red { background: var(--red-bg); color: var(--red); border-color: #f3b3b3; }
.badge-grey { background: var(--grey-bg); color: var(--grey); border-color: #cbd5e1; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .62rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { background: var(--surface-2); color: var(--text-2); font-weight: 650; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.table tbody tr:hover { background: #f8fbfd; }
.table td.actions { white-space: nowrap; text-align: right; }
.table a.row-link { font-weight: 600; text-decoration: none; color: var(--navy-800); }
.table a.row-link:hover { color: var(--teal-700); text-decoration: underline; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-muted td { color: var(--text-3); }
.table-compact th, .table-compact td { padding: .42rem .6rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-3); }

/* Responsive Tabellen: unter 760px als Karten */
@media (max-width: 760px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--border); padding: .55rem .2rem; }
  .table-cards td { border: 0; padding: .25rem .75rem .25rem calc(38% + 1.25rem); position: relative; text-align: right; overflow-wrap: anywhere; min-height: 1.9rem; }
  .table-cards td::before { content: attr(data-label); position: absolute; left: .75rem; top: .3rem; width: 38%; color: var(--text-3); font-size: .8rem; text-align: left; }
  .table-cards td .badges { justify-content: flex-end; }
  .table-cards td.actions, .table-cards td[data-label=""] { padding-left: .75rem; }
  .table-cards td.actions::before, .table-cards td[data-label=""]::before { display: none; }
}

/* ---------------------------------------------------------------- Formulare */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.1rem; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.logo-preview { border: 1px dashed var(--border); border-radius: var(--radius); height: 110px; display: flex; align-items: center; justify-content: center; padding: .75rem; margin-bottom: 1rem; background: #fff; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; }
.perm-matrix .group td { background: var(--surface-2); font-weight: 700; text-align: left; }
.audit-diff { margin: 0; padding: 0; list-style: none; font-size: .82rem; }
.audit-diff li { padding: .1rem 0; overflow-wrap: anywhere; }
.audit-diff .old { color: var(--red); text-decoration: line-through; }
.audit-diff .new { color: var(--green); }
.search-group h2 { font-size: 1rem; }
.upload-btn { position: relative; overflow: hidden; cursor: pointer; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 0; }
.upload-btn:focus-within { outline: 3px solid var(--teal-600); outline-offset: 2px; }
.upload-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.upload-list li { padding: .15rem 0; overflow-wrap: anywhere; }
.list-links { list-style: none; margin: 0; padding: 0; }
.list-links li + li { border-top: 1px solid var(--border); }
.list-links a { display: block; padding: .7rem 1.1rem; min-height: var(--touch); text-decoration: none; color: var(--text); }
.list-links a:hover, .list-links a:focus-visible { background: var(--surface-2); }
.form-grid .span-2, .form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .9rem; color: var(--navy-800); }
.field .hint { font-size: .8rem; color: var(--text-3); }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=url], input[type=month], select, textarea {
  width: 100%; min-height: var(--touch); padding: .55rem .75rem; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-500); outline: 3px solid rgba(14,165,183,.2); outline-offset: 0; }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
input[type=file] { font: inherit; min-height: var(--touch); padding: .4rem 0; max-width: 100%; }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--touch); cursor: pointer; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.check > span { min-width: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--teal-600); flex: 0 0 auto; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.field-error { color: var(--red); font-size: .85rem; margin: 0; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.input-group { display: flex; gap: .5rem; }
.input-group > input, .input-group > select { flex: 1; min-width: 0; }
@media (max-width: 520px) { .input-group { flex-wrap: wrap; } .input-group > input[type=text], .input-group > input[type=search], .input-group > input:not([type]) { flex: 1 1 100%; } }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon > input { padding-left: 2.6rem; }
.input-icon .toggle-pw { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.input-icon.has-toggle > input { padding-right: 3.2rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; align-items: center; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; color: var(--navy-800); padding: 0 .4rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; align-items: end; }
.filters .field > label { font-size: .8rem; }

/* ---------------------------------------------------------------- Meldungen */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; }
.alert .icon { margin-top: .1rem; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #a7e3bb; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f3b3b3; }
.alert-warning { background: var(--orange-bg); color: var(--orange); border-color: #f8c69a; }
.alert-info { background: var(--teal-100); color: var(--teal-700); border-color: #a5e3ea; }
.alert ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.warn-box { border: 2px solid #c2410c; background: var(--orange-bg); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.warn-box.is-red { border-color: #b91c1c; background: var(--red-bg); }

/* ---------------------------------------------------------------- Details/Definitionen */
.dl { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--text-3); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.status-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem; background: var(--surface-2); }
.status-tile .label { display: block; font-size: .75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; min-height: var(--touch); display: inline-flex; align-items: center; text-decoration: none; color: var(--text-2); border-bottom: 3px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs a.is-active { color: var(--teal-700); border-bottom-color: var(--teal-600); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.photos figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photos img { display: block; width: 100%; height: 110px; object-fit: cover; }
.photos figcaption { padding: .3rem .4rem; font-size: .75rem; display: flex; justify-content: space-between; gap: .25rem; align-items: center; }
.qr-box { display: inline-block; padding: .5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-box svg { width: 140px; height: 140px; display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--teal-500); border: 2px solid #fff; }
.timeline .when { font-size: .8rem; color: var(--text-3); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { border-bottom: 1px solid var(--border); }
.tree .node { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; min-height: var(--touch); flex-wrap: wrap; }
.tree .node .grow { flex: 1; min-width: 160px; }
.progress { height: 10px; background: var(--grey-bg); border-radius: 999px; overflow: hidden; }
.progress > span, .progress-bar { display: block; height: 100%; background: var(--teal-600); transition: width .3s; }
.kpis-small .kpi { flex-direction: column; align-items: flex-start; gap: .2rem; min-height: 0; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; }
.steps li { padding: .35rem .75rem; border-radius: 999px; background: var(--grey-bg); color: var(--text-2); font-size: .85rem; font-weight: 600; }
.steps li.current { background: var(--teal-600); color: #fff; }
.steps li.done { background: var(--teal-100); color: var(--teal-700); }
.steps li.done::before { content: '✓ '; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.calendar .dow { background: var(--surface-2); font-weight: 650; font-size: .78rem; text-transform: uppercase; padding: .4rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.calendar .day { min-height: 98px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .3rem; font-size: .8rem; min-width: 0; }
.calendar .day.other { background: var(--surface-2); color: var(--text-3); }
.calendar .day.today { box-shadow: inset 0 0 0 2px var(--teal-500); }
.calendar .num { font-weight: 700; display: block; margin-bottom: .2rem; }
.calendar .ev { display: block; background: var(--violet-bg); color: var(--violet); border-radius: 4px; padding: .1rem .3rem; margin-bottom: .2rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.calendar .ev.setup { background: var(--grey-bg); color: var(--grey); }

/* Scan */
.scan-area { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.scan-video { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-video .frame { position: absolute; inset: 18%; border: 3px solid rgba(14,165,183,.9); border-radius: 12px; pointer-events: none; }
.scan-status { font-size: .9rem; color: var(--text-2); }
.scan-input { font-size: 1.2rem !important; letter-spacing: .04em; }
.list-builder .line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--surface); }
.offline-banner { position: sticky; top: 60px; z-index: 25; background: var(--orange-bg); color: var(--orange); border-bottom: 1px solid #f8c69a; padding: .5rem 1rem; font-weight: 600; text-align: center; }
.sig-pad { border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; width: 100%; height: 200px; display: block; }
.pdf-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.pdf-pages figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem; background: #fff; text-align: center; font-size: .8rem; }
.pdf-pages canvas { width: 100%; height: auto; display: block; }
.pdf-pages figure.is-selected { outline: 3px solid var(--teal-500); }

dialog.modal { border: 0; border-radius: var(--radius); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(7,26,51,.55); }
dialog.modal .card-body { padding: 1.2rem; }

/* ---------------------------------------------------------------- Login */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: #f4f7fa; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 2.5rem 1rem 2rem; }
.auth-logo { margin-bottom: 1.8rem; }
.auth-logo .logo-mark { color: var(--navy-900); }
.auth-logo .logo-name { color: var(--navy-900); }
.auth-logo .logo-name b { color: var(--teal-600); font-weight: 700; }
.auth-logo .logo-claim { color: var(--navy-900); opacity: .85; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 30px rgba(15,31,51,.07); padding: 2rem 1.75rem; }
.auth-card h1 { text-align: center; font-size: 1.75rem; margin-bottom: .3rem; }
.auth-card .lead { text-align: center; color: var(--text-2); margin-bottom: 1.5rem; }
.auth-card .field { margin-bottom: 1rem; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.auth-foot { border-top: 1px solid var(--border); padding: 1rem 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--text-3); }
.auth-foot a { color: var(--text-2); text-decoration: none; margin-left: 1rem; }
.auth-foot a:hover { text-decoration: underline; }
.otp-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem; }
.legal-text { white-space: pre-wrap; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 20px rgba(0,0,0,.25); }
  .nav-open .sidebar { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(7,26,51,.5); z-index: 35; }
  .main { margin-left: 0; }
  .btn.menu-toggle { display: inline-flex; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-area { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .content { padding: 1rem 1rem 2.5rem; }
  .topbar { padding: .5rem .75rem; gap: .4rem; }
  .topbar .user-name { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge { white-space: normal; max-width: 100%; }
  .badges { max-width: 100%; }
  .form-grid .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .kpi { padding: .7rem; gap: .55rem; min-height: 72px; }
  .kpi-icon { width: 38px; height: 38px; }
  .kpi-value { font-size: 1.25rem; }
  .kpi-label { font-size: .78rem; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .dl dd { margin-bottom: .5rem; }
  h1 { font-size: 1.35rem; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .calendar .day { min-height: 64px; font-size: .7rem; padding: .2rem; }
  .calendar .ev { font-size: .65rem; }
  .recovery-codes { grid-template-columns: minmax(0, 1fr); }
  .auth-card { padding: 1.5rem 1.1rem; }
  .logo--large .logo-mark { font-size: 2.8rem; }
  .logo--large .logo-name { font-size: 1.6rem; }
}
@media print {
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
.logo-name b { color: var(--teal-500); font-weight: inherit; }
.auth-logo .logo-name b { color: var(--teal-600); }
