/* ════════════════════════════════════════════════════════════════════════════
   zeity — central stylesheet
   Base taken over from agbooks (tokens, nav, buttons, list rows, fields, toast,
   login, report table) plus the time-tracking parts: entry form with duration
   stepper, saldo bar, month blocks with stats, edit modal.
   ──────────────────────────────────────────────────────────────────────────
    1. Tokens & reset          6. Form fields + pills
    2. CMS navigation          7. Zeiten: entry form, saldo, months
    3. Buttons                 8. Modal
    4. List view + FAB         9. Toast   10. Login   11. Report / admin
    5. Rows                   12. Responsive
   ════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens & reset ──────────────────────────────────────────────────────── */
/* Borna wie bei agp (gleiche Dateien). Beide Schnitte hängen an einer Familie,
   damit font-weight: bold den echten Bold-Schnitt nimmt statt ihn zu fälschen. */
@font-face {
  font-family: 'borna';
  src: url('../fonts/borna-regular-webfont.woff2') format('woff2'),
       url('../fonts/borna-regular-webfont.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'borna';
  src: url('../fonts/borna-bold-webfont.woff2') format('woff2'),
       url('../fonts/borna-bold-webfont.woff') format('woff');
  font-weight: 700; font-style: normal; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }

:root {
  --bg:      #ffffff;
  --surface: #fafafa;
  --border:  #e2e2e2;
  --text:    #1a1917;
  --muted:   #9a9690;
  --accent:  #1a1917;
  --danger:  #c0392b;
  --green:   #2e8b57;
  --green-bg:#e7f6ec;
  --red-bg:  #fbecea;
  --chip:    #f0ede8;

  --sans: 'borna', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: var(--sans);   /* alles in Borna — die Labels bleiben klein/versal gesetzt */

  --text-xs:   12px;
  --text-s:    13px;
  --text-base: clamp(15px, calc(0.9rem + 0.375vw), 18px);
  --text-m:    clamp(17px, calc(1.05rem + 0.5vw), 20px);
  --text-l:    clamp(19px, calc(1.2rem + 0.3vw), 22px);
  --text-xl:   clamp(26px, calc(1.5rem + 1vw), 34px);
  --text-xxl:  clamp(34px, calc(1.8rem + 1.5vw), 48px);

  --radius:      16px;
  --radius-pill: 999px;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.pos { color: var(--green); }
.neg { color: var(--danger); }

/* ── 2. CMS navigation ──────────────────────────────────────────────────────── */
.cms-nav { margin-bottom: 8px; border-bottom: 1px solid var(--border); }

.cms-mainnav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
  max-width: 1200px; margin: 0 auto;
}
.cms-mainnav-links { display: flex; align-items: center; gap: 24px; }
.cms-mainnav-right { display: flex; align-items: center; gap: 16px; }

.cms-main-link {
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: color .15s;
}
.cms-main-link:hover  { color: var(--text); }
.cms-main-link.active { color: var(--text); font-weight: 700; }

.cms-logout {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); text-decoration: none; transition: color .15s;
}
.cms-logout:hover { color: var(--text); }

/* ── 3. Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 7px 16px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--text-m);
  border-radius: var(--radius-pill);
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.75; }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-ghost {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  text-decoration: none;
  line-height: normal;
  display: inline-flex; align-items: center; gap: 6px;
}

.btn-primary {
  background: var(--accent); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; line-height: normal;
}

.btn-danger {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { background: rgba(192, 57, 43, 0.1); color: var(--danger); opacity: 1; }
.btn-danger.locked { opacity: 0.3; cursor: not-allowed; }
.btn-danger.locked:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); opacity: 0.3; }

.icon-trash, .icon-copy, .icon-check, .icon-clock {
  display: inline-block; width: 18px; height: 18px;
  background-color: currentColor;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  flex-shrink: 0;
}
.icon-trash { -webkit-mask-image: url('../img/trash-2.svg'); mask-image: url('../img/trash-2.svg'); }
.icon-copy  { -webkit-mask-image: url('../img/copy.svg');    mask-image: url('../img/copy.svg'); }
.icon-clock { -webkit-mask-image: url('../img/favicon.svg');  mask-image: url('../img/favicon.svg'); width: 20px; height: 20px; }
.icon-check { -webkit-mask-image: url('../img/check.svg');   mask-image: url('../img/check.svg'); }

/* Round icon button on a row (duplicate / delete) */
.row-icon {
  background: rgba(0, 0, 0, 0.06); border: none; border-radius: var(--radius-pill);
  color: var(--muted); cursor: pointer; padding: 8px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.row-icon:hover     { color: var(--text); }
.row-icon.del:hover { background: rgba(192, 57, 43, 0.1); color: var(--danger); }

/* ── 4. List view + FAB ─────────────────────────────────────────────────────── */
#listView { max-width: 1200px; margin: 0 auto; padding: 24px 20px 96px; }
#zeitView { max-width: 900px;  margin: 0 auto; padding: 24px 20px 96px; }

.list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.list-title { font-size: var(--text-xl); font-weight: bold; }

.list-search {
  font-family: var(--sans); font-size: var(--text-m);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: transparent; color: var(--text);
  padding: 6px 14px; outline: none; transition: border-color 0.15s;
  width: 300px; max-width: 100%; margin-left: auto;
  -webkit-appearance: none; appearance: none;
}
.list-search::placeholder { color: var(--muted); }
.list-search:hover, .list-search:focus { border-color: var(--accent); }

.empty-msg { font-family: var(--mono); font-size: var(--text-s); color: var(--muted); padding: 24px 0; }
.empty-msg a { color: var(--text); }

.year-form { margin: 0; font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.year-select {
  font-family: var(--sans); font-size: var(--text-m);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: transparent; color: var(--text); padding: 6px 14px; cursor: pointer;
  outline: none; transition: border-color 0.15s;
}
.year-select:hover, .year-select:focus { border-color: var(--accent); }

.count-pill {
  font-family: var(--mono); font-size: var(--text-xs); color: var(--muted);
  background: var(--chip); border-radius: var(--radius-pill); padding: 3px 10px;
}

/* Customer filter pills (agbooks service filter) */
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-pill {
  font-family: var(--sans); font-size: var(--text-m);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: transparent; color: var(--muted);
  padding: 6px 16px; cursor: pointer; transition: all 0.15s;
}
.filter-pill:hover  { border-color: var(--accent); color: var(--text); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.fab {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); right: 24px;
  height: 48px; padding: 0 2em;
  border-radius: var(--radius-pill);
  background: var(--accent); color: #fff; border: none;
  font-family: var(--sans); font-size: var(--text-l); font-weight: 500;
  cursor: pointer; display: none; align-items: center; gap: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25); transition: opacity 0.15s;
  z-index: 50; white-space: nowrap;
}
.fab:hover   { opacity: 0.8; }
.fab.visible { display: flex; }

/* ── 5. Rows ────────────────────────────────────────────────────────────────── */
.row-list { display: flex; flex-direction: column; gap: 8px; }

.data-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0px;
  border-bottom: 1px solid var(--border);
  /* border-radius: var(--radius); */
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.2s;
}
.data-row:hover { border-color: var(--accent); }

.row-main { flex: 1; min-width: 0; }
.row-name { font-size: var(--text-l); font-weight: bold; line-height: 1.2; }
.row-name.untitled { color: var(--muted); font-weight: normal; font-style: italic; }
.row-sub {
  font-family: var(--mono); font-size: var(--text-xs); color: var(--muted);
  margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.row-amount { font-size: var(--text-l); font-weight: bold; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-lead { display: flex; flex-direction: column; gap: 2px; min-width: 84px; flex-shrink: 0; }
.row-date {font-family: var(--mono);font-size: var(--text-s);color: var(--muted);white-space: nowrap;}

.badge {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  border-radius: var(--radius-pill); padding: 2px 9px; background: var(--chip); color: var(--muted);
}
.badge.pos { background: var(--green-bg); color: var(--green); }
.badge.neg { background: var(--red-bg);   color: var(--danger); }

/* Edit view shell (Kunden) */
#editView { display: none; flex-direction: column; min-height: 100vh; }
#editView.active { display: flex; }
.edit-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.spacer { flex: 1; }
.edit-body { flex: 1; padding: 24px 20px 120px; width: 100%; margin: 0 auto; }

/* ── 6. Form fields + pills ─────────────────────────────────────────────────── */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld label,
.fld-label {
  font-family: var(--mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.fld input,
.fld select,
.fld textarea {
  font-family: var(--sans); font-size: var(--text-base);
  border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text);
  padding: 8px 12px; outline: none; transition: border-color 0.15s; width: 100%;
}
.fld textarea { font-family: var(--mono); font-size: var(--text-s); line-height: 1.5; resize: vertical; }
.fld input:focus,
.fld select:focus,
.fld textarea:focus { border-color: var(--accent); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--muted); }
.fld-hint { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); }

.fld-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }

/* Pill-style checkbox/radio (agbooks .pill-opt) */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-opt { cursor: pointer; line-height: 0; }
.pill-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-opt span {
  display: inline-block; line-height: normal;
  font-family: var(--sans); font-size: var(--text-m);
  text-transform: none; letter-spacing: normal;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  color: var(--muted); background: transparent;
  padding: 7px 16px; transition: all 0.15s; user-select: none;
}
.pill-opt:hover span { border-color: var(--accent); color: var(--text); }
.pill-opt input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.section-label {
  font-family: var(--mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 28px 0 12px; display: block;
}

/* ── 7. Zeiten ──────────────────────────────────────────────────────────────── */
/* Entry form: Leistung | Datum | Dauer | Speichern */
.entry-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 18px 20px; margin-bottom: 28px;
}
.entry-fields {
  display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px auto;
  gap: 14px; align-items: end;
}
.entry-fields .btn { height: 42px; }
.fld input[type="date"] { min-height: 42px; }
.fld input[type="text"] { min-height: 42px; }

/* Duration stepper — pill with −/+ */
.stepper {
  display: flex; align-items: center; height: 42px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg); overflow: hidden; outline: none; transition: border-color 0.15s;
}
.stepper:focus, .stepper:focus-within { border-color: var(--accent); }
.stepper button {
  width: 40px; height: 100%; border: none; background: transparent; flex-shrink: 0;
  font-family: var(--sans); font-size: 20px; color: var(--text); cursor: pointer;
  transition: background 0.1s;
}
.stepper button:hover { background: rgba(0, 0, 0, 0.06); }
.stepper-val {
  flex: 1; text-align: center; white-space: nowrap;
  font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Saldo bar under the form */
.saldo-bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 20px; margin-bottom: 28px; border-radius: var(--radius);
  background: var(--chip);
}
.saldo-bar.pos { background: var(--green-bg); }
.saldo-bar.neg { background: var(--red-bg); }
.saldo-label { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.saldo-val { font-size: var(--text-xl); font-weight: bold; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Month blocks */
.month { margin-bottom: 28px; }
.month-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; margin-bottom: 10px; padding: 0;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--sans); color: var(--text);
}
.month-title { font-size: var(--text-l); font-weight: bold; display: flex; align-items: center; gap: 10px; }
.toggle-icon { font-size: 11px; color: var(--muted); transition: transform .2s; display: inline-block; }
.month.open .toggle-icon { transform: rotate(90deg); }
.month-meta { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }

.month-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px;
  padding: 12px 16px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.month-stats.single { grid-template-columns: 1fr; }
.stat-label { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat-val { font-weight: bold; font-size: var(--text-m); font-variant-numeric: tabular-nums; }

.month-entries { display: none; }
.month.open .month-entries { display: flex; }
.month-entries .empty-msg { padding: 4px 2px 0; }

.data-row.pending { opacity: 0.35; pointer-events: none; }
.data-row.flash { border-color: var(--accent); background: var(--surface); }
.entry-row .row-name { font-size: var(--text-m); font-weight: 600; overflow-wrap: anywhere; }
.entry-row .row-amount { font-size: var(--text-m); }

/* ── 8. Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(26, 25, 23, 0.3);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 560px;
  background: var(--bg); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-title { font-size: var(--text-l); font-weight: bold; }
.modal-fields { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 14px; }
.modal-fields .wide { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── 9. Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  font-family: var(--sans); font-size: var(--text-base);
  background: var(--accent); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-pill); opacity: 0;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 100; white-space: nowrap;
}
.toast.show  { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast-undo { display: flex; align-items: center; gap: 16px; pointer-events: auto; }
.toast-undo button {
  background: none; border: none; color: #fff; cursor: pointer;
  font-family: var(--sans); font-size: var(--text-base); font-weight: 700;
  text-decoration: underline; padding: 0; white-space: nowrap;
}
.toast-undo button:hover { opacity: 0.75; }

/* ── 10. Login ──────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 24px; }
.login-heading { font-size: var(--text-xxl); font-weight: bold; line-height: 1.1; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form input[type="password"] {
  width: 100%; font-family: var(--sans); font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: transparent; color: var(--text); padding: 10px 16px; outline: none; transition: border-color 0.15s;
}
.login-form input[type="password"]:focus { border-color: var(--accent); }
.login-submit {
  width: 100%; padding: 11px 16px; border: none; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff; font-family: var(--sans); font-size: 16px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.login-submit:hover { opacity: 0.8; }
.login-error { font-size: 14px; color: var(--danger); }

/* ── 11. Report / admin ─────────────────────────────────────────────────────── */
#reportView, #adminView { max-width: 1200px; margin: 0 auto; padding: 24px 20px 96px; }
.report-intro { color: var(--muted); font-size: var(--text-s); margin-bottom: 20px; }
.report-intro code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); padding: 1px 5px; border-radius: 5px; }
.report-scroll { overflow-x: auto; }

.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 12px 16px; text-align: left; white-space: nowrap; }
.report-table th {
  font-family: var(--mono); font-size: var(--text-xs); font-weight: normal;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.report-table th a { color: inherit; text-decoration: none; }
.report-table th a:hover { color: var(--text); }
.report-table td { border-bottom: 1px solid var(--border); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table .col-month { font-weight: 500; }
.report-table td.zero { color: var(--border); }
.report-table .sum { font-weight: bold; border-left: 1px solid var(--border); }
.report-table tbody tr:hover td { background: var(--surface); }
.report-table tfoot td { border-bottom: none; border-top: 2px solid var(--text); font-weight: bold; padding-top: 14px; }

.backup-row .row-name { font-size: var(--text-m); display: flex; align-items: center; gap: 8px; }
.import-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.import-row input[type="file"] { font-family: var(--mono); font-size: var(--text-s); color: var(--muted); max-width: 100%; }

/* ── 12. Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px), (pointer: coarse) {
  .fld input, .fld select, .fld textarea, .list-search, .year-select, .import-row input[type="file"] { font-size: 16px; }
  .fld input, .fld select, .year-select, .list-search { min-height: 42px; }
  .stepper { height: 44px; }
  .stepper button { width: 48px; }
}

@media (max-width: 720px) {
  .cms-mainnav { padding: 8px 14px; flex-wrap: wrap; gap: 2px 12px; }
  .cms-mainnav-links { flex-wrap: wrap; gap: 4px 16px; }
  .cms-mainnav-right { margin-left: auto; }

  #listView, #zeitView, .edit-body, #adminView, #reportView { padding-left: 14px; padding-right: 14px; }
  .fld-grid { grid-template-columns: 1fr; }

  .list-head { flex-wrap: wrap; gap: 12px; }
  .list-search { width: 100%; margin-left: 0; }

  .entry-card { padding: 14px; }
  .entry-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .entry-fields .fld-leistung, .entry-fields .btn { grid-column: 1 / -1; }

  .month-stats { grid-template-columns: repeat(2, 1fr); }
  .saldo-bar { padding: 12px 16px; }

  .data-row { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .row-main { flex: 1 1 60%; }
  .row-main + .btn { margin-left: auto; }
  .entry-row .row-lead { order: 1; min-width: 0; flex: 1 1 auto; }
  .entry-row .row-main { order: 0; flex: 1 1 100%; }
  .entry-row .row-amount { order: 2; }
  .entry-row .row-icon { order: 3; padding: 11px; }

  .modal { padding: 18px; }
  .modal-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .edit-header { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
  .edit-header .btn { font-size: var(--text-base); padding: 8px 14px; }

  .report-table th, .report-table td { padding: 10px 10px; }

  .toast {
    white-space: normal; text-align: center;
    max-width: calc(100vw - 32px); left: 16px; right: 16px;
    transform: translateY(8px);
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .toast.show { transform: translateY(0); }

  .fab { height: 52px; padding: 0 1.6em; font-size: var(--text-m); }
  #listView { padding-bottom: 120px; }
}

/* Autocomplete-Liste (datalist) ohne Chrome-Pfeil im Leistungsfeld */
input[list]::-webkit-calendar-picker-indicator { display: none !important; }

/* ── Zeit-Button + Von/Bis-Picker ───────────────────────────────────────────── */
.time-btn {
  height: 42px; padding: 0 16px; white-space: nowrap;
  font-family: var(--sans); font-size: var(--text-base); font-variant-numeric: tabular-nums;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.time-btn:hover, .time-btn:focus { border-color: var(--accent); color: var(--text); outline: none; }
.time-btn.set { color: var(--text); font-weight: 600; }
.time-btn:not(.set) { width: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.time-pop {
  position: absolute; z-index: 120; width: 340px; max-width: calc(100vw - 16px);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.tp-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tp-label {
  font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px;
}
.tp-wheels { display: flex; align-items: center; gap: 2px; }
.tp-colon { font-weight: bold; color: var(--muted); }
.tp-col {
  flex: 1; height: 196px; overflow-y: auto; scroll-behavior: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 2px;
  border: 1px solid var(--border); border-radius: 10px; scrollbar-width: none;
}
.tp-col::-webkit-scrollbar { display: none; }
.tp-col button {
  flex-shrink: 0; height: 34px; border: none; border-radius: 8px; background: transparent;
  font-family: var(--sans); font-size: var(--text-base); color: var(--text);
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.tp-col button:hover  { background: var(--surface); }
.tp-col button.active { background: var(--accent); color: #fff; }
.tp-sum { font-family: var(--mono); font-size: var(--text-s); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tp-sum strong { font-family: var(--sans); font-size: var(--text-m); color: var(--text); margin-left: auto; }
.tp-warn { color: #b8860b; }
.tp-actions { display: flex; justify-content: space-between; gap: 8px; }
.tp-actions button {
  font-family: var(--sans); font-size: var(--text-s); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 16px; background: transparent; color: var(--text); transition: all 0.15s;
}
.tp-actions .tp-ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.tp-actions button:hover { opacity: 0.8; }

/* Von–Bis unter dem Datum in der Liste */
.row-time { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }

/* Eingabe: Leistung | Datum | Zeit | Dauer | Speichern */
.entry-fields { grid-template-columns: minmax(0, 1fr) 170px auto 150px auto; }
.modal-fields { grid-template-columns: minmax(0, 1fr) auto 150px; }
@media (max-width: 720px) {
  .entry-fields { grid-template-columns: minmax(0, 1fr) auto; }
  .entry-fields .fld-dauer { grid-column: 1 / -1; }
  .modal-fields { grid-template-columns: minmax(0, 1fr) auto; }
  .modal-fields .fld-dauer { grid-column: 1 / -1; }
  .tp-col { height: 168px; }
}

/* ── Externer Stundenzettel ─────────────────────────────────────────────────── */
.sheet-view { padding-top: 40px; }
.sheet-head {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-bottom: 32px;
}
.sheet-head h1 { font-size: var(--text-xxl); font-weight: bold; line-height: 1.1; }
.sheet-customer {font-size: var(--text-l);/* color: var(--muted); */margin-top: 6px;line-height: 1.2;}
.sheet-brand { display: flex; align-items: center; gap: 14px; }
.sheet-brand-text {text-align: right;font-size: var(--text-m);line-height: 1.1;white-space: nowrap;}
.sheet-logo { height: 56px; width: auto; display: block; }
.data-row.static { cursor: default; }
.data-row.static:hover { border-color: var(--border); }

@media (max-width: 720px) {
  .sheet-view { padding-top: 24px; }
  .sheet-head { gap: 12px; }
  .sheet-head h1 { font-size: var(--text-xl); }
  .sheet-logo { height: 44px; }
  .sheet-brand-text { font-size: var(--text-base); }
}

/* Drucken: alle Monate aufgeklappt, ohne Klapp-Pfeile */
@media print {
  .sheet-view { padding: 0; max-width: none; }
  .month .month-entries { display: flex; }
  .toggle-icon { display: none; }
  .month, .data-row, .month-stats { break-inside: avoid; }
  .saldo-bar, .month-stats { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Kunden: Link zum externen Stundenzettel */
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-url {
  flex: 1 1 280px; min-width: 0; min-height: 42px;
  font-family: var(--mono); font-size: var(--text-s); color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 8px 12px; outline: none;
}
.share-url:focus { border-color: var(--accent); color: var(--text); }
.share-row .btn { font-size: var(--text-base); padding: 9px 16px; }

/* Zeiten: Kundenauswahl einzeilig, horizontal scrollbar über die volle Breite */
.pill-bar { max-width: 1200px; margin: 0 auto; padding: 24px 0 0; }
.pill-bar .filter-pills {
  position: relative; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 0;
  padding: 0 20px 4px; scroll-padding: 0 20px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pill-bar .filter-pills::-webkit-scrollbar { display: none; }
.pill-bar .filter-pill { flex-shrink: 0; white-space: nowrap; }
.pill-bar + #zeitView { padding-top: 20px; }
@media (max-width: 720px) {
  .pill-bar .filter-pills { padding-left: 14px; padding-right: 14px; scroll-padding: 0 14px; }
}

/* Saldo-Balken: Stunden groß, Betrag klein darunter */
.saldo-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.saldo-sub { font-size: var(--text-s); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-table .th-rate { text-transform: none; letter-spacing: 0; }
.report-table tfoot tr.eur-row td { border-top: none; padding-top: 4px; font-weight: normal; }

/* ── Abgerechnet ────────────────────────────────────────────────────────────── */
.row-icon.bill.active { background: var(--green-bg); color: var(--green); }
.data-row.billed .row-name, .data-row.billed .row-amount { color: var(--muted); }
.data-row.billed .row-sub { margin-top: 2px; }
.month-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.mini-btn {
  font-family: var(--sans); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.05); border: none; border-radius: var(--radius-pill);
  padding: 8px 16px; cursor: pointer; color: var(--text); transition: opacity 0.15s;
}
.mini-btn:hover { opacity: 0.7; }

/* Bestätigungsdialog (askConfirm) — ersetzt confirm(), das im App-Wrapper nicht geht */
.confirm-modal { max-width: 440px; z-index: 1; }
.confirm-text { color: var(--muted); font-size: var(--text-s); overflow-wrap: anywhere; }
.btn-danger-solid { background: var(--danger); color: #fff; display: inline-flex; align-items: center; gap: 6px; line-height: normal; }
