/* cj. — Stundentracker KIWI KIWI
   Optik bewusst wie Rahmenvertrag und Rechnung: weiss, schwarze Serifenlose,
   feine Linien statt Kästen, cj.-Rot nur als Akzent. */

:root {
  --ink: #111214;
  --muted: #6b7076;
  --line: #e3e5e8;
  --bg: #ffffff;
  --soft: #f7f8f9;
  --red: #af3524;
  --green: #1f7a4d;
  --amber: #a86a12;
  --radius: 10px;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 22px 18px 96px; }
.wrap--narrow { max-width: 460px; }

/* ── Kopf ── */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
       padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.top h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.top .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cj { font-family: var(--serif); font-style: italic; font-size: 25px; color: var(--red);
      line-height: 1; text-decoration: none; }

/* ── Typo-Bausteine ── */
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
     font-weight: 600; margin: 30px 0 10px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ── Kennzahlen ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px;
         background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
         overflow: hidden; }
.stat { background: var(--bg); padding: 13px 15px; }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .v { font-size: 23px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums;
           letter-spacing: -0.02em; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }

/* ── Listen ── */
.row { display: flex; align-items: baseline; gap: 12px; padding: 11px 0;
       border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 550; }
.row .s { font-size: 12.5px; color: var(--muted); }
.row .n { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }

.bar { height: 5px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 15px; margin-bottom: 10px; }
.group > .head { display: flex; justify-content: space-between; align-items: baseline;
                 padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.group > .head .t { font-weight: 650; }

/* ── Aufklappbarer Kunde ── */
.acc { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.acc[open] { border-color: var(--muted); }
.acc > summary {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer;
  list-style: none; user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--soft); }
.acc > summary .grow { flex: 1; min-width: 0; }
.acc > summary .t { font-weight: 650; display: block; }
.acc > summary .s { font-size: 12.5px; color: var(--muted); display: block; margin-top: 1px; }
.acc > summary .n { font-variant-numeric: tabular-nums; font-weight: 550; white-space: nowrap; }
.acc > summary .bar { display: block; margin-top: 7px; max-width: 320px; }

/* Dreieck, das beim Aufklappen kippt. */
.acc-mark { width: 8px; height: 8px; flex: 0 0 8px; border-right: 1.5px solid var(--muted);
            border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); margin-top: -2px;
            transition: transform 140ms ease-out; }
.acc[open] .acc-mark { transform: rotate(45deg); }

.acc-body { border-top: 1px solid var(--line); padding: 2px 15px 6px; background: var(--soft); }
.job + .job { border-top: 1px solid var(--line); }
.row--job { font-weight: 600; padding-top: 13px; border-bottom: 0; }
.row--entry { padding: 7px 0 7px 14px; border-bottom: 0; }
.row--entry .t { font-weight: 500; }
.row--link { text-decoration: none; color: inherit; }
.row--link:hover .t { text-decoration: underline; }

/* ── Hinweise ── */
.note { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 6px;
        padding: 11px 14px; margin: 14px 0; font-size: 13.5px; background: var(--soft); }
.note--warn { border-left-color: var(--red); background: #fdf6f4; }
.note--ok { border-left-color: var(--green); background: #f3f9f5; }
.note b { display: block; margin-bottom: 3px; }

/* ── Bedienelemente ── */
button, .btn {
  font: inherit; font-weight: 550; cursor: pointer; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 9px 15px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
button:disabled { opacity: 0.4; cursor: default; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn--danger { background: transparent; color: var(--red); border-color: var(--line); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px;
        text-transform: uppercase; letter-spacing: 0.05em; }
.field { margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
        background: transparent; color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }

.tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px;
       border-radius: 4px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.tag--draft { color: var(--amber); border-color: #ecd9b5; background: #fdf8ef; }

table { width: 100%; border-collapse: collapse; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
     font-weight: 600; text-align: left; padding: 0 0 7px; border-bottom: 1px solid var(--line); }
td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th.r, td.r { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .stat .v { font-size: 20px; }
  /* Zwei Spalten; bei ungerader Anzahl füllt die letzte Kachel die Zeile,
     sonst bleibt der Rasterhintergrund als graue Lücke stehen. */
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
