/* bancacorner — Mobile-First Full-Width Layout (Cornercard-Look) */
:root {
  --bc-blue: #0055a3;
  --bc-blue-dark: #003d75;
  --bc-blue-light: #e8f1fa;
  --bc-hero-from: #d6e7f7;
  --bc-hero-to: #eef5fc;
  --bc-text: #1a2b3c;
  --bc-muted: #6b7c8f;
  --bc-border: #dfe7ef;
  --bc-green: #1e7e34;
  --bc-green-bg: #e3f3e7;
  --bc-orange: #b45309;
  --bc-orange-bg: #fdf0dd;
  --bc-red: #b91c1c;
  --bc-bg: #f4f7fb;
  --bc-card: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bc-bg);
  color: var(--bc-text);
  min-height: 100vh;
}

/* Volle Display-Breite — keine seitlichen Balken, kein zentrierter Streifen */
.app {
  width: 100%;
  min-height: 100vh;
  background: var(--bc-bg);
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}

/* ---------- Header (Logo + Logout oben rechts) ---------- */
.header {
  background: var(--bc-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--bc-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { height: 26px; width: auto; display: block; }

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--bc-muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.logout-btn:active { background: var(--bc-blue-light); color: var(--bc-blue); }

/* ---------- Top-Navigation (ueber dem Saldo) ---------- */
.top-nav {
  display: flex;
  background: var(--bc-card);
  border-bottom: 1px solid var(--bc-border);
  position: sticky;
  top: 62px;
  z-index: 19;
}
.top-nav a {
  flex: 1;
  text-align: center;
  padding: 11px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bc-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.top-nav a.active {
  color: var(--bc-blue);
  border-bottom-color: var(--bc-blue);
}

/* ---------- Hero (Saldo) ---------- */
.hero {
  background: linear-gradient(160deg, var(--bc-hero-from), var(--bc-hero-to));
  padding: 22px 18px 26px;
}

.hero-label {
  font-size: 0.78rem;
  color: var(--bc-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.hero-unit { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }

.hero-balance {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--bc-blue-dark);
  letter-spacing: -0.02em;
}

.hero-balance small { font-size: 1rem; font-weight: 600; color: var(--bc-muted); margin-left: 6px; }

.hero-note { font-size: 0.8rem; color: var(--bc-muted); margin-top: 4px; }

/* ---------- Karten ---------- */
.card {
  background: var(--bc-card);
  border: 1px solid var(--bc-border);
  border-radius: var(--radius);
  margin: 14px 14px 0;
  padding: 16px;
}

.avail-row { display: flex; justify-content: space-between; align-items: baseline; }
.avail-label { font-size: 0.85rem; color: var(--bc-muted); }
.avail-value { font-size: 1.15rem; font-weight: 700; }
.avail-sub { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.82rem; color: var(--bc-muted); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--bc-blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--bc-blue); border: 1px solid var(--bc-border); }
.btn-danger { background: var(--bc-red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ---------- Sektions-Kopf ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 18px 4px;
}
.section-title { font-size: 1rem; font-weight: 700; }
.section-sub { font-size: 0.8rem; color: var(--bc-muted); }

/* ---------- Transaktions-Karten (klickbar) ---------- */
.tx-list { padding: 0 14px; }

.tx-card {
  display: block;
  background: var(--bc-card);
  border: 1px solid var(--bc-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.tx-card:active { transform: scale(0.99); }
.tx-card:hover { box-shadow: 0 4px 14px rgba(0, 61, 117, 0.10); }

.tx-top { display: flex; justify-content: space-between; gap: 10px; }
.tx-date { font-size: 0.78rem; color: var(--bc-muted); white-space: nowrap; }
.tx-amount { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.tx-amount.neg { color: var(--bc-green); }

.tx-merchant { font-size: 0.92rem; font-weight: 600; margin-top: 2px; }
.tx-meta { font-size: 0.78rem; color: var(--bc-muted); margin-top: 2px; }

.tx-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tx-cardno { font-size: 0.78rem; color: var(--bc-muted); }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 10px;
}
.badge-reserved { background: var(--bc-orange-bg); color: var(--bc-orange); }
.badge-booked { background: var(--bc-green-bg); color: var(--bc-green); }

/* ---------- Detail-Seite ---------- */
.detail-amount { font-size: 1.9rem; font-weight: 700; color: var(--bc-blue-dark); margin: 6px 0 2px; }
.detail-rows { margin-top: 12px; }
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bc-border);
  font-size: 0.88rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--bc-muted); }
.detail-row dd { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------- Dokumente ---------- */
.doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bc-border);
}
.doc-row:last-child { border-bottom: none; }
.doc-title { font-size: 0.9rem; font-weight: 600; }
.doc-meta { font-size: 0.76rem; color: var(--bc-muted); margin-top: 2px; }
.doc-dl { display: inline-block; margin-top: 6px; font-size: 0.8rem; font-weight: 600; color: var(--bc-blue); text-decoration: none; }

/* ---------- Monatsauszug-Karten (Kontoauszuege-Seite) ---------- */
.st-card {
  display: block;
  background: var(--bc-card);
  border: 1px solid var(--bc-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 10px 14px 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.st-card:active { transform: scale(0.99); }
.st-card:hover { box-shadow: 0 4px 14px rgba(0, 61, 117, 0.10); }

.st-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.st-title { font-size: 0.92rem; font-weight: 600; }
.st-amount { font-size: 1rem; font-weight: 700; color: var(--bc-blue-dark); white-space: nowrap; }

.st-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--bc-muted);
}

.st-dl {
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bc-blue);
}

/* ---------- Admin ---------- */
.admin-wrap { padding: 18px; }
.admin-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.admin-sub { font-size: 0.82rem; color: var(--bc-muted); margin-bottom: 16px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--bc-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--bc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--bc-text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--bc-blue); outline-offset: -1px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.admin-section { margin-top: 22px; }
.admin-section > h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }

.tx-edit {
  border: 1px solid var(--bc-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 10px;
  background: #fff;
}
.tx-edit summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.tx-edit summary .amt { color: var(--bc-muted); font-weight: 500; }
.tx-edit form { margin-top: 12px; }

.row-actions { display: flex; gap: 8px; margin-top: 10px; }

.error-box {
  background: #fdecec;
  color: var(--bc-red);
  border: 1px solid #f5c2c2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.hint { font-size: 0.75rem; color: var(--bc-muted); margin-top: 10px; }

.footer { text-align: center; font-size: 0.7rem; color: var(--bc-muted); padding: 26px 0 10px; }
.footer a { color: var(--bc-muted); text-decoration: none; }

/* ---------- Fruehere Abrechnungsperioden (Link unter TX-Liste) ---------- */
.period-link {
  display: block;
  text-align: center;
  margin: 18px 14px 6px;
  padding: 12px;
  color: var(--bc-blue);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--bc-border);
  border-radius: var(--radius);
  background: var(--bc-card);
}
.period-link:active { transform: scale(0.99); }
