/* ============================================================
   LifeOS – Design-Tokens
   Helles, fast monochromes Layout nach Vorlage; Apricot bleibt
   die Akzentfarbe. Serif fuer Headlines, Monospace fuer Labels.
   ============================================================ */
:root {
  /* Flächen – warmes Weiß mit minimalem Gelbstich, damit das Apricot
     nicht auf kaltem Grau sitzt */
  --bg:          #faf9f7;
  --surface:     #ffffff;
  --surface-2:   #f7f6f4;
  --surface-3:   #efedea;

  /* Dunkles Warmschwarz – Kopfzeile und der Briefing-Block */
  --dark:        #232120;

  /* Hairlines – tragen wie vorher die gesamte Struktur, jetzt hell */
  --border:      #e7e4e0;
  --border-soft: #f0eeeb;
  --border-lift: #d4d0ca;

  /* Typo-Farben */
  --text:        #1b1a19;
  --text-dim:    #56524e;
  --muted:       #8a857f;

  /* Apricot. Als Fläche bleibt der Originalton, als Schrift oder Linie
     muss er deutlich dunkler werden: #f0a97c auf Weiß sind nur 1.9:1,
     --accent-ink erreicht 5.6:1 und ist damit als Text lesbar. */
  --accent:      #f0a97c;
  --accent-ink:  #a0521a;
  --accent-soft: rgba(240, 169, 124, .16);
  --accent-line: rgba(240, 169, 124, .55);
  --accent-grad: linear-gradient(165deg, #fad0ac 0%, #f0a97c 55%, #e59463 100%);

  /* Bereichs-Tags. Jede Klasse setzt --a (Schrift/Linie, alle ≥4.5:1 auf Weiß)
     und --a-soft (Fläche). Genutzt von Filter-Chips, Task-Dropdown und
     Projektkarten – deshalb hier zentral und nicht je Komponente. */
  --a-all: var(--accent-ink);

  /* Prioritäten – warme Palette, auf hellem Grund nachgedunkelt */
  --p4: #c2410c;   /* Dringend */
  --p3: #a0521a;   /* Hoch     */
  --p2: #8a857f;   /* Mittel   */
  --p1: #b3aea8;   /* Niedrig  */
  --ok: #3f7d55;

  /* Finanzanalyse: zwei zusaetzliche, im uebrigen UI ungenutzte Hues fuer
     Einnahmen/Ausgaben (kategorial, feste Zuordnung, nicht zyklisch -
     siehe dataviz-Skill). Auf --bg validiert. */
  --chart-income:  #2a78d6;
  --chart-expense: #eb6834;

  /* Kantig statt Bento – die Vorlage arbeitet mit fast rechten Winkeln */
  --radius-lg: 6px;
  --radius:    4px;
  --radius-sm: 3px;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, .8, .28, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
}

/* Sehr zurückhaltender warmer Schimmer oben – ersetzt den Radial-Glow
   der dunklen Fassung, ohne die hellen Flächen anzuschmutzen */
.glow {
  position: fixed;
  top: 0; left: 50%;
  width: 1200px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(240, 169, 124, .10) 0%, rgba(240, 169, 124, .03) 42%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body > *:not(.glow) { position: relative; z-index: 1; }

.hidden { display: none !important; }
.muted  { color: var(--muted); }
.error  { color: var(--p4); font-size: 13.5px; }

/* Headlines durchgehend in der Serif, mit engem Satz wie in der Vorlage */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0;
}

/* Versal-Label in Monospace mit weiter Laufweite – das wiederkehrende
   Detail der Vorlage (Navigation, Rubriken, Spaltenköpfe) */
nav .tab, .prio-col > header .label, .cal-dow,
.briefing-col > h3, .content-sub-head h4 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 500;
}

/* ============================================================
   Karte – das Grundelement des Layouts
   ============================================================ */
.bento {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.bento:hover { border-color: var(--border-lift); }

/* ============================================================
   Buttons & Felder
   ============================================================ */
input, select, button, textarea {
  font: inherit;
  letter-spacing: inherit;
  border-radius: var(--radius);
}

input, select, textarea {
  padding: 10px 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--border-lift); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button { cursor: pointer; border: none; background: none; color: inherit; }

.btn-primary {
  padding: 11px 22px;
  border-radius: var(--radius);
  background: var(--accent-grad);
  border: 1px solid rgba(180, 110, 60, .35);
  color: #3a220f;
  font-weight: 600;
  transition: filter .2s var(--ease), transform .18s var(--ease);
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .arr { display: inline-block; transition: transform .22s var(--ease); }
.btn-primary:hover .arr { transform: translateX(3px); }

.btn-ghost {
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 500;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.btn-ghost:hover { border-color: var(--border-lift); color: var(--text); }

/* Pill-Badge */
.badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ============================================================
   Login
   ============================================================ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: 100%; max-width: 420px;
  padding: 40px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 {
  margin: 10px 0 0;
  font-size: 46px; line-height: 1.05; font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.login-card p { margin: 0 0 6px; }
.login-card .btn-primary { margin-top: 6px; }

/* ============================================================
   Header – dunkles Band wie in der Vorlage
   ============================================================ */
header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 32px;
  background: var(--dark);
  color: #fff;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-mono);
  font-weight: 600; font-size: 15px;
  text-transform: uppercase; letter-spacing: .16em;
  color: #fff;
}
.brand .mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 2px;
  background: var(--accent);
  color: #2a1a10;
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0;
}

nav { display: flex; gap: 6px; flex: 1; justify-content: center; }
.tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.tab:hover { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .06); }
.tab.active { color: var(--accent); background: rgba(240, 169, 124, .12); }

/* Reiter mit Ausklappmenü (Rechnungen) */
.tab-group { position: relative; }
.tab-group .caret { font-size: 9px; opacity: .7; margin-left: 2px; }
.tab-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 190px; padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(28, 25, 23, .22);
  display: flex; flex-direction: column;
}
.tab-menu[hidden] { display: none; }
.tab-menu button {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.tab-menu button:hover { background: var(--surface-2); color: var(--text); }
.tab-menu button.current { color: var(--accent-ink); background: var(--accent-soft); font-weight: 500; }

header .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .82);
}
header .btn-ghost:hover { border-color: rgba(255, 255, 255, .45); color: #fff; }

/* ============================================================
   Schnellerfassung
   ============================================================ */
.capture {
  display: flex; gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 32px 0;
}
.capture input { flex: 1; }
.capture select { width: auto; color: var(--text-dim); }
.capture-submit {
  width: 46px; padding: 0;
  font-size: 20px; line-height: 1;
  display: grid; place-items: center;
}

/* ============================================================
   Bereichs-Tags & Filterleiste
   ============================================================ */
.a-all        { --a: var(--accent-ink); --a-soft: var(--accent-soft); }
.a-4eo        { --a: #a0521a; --a-soft: rgba(160, 82, 26, .10); }
.a-content    { --a: #8a3f7a; --a-soft: rgba(138, 63, 122, .10); }
.a-nuel_media { --a: #2c6180; --a-soft: rgba(44, 97, 128, .10); }
.a-sonstiges  { --a: #6b6660; --a-soft: rgba(107, 102, 96, .10); }

/* Sitzt direkt unter der Überschrift der Liste, die sie filtert.
   Immer offen, kein Menü: „Alle" plus je ein anhakbarer Tag. */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -4px 0 16px;
}

.fchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 9px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.fchip:hover { border-color: var(--a); color: var(--a); }

.fchip .box {
  flex: none;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  border-radius: 2px;
  border: 1.5px solid var(--border-lift);
  background: var(--surface);
  color: transparent;
  font-size: 9.5px; line-height: 1;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.fchip .n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.fchip.on { color: var(--a); border-color: var(--a); background: var(--a-soft); }
.fchip.on .box { border-color: var(--a); background: var(--a); color: #fff; }
.fchip.on .n { color: var(--a); opacity: .7; }

/* Prioritäts- und Bereichs-Dropdown in der Task-Zeile – sehen aus wie Chips,
   sind aber echte <select>, damit ein Klick reicht. Beide färben sich über
   --a / --a-soft, gesetzt von .p1–.p4 bzw. .a-*. */
.prio-pick, .area-pick {
  padding: 2px 20px 2px 9px;
  border-color: var(--a);
  background-color: var(--a-soft);
  color: var(--a);
  font-size: 12px;
  line-height: inherit;
  width: auto; max-width: 150px;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 7px center, right 10px center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.prio-pick:hover, .area-pick:hover { border-color: var(--a); }
.area-pick.inherited { opacity: .6; font-style: italic; }

.prio-pick { font-weight: 500; }
/* Niedrig/Mittel bewusst nicht in --p1/--p2: die hellen Grautöne haben als
   Schrift zu wenig Kontrast, und das hier ist ein Bedienelement. */
.prio-pick.p4 { --a: var(--p4);       --a-soft: rgba(194, 65, 12, .10); }
.prio-pick.p3 { --a: var(--p3);       --a-soft: rgba(160, 82, 26, .10); }
.prio-pick.p2 { --a: var(--text-dim); --a-soft: var(--surface-2); }
.prio-pick.p1 { --a: #6b6660;         --a-soft: var(--surface-2); }

.chip.area-tag { border-color: var(--a); background: var(--a-soft); color: var(--a); }

/* ============================================================
   Layout
   ============================================================ */
main { max-width: 1180px; margin: 0 auto; padding: 30px 32px 80px; }

/* Sektionsüberschrift in der Serif, mit Monospace-Zähler daneben */
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 44px 0 18px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 30px; font-weight: 600; }
.section-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}

/* ============================================================
   Block 1 – Briefing (Heutige Prios · News · zu klären)
   Der einzige dunkle Block im Inhalt: das Pendant zum Hero der
   Vorlage, damit der Tageseinstieg optisch traegt.
   ============================================================ */
.briefing {
  padding: 30px;
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.briefing:hover { border-color: var(--dark); }

.briefing-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.briefing-head h2 { font-size: 36px; font-weight: 600; color: #fff; }
.briefing-head .date {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em;
  color: rgba(255, 255, 255, .5);
  margin-top: 6px;
}
.briefing-head .badge {
  border-color: rgba(240, 169, 124, .45);
  background: rgba(240, 169, 124, .14);
  color: var(--accent);
}

.briefing-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  overflow: hidden;
}
.briefing-col { background: var(--dark); padding: 20px; min-height: 150px; }
.briefing-col > h3 {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  color: rgba(255, 255, 255, .48);
  margin-bottom: 15px;
}

.brief-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.brief-item:first-of-type { border-top: none; padding-top: 0; }
.brief-item .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); flex: none; margin-top: 9px;
}
.brief-item .dot.p4 { background: #f07a5f; }
.brief-item .dot.p2 { background: rgba(255, 255, 255, .45); }
.brief-item .dot.p1 { background: rgba(255, 255, 255, .28); }
.brief-item .txt { flex: 1; min-width: 0; font-size: 13.5px; }
.brief-item .sub {
  color: rgba(255, 255, 255, .45);
  font-size: 12px; margin-top: 1px;
}
.brief-item .resolve {
  color: rgba(255, 255, 255, .4); font-size: 12px; flex: none;
  opacity: 0; transition: opacity .2s var(--ease), color .2s var(--ease);
}
.brief-item:hover .resolve { opacity: 1; }
.brief-item .resolve:hover { color: var(--accent); }

.briefing .empty { color: rgba(255, 255, 255, .35); }

/* ============================================================
   Block 2 – To-Dos nach Prio (High / Mid / Low)
   ============================================================ */
/* minmax(0, 1fr) statt 1fr: sonst zwingt ein langer, nicht umbrechender Chip
   („Website-Datenschutzerklärungen nach eRecht24-Abo") seine Spalte breiter
   und quetscht die beiden anderen zusammen. */
.prio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.prio-col { padding: 20px; }
.prio-col > header {
  position: static; padding: 0; border: none;
  background: none; color: inherit;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 16px;
}
.prio-col > header .label { font-size: 11px; flex: 1; color: var(--text-dim); }
.prio-col > header .n {
  min-width: 22px; text-align: center;
  padding: 2px 7px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
}
.prio-col > header .swatch { width: 7px; height: 7px; border-radius: 50%; }
.prio-col.high header .swatch { background: var(--p4); }
.prio-col.mid  header .swatch { background: var(--accent); }
.prio-col.low  header .swatch { background: var(--p1); }
.prio-col.high { border-color: rgba(194, 65, 12, .22); }

/* In den drei schmalen Spalten etwas kompakter als in Inbox/Projektansicht,
   damit Titel und Chips nicht jede für sich eine Zeile brauchen. */
.prio-col .task .meta { font-size: 11.5px; gap: 4px; }
.prio-col .chip, .prio-col .prio-pick, .prio-col .area-pick { padding-top: 1px; padding-bottom: 1px; }
.prio-col .task .title { font-size: 14px; }

/* Drag & Drop – die Liste ist das Drop-Ziel, min-height hält auch leere
   Spalten treffbar. */
.prio-list { min-height: 46px; }
.prio-col.drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.drag-item.dragging { opacity: .35; }

.drop-line {
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--accent);
}

/* Die Zeile, die am Zeiger hängt. Liegt an <body>, deshalb position:fixed;
   pointer-events:none, damit elementFromPoint die Spalte darunter trifft. */
.drag-ghost {
  position: fixed; top: 0; left: 0;
  z-index: 60;
  width: auto;
  padding: 11px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(28, 25, 23, .22);
  opacity: .96;
  pointer-events: none;
}
.drag-ghost .actions { display: none; }

/* Griff: nur in den Prio-Spalten und nur an der Hauptzeile, nicht an
   Teilaufgaben – die werden über ihre Elternaufgabe mitbewegt. Dauerhaft
   sichtbar (nur gedimmt), sonst findet man ihn nicht.
   touch-action: none = am iPhone zieht der Griff, statt zu scrollen. */
.task .grip { display: none; }
.prio-list > .drag-item .grip {
  display: block;
  flex: none;
  width: 13px; margin-top: 1px;
  color: var(--border-lift);
  font-size: 13px; line-height: 1.4;
  text-align: center;
  cursor: grab;
  opacity: .55;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  transition: opacity .2s var(--ease), color .2s var(--ease);
}
.prio-list > .drag-item .subtasks .grip { display: none; }
.prio-list > .drag-item:hover .grip { opacity: 1; color: var(--muted); }
.prio-list > .drag-item .grip:hover { color: var(--accent-ink); }
.prio-list > .drag-item .grip:active { cursor: grabbing; }

/* ============================================================
   Task-Zeile
   ============================================================ */
.task {
  position: relative;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}
.task:first-of-type { border-top: none; padding-top: 2px; }

.task .check {
  width: 18px; height: 18px; flex: none; margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--border-lift);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.task .check:hover { border-color: var(--accent); background: var(--accent-soft); }
.task.done .check { background: var(--ok); border-color: var(--ok); }
.task.done .title { text-decoration: line-through; color: var(--muted); }

.task .body { flex: 1; min-width: 0; }
.task .title { font-size: 14.5px; font-weight: 500; }
.task .meta {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin-top: 6px; font-size: 12px; color: var(--muted);
}

.chip {
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
}

/* In den schmalen Prio-Spalten darf ein langer Projektname die Zeile nicht
   sprengen – lieber abschneiden, der volle Name steht im title-Attribut. */
.task .meta > .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.flag { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.chip.overdue { border-color: rgba(194, 65, 12, .3); background: rgba(194, 65, 12, .08); color: var(--p4); }

/* Stern nur zeigen, wenn gesetzt oder wenn die Zeile unter dem Cursor ist */
.star { cursor: pointer; opacity: 0; transition: opacity .2s var(--ease), color .2s var(--ease); }
.task:hover .star { opacity: .35; }
.task:hover .star:hover { opacity: .7; }
.star.on, .task:hover .star.on { opacity: 1; color: var(--accent-ink); }

/* Absolut in der Ecke statt als Flex-Kind: als Flex-Kind hat „+ Teilaufgabe"
   auch unsichtbar ~110px Breite belegt – in den schmalen Prio-Spalten blieben
   dem Titel dadurch nur noch gut 140px und alles brach zeilenweise um. */
.task .actions {
  position: absolute; top: 8px; right: 0;
  display: flex; gap: 6px;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.task:hover .actions { opacity: 1; }
.task .actions .iconbtn { box-shadow: -10px 0 10px 4px var(--surface); }
.task .actions .del-task:hover { color: var(--p4); border-color: rgba(194, 65, 12, .35); }
.iconbtn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.iconbtn:hover { color: var(--text); border-color: var(--border-lift); }

.subtasks { margin: 2px 0 0 29px; padding-left: 14px; border-left: 1px solid var(--border); }
.subtasks .task { padding: 8px 0; border-top: none; }
.subtasks .title { font-size: 13.5px; font-weight: 400; color: var(--text-dim); }

/* ============================================================
   Block 3 – Kalender (7-Tage-Streifen)
   ============================================================ */
.calendar { padding: 0; overflow: hidden; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}
.cal-day {
  background: var(--surface);
  padding: 16px 14px;
  min-height: 190px;
  display: flex; flex-direction: column; gap: 8px;
}
.cal-day.today { background: var(--accent-soft); }
.cal-day.weekend { background: var(--surface-2); }
.cal-day.weekend .cal-date { color: var(--muted); }

.cal-dow { font-size: 10px; color: var(--muted); }
.cal-date {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600; line-height: 1; margin-top: -2px;
}
.cal-day.today .cal-date { color: var(--accent-ink); }
.cal-day.today .cal-dow { color: var(--accent-ink); }

.cal-events { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cal-event {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  font-size: 12.5px;
  line-height: 1.35;
}
.cal-day.today .cal-event { background: rgba(255, 255, 255, .75); }
.cal-event .time {
  font-family: var(--font-mono);
  color: var(--muted); font-size: 10.5px; display: block;
  text-transform: uppercase; letter-spacing: .08em;
}
.cal-event.src-google { border-left-color: #4f7dc4; }
.cal-event.src-apple  { border-left-color: #8b6bc4; }
.cal-event.src-task   { border-left-color: var(--p3); border-left-style: dashed; }

.cal-empty { color: var(--muted); font-size: 12px; opacity: .5; }

/* Hinweisstreifen unter dem Kalender, solange kein Sync eingerichtet ist */
.cal-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   Projekte
   ============================================================ */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.project-card { cursor: pointer; padding: 24px; }
.project-card h3 { font-size: 21px; margin-bottom: 8px; }
.project-card .outcome { color: var(--muted); font-size: 13.5px; min-height: 20px; }
.project-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; font-size: 12px; }
.progress { height: 3px; background: var(--surface-3); border-radius: 999px; margin-top: 18px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent-grad); transition: width .4s var(--ease); }

/* ============================================================
   Content-Management (Social Media)
   ============================================================ */
.content-add { padding: 16px 20px; margin-bottom: 16px; }
.content-add-form { display: flex; gap: 10px; }
.content-add-form .idea-title { flex: 1; }
.content-add-form .idea-date { width: auto; color: var(--text-dim); }

.content-list { display: flex; flex-direction: column; gap: 16px; }

.content-card { padding: 24px; display: flex; flex-direction: column; gap: 15px; }
.content-card.posted { opacity: .55; }

.content-head { display: flex; align-items: center; gap: 10px; }
.content-head h3 { flex: 1; font-size: 22px; cursor: pointer; }
.content-head h3:hover { color: var(--accent-ink); }
.content-del { opacity: 0; transition: opacity .2s var(--ease), color .2s var(--ease); }
.content-card:hover .content-del { opacity: .55; }
.content-del:hover { opacity: 1 !important; color: var(--p4); }

.content-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.content-status, .content-date {
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  width: auto;
}
.content-date.overdue { border-color: rgba(194, 65, 12, .3); background: rgba(194, 65, 12, .08); color: var(--p4); }
.chip.tag { cursor: pointer; }
.chip.tag:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

.content-text {
  width: 100%; resize: none; overflow: hidden;
  padding: 12px 14px; min-height: 44px;
  background: var(--surface-2);
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
}
.content-text:focus { background: var(--surface); }

.content-sub { border-top: 1px solid var(--border-soft); padding-top: 14px; }
.content-sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.content-sub-head h4 {
  flex: 1; margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  color: var(--muted);
}
.content-sub-list { display: flex; flex-direction: column; gap: 6px; }
.content-sub-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 13px;
}
.content-sub-item span, .content-sub-item a { flex: 1; min-width: 0; color: var(--text-dim); }
.content-sub-item a { color: var(--accent-ink); text-decoration: none; overflow-wrap: anywhere; }
.content-sub-item a:hover { text-decoration: underline; }
.content-sub-item .iconbtn { opacity: 0; transition: opacity .2s var(--ease); }
.content-sub-item:hover .iconbtn { opacity: .6; }
.content-sub-item .iconbtn:hover { opacity: 1 !important; color: var(--p4); }

/* ============================================================
   Zustände
   ============================================================ */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 44px 20px;
  font-size: 13.5px;
}
.prio-col .empty, .briefing-col .empty { padding: 22px 0; text-align: left; }

.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 12px 40px rgba(28, 25, 23, .25);
  z-index: 50;
}

.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted);
  transition: color .2s var(--ease);
}
.back-link:hover { color: var(--accent-ink); }

/* ============================================================
   Rechnungen / Finanzen
   ============================================================ */
/* Rechts (Finanzanalyse) doppelt so breit wie links (Rechnungen), wie vom
   User gefordert. */
.finance-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 8px;
}

.invoices-col, .finance-col { display: flex; flex-direction: column; }

/* Die linke Spalte ist nur rund ein Drittel breit - bei den globalen 30px
   bricht „Anstehende Rechnungen" auf zwei Zeilen. Kleiner setzen und den
   Umbruch verbieten, damit die drei Überschriften gleich hoch bleiben. */
.invoices-col .section-head h2 { font-size: 21px; white-space: nowrap; }
.invoices-col .section-head, .finance-col .section-head { margin-top: 20px; }
.invoices-col .section-head:first-child, .finance-col .section-head:first-child { margin-top: 0; }

.invoice-list { padding: 8px 20px; display: flex; flex-direction: column; }
.invoice-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 13px 0;
  border-top: 1px solid var(--border-soft);
}
.invoice-row:first-child { border-top: none; }
.invoice-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.invoice-number { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.invoice-client { font-size: 14px; font-weight: 500; }
.invoice-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.invoice-date { color: var(--muted); font-size: 12px; }
.invoice-right { display: flex; align-items: center; gap: 10px; }

/* Noch nicht existierende Rechnung (aus einer faelligen Leistung abgeleitet).
   Gestrichelte Kante wie beim Task-Termin im Kalender: sichtbar "noch nicht
   real", ohne eine eigene Farbe zu verbrauchen. */
.invoice-row.forecast { border-left: 2px dashed var(--accent-line); padding-left: 12px; }
.invoice-row.forecast .invoice-number { font-style: italic; }
.invoice-actions { display: flex; align-items: center; gap: 6px; }

/* Schrittknopf in die naechste Station (versendet -> bezahlt). Dezent, bis
   man mit der Maus in die Zeile geht - loest aber sofort aus, kein Dialog. */
.invoice-step {
  padding: 5px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim);
  opacity: .45;
  transition: opacity .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.invoice-row:hover .invoice-step { opacity: 1; }
.invoice-step:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.invoice-pdf { opacity: .5; transition: opacity .2s var(--ease); }
.invoice-row:hover .invoice-pdf { opacity: 1; }

/* ---- Betrag als Statusfeld ----
   Traegt die Zahlungslage als Flaeche: grau = muss noch raus, orange = raus
   und im Zahlungsziel, rot = Zahlungsziel gerissen, gruen = bezahlt.
   Die Textfarbe ist je Grundton getrennt gewaehlt: auf Rot und Gruen laeuft
   Weiss (>4.5:1), auf dem hellen Orange dagegen dunkles Braun - weisse
   Schrift auf einem Orange, das noch als Orange lesbar ist, kaeme nie auf
   ausreichenden Kontrast. Farbe steht nie allein: der Status-Chip daneben
   benennt den Zustand zusaetzlich. */
.invoice-amount {
  padding: 5px 11px;
  border-radius: var(--radius);
  font-size: 18px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.invoice-amount.state-todo    { background: var(--surface-3); color: #44403c; }
.invoice-amount.state-due     { background: #f59e0b; color: #3a2504; }
.invoice-amount.state-overdue { background: #c0271f; color: #fff; }
.invoice-amount.state-paid    { background: #3f7d55; color: #fff; }
.invoice-amount.state-neutral { background: var(--surface-2); color: var(--muted); }

/* In der Kundenhistorie dieselbe Logik, nur eine Nummer kleiner */
.client-invoice-row .invoice-amount { font-size: 14px; padding: 3px 9px; }

.invoice-files { display: inline-flex; gap: 4px; }
.client-invoice-row .invoice-files .iconbtn { opacity: .5; }
.client-invoice-row:hover .invoice-files .iconbtn { opacity: 1; }

/* ---- Gesamtübersicht / Rechnungshistorie ---- */
.history-year-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.history-year-head h3 { font-size: 24px; }
.history-year-sum {
  margin-left: auto;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.history-month { margin-bottom: 12px; }
.history-month-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.history-month-name {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.history-month-sum {
  font-size: 12.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Status-Farbe traegt nur bei den beiden Endzustaenden, die wirklich vom
   Normalfall abweichen - alles andere bleibt neutraler Chip. */
.chip.status-paid { border-color: rgba(63, 125, 85, .35); background: rgba(63, 125, 85, .12); color: var(--ok); }
.chip.status-cancelled { border-color: rgba(194, 65, 12, .3); background: rgba(194, 65, 12, .1); color: var(--p4); }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-tile { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.kpi-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-tile.good .kpi-value { color: var(--ok); }
.kpi-tile.bad .kpi-value { color: var(--p4); }

.finance-chart { padding: 20px 22px; margin-bottom: 20px; position: relative; }
.chart-legend { display: flex; gap: 18px; margin-bottom: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.legend-item .swatch { width: 9px; height: 9px; border-radius: 2px; }
.legend-item .swatch.income { background: var(--chart-income); }
.legend-item .swatch.expense { background: var(--chart-expense); }
.chart-svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart-grid { stroke: var(--border-soft); stroke-width: 1; }
.chart-bar.income { fill: var(--chart-income); }
.chart-bar.expense { fill: var(--chart-expense); }
.chart-bar { cursor: default; }
.chart-axis-label {
  font-family: var(--font-mono); font-size: 9.5px; fill: var(--muted);
  text-anchor: middle; text-transform: uppercase;
}
.chart-tip {
  position: absolute; pointer-events: none;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--dark); color: #fff;
  font-size: 12px; white-space: nowrap;
  transform: translateY(-100%);
  z-index: 5;
}

.finance-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.finance-sub { padding: 18px 20px; }
.finance-sub-title { font-size: 15px; margin-bottom: 4px; }
.finance-sub-note { color: var(--muted); font-size: 12px; margin: 0 0 14px; }

.cashflow-list { display: flex; flex-direction: column; gap: 8px; }
.cashflow-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--border-soft); }
.cashflow-row:first-child { border-top: none; }
.cashflow-amount { font-weight: 600; font-variant-numeric: tabular-nums; }

.category-list { display: flex; flex-direction: column; gap: 10px; }
.category-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.category-label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-track { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.category-bar { height: 100%; background: var(--chart-expense); border-radius: 999px; }
.category-amount { font-variant-numeric: tabular-nums; font-weight: 500; }

.expense-add { padding: 16px 20px; margin-bottom: 16px; }
.expense-add-form { display: flex; gap: 10px; flex-wrap: wrap; }
.expense-add-form .ex-date { width: 150px; }
.expense-add-form .ex-category { width: 200px; }
.expense-add-form .ex-desc { flex: 1; min-width: 160px; }
.expense-add-form .ex-amount { width: 120px; }

.expense-list { padding: 8px 20px; display: flex; flex-direction: column; }
.expense-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 0; border-top: 1px solid var(--border-soft);
}
.expense-row:first-child { border-top: none; }
.expense-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.expense-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.expense-desc { color: var(--text-dim); font-size: 13px; }
.expense-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.expense-receipt, .expense-del { opacity: .5; transition: opacity .2s var(--ease), color .2s var(--ease); }
.expense-row:hover .expense-receipt, .expense-row:hover .expense-del { opacity: 1; }
.expense-del:hover { color: var(--p4); }

/* Gruppenkopf über der Kundenliste (laufende Kunden / Einmalbezieher) */
.client-group-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 26px 0 12px;
}
.client-group-head h3 { font-size: 19px; }
.client-group-note { color: var(--muted); font-size: 12.5px; }
.client-hidden-note {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted); font-size: 12.5px;
}

.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-card { padding: 0; overflow: hidden; }
.client-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px; cursor: pointer;
}
.client-number { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.client-name { flex: 1; font-weight: 500; }
.client-caret { color: var(--muted); font-size: 12px; }
.client-card.open .client-head { border-bottom: 1px solid var(--border-soft); }

.client-body { padding: 4px 22px 20px; }
.client-sub-title {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 18px 0 10px;
}
.client-services, .client-invoices { display: flex; flex-direction: column; gap: 6px; }
.client-service-row, .client-invoice-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px;
}
.client-service-amount { font-variant-numeric: tabular-nums; font-weight: 500; }
.client-year-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin: 10px 0 6px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .prio-grid, .briefing-cols { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 150px; }
  .section-head h2 { font-size: 26px; }
  .briefing-head h2 { font-size: 30px; }
  .finance-grid, .finance-sub-grid, .kpi-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  header { padding: 14px 18px; gap: 12px; flex-wrap: wrap; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; justify-content: flex-start; }
  .capture { padding: 18px 18px 0; }
  main { padding: 22px 18px 60px; }
  .bento, .briefing, .prio-col, .content-card { padding: 18px; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
  .login-card { padding: 28px; }
  .login-card h1 { font-size: 34px; }
  .section-head h2 { font-size: 24px; }
  .briefing-head h2 { font-size: 27px; }
  .finance-grid, .finance-sub-grid, .kpi-row { grid-template-columns: 1fr; }
  .category-row { grid-template-columns: 90px 1fr auto; }
}

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