/* Chiarina style.css v8 — Phase 6b Toolbar-Fix
   Generated: 2026-05-06
   Header: Liste links | Spacer | Logo rechts
   Tab-Bar entfernt. Confirm-Block (JA/NEIN) fixed bottom, default hidden.
   Mobile-first, max-width 480px zentriert, keine Animationen, keine Transitions.
   v8 Änderungen ggü v7:
   - Mobile: .toolbar als display:contents hinzugefügt → Layout byte-identisch zu v7
   - Desktop ≥768px: .main--liste zurück zu flex-column, .toolbar als flex-row
     (kein Grid-Areas mehr) → robuste 1-Zeilen-Toolbar
   - Desktop: Filter-Labels "Von"/"Bis" sichtbar inline, Kategorie-Label hidden
*/

/* ---------------------------------------------------------------------------
   Farb-Palette + Token
--------------------------------------------------------------------------- */
:root {
  --color-idle:        #047026;
  --color-recording:   #dc2626;
  --color-processing:  #ea580c;
  --color-waiting:     #1675b9;
  --color-disabled:    #a3a3a3;
  --color-bg:          #f5f5f5;
  --color-header:      #ffffff;
  --color-text:        #1a1a1a;
  --color-text-muted:  #666666;
  --color-border:      #e5e5e5;

  --confirm-height:    64px;
  --header-pad-y:      8px;
  --header-pad-x:      12px;
  --max-w:             480px;
}

/* ---------------------------------------------------------------------------
   Reset / Base
--------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------------------------------------------------------------------------
   App-Container — mobile-first, max 480px zentriert
--------------------------------------------------------------------------- */
.app {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------------
   Header — 3-Spalten-Grid: [Liste-Link | Spacer | Logo]
--------------------------------------------------------------------------- */
.header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: var(--color-header);
  padding: var(--header-pad-y) var(--header-pad-x);
  border-bottom: 1px solid var(--color-border);
}

.header__list-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-idle);
  background: transparent;
  border-radius: 8px;
  /* Touch-Target: Padding 12+12=24 + ~24 Inhalt = 48px hoch, gut klickbar */
}

.header__list-icon {
  font-size: 22px;
  line-height: 1;
}

.header__list-label {
  letter-spacing: 0.02em;
}

.header__spacer {
  /* füllt den Raum zwischen Liste-Link und Logo */
}

.header__logo {
  height: 60px;
  width: auto;
  display: block;
}

/* ---------------------------------------------------------------------------
   Main — füllt zwischen Header und (eventuell) Confirm-Bar
   padding-bottom 80px → reserviert Platz für Confirm-Bar (auch wenn unsichtbar)
--------------------------------------------------------------------------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 32px 16px 80px 16px;
}

/* ---------------------------------------------------------------------------
   PTT-Button — Push-to-Talk (Quadrat mit abgerundeten Ecken)
--------------------------------------------------------------------------- */
.ptt {
  width: 80%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 24px;
  background: var(--color-idle);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  outline: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.ptt__icon {
  font-size: 80px;
  line-height: 1;
}

.ptt__label {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* State-spezifische Farben — instant, keine Transitions */
.ptt[data-state="idle"]       { background: var(--color-idle); }
.ptt[data-state="recording"]  { background: var(--color-recording); }
.ptt[data-state="processing"] { background: var(--color-processing); }
.ptt[data-state="waiting"]    { background: var(--color-waiting); }
.ptt[data-state="disabled"]   { background: var(--color-disabled); cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   Status-Pane — Frage-Text + Queue-Counter + Reminder
--------------------------------------------------------------------------- */
.status {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
}

.status__frage {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  word-wrap: break-word;
}

.status__queue {
  margin: 8px 0 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
  min-height: 1em;
}

.status__queue[data-count="0"] {
  visibility: hidden;
}

/* Reminder-State — fällt visuell auf, kein Audio (iOS-Autoplay-Block) */
.status--reminder .status__frage {
  color: var(--color-recording);
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   Confirm-Bar — fixed bottom, default hidden
   JS später: confirm.hidden = false  ODER  confirm.removeAttribute('hidden')
--------------------------------------------------------------------------- */
.confirm {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--confirm-height);
  display: flex;
  z-index: 100;
}

.confirm[hidden] {
  display: none;
}

.confirm__btn {
  flex: 1 1 50%;
  border: 0;
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: white;
  cursor: pointer;
  outline: none;
}

.confirm__btn--ja   { background: var(--color-idle); }       /* grün #047026 */
.confirm__btn--nein { background: var(--color-recording); }  /* rot  #dc2626 */

/* ===========================================================================
   LISTE / KASSENBUCH — Phase 6b UI-Mockup (v3 Append)
   Klassen NUR auf liste.html benötigt. Keine Konflikte mit bestehenden v2-Klassen.
   =========================================================================== */

/* Header-Variante für Liste-Seite — Logo rechts, Titel links */
.header--liste {
  grid-template-columns: 1fr auto;
}

.header__title {
  margin: 0;
  padding: 12px 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

/* Main-Variante für Liste — links-bündig statt zentriert, mehr horizontaler Padding */
.main--liste {
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px 16px 80px 16px;
}

/* Zurück-Button */
.btn-back {
  display: inline-block;
  align-self: flex-start;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-idle);
  background: transparent;
  border: 1px solid var(--color-idle);
  border-radius: 8px;
  text-decoration: none;
}

/* Filter-Bereich */
.filter {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter__row {
  display: flex;
  gap: 12px;
}

.filter__row--dates .filter__field {
  flex: 1 1 50%;
}

.filter__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.filter__field--full {
  width: 100%;
}

.filter__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.filter__input,
.filter__select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.filter__select {
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
                    linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

/* + Begriff hinzufügen Button — voll-breit */
.btn-add {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 700;
  color: white;
  background: var(--color-idle);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

/* Toolbar-Wrapper — Mobile: display:contents (transparent für Layout)
   → Mobile-Verhalten bleibt byte-identisch zu v7. Nur auf Desktop wird der
   Wrapper zum echten flex-row Container, der die 3 Kinder in 1 Zeile packt. */
.toolbar {
  display: contents;
}


/* ===========================================================================
   LISTE DER EINTRÄGE — neue Struktur (entry__top weg, 4 flat children)
   =========================================================================== */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mobile — Block-Karte mit Date+Amount oben, Beschreibung mittig, Kategorie unten */
.entry {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "date   amount"
    "desc   desc"
    "cat    cat";
  gap: 4px 12px;
  align-items: baseline;
}

.entry__date   { grid-area: date; }
.entry__desc   { grid-area: desc; }
.entry__cat    { grid-area: cat; }
.entry__amount { grid-area: amount; }

.entry__date {
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.entry__amount {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.entry__amount--pos { color: var(--color-idle); }
.entry__amount--neg { color: var(--color-recording); }

.entry__desc {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  word-wrap: break-word;
}

.entry__cat {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Modal — Vollbild, KEIN Backdrop-Click-Close */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
}

.modal[hidden] {
  display: none;
}

.modal__dialog {
  width: 100%;
  max-width: var(--max-w);
  background: white;
  padding: 20px 16px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  box-sizing: border-box;
}

.modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.modal__input,
.modal__select {
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  font-family: inherit;
  color: var(--color-text);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.modal__select {
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
                    linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.modal__btn {
  flex: 1 1 50%;
  padding: 14px 12px;
  font-size: 17px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.modal__btn--save   { background: var(--color-idle);     color: white; }
.modal__btn--cancel { background: var(--color-disabled); color: white; }

/* Spaltenkopf default versteckt, nur Desktop sichtbar */
.entries-header {
  display: none;
}

/* ===========================================================================
   DESKTOP — ab 768px kompakte Buchungstabelle, jede Buchung 1 Zeile
   =========================================================================== */

@media (min-width: 768px) {

  /* Container-Verbreiterung NUR Liste-Seite */
  .app:has(.main--liste) {
    max-width: 1100px;
  }

  /* === MAIN-LAYOUT: flex-column, Toolbar erbt von Mobile, wird unten zu flex-row === */
  /* Override aller Mobile-Eigenschaften: kein Grid, sauberer flex-column. */
  .main--liste {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px 24px 14px;
    margin: 0;
  }

  /* === TOOLBAR — auf Desktop echter flex-row Container === */
  .toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
  }

  /* === ZURÜCK-BUTTON === */
  .btn-back {
    flex: 0 0 auto;
    align-self: auto;
    margin: 0;
    padding: 0 14px;
    height: 36px;
    min-height: 36px;
    font-size: 14px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  /* === FILTER — wird Teil der flex-row Toolbar, nimmt mittleren Platz === */
  .filter {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
  }

  /* .filter__row als display:contents → Kinder werden direkte flex-Items von .filter */
  .filter__row {
    display: contents;
  }

  /* Datums-Felder: Label "Von"/"Bis" sichtbar inline links neben Input */
  .filter__row--dates .filter__field {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .filter__row--dates .filter__label {
    display: inline;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: 0;
    white-space: nowrap;
  }

  /* Kategorie-Feld: Label hidden (Andreas: "Dropdown ist etwas zu groß") */
  .filter__field--full {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    margin: 0;
    width: auto;
  }

  .filter__field--full .filter__label {
    display: none;
  }

  /* Datums-Inputs schmal halten */
  .filter__input {
    width: 140px;
    height: 36px;
    padding: 4px 10px;
    font-size: 14px;
    box-sizing: border-box;
  }

  /* Kategorie-Select schmal halten */
  .filter__select {
    width: 180px;
    height: 36px;
    padding: 4px 28px 4px 10px;
    font-size: 14px;
    box-sizing: border-box;
  }

  /* === + BEGRIFF HINZUFÜGEN — rechts in Toolbar === */
  .btn-add {
    flex: 0 0 auto;
    margin: 0;
    width: auto;
    height: 36px;
    min-height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* === SPALTENKOPF === */
  .entries-header {
    display: grid;
    grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1fr) 110px;
    gap: 12px;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--color-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .entries-header__col--amount {
    text-align: right;
  }

  /* === LISTE === */
  .entries {
    gap: 0;
    border: 1px solid var(--color-border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: white;
    margin: 0;
    padding: 0;
  }

  /* Eintrag = 1 Zeile, 4 Spalten */
  .entry {
    display: grid;
    grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1fr) 110px;
    grid-template-areas: none;
    gap: 12px;
    align-items: center;
    padding: 6px 12px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    min-height: 32px;
  }

  .entry:last-child {
    border-bottom: 0;
  }

  .entry:nth-child(odd) {
    background: #fafafa;
  }

  .entry:hover {
    background: #eef5ee;
  }

  .entry__date,
  .entry__desc,
  .entry__cat,
  .entry__amount {
    grid-area: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .entry__date {
    font-size: 13px;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }

  .entry__desc {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
  }

  .entry__cat {
    font-size: 13px;
    color: var(--color-text-muted);
  }

  .entry__amount {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
}


/* PHASE7A2_V1 (09.05.2026) — Foto-/Belegmodul UI-Redesign
   Klassen: .foto-bereich (Container), .foto-btn (Button), .foto-btn__icon,
            .foto-btn__label, .belege-preview, .belege-status.
   Position: innerhalb .main, direkt nach .status. Garantiert keine
   Ueberlappung mit .confirm (JA/NEIN), da DOM-Position davor.
   ============================================================== */
.foto-bereich {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 12px;
  width: 100%;
}
.foto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  background: var(--color-idle, #047026);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(4, 112, 38, 0.25),
              0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background 0.15s ease,
              transform 0.05s ease,
              box-shadow 0.15s ease;
}
.foto-btn__icon {
  font-size: 18px;
  line-height: 1;
}
.foto-btn__label {
  line-height: 1;
}
.foto-btn:hover {
  background: #035a1f;
  box-shadow: 0 6px 16px rgba(4, 112, 38, 0.32),
              0 2px 4px rgba(0, 0, 0, 0.10);
}
.foto-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(4, 112, 38, 0.22),
              0 1px 2px rgba(0, 0, 0, 0.08);
}
.foto-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.belege-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 480px;
}
.belege-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border, #d0d0d0);
  background: var(--color-bg-elevated, #f5f5f5);
  display: block;
}
.belege-status {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted, #666);
  text-align: center;
  min-height: 1em;
}
.belege-status[data-tone="error"] {
  color: var(--color-recording, #c62828);
}
/* /PHASE7A2_V1 */
