/* Kladde – Oberfläche */
:root {
  /* Design v0.15: Dunkelblau #16243d, Kladde-Grün #1f8b3d, warmes Papierbeige, dezente Schatten, leicht gerundete Ecken.
     Schaltflächen und Links nutzen ein minimal dunkleres Grün (#1c7d37), damit weiße Schrift gut lesbar bleibt (Kontrast ≥ 4,5:1). */
  --bg: #F6F1E6;
  --surface: #FFFEFB;
  --surface-2: #F1EBDD;
  --paper: #FBF6E9;
  --ink: #16243d;
  --ink-2: #3F4B60;
  --ink-3: #6A7384;
  --line: #E6DFCF;
  --line-2: #D3CAB6;
  --brand: #1f8b3d;
  --accent: #1c7d37;
  --accent-ink: #ffffff;
  --accent-soft: #DDF0E1;
  --head: #16243d;
  --head-ink: #F6F1E6;
  --note: #F9E7A3;
  --ok: #1c7d37;
  --ok-soft: #DDF0E1;
  --warn: #8A5A00;
  --warn-soft: #FBEBC4;
  --err: #B42318;
  --err-soft: #FBE1DD;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 36, 61, .06), 0 6px 18px rgba(22, 36, 61, .07);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ic2: #1f8b3d;
  --ic3: #f2b636;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1522;
    --surface: #16243d;
    --surface-2: #121C30;
    --paper: #1B2A45;
    --note: #5C4E1E;
    --ink: #F3F4F6;
    --ink-2: #CBD5E1;
    --ink-3: #9CA3AF;
    --line: #243047;
    --line-2: #334158;
    --brand: #2FB457;
    --accent: #4ADE80;
    --ic2: #4ADE80;
    --accent-ink: #ffffff;
    --accent-soft: #14301F;
    --head: #0B111C;
    --ok: #4ADE80;
    --ok-soft: #14301F;
    --warn: #F0B44C;
    --warn-soft: #3A2D12;
    --err: #FF7B6E;
    --err-soft: #3D1B18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  min-height: 100vh; min-height: 100dvh;
}
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small { color: var(--ink-3); }
.muted { color: var(--ink-3); }
.mt { margin-top: 20px; }
.noscript { padding: 16px; }

/* Schaltflächen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #1c7d37; border-color: #1c7d37; color: #fff; }
.btn-primary:hover { background: #17692f; border-color: #17692f; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { color: var(--err); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.ms-logo {
  width: 18px; height: 18px; flex: none;
  background:
    linear-gradient(#f25022, #f25022) 0 0 / 8px 8px no-repeat,
    linear-gradient(#7fba00, #7fba00) 10px 0 / 8px 8px no-repeat,
    linear-gradient(#00a4ef, #00a4ef) 0 10px / 8px 8px no-repeat,
    linear-gradient(#ffb900, #ffb900) 10px 10px / 8px 8px no-repeat;
}

/* Hinweise */
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }

/* Formulare */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { font-size: 13px; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 16px/1.4 var(--font);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand);
}
.check-line { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check-line span { display: grid; gap: 2px; font-weight: 600; font-size: 15px; }
.check-line small { font-weight: 400; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; align-items: start; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin: 8px 0 0; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

/* Installer */
.setup-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.setup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.setup-head img { border-radius: 10px; }
.setup-head strong { display: block; font-size: 20px; }
.setup-head span { color: var(--ink-3); font-size: 14px; }
.setup-foot { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 18px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 0 0 16px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.steps li span { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--line); color: var(--ink-2); font-weight: 700; font-size: 12px; flex: none; }
.steps li.current { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.steps li.current span { background: #1c7d37; color: #fff; }
.steps li.done span { background: var(--ok); color: #fff; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.check b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-size: 13px; }
.check div { display: grid; }
.check-ok b { background: var(--ok); }
.check-warn b { background: var(--warn); }
.check-error b { background: var(--err); }
.howto { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; }
.howto summary { font-weight: 600; cursor: pointer; }
.howto ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Anmeldung */
.login-main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; align-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand img { border-radius: 14px; }
.login-brand h1 { margin: 10px 0 2px; font-size: 1.6rem; }
.login-brand p { color: var(--ink-3); margin: 0; }
.login-hint { font-size: 13px; color: var(--ink-3); text-align: center; margin: 14px 0 0; }
.login-foot { color: var(--ink-3); font-size: 12px; margin-top: 14px; }

/* App-Hülle */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--ink-3); }
.boot-logo { text-align: center; }
.boot-logo img { border-radius: 12px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--head); color: var(--head-ink);
  padding: calc(env(safe-area-inset-top) + 0px) 16px 0;
}
.topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { display: block; }
.brand span { letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #c9d1d9; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 0 -2px 0 var(--brand); }
.nav a .badge { margin-left: 6px; }
.user-chip { text-decoration: none; display: flex; align-items: center; gap: 10px; color: #c9d1d9; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1f8b3d; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.menu-btn { display: none; background: transparent; border: 0; color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; margin-left: auto; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; margin: 0 auto; content: ""; }
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }
.main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 4px; min-width: 0; align-content: start; }
.tile-label { font-size: 13px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tile-value { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.tile-sub { font-size: 13px; color: var(--ink-3); }
.tile.ok { border-left: 4px solid var(--ok); }
.tile.warn { border-left: 4px solid var(--warn); }
.tile.err { border-left: 4px solid var(--err); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 13px; color: var(--ink-3); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.diff { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { flex: 1 1 200px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--ink-3); padding: 28px 10px; }
.drop { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface-2); }

/* Meldungen */
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(460px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 15px; animation: toast-in .2s ease-out; }
.toast.err { background: var(--err); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* App-Installation */
.install-banner { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.install-banner img { border-radius: 8px; flex: none; }
.install-banner div { flex: 1; min-width: 0; }
.install-banner strong { display: block; }
.install-banner small { color: var(--ink-2); }

/* Dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); width: min(480px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(10, 14, 20, .5); }
.dialog-body { padding: 22px; display: grid; gap: 14px; }
.dialog-body h2 { margin: 0; }

@media (max-width: 1100px) {
  .menu-btn { display: block; }
  .topbar-inner { flex-wrap: wrap; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; padding: 0 0 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; }
  .user-chip .user-name { display: none; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(4, auto); }
  .steps li { font-size: 0; padding: 8px; justify-content: center; }
  .steps li.current { font-size: 13px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .main { padding-top: 16px; }
  .summary, .kv { grid-template-columns: 1fr; gap: 2px; }
  .summary dd, .kv dd { margin-bottom: 8px; }
  .responsive-table thead { display: none; }
  .responsive-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .responsive-table td { display: block; border: 0; padding: 3px 0; }
  .responsive-table td[data-label] { text-align: right; min-height: 22px; }
  .responsive-table td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--ink-3); font-size: 13px; font-weight: 500; text-align: left; }
  .responsive-table td[data-label] .sub { text-align: right; }
  .responsive-table td[data-label] .row-actions, .responsive-table td[data-label] .actions { justify-content: flex-end; }
  .responsive-table td.num { text-align: right; }
  .responsive-table .row-actions { justify-content: flex-start; margin-top: 6px; }
}

/* v0.02 */
.small { font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.login-card-wide { max-width: 520px; }
.login-sub { text-align: center; color: var(--ink-3); margin: -8px 0 18px; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 14px; margin: 16px 0 0; }
.login-links span { color: var(--line-2); }
.login-card .form { gap: 12px; }
.login-card .check-line span { font-weight: 400; font-size: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-ms { background: var(--surface); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: 600 15px var(--font); color: var(--ink-3); cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.org-switch { width: auto; min-height: 36px; padding: 4px 10px; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); font-size: 14px; max-width: 260px; }
.org-switch option { color: #1c2530; }
.org-name { color: #c9d1d9; font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-cards .card + .card { margin-top: 0; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.select-sm { width: auto; min-height: 34px; padding: 4px 8px; font-size: 14px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.plain-list .sub { display: block; font-size: 13px; color: var(--ink-3); }
.steps-list { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
.card h2 + .form, .card h2 + .kv { margin-top: 4px; }
@media (max-width: 1100px) {
  .org-switch, .org-name { order: 3; flex-basis: 100%; max-width: none; margin-bottom: 8px; }
}

/* v0.03 */
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr img { background: #fff; border-radius: 8px; image-rendering: pixelated; max-width: 100%; height: auto; }
.secret-key { text-align: center; display: grid; gap: 4px; }
.secret-key code { font-size: 15px; letter-spacing: .05em; padding: 6px 10px; }
.enroll-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.codes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code { display: block; text-align: center; font-size: 15px; padding: 6px; }
.quote { background: var(--surface-2); border-left: 3px solid var(--brand); padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.deleg-row { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.deleg-row .check-line { flex: 1 1 260px; }
.deleg-exp { display: grid; gap: 4px; }
.deleg-exp input { width: auto; }
.actions-left { justify-content: flex-start; }
.group-row td { background: var(--surface-2); }
.sub-row td { font-size: 14px; color: var(--ink-2); }
.alert .btn { margin-left: 8px; }

/* v0.04 */
dialog.dialog-wide { width: min(720px, calc(100% - 32px)); }
.chips { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip-future { border-style: dashed; color: var(--ink-3); }
.role-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.role-card p { margin: 6px 0; }
.matrix { border-collapse: collapse; width: 100%; font-size: 14px; }
.matrix th, .matrix td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.matrix-role { font-size: 13px; min-width: 90px; }
.matrix-cell { text-align: center !important; color: var(--ink-3); }
.matrix-cell.yes { color: var(--ok); font-weight: 700; }
.matrix .sub { display: block; font-size: 12px; color: var(--ink-3); }
.perm-groups { display: grid; gap: 12px; max-height: 50vh; overflow: auto; padding-right: 4px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; display: grid; gap: 10px; }
.perm-group legend { font-weight: 700; padding: 0 6px; }
.perm-item span { font-size: 14px; }
.perm-locked { opacity: .6; cursor: not-allowed; }
.filters .date-filter { flex: 0 1 170px; display: grid; gap: 2px; }
.filters .date-filter span { font-size: 12px; color: var(--ink-3); }
.role-card { display: flex; flex-direction: column; }
.role-card .row-actions { margin-top: auto; padding-top: 8px; justify-content: flex-start; }
.matrix-perm, .matrix tbody td:first-child { min-width: 200px; }
[hidden] { display: none !important; }

/* v0.05 */
.footer-preview { font-size: 13px; color: var(--ink-3); text-align: center; line-height: 1.7; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.logo-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 10px; margin-bottom: 12px; background: #fff; }
.logo-preview img { max-width: 220px; height: 44px; object-fit: contain; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row .color-label { flex: 1 1 240px; font-weight: 600; font-size: 14px; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.color-row .color-text { width: 110px; min-height: 40px; font-family: var(--mono); }
.tpl-list .sub { max-width: 640px; }
.tpl-subject { font-style: italic; }
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-editor .card + .card { margin-top: 0; }
.tpl-body { min-height: 240px; }
.tpl-preview { position: sticky; top: 76px; }
.tpl-preview-subject { display: grid; gap: 2px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.tpl-frame { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #FAFAF8; }
.ph-box { display: grid; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip { font: 500 13px var(--mono); padding: 4px 8px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.ph-chip.ph-global { background: var(--surface); border-color: var(--line-2); }
.ph-chip:hover { border-color: var(--brand); }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: #FDF1D8; color: #6B4100; border-bottom: 1px solid #F0C36B; font-size: 14px; }
@media (prefers-color-scheme: dark) { .support-banner { background: #3A2D12; color: #F0C36B; border-color: #6B4100; } }
@media (max-width: 1000px) {
  .tpl-editor { grid-template-columns: 1fr; }
  .tpl-preview { position: static; }
  .tpl-frame { height: 560px; }
}

/* v0.06 – Zeiterfassung */
.clock-card { text-align: center; }
.clock-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; text-align: left; }
.clock-head .sub { display: block; color: var(--ink-3); font-size: 14px; }
.clock-now { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock-status { font-size: 20px; font-weight: 600; margin: 18px 0 16px; }
.clock-in { color: var(--ok); }
.clock-break { color: var(--warn); }
.clock-out { color: var(--ink-3); }
.clock-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; }
.btn-clock-sub { min-height: 52px; font-size: 17px; border-radius: 14px; font-weight: 600; }
.geo-line { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.btn-clock { min-height: 88px; font-size: 22px; border-radius: 16px; font-weight: 700; }
.btn-in { background: #1c7d37; border-color: #1c7d37; color: #fff; }
.btn-in:hover { background: #17692f; border-color: #17692f; }
.btn-break { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.btn-out { background: #1F2937; border-color: #1F2937; color: #fff; }
@media (prefers-color-scheme: dark) { .btn-out { background: #334158; border-color: #334158; } }
.sync-note { margin: 14px 0 0; font-size: 14px; color: var(--warn); }
.sync-note.ok { color: var(--ink-3); }
.ev-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ev-list li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.ev-list .ev-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; }
.ev-pending { outline: 1px dashed color-mix(in srgb, var(--warn) 50%, transparent); }
.ev-error { outline: 1px solid color-mix(in srgb, var(--err) 50%, transparent); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav strong { min-width: 150px; text-align: center; }
.month-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.month-table th, .month-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.month-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-table .nowrap { white-space: nowrap; }
.month-table .pos { color: var(--ok); }
.month-table .neg { color: var(--err); }
.row-weekend td { background: var(--surface-2); }
.row-holiday td { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.row-inactive td { opacity: .55; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-chip { font-size: 12.5px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-chip.ev-in { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.ev-chip.ev-out { border-color: color-mix(in srgb, var(--ink-3) 50%, transparent); }
.ev-chip.ev-break_start, .ev-chip.ev-break_end { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.ev-chip.ev-manual { border-style: dashed; }
.ev-chip.ev-voided { text-decoration: line-through; opacity: .55; }
.ev-click { cursor: pointer; }
.ev-click:hover { border-color: var(--err); }
.day-notes { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.day-notes .sub { font-size: 12px; color: var(--ink-3); }
.issue { font-size: 12.5px; color: var(--err); font-weight: 600; }
.link-btn { background: none; border: 0; color: var(--err); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin: 8px 0; }
.week-grid div { background: var(--surface-2); border-radius: 8px; padding: 6px 2px; display: grid; }
.week-grid small { font-size: 11px; }
.week-inputs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-inputs label { display: grid; gap: 2px; text-align: center; }
.week-inputs .hours { text-align: center; padding: 8px 4px; }
.state-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.state-check { font-size: 14px; white-space: nowrap; }
body.is-offline .topbar { box-shadow: inset 0 -3px 0 var(--warn); }
@media (max-width: 640px) {
  .btn-clock { min-height: 96px; }
  /* Monatsübersicht als Kartenliste statt Tabelle */
  .month-table, .month-table tbody { display: block; font-size: 14px; }
  .month-table thead { display: none; }
  .month-table tr { display: grid; grid-template-columns: 1fr auto auto auto; column-gap: 12px; row-gap: 6px; align-items: baseline; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .month-table td { display: block; border: 0; padding: 0; }
  .month-table .mt-day { font-weight: 600; }
  .month-table .mt-day { grid-row: 1; grid-column: 1; }
  .month-table .mt-soll { grid-row: 1; grid-column: 2; }
  .month-table .mt-ist { grid-row: 1; grid-column: 3; }
  .month-table .mt-saldo { grid-row: 1; grid-column: 4; }
  .month-table .mt-ev { grid-row: 2; grid-column: 1 / -1; }
  .month-table .mt-notes { grid-row: 3; grid-column: 1 / -1; }
  .month-table .mt-empty { display: none; }
  .month-table td[data-label]::before { content: attr(data-label) ' '; color: var(--ink-3); font-size: 12px; font-weight: 400; }
  .month-table .row-weekend, .month-table .row-inactive { padding: 6px 2px; }
  .month-table .row-weekend td, .month-table .row-holiday td { background: transparent; }
  .month-table tr.row-weekend { background: var(--surface-2); }
  .month-table tr.row-holiday { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
  .card:has(> .table-wrap > .month-table) { padding-left: 14px; padding-right: 14px; }
  /* Kennzahlen zweispaltig */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile-value { font-size: 19px; }
  .tile-label { font-size: 12px; }
  .tile-sub { font-size: 12px; }
}
.user-chip .user-name { white-space: nowrap; }
@media (max-width: 1440px) and (min-width: 1101px) { .user-chip .user-name { display: none; } .nav a, .nav .nav-more > summary { padding: 8px 8px; } .nav { gap: 2px; } .org-switch { max-width: 190px; } }
@media (max-width: 1280px) and (min-width: 1101px) { .topbar-inner { gap: 10px; } .nav { gap: 0; } .nav a, .nav .nav-more > summary { padding: 8px 6px; font-size: 14px; } .org-switch { max-width: 160px; } }

/* v0.07 – Handwerk */
.clock-selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 0 0 14px; text-align: left; }
.clock-project { margin: -8px 0 14px; font-weight: 600; color: var(--ink-2); }
.geo-note { font-size: 14px; }
.crew-list { display: grid; gap: 6px; margin: 6px 0 12px; }
.crew-member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.crew-member input { width: 20px; height: 20px; accent-color: var(--accent); }
.crew-member span:nth-of-type(1) { flex: 1; font-weight: 600; }
.crew-state { font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.crew-in { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.crew-break { color: var(--warn); }
.crew-actions .btn { flex: 1 1 110px; }
.crew-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; max-height: 40vh; overflow: auto; }
.seg { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); }
.trip, .travel { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.travel { border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.meal-checks { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.meal-checks input { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; }

/* ---------- v0.08: Navigation „Verwaltung“, Monatsabschluss, Konten, Prüfregeln, Zuschläge ---------- */
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: #c9d1d9; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 15px; white-space: nowrap; user-select: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " ▾"; font-size: 11px; opacity: .8; }
.nav-more > summary:hover, .nav-more[open] > summary { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-more.active > summary { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 0 -2px 0 var(--brand); }
.nav-more-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--head); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px; min-width: 200px; z-index: 40; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.nav-more-menu a { padding: 9px 12px; }
@media (max-width: 1100px) {
  .nav-more > summary { padding: 12px; font-size: 16px; }
  .nav-more-menu { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; min-width: 0; }
}
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.chk { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; margin: 0 4px 2px 0; white-space: nowrap; }
.chk-fehler { background: var(--err-soft); color: var(--err); }
.chk-warnung { background: var(--warn-soft); color: var(--warn); }
.chk-hinweis { background: var(--surface-2); color: var(--ink-2); }
.day-notes .chk { white-space: normal; }
.ev-corr { outline: 2px dashed var(--warn); outline-offset: 1px; }
.corr-mark { color: var(--warn); font-weight: 700; margin-left: 2px; }
.findings { list-style: none; margin: 0; padding: 0; }
.findings li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.findings li:last-child { border-bottom: 0; }
.findings .when { min-width: 92px; color: var(--ink-2); white-space: nowrap; }
.rule-table td { vertical-align: middle; }
.rule-table select, .rule-table input { max-width: 160px; }
.rule-law { display: block; font-size: 12px; color: var(--ink-2); }
.num-cell input { width: 90px; text-align: right; }
.month-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
a.tab { text-decoration: none; display: inline-block; }
/* v0.10: Supportzugriff */
.findings.grants li > span:nth-child(2) { flex: 1; min-width: 0; }
.findings .sub { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
/* v0.11: Testumgebung */
.test-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: repeating-linear-gradient(135deg, #FDF1D8 0 14px, #FBE7BD 14px 28px); color: #7A4B00; border-bottom: 1px solid #E8C77A; font-size: 14px; }
@media (prefers-color-scheme: dark) { .test-banner { background: repeating-linear-gradient(135deg, #3A2D12 0 14px, #45351A 14px 28px); color: #F0C36B; border-color: #6B4100; } }
#app.is-test .topbar { box-shadow: inset 0 -4px 0 #D97706; }
.test-card { border-left: 4px solid var(--warn); }

/* v0.14 */
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 4px 0 0; display: grid; gap: 10px; min-width: 0; }
.fieldset legend { font-weight: 600; padding: 0 6px; }
.field-btn { justify-content: flex-end; display: flex; align-items: flex-end; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.req-list .req-item { align-items: flex-start; }
.req-main { display: grid; gap: 2px; min-width: 0; }
.req-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ev-geo-off { box-shadow: inset 0 0 0 2px #D97706; }

.logo-options { display: grid; gap: 10px; margin-bottom: 8px; }
.logo-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.logo-option.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.logo-option.disabled { opacity: .6; cursor: default; }
.logo-option input { margin-top: 4px; }
.logo-option-body { display: grid; gap: 8px; min-width: 0; }
.mail-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #1F2937; background: #fff; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }

.ph-wrap { position: relative; }
.ph-wrap > input, .ph-wrap > textarea { position: relative; background: transparent; z-index: 1; }
.ph-back { position: absolute; inset: 0; overflow: hidden; color: transparent; white-space: pre; border: 1px solid transparent; border-radius: var(--radius-sm, 10px);
  padding: 10px 12px; font: 16px/1.4 var(--font); background: var(--surface); pointer-events: none; }
.ph-multi .ph-back { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }
.ph-back mark { color: transparent; border-radius: 4px; }
.ph-back mark.ph-ok { background: #CDEFD8; box-shadow: 0 0 0 1px #16A34A55; }
.ph-back mark.ph-bad { background: #FDD8D8; box-shadow: 0 0 0 1px #DC262666; }
mark.ph-mark, code.ph-tag { background: #E3F4E9; color: #166534; border-radius: 4px; padding: 0 3px; font-style: normal; }
code.ph-tag { font-size: 12px; }
.ph-mini { margin-top: 4px; }
@media (prefers-color-scheme: dark) { .ph-back mark.ph-ok { background: #1E4D30; } .ph-back mark.ph-bad { background: #5B1D1D; } mark.ph-mark, code.ph-tag { background: #1E4D30; color: #BBF7D0; } }

tr.row-test td { background: repeating-linear-gradient(135deg, #FEF3C7 0 12px, #FDF6E3 12px 24px); }
@media (prefers-color-scheme: dark) { tr.row-test td { background: #3A2D12; } }

/* v0.13 Sicherheit */
.sec-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sec-list li { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.sec-list li.sec-ok { border-left-color: var(--ok, #16A34A); }
.sec-list li.sec-warnung { border-left-color: #D97706; }
.sec-list li.sec-fehler { border-left-color: #DC2626; }
.sec-list li.sec-hinweis { border-left-color: #9CA3AF; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sec-detail { color: var(--ink-2); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.sec-fix { font-size: 14px; margin-top: 4px; font-weight: 500; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 10px 12px; }
  .page-head .actions, .card .actions { justify-content: flex-start; }
  .page-head { align-items: flex-start; }
}

/* ==========================================================================
   Design-Relaunch v0.15 – „Digitale Kladde für Handwerker, Betriebe und Steuerberater.“
   Nur Darstellung: Papierbeige, Dunkelblau, Kladde-Grün, Symbole, Ringe, Haftnotizen.
   ========================================================================== */
.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.24em; overflow: visible; }
body { background: var(--bg); }
h1, h2 { letter-spacing: -.01em; }
.card { border-radius: var(--radius); }
.card > h2, .card-head > h2 { display: flex; align-items: center; gap: 10px; }
.h-ic { width: 26px; height: 26px; padding: 4px; border-radius: 8px; background: var(--accent-soft); color: var(--head); --ic2: var(--brand); }
.btn-ic { width: 20px; height: 20px; margin-right: -2px; }
.marker { position: relative; display: inline-block; padding-bottom: 6px; background: url("/assets/deco/marker.svg") no-repeat left bottom / 100% 9px; }

/* Kopfzeile und Navigation */
.topbar { box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.nav a, .nav .nav-more > summary { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.nav .nav-ic { width: 20px; height: 20px; color: #cfd6e2; --ic2: #6fd58a; --ic3: #f2c453; }
.nav-t { position: relative; z-index: 1; }
.nav a.active, .nav .nav-more.active > summary { background: var(--ic2); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); border-radius: 999px; }
.nav a.active .nav-ic, .nav .nav-more.active > summary .nav-ic { color: #fff; --ic2: #c9f3d5; --ic3: #fff3c4; }
.nav a.active .nav-t { background: none; font-weight: 600; }
.nav a:hover .nav-ic { color: #fff; }

/* Dekoration: Haftnotiz, Büroklammer, Handschrift */
.sticky { display: inline-block; background: var(--note); color: #4a3d0a; padding: 8px 12px; font-family: var(--hand); font-size: 14px; line-height: 1.2; transform: rotate(3deg);
  box-shadow: 0 2px 6px rgba(22, 36, 61, .18); border-radius: 2px 2px 8px 2px; max-width: 150px; text-align: center; }
.hand-note { display: block; font-family: var(--hand); font-size: 17px; color: var(--ink-2); transform: rotate(-4deg); margin: 4px 0 0; }
.clip { position: absolute; width: 16px; height: 34px; background: url("/assets/deco/klammer.svg") no-repeat center / contain; top: -14px; right: 18px; }
.note-card { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; background: #F7EBCB; border: 1px dashed #d9c48a; border-radius: 4px; transform: rotate(-1.5deg);
  font-family: var(--hand); color: #5b4b1a; box-shadow: 0 2px 8px rgba(22, 36, 61, .12); max-width: 300px; }
.note-card .note-ic { width: 30px; height: 30px; color: #5b4b1a; }
@media (prefers-color-scheme: dark) { .note-card { background: #4a3f1b; border-color: #7b6a30; color: #f4e6b0; } .note-card .note-ic { color: #f4e6b0; } .sticky { color: #f4e6b0; } }

/* Begrüßung (Stempeln) */
.greet-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid #E4D6A4;
  background: repeating-linear-gradient(135deg, #FBF1CF, #FBF1CF 14px, #F8EBC0 14px, #F8EBC0 28px); box-shadow: var(--shadow); color: #3a3010; }
.greet-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.greet-ic .ic { width: 42px; height: 42px; color: #4a3d0a; --ic2: #b9891b; }
.greet-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.greet-text strong { font-size: 19px; }
.greet-text span { font-size: 14px; }
.greet-sub { color: #6b5a20; }
.greet-card .sticky { flex: none; }
@media (prefers-color-scheme: dark) { .greet-card { background: repeating-linear-gradient(135deg, #2a2f3d, #2a2f3d 14px, #262b39 14px, #262b39 28px); border-color: #3a4256; color: #F3ECD3; } .greet-ic .ic { color: #F3ECD3; } .greet-sub { color: #cdbf8a; } }

/* Stempeluhr */
.clock { max-width: 640px; margin: 0 auto; position: relative; }
main[data-page="/stempeln"] { position: relative; }
main[data-page="/stempeln"]::before { content: ""; position: absolute; right: -10px; top: 190px; width: 300px; height: 330px; background: url("/assets/deco/stoppuhr-wasserzeichen.svg") no-repeat center / contain; opacity: .045; pointer-events: none; }
.clock-card { text-align: center; padding: 20px 18px 22px; position: relative; overflow: hidden; }
.clock-head h2 { font-size: 1.5rem; margin: 0; }
.clock-head .sub { display: block; margin-top: 2px; }
.clock-now { font-size: 28px; color: var(--ink-2); }
.clock-focus { position: relative; padding: 10px 0 6px; }
.ring-wrap { position: relative; width: 210px; height: 210px; margin: 6px auto 0; display: grid; place-items: center; }
.ring-wrap::before { content: ""; position: absolute; inset: -34px; background: url("/assets/deco/strahlen.svg") no-repeat center / contain; opacity: .9; pointer-events: none; }
.clock-focus-in .ring-wrap::before { background-image: url("/assets/deco/strahlen-gehen.svg"); opacity: .55; }
.clock-focus-break .ring-wrap::before { opacity: .0; }
.ring-wrap .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { stroke: var(--line); }
.ring-bar { stroke: var(--brand); transition: stroke-dasharray .6s ease; }
.ring-warn .ring-bar { stroke: #d99a1e; } .ring-err .ring-bar { stroke: #c0453d; } .ring-out .ring-bar { stroke: transparent; }
.ring-btn { position: relative; z-index: 1; width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--head); box-shadow: inset 0 0 0 5px var(--brand), 0 4px 14px rgba(31, 139, 61, .25); transition: transform .08s; }
.ring-btn:active { transform: scale(.97); }
.ring-btn .ic { width: 64px; height: 64px; }
.ring-btn-out { }
.clock-focus-in .ring-btn { background: #FBE6E3; box-shadow: inset 0 0 0 5px #c0453d, 0 4px 14px rgba(192, 69, 61, .22); }
.clock-focus-break .ring-btn { background: var(--warn-soft); box-shadow: inset 0 0 0 5px #d99a1e; }
.clock-status { font-size: 18px; font-weight: 600; margin: 14px 0 4px; }
.clock-big { font-size: 46px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock-goal { color: var(--ink-3); margin: 2px 0 0; font-size: 14px; }
.clock-focus .hand-note { position: absolute; right: 2%; top: 74px; width: 120px; text-align: center; }
.clock-buttons { margin: 16px 0 6px; }
.btn-clock { position: relative; overflow: hidden; min-height: 78px; font-size: 24px; letter-spacing: .01em; box-shadow: 0 6px 16px rgba(22, 36, 61, .18); }
.btn-clock .btn-ic { width: 30px; height: 30px; }
.btn-clock::after { content: ""; position: absolute; right: 18px; top: 50%; width: 46px; height: 46px; transform: translateY(-50%); background: url("/assets/deco/strahlen.svg") no-repeat center / contain; opacity: .55; filter: brightness(2.2); }
.btn-out { background: #16243d; border-color: #16243d; }
.btn-out::after { background-image: url("/assets/deco/strahlen-gehen.svg"); filter: brightness(1.5); }
.btn-out .btn-ic, .btn-in .btn-ic { --ic2: #fff; color: #fff; }
.btn-clock-sub { gap: 8px; }
.sel-field { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); min-width: 0; cursor: pointer; }
.sel-ic { width: 26px; height: 26px; color: var(--head); flex: none; }
.sel-body { display: grid; min-width: 0; flex: 1; }
.sel-body small { font-size: 12px; }
.sel-body select { border: 0; padding: 0; min-height: 26px; background: transparent; font-weight: 600; font-size: 16px; }
.sel-body select:focus { outline: none; box-shadow: none; }
.clock-selects { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; text-align: left; }
.chips-label { flex: 1 0 100%; font-weight: 600; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 15px var(--font); cursor: pointer; }
.chip .chip-ic { width: 20px; height: 20px; }
.chip.on { background: var(--accent-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stat-card { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; min-width: 0; align-content: start; }
.stat-ic .ic { width: 30px; height: 30px; color: var(--head); }
.stat-err .stat-ic .ic { --ic2: #d9822b; }
.stat-label { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.stat-value { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-err .stat-value { color: var(--err); }
.stat-sub { font-size: 12.5px; color: var(--ink-3); }
.bar { display: block; height: 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.stat-err .bar-fill { background: #e59a92; } .stat-warn .bar-fill { background: #e3b04b; }
.bar-fill[data-pct="0"]{width:0%}
.bar-fill[data-pct="5"]{width:5%}
.bar-fill[data-pct="10"]{width:10%}
.bar-fill[data-pct="15"]{width:15%}
.bar-fill[data-pct="20"]{width:20%}
.bar-fill[data-pct="25"]{width:25%}
.bar-fill[data-pct="30"]{width:30%}
.bar-fill[data-pct="35"]{width:35%}
.bar-fill[data-pct="40"]{width:40%}
.bar-fill[data-pct="45"]{width:45%}
.bar-fill[data-pct="50"]{width:50%}
.bar-fill[data-pct="55"]{width:55%}
.bar-fill[data-pct="60"]{width:60%}
.bar-fill[data-pct="65"]{width:65%}
.bar-fill[data-pct="70"]{width:70%}
.bar-fill[data-pct="75"]{width:75%}
.bar-fill[data-pct="80"]{width:80%}
.bar-fill[data-pct="85"]{width:85%}
.bar-fill[data-pct="90"]{width:90%}
.bar-fill[data-pct="95"]{width:95%}
.bar-fill[data-pct="100"]{width:100%}

.ev-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 0 2px; }
.ev-empty p { margin: 0; }
@media (max-width: 520px) { .stat-cards { grid-template-columns: 1fr 1fr; } .stat-card:last-child { grid-column: 1 / -1; } .clock-focus .hand-note { position: static; width: auto; margin-top: 2px; } .greet-card { flex-wrap: wrap; } .greet-card .sticky { margin-left: auto; } }

/* Untere Leiste (Handy) */
.tabbar { display: none; }
@media (max-width: 700px) {
  .has-tabbar .main { padding-bottom: 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; gap: 2px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 28px rgba(22, 36, 61, .22); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; text-decoration: none; color: var(--ink-2); font-size: 11.5px; font-weight: 600; min-width: 0; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar .tab-ic { width: 24px; height: 24px; }
  .tabbar a.active { background: var(--accent-soft); color: var(--accent); }
  .tabbar a.active .tab-ic { --ic2: var(--brand); color: var(--head); }
}

/* Kennzahlen / Dashboard-Karten */
.tile { position: relative; padding: 18px 18px 16px 18px; gap: 3px; border-radius: var(--radius); }
.tile-ic { position: absolute; right: 14px; top: 14px; width: 46px; height: 46px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.tile-ic .ic { width: 26px; height: 26px; color: var(--head); }
.tile-label { padding-right: 56px; }
.tile.ok { border-left: 0; box-shadow: var(--shadow), inset 4px 0 0 var(--ok); }
.tile.warn { border-left: 0; box-shadow: var(--shadow), inset 4px 0 0 #d99a1e; }
.tile.err { border-left: 0; box-shadow: var(--shadow), inset 4px 0 0 #c0453d; }
.action-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--surface) 55%, var(--paper)); }
.action-card::after { content: ""; position: absolute; right: -18px; bottom: -34px; width: 230px; height: 250px; background: url("/assets/deco/stoppuhr-wasserzeichen.svg") no-repeat center / contain; opacity: .06; pointer-events: none; }
.action-text > * { position: relative; z-index: 1; }
.action-ill { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; position: relative; z-index: 1; }
.ill-chip { display: grid; justify-items: center; gap: 2px; width: 92px; padding: 12px 6px 8px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(22, 36, 61, .06); }
.ill-chip .ic { width: 36px; height: 36px; color: var(--head); }
.ill-chip small { font-size: 12px; font-weight: 600; }
@media (max-width: 760px) { .action-card { grid-template-columns: 1fr; } .action-ill { grid-template-columns: repeat(4, 1fr); } .ill-chip { width: auto; } }
.actions-left { justify-content: flex-start; }

/* Mandantenkarten (Kanzlei) */
.mandant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.mandant-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 12px; position: relative; overflow: hidden; }
.mandant-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line-2); }
.mc-ok::before { background: var(--brand); } .mc-warn::before { background: #d99a1e; } .mc-open::before { background: #9aa3b2; }
.mc-link { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.mc-link:hover { transform: translateY(-2px); }
.mandant-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mandant-card header > div { flex: 1; min-width: 0; display: grid; }
.mandant-card header strong { overflow-wrap: anywhere; }
.mc-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.mc-badge .ic { width: 26px; height: 26px; color: var(--head); }
.mandant-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mandant-card li { display: grid; grid-template-columns: 22px 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.mc-ic { width: 20px; height: 20px; color: var(--ink-2); }
.mc-l { color: var(--ink-3); }
.mc-v { min-width: 0; overflow-wrap: anywhere; }

/* Leere Zustände */
.ill { display: grid; place-items: center; width: 86px; height: 86px; margin: 10px auto 6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.ill .ill-ic { width: 46px; height: 46px; color: var(--head); }
.ill::after { content: ""; position: absolute; right: -26px; top: -4px; width: 40px; height: 30px; background: url("/assets/deco/stern.svg") no-repeat center / contain; }
p.empty-done { text-align: center; color: var(--ink-3); max-width: 460px; margin: 0 auto 10px; }

/* Seitenköpfe: Symbol als ruhiges Wasserzeichen */
.page-head { position: relative; }
.page-ill { order: 3; width: 60px; height: 60px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; margin-left: auto; }
.page-ill .ic { width: 34px; height: 34px; color: var(--head); }
@media (max-width: 640px) { .page-ill { display: none; } }

/* Status-Tafel Monatsabschluss */
.status-board { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; margin-bottom: 16px; }
.sb-ring { position: relative; width: 150px; height: 150px; justify-self: center; }
.sb-ring .ring { position: absolute; inset: 0; }
.sb-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.sb-center strong { font-size: 28px; letter-spacing: -.02em; }
.ind-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.ind { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.ind-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); flex: none; }
.ind-ic .ic { width: 22px; height: 22px; color: var(--head); }
.ind-t { display: grid; flex: 1; min-width: 0; }
.ind-t small { font-size: 12.5px; }
.ind-v { font-size: 22px; font-weight: 800; }
.ind-ok { background: var(--ok-soft); border-color: transparent; } .ind-ok .ind-v { color: var(--ok); }
.ind-warn { background: var(--warn-soft); border-color: transparent; } .ind-warn .ind-v { color: var(--warn); }
.ind-err { background: var(--err-soft); border-color: transparent; } .ind-err .ind-v { color: var(--err); }
.step-track { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.step-track li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--ink-3); background: var(--surface); }
.st-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; }
.st-dot .ic { width: 16px; height: 16px; color: #fff; --ic2: #fff; }
.step-track li.done { color: var(--ok); border-color: var(--brand); background: var(--ok-soft); } .step-track li.done .st-dot { background: var(--brand); }
.step-track li.now { color: var(--ink); border-color: var(--head); box-shadow: 0 0 0 2px color-mix(in srgb, var(--head) 12%, transparent); }
@media (max-width: 640px) { .status-board { grid-template-columns: 1fr; } }

/* Beschäftigte */
.person { display: flex; align-items: center; gap: 12px; }
.person > div { min-width: 0; }
.avatar-md { position: relative; width: 42px; height: 42px; font-size: 15px; background: var(--head); }
.avatar-off { background: var(--ink-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9aa3b2; }
.dot-ok { background: var(--brand); } .dot-warn { background: #d99a1e; } .dot-off { background: #9aa3b2; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border: 2px solid var(--surface); }
.team-strip { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--radius); background: linear-gradient(135deg, var(--surface) 50%, var(--paper)); border: 1px solid var(--line); box-shadow: var(--shadow); flex-wrap: wrap; }
.strip-stats { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.strip-stats strong { font-size: 18px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* Exportfehler mit Sprung, Anleitung */
.issue-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.issue-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0; border-top: 1px dashed color-mix(in srgb, var(--err) 30%, transparent); }
.issue-list li:first-child { border-top: 0; }
.issue-list .btn { color: var(--ink); }
.guide { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 10px; background: var(--surface-2); }
.guide summary { font-weight: 700; cursor: pointer; }
.guide-card::after { content: none; }
.deleg-req { align-items: center; }
.deleg-req .actions { margin: 0; }

/* Einstellungen: Abschnitte */
.h-ic { flex: none; }
.clock-focus .hand-note { margin-top: 22px; }
@media (max-width: 520px) {
  .greet-ic { display: none; }
  .greet-card { padding: 14px; }
  .greet-card .sticky { flex: 1 0 100%; max-width: none; transform: rotate(-1deg); margin: 2px 0 0; }
}
.btn-primary .ic { --ic2: #fff; }
.mandant-card li { grid-template-columns: 22px 128px 1fr; }
@media (max-width: 420px) { .mandant-card li { grid-template-columns: 22px 108px 1fr; } }
.tab-ic2 { width: 18px; height: 18px; margin-right: 6px; vertical-align: -.3em; }
.tabs .tab.active .tab-ic2 { --ic2: var(--brand); }
