/* Optisch an die ELAN-Familie angeglichen (Sibylles Ask, 25.09.2026:
   "wie Dashboard, Insight und ELAN Chat"). Farbwerte, Radien und der
   Markenblock sind aus Mein Dashboard bzw. ELAN Insight uebernommen -
   .brand/.brand-logo/.brand-sub bitte nicht abwandeln, die drei Apps
   sollen nebeneinander gleich aussehen. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2f5fd8;
  --accent-soft: #eaf0ff;
  --green: #1f9d55;
  --red: #d1453b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }

/* ---------- Markenblock: identisch zu Insight und Mein Dashboard ---------- */
.brand { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub {
  font-weight: 600;
  font-size: 2.2rem;
  color: #000;
  line-height: 1;
  position: relative;
  top: -2px;
}

/* ---------- Anmeldung ---------- */
#login-view { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 32px; width: 400px; box-shadow: 0 1px 3px rgba(31, 36, 48, .06);
}
.login-box .brand { margin-bottom: 4px; }
.login-box .hint { margin: 0 0 18px; }
.login-box .brand-sub { font-size: 1.7rem; }

/* ---------- Rahmen ---------- */
header {
  padding: 14px 32px 12px; position: sticky; top: 0; z-index: 30;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.user-box { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }

.tabs { display: flex; gap: 4px; padding: 0 32px; border-bottom: 1px solid var(--border);
  background: var(--card); position: sticky; top: var(--header-height, 76px); z-index: 29; flex-wrap: wrap; }
.tab {
  border: none; background: none; padding: 10px 16px; font-size: 0.95rem;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

main { padding: 24px 32px 64px; max-width: 1300px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
h1, h2, h3 { font-weight: 600; }
h2 { font-size: 1rem; margin: 0 0 10px; }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
/* Beschriftung und "(optional)" muessen EIN Flex-Kind sein - sonst bricht der
   Zusatz in eine eigene Zeile um (label ist flex-column). */
label .cap { display: block; }
label .cap .hint { margin: 0; font-size: inherit; }
input, select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.92rem; background: var(--card); color: var(--text);
  font-family: inherit; height: 38px;
}
input[type=file] { padding: 6px 8px; }
.zeile { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.wachsen { flex: 1 1 220px; }
button {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 0.88rem; color: var(--text);
  font-family: inherit; height: 38px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.secondary { background: var(--card); }
button.link { background: none; border: none; color: var(--accent); padding: 0; height: auto; }
button.klein { height: 28px; padding: 3px 10px; font-size: 0.8rem; }
button.gefahr { color: var(--red); border-color: #f0c3c0; }
button:hover { filter: brightness(0.97); }
.error { color: var(--red); font-size: 0.85rem; min-height: 1em; margin: 8px 0 0; }
.ok { color: var(--green); font-size: 0.85rem; min-height: 1em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }

/* ---------- Listen ---------- */
.filterleiste { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.filterleiste input[type=search] { flex: 1 1 320px; }
table.liste { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.liste th {
  text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--border); padding: 8px 10px; font-weight: 600;
}
table.liste td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 0.92rem; }
table.liste tr:last-child td { border-bottom: none; }
.titel { font-weight: 600; font-size: 0.95rem; }
.datei-link { color: var(--accent); text-decoration: none; }
.datei-link:hover { text-decoration: underline; }
.betrag { text-align: right; white-space: nowrap; }
.pille {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}

/* ---------- Dialog ---------- */
#passwort-dialog { position: fixed; inset: 0; background: rgba(31, 36, 48, .38);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { background: var(--card); border-radius: var(--radius); padding: 24px 28px; width: 400px; }

@media (max-width: 640px) {
  header, .tabs, main { padding-left: 16px; padding-right: 16px; }
  .brand-sub { font-size: 1.6rem; }
}

/* Stapel-Upload: Ergebnisliste je Datei */
.bericht { margin: 10px 0 0; padding-left: 18px; font-size: 0.9rem; }
.bericht li { margin-bottom: 6px; }
.bericht .hint { margin: 2px 0 0; }
.aktionen { white-space: nowrap; }
.aktionen button + button { margin-left: 6px; }
.bearbeiten-zeile td { background: var(--bg); }
.bearbeiten-zeile label { margin-bottom: 8px; }

/* ---------- FinanceArchive: Ordneransicht und Nummern-Uebersicht (26.09.2026) ---------- */
h2.abstand { margin-top: 28px; }
tr.gruppe td {
  background: var(--bg); font-size: 0.8rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; padding: 7px 10px;
}
tr.gruppe .pfeil { color: var(--border); margin: 0 6px; }
.pille.gesellschaft { background: #eef2f6; color: var(--text); }
.pille.schloss { background: #fdecea; color: var(--red); }
label.haken { flex-direction: row; align-items: center; gap: 6px; height: 38px; }
label.haken input { height: auto; }

.nummern-karte { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 6px; margin-bottom: 16px; }
.nummern-karte h3 { margin: 0 0 2px; font-size: 1rem; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nummern-karte h3 .hint { font-weight: 400; font-size: 0.85rem; margin: 0; }
.nummern-karte table.liste td { vertical-align: middle; }
.nummer-art { color: var(--muted); width: 32%; }
.nummer-wert { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.98rem; font-weight: 600; }
a.nummer-wert { color: var(--accent); text-decoration: none; }
a.nummer-wert:hover { text-decoration: underline; }
.nummer-leer { color: var(--muted); font-style: italic; font-weight: 400; font-family: inherit; }
.nachweis-fehlt { color: #b45309; font-size: 0.82rem; }
.neue-nummer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 8px; }
.neue-nummer h3 { font-size: 0.95rem; margin: 0 0 10px; }
/* Lange Dateinamen duerfen umbrechen, sonst schiebt die Spalte die Knoepfe aus dem Bild. */
.datei-link { overflow-wrap: anywhere; }
.panel { overflow-x: auto; }
