/* =============================================================================
   app.css – Gestaltung der Oberfläche
   Stil angelehnt an die CF5 ScoreCard App: heller Hintergrund, klare Karten,
   nummerierte Abschnitte, dunkler Hauptknopf – in den Farben von Tante Siam
   (Schiefergrau #3D4D5C und Gold wie auf www.tantesiam.de).
   ============================================================================= */

/* ---- Schrift Sarabun (lokal eingebunden, unterstützt Deutsch und Thai) ---- */
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url('fonts/sarabun-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url('fonts/sarabun-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Sarabun'; font-weight: 700; font-display: swap; src: url('fonts/sarabun-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url('fonts/sarabun-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url('fonts/sarabun-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sarabun'; font-weight: 700; font-display: swap; src: url('fonts/sarabun-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url('fonts/sarabun-thai-400-normal.woff2') format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url('fonts/sarabun-thai-600-normal.woff2') format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Sarabun'; font-weight: 700; font-display: swap; src: url('fonts/sarabun-thai-700-normal.woff2') format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ---- Farben und Maße (Design-Token) ---- */
:root {
  --brand: #3D4D5C;          /* Hauptfarbe Tante Siam (Schiefer) */
  --brand-dark: #2B3844;     /* dunklere Variante für Seitenleiste */
  --brand-soft: #E9EEF4;     /* helle Fläche für ausgewählte Karten */
  --gold: #D9A62E;           /* Akzent Gold (Logo "Siam") */
  --gold-ink: #8A6210;       /* Gold als lesbare Textfarbe */
  --bg: #F4F6F9;             /* Seitenhintergrund */
  --surface: #FFFFFF;        /* Kartenfläche */
  --border: #DCE2EA;         /* Rahmenlinien */
  --text: #1E2833;           /* Haupttext */
  --muted: #5F6B78;          /* Nebentext */
  --ist: #2E8B57;            /* GRÜN = eingetragener Ist-Wert */
  --ist-soft: #E3F3EA;       /* helles Grün */
  --plan: #2F6FD6;           /* BLAU = hochgerechneter Wert */
  --plan-soft: #E4EDFB;      /* helles Blau */
  --closed: #9AA4AF;         /* GRAU = geschlossen */
  --closed-soft: #EEF0F3;    /* helles Grau */
  --danger: #C8323C;         /* ROT = Warnung */
  --danger-soft: #FBE7E8;    /* helles Rot */
  --warn: #B26A00;           /* Hinweis (orange) */
  --warn-soft: #FFF3E0;      /* helles Orange */
  --series-a: #6A55B8;       /* Diagramm: Kontostand (validiert) */
  --series-b: #A8740E;       /* Diagramm: frei verfügbar (validiert) */
  --radius: 12px;            /* Eckenradius Karten */
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 4px 14px rgba(20, 30, 45, .05); /* dezenter Schatten */
}

/* ---- Grundlayout ---- */
* { box-sizing: border-box; }                                                        /* Rahmen in Breite einrechnen */
html, body { margin: 0; padding: 0; }                                                /* keine Standardabstände */
body { font-family: 'Sarabun', 'Segoe UI', system-ui, sans-serif; font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); } /* Grundschrift */
a { color: var(--plan); }                                                           /* Links */
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }                                 /* Überschriften */
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }       /* Größen */
.muted { color: var(--muted); }                                                     /* Nebentext */
.small { font-size: .85rem; }                                                        /* kleiner Text */
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; } /* Zahlen rechtsbündig, gleich breit */
.hidden { display: none !important; }                                                /* ausblenden */

/* ---- Kopfzeile (wie ScoreCard: Logo links, Sprache/Hilfe/Konfiguration rechts) ---- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { height: 44px; width: 44px; object-fit: contain; }
.wordmark { white-space: nowrap; font-weight: 700; font-size: 1.35rem; letter-spacing: .2px; color: var(--brand); }
.wordmark span { color: var(--gold); }
.apptitle { font-weight: 700; font-size: 1.1rem; color: var(--text); padding-left: 12px; border-left: 1px solid var(--border); }
.topbar .spacer { flex: 1; }
.topbar select { height: 36px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--brand); background: var(--surface); color: var(--brand); font-weight: 700; cursor: pointer; }
.menu-toggle { display: none; }

/* Auswahllisten in Kopf- und Aktionszeilen nur so breit wie nötig */
.topbar select, .pagehead select, .actions select { width: auto; min-width: 140px; }

/* ---- Seitenleiste und Inhalt ---- */
.shell { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 236px; flex-shrink: 0; background: var(--brand-dark); color: #DDE4EC; padding: 14px 10px; }
.sidebar .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: #9FB0C1; margin: 16px 10px 6px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #E7EDF3; text-decoration: none; font-weight: 600; }
.sidebar a:hover { background: rgba(255, 255, 255, .07); }
.sidebar a.active { background: rgba(255, 255, 255, .13); box-shadow: inset 3px 0 0 var(--gold); }
.sidebar .dot { width: 9px; height: 9px; border-radius: 50%; background: #7F93A8; flex-shrink: 0; }
.sidebar a.active .dot { background: var(--gold); }
.content { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1280px; }
.footer { color: var(--muted); font-size: .8rem; margin-top: 32px; }

/* ---- Seitenkopf ---- */
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .grow { flex: 1; }
.pagehead p { margin: 2px 0 0; color: var(--muted); }

/* ---- Karten und nummerierte Abschnitte ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.step { font-weight: 700; margin: 4px 0 10px; color: var(--text); }
.step b { color: var(--brand); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---- Auswahlkarten (wie "Getrennt / Zusammen / Nur Agent" in der ScoreCard) ---- */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.choice { text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; }
.choice b { display: block; margin-bottom: 2px; }
.choice span { color: var(--muted); font-size: .85rem; }
.choice:hover { border-color: #A9B6C4; }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

/* ---- Kennzahl-Kacheln ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.tile .value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .sub { color: var(--muted); font-size: .8rem; }
.tile.accent { border-top: 3px solid var(--gold); }
.tile.bad .value { color: var(--danger); }

/* ---- Formulare ---- */
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .88rem; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .choice:focus-visible, button:focus-visible { outline: 2px solid var(--plan); outline-offset: 1px; }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
input[type=checkbox] { width: auto; min-height: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border); border-radius: 999px; padding: 5px 12px; background: var(--surface); cursor: pointer; font: inherit; font-size: .85rem; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }

/* ---- Knöpfe ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #A9B6C4; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; min-width: 220px; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1E2833; }
.btn.danger { color: var(--danger); border-color: #EBC2C5; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.actions .grow { flex: 1; }

/* ---- Tabellen ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid #EDF0F4; text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #F8FAFC; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }                                           /* erste Spalte (Datum/Monat) nicht umbrechen */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #F7F9FC; }
tr.sum td { font-weight: 700; background: #F8FAFC; }
tr.storno td { color: var(--muted); text-decoration: line-through; }

/* ---- Status-Farben (grün = Ist, blau = Prognose, grau = geschlossen, rot = Warnung) ---- */
.ist { color: var(--ist); font-weight: 700; }
.plan { color: var(--plan); font-weight: 700; }
.closed { color: var(--closed); }
.bad { color: var(--danger); font-weight: 700; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.ist { background: var(--ist-soft); color: var(--ist); }
.badge.plan { background: var(--plan-soft); color: var(--plan); }
.badge.closed { background: var(--closed-soft); color: var(--muted); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- Kalender ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; }
.cal .day { min-height: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px; font-size: .8rem; cursor: pointer; }
.cal .day.other { opacity: .35; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal .day .n { font-weight: 700; color: var(--muted); }
.cal .day .v { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal .v.ist { background: var(--ist-soft); color: var(--ist); }
.cal .v.plan { background: var(--plan-soft); color: var(--plan); }
.cal .v.closed { background: var(--closed-soft); color: var(--muted); font-weight: 400; }
.cal .v.missing { background: var(--warn-soft); color: var(--warn); }
.cal .day .bal { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.cal .day .bal.bad { color: var(--danger); }

/* ---- Hinweise, Meldungen, Dialoge ---- */
.notice { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.notice.info { background: var(--plan-soft); border-color: #C5D7F5; }
.notice.warn { background: var(--warn-soft); border-color: #F2D3A6; }
.notice.bad { background: var(--danger-soft); border-color: #F0C3C6; }
.notice.ok { background: var(--ist-soft); border-color: #BFE3CD; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: var(--brand-dark); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; }
.toast.bad { background: var(--danger); }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(20, 28, 38, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 720px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h2 { margin-bottom: 12px; }
.queue { position: fixed; left: 20px; bottom: 20px; z-index: 95; background: var(--warn); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; }

/* ---- Diagramme ---- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid line { stroke: #E6EAF0; stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--brand-dark); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: .8rem; white-space: nowrap; transform: translate(-50%, -110%); }
.bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar .lbl { width: 190px; flex-shrink: 0; font-size: .88rem; }
.bar .track { flex: 1; background: #EEF1F5; border-radius: 4px; height: 14px; }
.bar .fill { height: 14px; border-radius: 0 4px 4px 0; background: var(--brand); }
.bar .val { width: 110px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- Anmeldung ---- */
.login { max-width: 420px; margin: 8vh auto; }
.login .brand { justify-content: center; margin-bottom: 18px; }
.login .brand img { height: 84px; width: 84px; }
.photo-preview { max-width: 100%; max-height: 380px; border-radius: 10px; border: 1px solid var(--border); display: block; margin-top: 8px; }

/* ---- Handy / Truck (schmale Bildschirme) ---- */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .apptitle { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }                                            /* engere Kopfzeile */
  .topbar .btn.small { display: none; }                                             /* Konfiguration/Profil stehen im Menü */
  .topbar select { min-width: 0; width: 96px; min-height: 36px; font-size: 14px; }  /* schmale Sprachwahl */
  .wordmark { font-size: 1.15rem; }                                                /* kleineres Textlogo */
  .brand img { height: 36px; width: 36px; }                                        /* kleineres Bildlogo */
  .sidebar { position: fixed; top: 64px; bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; }
  .sidebar.open { transform: none; }
  .content { padding: 16px 14px 80px; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .g2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select { min-height: 46px; font-size: 16px; }
  .btn { min-height: 46px; }
  .btn.primary { width: 100%; }
  .cal .day { min-height: 64px; font-size: .7rem; padding: 4px; }
  .bar .lbl { width: 120px; }
}

/* ---- Druck ---- */
@media print {
  .topbar, .sidebar, .actions, .btn { display: none !important; }
  .content { padding: 0; }
  .card, .tile { box-shadow: none; }
}

/* ---- Beleg hochladen: ein Feld zum Hochladen, Ergebnis als Karte ---- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px; padding: 24px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: #FFFBF1; }
.dropzone input[type=file] { display: none; }
.dz-icon { font-size: 2rem; color: var(--gold-ink); line-height: 1; }
.dz-title { font-size: 1.15rem; font-weight: 700; color: var(--brand); }
.receipt-result { margin-top: 16px; }
.receipt-grid { display: flex; gap: 18px; align-items: flex-start; }
.receipt-thumb img { width: 120px; max-height: 170px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.receipt-thumb .pdf-icon { width: 120px; height: 150px; display: flex; align-items: center; justify-content: center; font-size: 3rem; border: 1px solid var(--border); border-radius: 8px; }
.receipt-vendor { font-size: 1.35rem; font-weight: 700; }
.receipt-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.receipt-sums .label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.receipt-sums .big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .receipt-grid { flex-direction: column; }
  .receipt-sums { grid-template-columns: 1fr 1fr; }
  .receipt-thumb img { width: auto; max-width: 100%; max-height: 220px; }
}

/* ---- Bearbeitungsmaske: Beleg links, Felder rechts ---- */
.modal.wide { max-width: 1240px; }
.receipt-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.receipt-pane { position: sticky; top: 0; }
.receipt-view { border: 1px solid var(--border); border-radius: 10px; background: #F7F8FA; height: 70vh; overflow: auto; display: flex; align-items: flex-start; justify-content: center; }
.receipt-view img { max-width: 100%; height: auto; cursor: zoom-in; display: block; }
.receipt-view.zoom { align-items: flex-start; justify-content: flex-start; }
.receipt-view.zoom img { max-width: none; width: 200%; cursor: zoom-out; }
.receipt-view iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.receipt-view.empty { align-items: center; color: var(--muted); }
.sumline { display: flex; gap: 24px; margin-top: 10px; padding: 10px 12px; background: var(--brand-soft); border-radius: 8px; }
.sumline b { font-size: 1.15rem; margin-left: 4px; }
@media (max-width: 900px) {
  .receipt-editor { grid-template-columns: 1fr; }
  .receipt-pane { position: static; }
  .receipt-view { height: 50vh; }
}

/* ---- Warteschlange mehrerer Belege ---- */
.queue-card { margin-top: 14px; }
.queue-list { margin: 8px 0 0; padding-left: 20px; }
.queue-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.queue-list li:last-child { border-bottom: 0; }
.queue-list li.active { background: var(--brand-soft); border-radius: 6px; }
/* ---- Positionen im Beleg ---- */
details.items { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
details.items summary { cursor: pointer; font-weight: 600; }
.items-table input, .items-table select { width: 100%; min-width: 60px; }
.items-table td:first-child input { min-width: 140px; }
.items-table td { padding: 4px; }

/* ---- Belegliste nach Monaten ---- */
.month-group { margin-bottom: 18px; }
.month-head { font-size: 1.05rem; margin: 18px 0 8px; }

/* Dashboard */
.dash-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.dash-head h2 { margin: 0; }
.tiles.small { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles.small .tile .value { font-size: 1.35rem; }
.tasklist { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.tasklist li.bad { color: var(--danger); font-weight: 600; }
.tasklist li.warn { color: var(--warn); }
.dash-more summary { cursor: pointer; }
.dash-more[open] summary { margin-bottom: 12px; }
@media (max-width: 700px) { .tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles.small .tile .value { font-size: 1.1rem; } }
.tile.good .value { color: var(--ist); }
tr.active td { background: var(--brand-soft); }
.share { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 110px; }
.sharebar { display: inline-block; height: 8px; border-radius: 4px; background: var(--plan); max-width: 70px; }
.items-table select { min-width: 150px; }
/* Einkauf: gleiche Spaltenbreiten in allen Warengruppen */
.article-list table { table-layout: fixed; width: 100%; }
.article-list th:nth-child(1) { width: 17%; } .article-list th:nth-child(2) { width: 10%; } .article-list th:nth-child(3) { width: 9%; }
.article-list th:nth-child(4) { width: 13%; } .article-list th:nth-child(5) { width: 16%; } .article-list th:nth-child(6) { width: 8%; }
.article-list th:nth-child(7) { width: 9%; } .article-list th:nth-child(8) { width: 9%; } .article-list th:nth-child(9) { width: 9%; }
@media (max-width: 900px) { .article-list table { table-layout: auto; } }
.order-card h3 { margin: 0; }
.order-card .sumline { margin-top: 10px; }
/* MwSt-Prüfung im Beleg */
.vat-check { margin-top: 10px; }
.vat-check summary { cursor: pointer; }
.vat-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .92rem; }
.vat-table th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.vat-table td { padding: 5px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.vat-table tr.bad td { background: var(--danger-soft); }
.vat-table tr.warn td { background: var(--warn-soft); }
.warnc { color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
