/* ============================================================
   Dokupilot
   Ein Werkzeug von all of us Medienproduktion.
   Farben, Schriften und Formensprache folgen der Website.
   ============================================================ */

/* ------------------------------------------------------------ Schriften
   Selbst gehostet: keine externen Anfragen, funktioniert auch offline. */
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/poppins-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/poppins-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/poppins-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF;
}
@font-face {
  font-family: 'InterLocal'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'InterLocal'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF;
}
@font-face {
  font-family: 'InterLocal'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'InterLocal'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* --------------------------------------------------------------- Tokens */
:root {
  --bg:          #0b0b0c;
  --bg-elev:     #131315;
  --bg-elev-2:   #1a1a1d;
  --bg-sunken:   #0f0f11;

  --line:        rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);

  --fg:          #f4f3f1;
  --fg-muted:    #a8a6a2;
  --fg-dim:      #77757a;

  --accent-1:    #ffccbc;   /* Pfirsich */
  --accent-2:    #ffe082;   /* Bernstein */
  --accent-3:    #b3e5fc;   /* Himmel */
  --accent-4:    #d1c4e9;   /* Flieder */
  --accent-grad: linear-gradient(100deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-4));

  --gut:         #a5d6a7;   /* Einnahmen, erledigt */
  --gut-bg:      rgba(165, 214, 167, .12);
  --acht:        #ffe082;   /* offen, wartet */
  --acht-bg:     rgba(255, 224, 130, .12);
  --schlecht:    #ef9a9a;   /* überfällig, Fehler */
  --schlecht-bg: rgba(239, 154, 154, .12);
  --info-bg:     rgba(179, 229, 252, .10);

  --font-display: 'Poppins', 'Century Gothic', 'Futura', 'Trebuchet MS', system-ui, sans-serif;
  --font-body:    'InterLocal', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius:    18px;
  --radius-sm: 10px;
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
* :focus-visible { outline: 2px solid var(--accent-3); outline-offset: 2px; border-radius: 4px; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(78px + var(--safe-bottom));
}

/* Feines Filmkorn, wie auf der Website */
body::after {
  content: "";
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 9999; opacity: .03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

button, input, select, textarea { font: inherit; color: inherit; font-family: var(--font-body); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-1); color: #111; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.14;
}

.grad-text {
  background: var(--accent-grad);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: gradientFlow 9s ease-in-out infinite;
}
@keyframes gradientFlow {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* Kleine Vorzeile in Versalien, das Erkennungsmerkmal der Marke */
.eyebrow {
  font-family: var(--font-body);
  font-size: .68rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--fg-muted);
  display: flex; align-items: center; gap: .7rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--line-strong); flex: none; }

/* ---------------------------------------------------------- Kopfbereich */
header.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 11, 12, .74);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  padding: max(10px, env(safe-area-inset-top)) 18px 11px;
  display: flex; align-items: center; gap: 12px;
}
header.top .brand { flex: 1; min-width: 0; }
header.top h1 {
  font-size: 19px; margin: 0; font-weight: 600; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
header.top .sub {
  display: block; font-family: var(--font-body); font-size: .62rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--fg-dim);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--accent-grad); background-size: 200% auto;
  display: grid; place-items: center;
  color: #0b0b0c; font-family: var(--font-display); font-weight: 600; font-size: 16px;
  animation: gradientFlow 9s ease-in-out infinite;
}
.mark img { width: 100%; height: 100%; object-fit: contain; }

main { padding: 18px; max-width: 940px; margin: 0 auto; }

/* Zwei Wege zurück aus einem Projekt: der Pfeil oben in der Kopfzeile, der
   beim Blättern immer stehen bleibt, und der beschriftete Knopf darunter. */
.kopf-zurueck {
  flex: none; width: 38px; height: 38px; margin-left: -4px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--bg-elev-2); color: var(--fg);
  border: 1px solid var(--line); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.kopf-zurueck:active, .kopf-zurueck:hover { background: var(--fg); color: var(--bg); }
.kopf-zurueck.hidden { display: none; }
.zurueck-leiste { margin-bottom: 12px; }
.zurueck-leiste .btn { display: inline-flex; align-items: center; }
.view { display: none; }
.view.active { display: block; animation: riseIn .35s var(--ease); }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h2 {
  font-size: 1.15rem; margin: 26px 0 12px; font-weight: 600;
  display: flex; align-items: center; gap: .6rem;
}
h2:first-child { margin-top: 4px; }
h3 { font-size: 1rem; margin: 18px 0 9px; }
p.hint { color: var(--fg-muted); font-size: .9rem; margin: 6px 0 14px; }
.muted { color: var(--fg-muted); }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Karten */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease);
}
.card.tight { padding: 14px 16px; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--line-strong); background: var(--bg-elev-2); transform: translateY(-3px); }
.card.clickable:active { transform: translateY(0); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px 16px;
}
.stat .label {
  font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 7px;
}
.stat .value {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.stat .value.pos { color: var(--gut); }
.stat .value.neg { color: var(--schlecht); }
.stat .note { font-size: .8rem; color: var(--fg-muted); margin-top: 3px; }

/* ---------------------------------------------------------------- Listen */
.list {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.item {
  display: flex; gap: 13px; align-items: center; width: 100%;
  padding: 13px 15px; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: rgba(255, 255, 255, .03); }
.item .grow { flex: 1; min-width: 0; }
.item .title {
  font-weight: 500; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .meta {
  font-size: .8rem; color: var(--fg-muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .amount {
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em;
}

.thumb {
  width: 44px; height: 54px; border-radius: var(--radius-sm); flex: none;
  overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 20% 15%, rgba(255,204,188,.20), transparent 55%),
              radial-gradient(120% 120% at 85% 80%, rgba(179,229,252,.18), transparent 55%), #17171a;
  border: 1px solid var(--line);
  font-family: var(--font-display); font-size: .62rem; font-weight: 600;
  letter-spacing: .08em; color: rgba(255, 255, 255, .45);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  color: var(--fg-muted); letter-spacing: -.01em;
}

.empty { text-align: center; padding: 40px 22px; color: var(--fg-muted); }
.empty .big {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 600;
  letter-spacing: -.04em; color: rgba(255, 255, 255, .14); margin-bottom: 10px;
}

/* -------------------------------------------------------------- Merkmale */
.badge {
  display: inline-block; padding: .24rem .66rem; border-radius: 999px;
  font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--fg-muted); white-space: nowrap;
}
.badge.gruen { color: var(--gut); border-color: rgba(165, 214, 167, .35); background: var(--gut-bg); }
.badge.gelb  { color: var(--acht); border-color: rgba(255, 224, 130, .32); background: var(--acht-bg); }
.badge.rot   { color: var(--schlecht); border-color: rgba(239, 154, 154, .35); background: var(--schlecht-bg); }
.badge.grau  { color: var(--fg-dim); }

.tagchip {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted); border: 1px solid var(--line); border-radius: 999px;
  padding: .26rem .66rem; white-space: nowrap;
}
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0 0; }

/* ------------------------------------------------------------- Bedienung */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-size: .9rem; font-weight: 600;
  padding: .72rem 1.3rem; min-height: 46px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--fg); cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, .07); border-color: var(--fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.ghost { border-color: transparent; color: var(--fg-muted); padding: .5rem .7rem; min-height: 40px; }
.btn.ghost:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.btn.danger { color: var(--schlecht); border-color: rgba(239, 154, 154, .35); }
.btn.danger:hover { background: var(--schlecht-bg); border-color: var(--schlecht); }
.btn.block { width: 100%; }
.btn.small { padding: .45rem .95rem; min-height: 38px; font-size: .8rem; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.row { display: flex; gap: 9px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

label.field { display: block; margin-bottom: 14px; }
label.field span {
  display: block; font-size: .64rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fg-muted); margin-bottom: 7px;
}
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=search], select, textarea {
  width: 100%; padding: .7rem .85rem; min-height: 46px; font-size: 16px;
  background: var(--bg-sunken); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-3); background: var(--bg-elev);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a8a6a2' stroke-width='1.6'><path d='M1 1.5 6 6.5 11 1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
input[type=date] { min-height: 46px; }
::placeholder { color: var(--fg-dim); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: .42rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  font-size: .74rem; font-weight: 600; letter-spacing: .06em;
  color: var(--fg-muted); cursor: pointer; white-space: nowrap;
  transition: all .28s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--fg); }
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* ------------------------------------------------------------ Navigation */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(11, 11, 12, .82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-bottom);
}
nav.bottom button {
  flex: 1; background: none; border: 0; cursor: pointer;
  padding: 9px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: .58rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-dim); transition: color .3s var(--ease);
  position: relative;
}
nav.bottom button:hover { color: var(--fg-muted); }
nav.bottom button.on { color: var(--fg); }
nav.bottom button.on::before {
  content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 26px; height: 2px; border-radius: 2px;
  background: var(--accent-grad); background-size: 200% auto;
  animation: gradientFlow 9s ease-in-out infinite;
}
nav.bottom svg { width: 21px; height: 21px; }

.fab {
  position: fixed; right: 20px; bottom: calc(88px + var(--safe-bottom)); z-index: 45;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.fab:hover { transform: translateY(-3px); background: #fff; }
.fab:active { transform: translateY(0); }

/* --------------------------------------------------------------- Dialoge */
.sheet-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 6, 7, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-bg.open { display: flex; }
.sheet {
  background: var(--bg-elev); border: 1px solid var(--line); border-bottom: 0;
  width: 100%; max-width: 660px; max-height: 92vh;
  border-radius: 22px 22px 0 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 18px calc(26px + var(--safe-bottom));
  animation: sheetUp .34s var(--ease);
  /* Für das Herunterwischen: der Rückweg wird weich gefahren */
  transition: transform .26s var(--ease);
}
/* Solange der Finger zieht, folgt das Blatt ohne Verzögerung */
.sheet.zieht { transition: none; }
@keyframes sheetUp { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: var(--radius); border-bottom: 1px solid var(--line); max-height: 88vh; }
}
/* Kopfzeile jedes Dialogs: Griff in der Mitte, Schließen-Knopf rechts.
   Sie bleibt beim Blättern oben stehen, damit der Weg hinaus immer da ist. */
.sheet-kopf {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: flex-start; justify-content: flex-end;
  margin: 0 -18px 6px; padding: 7px 12px 7px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  /* Hier wird gewischt, deshalb soll der Browser die Geste nicht selbst
     als Blättern deuten. */
  touch-action: none;
}
/* Der Griff sitzt bündig oben in der Mitte */
.sheet .handle {
  position: absolute; left: 50%; top: 7px;
  transform: translateX(-50%);
  width: 44px; height: 4px; border-radius: 2px;
  background: var(--line-strong); margin: 0;
  transition: background .18s var(--ease), width .18s var(--ease);
}
.sheet-kopf:active .handle { background: var(--fg-muted); width: 54px; }
.sheet-zu {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--bg-elev-2); color: var(--fg-muted);
  border: 1px solid var(--line); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.sheet-zu:active, .sheet-zu:hover { background: var(--fg); color: var(--bg); }
.sheet h3 { margin-top: 0; font-size: 1.3rem; }
.sheet-actions { display: flex; gap: 9px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.sheet details summary { cursor: pointer; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

/* -------------------------------------------------------------- Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  text-align: left; padding: 9px 7px;
  font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-dim); border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 7px; border-bottom: 1px solid var(--line); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tr.sum td {
  font-family: var(--font-display); font-weight: 600;
  border-top: 1px solid var(--line-strong); border-bottom: 0;
}
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------------------- Meldungen */
#toast {
  position: fixed; left: 50%; translate: -50% 0;
  bottom: calc(100px + var(--safe-bottom)); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 36px);
}
.toast {
  background: var(--fg); color: var(--bg);
  padding: .65rem 1.15rem; border-radius: 999px;
  font-size: .85rem; font-weight: 500; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: riseIn .3s var(--ease);
}
.toast.err  { background: var(--schlecht); }
.toast.ok   { background: var(--gut); }
.toast.warn { background: var(--acht); }

.banner {
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  font-size: .87rem; margin-bottom: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  display: flex; gap: .7rem; align-items: flex-start;
}
.banner::before {
  content: ""; width: 3px; align-self: stretch; border-radius: 3px; flex: none;
  background: var(--accent-3);
}
.banner.warn { background: var(--acht-bg); border-color: rgba(255, 224, 130, .22); }
.banner.warn::before { background: var(--accent-2); }
.banner.err { background: var(--schlecht-bg); border-color: rgba(239, 154, 154, .25); }
.banner.err::before { background: var(--schlecht); }
.banner.info { background: var(--info-bg); border-color: rgba(179, 229, 252, .20); }

.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: var(--accent-2); color: #111;
  text-align: center; font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; display: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.offline .offline-bar { display: block; }
body.offline header.top { padding-top: calc(28px + env(safe-area-inset-top)); }

/* ----------------------------------------------------------------- Login */
.center-screen {
  min-height: 100svh; display: grid; place-items: center;
  padding: 28px 22px; position: relative; overflow: hidden;
}
/* Ruhiges Aurora-Leuchten, wie im Hero der Website */
.center-screen::before {
  content: ""; position: absolute; pointer-events: none;
  width: min(140vw, 1000px); aspect-ratio: 1; left: 50%; top: 38%; translate: -50% -50%;
  background:
    radial-gradient(circle at 35% 40%, rgba(255, 204, 188, .16), transparent 60%),
    radial-gradient(circle at 68% 55%, rgba(179, 229, 252, .14), transparent 62%),
    radial-gradient(circle at 50% 75%, rgba(209, 196, 233, .12), transparent 65%);
  filter: blur(34px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
.login-box { width: 100%; max-width: 400px; position: relative; z-index: 2; }
.login-box .eyebrow { justify-content: center; margin-bottom: 1.1rem; }
.login-box .eyebrow::before { display: none; }
.login-box h1 {
  text-align: center; font-size: clamp(2.6rem, 12vw, 3.4rem);
  font-weight: 600; letter-spacing: -.05em; margin: 0 0 .35rem;
}
.login-box .tag {
  text-align: center; color: var(--fg-muted); font-size: .92rem; margin-bottom: 1.8rem;
}
.login-box .card { background: rgba(19, 19, 21, .8); backdrop-filter: blur(8px); }
.login-foot {
  text-align: center; margin-top: 1.4rem;
  font-size: .62rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-dim);
}

/* ------------------------------------------------------------- Sonstiges */
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress i {
  display: block; height: 100%; width: 0;
  background: var(--accent-grad); background-size: 200% auto;
  transition: width .3s var(--ease);
}

.doc-preview {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg-sunken); max-height: 52vh; object-fit: contain; display: block;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Abzeichen unter einem Listeneintrag, ohne abgeschnitten zu werden */
.badge-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

/* Auf schmalen Bildschirmen zeigen die Auswertungstabellen nur das Wesentliche */
@media (max-width: 560px) {
  .table.kompakt th:nth-child(3), .table.kompakt td:nth-child(3),
  .table.kompakt th:nth-child(4), .table.kompakt td:nth-child(4) { display: none; }
  .table { font-size: .82rem; }
  .table th, .table td { padding: 9px 5px; }
}

/* Papierflieger über dem Namen auf dem Anmeldebildschirm */
.login-plane { display: flex; justify-content: center; margin-bottom: 1.1rem; }
.login-plane svg { animation: riseIn 1s var(--ease) .1s both; }

/* Vierspaltige Tabellen blenden auf schmalen Bildschirmen die Steuer aus */
@media (max-width: 560px) {
  .table.schmal th:nth-child(3), .table.schmal td:nth-child(3) { display: none; }
}

/* ------------------------------------------------- Auswahl und Ablegen */
.item.gewaehlt { background: rgba(179, 229, 252, .07); }
.haken {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-strong); display: grid; place-items: center;
  font-size: .8rem; color: var(--bg); background: transparent;
}
.haken.an { background: var(--accent-3); border-color: var(--accent-3); color: #0b0b0c; font-weight: 700; }

#ablegen {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(6, 6, 7, .82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
#ablegen.an { display: flex; animation: riseIn .18s var(--ease); }
.ablegen-box {
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  padding: 42px 34px; text-align: center; max-width: 460px; width: 100%;
  background: rgba(19, 19, 21, .7);
}
.ablegen-box svg { margin: 0 auto 16px; display: block; }
.ablegen-titel {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  letter-spacing: -.03em; margin-bottom: 6px;
}
.ablegen-text { color: var(--fg-muted); font-size: .9rem; }

/* ---------------------------------------------------- Der Marge-Balken
   Zeigt je Projekt, wie viel von den Einnahmen übrig bleibt, und wo dieser
   Punkt bei den übrigen Projekten liegt. */
.vbalken { margin-top: 10px; }
.vbalken.gross { margin: 0 0 14px; padding: 16px; }

.vb-spur {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  overflow: hidden;
}
.vbalken.gross .vb-spur { height: 18px; border-radius: 9px; }

.vb-teil {
  position: absolute;
  top: 0; bottom: 0;
  transition: width .45s var(--ease), left .45s var(--ease);
}
.vb-aus    { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); }
.vb-uebrig { background: var(--gut); }
.vb-fehl   { background: var(--schlecht); }

/* Wo die Ausgaben bei einem üblichen Projekt enden würden.
   Der Strich liegt über der Spur, damit er auch an den Rändern zu sehen ist. */
.vb-rahmen { position: relative; padding-top: 6px; }
.vb-median {
  position: absolute;
  top: 0; bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--fg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  border-radius: 1px;
  transition: left .45s var(--ease);
}
.vb-median::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--fg);
}

/* Der hellere Streifen darunter: mit den geplanten Posten gerechnet */
.vb-plan { height: 6px; margin-top: 4px; opacity: .55; border-radius: 3px; }
.vbalken.gross .vb-plan { height: 8px; margin-top: 5px; }

.vb-fuss {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; font-size: 12.5px;
}
.vb-kenn { color: var(--fg-muted); }

.vb-legende {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 10px; font-size: 12.5px; color: var(--fg-muted);
}
.vb-legende span { display: inline-flex; align-items: center; gap: 6px; }
.vb-punkt { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.vb-punkt.aus    { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); }
.vb-punkt.uebrig { background: var(--gut); }
.vb-punkt.fehl   { background: var(--schlecht); }
.vb-punkt.median { width: 0; height: 12px; border-left: 2px dashed var(--fg); border-radius: 0; }
.vb-punkt.plan   { background: var(--fg-dim); opacity: .45; }

.vb-satz { margin-top: 12px; line-height: 1.5; }
.vb-satz .badge { vertical-align: 1px; }

/* -------------------------------------------- Anzeige der Texterkennung
   Solange Claude Belege liest, blinkt oben rechts ein Punkt. */
.lese {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  background: var(--info-bg); border: 1px solid rgba(179, 229, 252, .28);
  color: var(--accent-3); font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em; white-space: nowrap;
}
.lese.hidden { display: none; }
.lese-punkt {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent-3); animation: pulsen 1.25s ease-in-out infinite;
}
@keyframes pulsen { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Dasselbe kleiner, in der Belegzeile und im Belegblatt */
.badge.liest { color: var(--accent-3); border-color: rgba(179, 229, 252, .3); background: var(--info-bg); }
.badge.liest::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-3); margin-right: 5px; vertical-align: 0;
  animation: pulsen 1.25s ease-in-out infinite;
}

/* Kleines Auswahlfeld in Listenzeilen, etwa für den Steuersatz je Kategorie */
select.klein {
  flex: none; width: auto; min-width: 116px;
  padding: .4rem .6rem; font-size: .82rem;
  background: var(--bg-elev-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
