:root {
  /* EQUANS: Navy #00233B, Grün #6BBA93 / #3F7F6E */
  --brand-navy: #00233b;
  --brand-green: #6bba93;
  --brand-green-dark: #3f7f6e;
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-2: #f5f8f9;
  --border: #dbe3e7;
  --border-strong: #b5c3cb;
  --text: #0f2230;
  --muted: #56697a;
  --primary: #00233b;
  --primary-hover: #0b3a57;
  --primary-soft: #e3edf1;
  --on-primary: #ffffff;
  --accent: #2e7d5b;
  --accent-soft: #e3f3ea;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn: #8a5d00;
  --warn-soft: #fff4d6;
  --input-bg: #ffffff;
  --row-alt: #f8fafb;
  --focus: #3f7f6e;
  --shadow: 0 1px 2px rgba(0, 35, 59, .06), 0 4px 16px rgba(0, 35, 59, .06);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1620; --surface: #0f202c; --surface-2: #132837; --border: #213a4a; --border-strong: #33505f;
    --text: #e4edf1; --muted: #93a8b5; --primary: #6bba93; --primary-hover: #82c9a6; --primary-soft: #163a31; --on-primary: #00233b;
    --accent: #6bba93; --accent-soft: #163a31; --danger: #f2877f; --danger-soft: #3a1f1d; --warn: #e6b450; --warn-soft: #3a3019;
    --input-bg: #0b1b25; --row-alt: #112533; --focus: #6bba93; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: var(--primary); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); }
.pos { color: var(--accent); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- Buttons & Inputs ---------- */
button, .btn {
  font: inherit; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap; min-height: 36px;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary:hover { background: var(--primary-hover); }
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.icon { padding: 6px 9px; min-width: 36px; justify-content: center; }
button.sm { min-height: 28px; padding: 3px 9px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 7px 9px; min-height: 36px; width: 100%;
}
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 8px 18px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; white-space: nowrap; color: var(--text); text-decoration: none; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
.brand .appname { padding-left: 12px; border-left: 1px solid var(--border-strong); color: var(--muted); font-weight: 600; letter-spacing: .02em; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--brand-navy) 0%, var(--brand-green-dark) 45%, var(--brand-green) 100%); }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; }
.nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.topbar select { width: auto; min-width: 180px; }
.usermenu { display: flex; align-items: center; gap: 6px; }
main { padding: 18px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-b { padding: 16px; }
.section-gap { margin-top: 16px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: 100%; max-width: 400px; }
.auth .card-b { padding: 26px; }
.auth h1 { margin-bottom: 4px; }
.auth .brand { margin-bottom: 18px; justify-content: center; font-size: 17px; }
.auth form > * + * { margin-top: 14px; }
.auth button.primary { width: 100%; justify-content: center; min-height: 42px; }
.otp-input { font-family: var(--mono); font-size: 24px; letter-spacing: 8px; text-align: center; }
.qr { display: block; margin: 8px auto; border-radius: 8px; background: #fff; padding: 6px; }
.secret { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 8px; border-radius: 6px; text-align: center; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--mono); font-size: 15px; }
.codes div { background: var(--surface-2); border: 1px solid var(--border); padding: 6px; border-radius: 6px; text-align: center; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--primary-soft); color: var(--primary); }

/* ---------- Woche ---------- */
.weekbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.weekbar .kw { font-size: 21px; font-weight: 700; min-width: 128px; text-align: center; }
.weekbar .range { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.badge.offen { }
.badge.eingereicht { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.freigegeben { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.savestate { font-size: 12.5px; color: var(--muted); min-width: 90px; }
.savestate.err { color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat input { font-size: 20px; font-weight: 700; padding: 2px 6px; width: 90px; min-height: 0; margin-top: 2px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.rap { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; }
table.rap th, table.rap td { border-bottom: 1px solid var(--border); padding: 0; text-align: left; vertical-align: middle; }
table.rap thead th { background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--muted); padding: 7px 6px; position: sticky; top: 0; border-bottom: 1px solid var(--border-strong); }
table.rap thead th.day { text-align: center; }
table.rap thead th.day .dn { display: block; color: var(--text); font-size: 13px; }
table.rap thead th.day.today { color: var(--primary); background: var(--primary-soft); }
table.rap thead th.day.today .dn { color: var(--primary); }
table.rap thead th.day.we, table.rap td.we { background: var(--row-alt); }
table.rap td input { border: 1px solid transparent; border-radius: 0; background: transparent; min-height: 34px; padding: 5px 7px; }
table.rap td input:hover { border-color: var(--border); }
table.rap td input:focus { border-color: var(--focus); background: var(--input-bg); outline: none; box-shadow: inset 0 0 0 1px var(--focus); }
table.rap td.h input { text-align: center; font-variant-numeric: tabular-nums; }
table.rap td.h input.bad { color: var(--danger); background: var(--danger-soft); }
table.rap col.c-auftrag { width: 170px; } table.rap col.c-komm { width: 88px; } table.rap col.c-day { width: 64px; } table.rap col.c-sum { width: 64px; } table.rap col.c-del { width: 38px; }
table.rap td.sum, table.rap th.sum { text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; padding: 0 6px; background: var(--surface-2); }
table.rap td.del { text-align: center; }
table.rap td.del button { min-height: 28px; padding: 2px 7px; color: var(--muted); border-color: transparent; background: transparent; }
table.rap td.del button:hover { color: var(--danger); background: var(--danger-soft); }
table.rap tr.total td { background: var(--primary-soft); font-weight: 700; padding: 8px 6px; border-top: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); }
table.rap tr.total td.hv { text-align: center; font-variant-numeric: tabular-nums; }
table.rap tr.grand td { background: var(--surface-2); font-weight: 700; padding: 8px 6px; }
table.rap tr.grand td.hv { text-align: center; font-variant-numeric: tabular-nums; }
table.rap td.hv.over { color: var(--danger); }
table.rap tr.cat td.code { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 0 8px; }
table.rap tr.cat td.lbl { font-weight: 550; padding: 0 8px; }
table.rap tr.sep td { background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px 6px; }
table.rap.ro td input { pointer-events: none; }
.tablefoot { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.daychips { display: none; gap: 4px; overflow-x: auto; padding: 10px 12px 0; }
.daychips button { min-width: 46px; justify-content: center; flex-direction: column; gap: 0; line-height: 1.1; padding: 5px 6px; font-size: 13px; }
.daychips button small { font-size: 10.5px; color: var(--muted); }
.daychips button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.daychips button.on small { color: inherit; opacity: .8; }

/* ---------- Jahr ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 650; position: sticky; top: 0; }
table.list th:first-child, table.list td:first-child { text-align: left; }
table.list td.l, table.list th.l { text-align: left; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list tbody tr.click { cursor: pointer; }
table.list tr.future td { color: var(--muted); }
table.list tr.current td { background: var(--primary-soft); }
table.list tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-strong); }
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; }
.kv .v input { width: 110px; text-align: right; }
.kv .total { font-weight: 700; color: var(--text); border-top: 1px solid var(--border); padding-top: 6px; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.pill.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.adm { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 16, 24, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; }
.modal .card-f { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Autocomplete ---------- */
.ac { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); overflow-y: auto; padding: 4px; }
.ac-item { padding: 7px 9px; border-radius: 6px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; align-items: center; }
.ac-item:hover, .ac-item.on { background: var(--primary-soft); }
.ac-item .a { font-weight: 650; font-variant-numeric: tabular-nums; }
.ac-item .b { grid-column: 1; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .k { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ac-item .k small { display: block; color: var(--muted); font-size: 11px; }
.src { font-size: 10.5px; font-weight: 650; padding: 0 5px; border-radius: 4px; margin-left: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: 1px; }
.src.trello { background: #0c66e4; color: #fff; border-color: transparent; }
table.rap td input.komm-warn { color: var(--warn); background: var(--warn-soft); }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: var(--brand-navy); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 90vw; }
#toast div.err { background: var(--danger); }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  main { padding: 12px; }
  .brand .logo { height: 24px; }
  .brand .appname { display: none; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .topbar select { min-width: 0; flex: 1; }
  .nav { order: 3; width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .balances { grid-template-columns: 1fr; }
  .daychips { display: flex; }
  table.rap.oneday { min-width: 0; }
  table.rap.oneday col.c-day, table.rap.oneday .dcol { display: none; }
  table.rap.oneday.day-0 .d0, table.rap.oneday.day-1 .d1, table.rap.oneday.day-2 .d2, table.rap.oneday.day-3 .d3,
  table.rap.oneday.day-4 .d4, table.rap.oneday.day-5 .d5, table.rap.oneday.day-6 .d6 { display: table-cell; }
  table.rap.oneday col.c-auftrag { width: 34%; }
  table.rap.oneday col.c-komm, table.rap.oneday .komm { display: none; }
  table.rap.oneday td.h input { font-size: 16px; }
  table.rap td input { font-size: 16px; } /* verhindert iOS-Zoom */
  .weekbar .kw { min-width: 0; font-size: 18px; }
}
@media print { .topbar, .weekbar button, .tablefoot { display: none; } }
input.mono { font-family: var(--mono); font-size: 13px; }
ol.small { margin: 0; padding-left: 20px; }
ol.small li + li { margin-top: 3px; }

/* ---------- Tages-Trenner ---------- */
table.rap th.dcol, table.rap td.dcol { border-left: 1px solid var(--day-sep); }
table.rap th.d0, table.rap td.d0 { border-left: 2px solid var(--day-sep-strong); }
table.rap th.sum, table.rap td.sum { border-left: 2px solid var(--day-sep-strong); }
table.rap td.dcol + td:not(.dcol):not(.sum), table.rap th.dcol + th:not(.dcol):not(.sum) { border-left: 2px solid var(--day-sep-strong); }
:root { --day-sep: #cfd9df; --day-sep-strong: #9fb2bd; }
@media (prefers-color-scheme: dark) { :root { --day-sep: #2c4a5c; --day-sep-strong: #45697d; } }
@media (max-width: 860px) { table.rap.oneday th.dcol, table.rap.oneday td.dcol { border-left: 2px solid var(--day-sep-strong); } }

/* ---------- Wochentabelle v1.2: Spaltenbreiten, Werkzeugleiste, Handy-Zeilen ---------- */
table.rap th.w-auftrag { width: 150px; }
table.rap th.w-komm { width: 84px; }
table.rap th.w-bem { width: 170px; }
table.rap th.w-del { width: 38px; }
table.rap th.day { width: 62px; }
table.rap th.sum { width: 58px; }
table.rap .mob { display: none; }
.tabletools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tabletools .hint { margin-left: 4px; }
.src.liste { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
button.mobrow { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 8px 10px; cursor: pointer; min-height: 44px; }
button.mobrow:focus-visible { outline: 2px solid var(--focus); }
.mobrow .m-a { font-weight: 650; font-variant-numeric: tabular-nums; }
.mobrow .m-a small { font-weight: 500; color: var(--muted); }
.mobrow .m-b { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
.mobrow .m-c { font-size: 12px; color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
table.rap td.mob.lbl { padding: 8px 10px; font-weight: 550; }
table.rap td.mob.lbl .code { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 4px; }
table.rap tr.total td.mob, table.rap tr.grand td.mob { padding: 10px; }

/* Bearbeitungsfenster */
.modal.rowedit { max-width: 640px; }
.hgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hcell { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.hcell span { font-size: 12.5px; font-weight: 650; }
.hcell span small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.hcell input { text-align: center; font-size: 17px; padding: 8px 4px; font-variant-numeric: tabular-nums; }
.hcell.we input { background: var(--row-alt); }
.hcell.sel input { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.hcell.today span { color: var(--primary); }
.hcell input.bad { color: var(--danger); background: var(--danger-soft); }

@media (max-width: 860px) {
  table.rap.oneday .dt { display: none; }
  table.rap.oneday .mob { display: table-cell; }
  table.rap.oneday th.day { width: 76px; }
  table.rap.oneday td.h input { font-size: 17px; min-height: 44px; }
  .tabletools { padding: 10px; }
  .tabletools button { flex: 1 1 100%; justify-content: center; min-height: 44px; font-size: 15px; }
  .tabletools .hint { display: none; }
  .tablefoot { display: none; }
  .hgrid { grid-template-columns: repeat(4, 1fr); }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal.rowedit { max-width: none; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal .card-f button { flex: 1; justify-content: center; min-height: 44px; }
}

/* ---------- Jahresübersicht: Linien & Gruppen ---------- */
table.list.year th, table.list.year td { border-left: 1px solid var(--day-sep); padding: 7px 8px; }
table.list.year th:first-child, table.list.year td:first-child { border-left: 0; }
table.list.year .g { border-left: 2px solid var(--day-sep-strong); }
table.list.year thead tr.grp th { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--surface); }
table.list.year tbody tr:nth-child(even) td { background: var(--row-alt); }
table.list.year tbody tr.current td { background: var(--primary-soft); }
table.list.year tbody tr:hover td { background: var(--primary-soft); }
table.list.year td.diff, table.list.year th.diff { font-weight: 650; }
table.list.year td.ist { font-weight: 650; }
table.list.year td.zero { color: var(--muted); opacity: .45; }
table.list.year th:first-child, table.list.year td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.list.year thead th:first-child { z-index: 3; background: var(--surface-2); }
table.list.year tfoot td { border-top: 2px solid var(--day-sep-strong); }
.modal.wide { max-width: 980px; }
.daychips { gap: 4px; }
.daychips button { flex: 1 0 44px; min-width: 44px; padding: 5px 2px; font-size: 13px; gap: 1px; }
.daychips button .cd { font-size: 10.5px; opacity: .75; }
.daychips button small { font-size: 11px; font-weight: 650; }

/* Passwort-Auge */
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; min-height: 32px; padding: 4px 8px; color: var(--muted); }
.pw-eye:hover { background: var(--surface-2); color: var(--text); }
.pw-eye[aria-pressed="true"] { color: var(--primary); }

/* Übersicht / Hinweise */
.section-gap-b { margin-bottom: 14px; }
.alert.pending { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wchip:hover { border-color: var(--primary); background: var(--primary-soft); }
.wchip.short { border-color: var(--danger); }
.wchip.ok { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.alert.warn .wchip { background: var(--surface); }
table.list.dash td { vertical-align: top; }

/* ---------- Trennlinien Textspalten (Desktop) ---------- */
table.rap th.tcol, table.rap td.tcol { border-left: 1px solid var(--day-sep); }
table.rap tr.sep td { padding: 0; }
.catsToggle { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 8px 6px; cursor: default;
  font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mobonly { display: none; }
.userbtn .ini { display: none; }

/* =====================================================================
   Handy (≤ 860 px): kompakt, Aufträge sofort sichtbar
   ===================================================================== */
@media (max-width: 860px) {
  body { font-size: 15px; }
  main { padding: 10px 10px 40px; }
  .mobonly { display: inline; }

  /* Kopfzeile: eine kompakte Zeile + Navigation darunter */
  .topbar { padding: 6px 10px; gap: 6px 8px; min-height: 0; }
  .brand .logo { height: 22px; }
  .usermenu { margin-left: auto; gap: 2px; }
  .userbtn { min-height: 34px; padding: 4px 8px; }
  .userbtn .full { display: none; }
  .userbtn .ini { display: inline; font-weight: 700; letter-spacing: .03em; }
  .logoutbtn { min-height: 34px; padding: 4px 8px; font-size: 13px; }
  .topbar select { order: 4; width: 100%; flex: 1 1 100%; min-height: 34px; padding: 4px 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 14px; white-space: nowrap; }

  /* Name nur bei fremden Rapporten */
  .ownerrow.me { display: none; }
  .ownerrow h1 { font-size: 17px; }

  /* Wochenleiste: KW-Navigation oben, Aktionen darunter */
  .weekbar { gap: 6px; margin-bottom: 8px; }
  .weekbar > button.icon { min-width: 40px; min-height: 40px; }
  .weekbar .kw { font-size: 18px; min-width: 0; flex: 1; }
  .weekbar .range { order: 10; font-size: 12.5px; }
  .weekbar .badge { order: 11; }
  .weekbar .spacer { display: none; }
  .weekbar .savestate { order: 12; flex: 1 1 100%; min-width: 0; font-size: 12px; }
  .weekbar > button:not(.icon), .weekbar > .btn { order: 13; min-height: 36px; padding: 4px 12px; flex: 1; justify-content: center; }
  .section-gap { margin-top: 10px; }

  /* Kennzahlen als eine schmale Zeile */
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
  .stat { padding: 6px 8px; border-radius: 8px; box-shadow: none; }
  .stat .l { font-size: 10px; letter-spacing: .02em; }
  .stat .v { font-size: 17px; margin-top: 0; }
  .stat .v small { font-size: 10px; }
  .stat input { font-size: 16px; width: 100%; padding: 2px 4px; }

  /* Karte */
  .card-h { padding: 8px 10px; gap: 6px 14px; font-size: 13.5px; }
  .card-h .small.muted { display: none; }
  .tabletools { padding: 8px; gap: 6px; flex-wrap: nowrap; }
  .tabletools button { flex: 1 1 0; min-height: 42px; font-size: 14px; padding: 4px 8px; white-space: normal; line-height: 1.2; }
  .daychips { padding: 8px 8px 0; }

  /* Tabelle: Auftrag links, Stunden rechts */
  table.rap.oneday th.day { width: 72px; }
  .mobrow { padding: 8px 10px; }
  .mobrow .m-b, .mobrow .m-c { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  table.rap.oneday td.h input { font-size: 18px; font-weight: 600; min-height: 48px; }
  table.rap tr.orow td.mob { border-bottom: 1px solid var(--border); }

  /* Kategorien: nur benutzte, Rest per Tipp */
  .catsToggle { cursor: pointer; padding: 12px 10px; }
  table.rap tr.cat { display: none; }
  table.rap tr.cat.hasval, table.rap.cats-open tr.cat { display: table-row; }
  table.rap .ct-less { display: none; }
  table.rap.cats-open .ct-more { display: none; }
  table.rap.cats-open .ct-less { display: inline; }

  /* Jahresübersicht */
  .balances { gap: 10px; }
  .kv { gap: 4px 10px; font-size: 14px; }
  .kv .v input { width: 90px; }
  table.list.year th, table.list.year td { padding: 6px; font-size: 13px; }

  /* Übersicht */
  table.list.dash th:nth-child(2), table.list.dash td:nth-child(2) { display: none; }
}

@media (max-width: 860px) { .weekbar > button.todaybtn { order: 0; flex: 0 0 auto; min-height: 40px; } }
@media (max-width: 860px) {
  .weekbar .kw { white-space: nowrap; flex: 1 1 auto; text-align: center; }
  .weekbar .range { flex: 1 1 auto; }
}

/* Kilometerstand */
.kmbox { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-left: 4px solid var(--brand-green); }
.kmbox .kmicon { font-size: 26px; }
.kmbox .kmtxt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kmbox .kmtxt .pill { align-self: flex-start; margin-top: 2px; }
.kmbox .kmin { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.kmbox .kmin input { width: 150px; font-size: 18px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.kmbox .kmin input.bad { color: var(--danger); background: var(--danger-soft); }
.kmmsg.warn { color: var(--warn); } .kmmsg.neg { color: var(--danger); } .kmmsg.pos { color: var(--accent); }
.carrow .plate { max-width: 220px; }
@media (max-width: 860px) {
  .kmbox { flex-wrap: wrap; padding: 10px 12px; gap: 8px 10px; }
  .kmbox .kmicon { font-size: 22px; }
  .kmbox .kmin { flex: 1 1 100%; }
  .kmbox .kmin input { flex: 1; width: auto; min-height: 46px; }
}
@media (max-width: 860px) { .topbar { position: static; } }
input.yearin { width: 90px; }
.cardetails { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.kmwarn { border-left: 4px solid var(--danger); }
