/* Klassenkasse v1.1 — target amount + reminder batch */

:root{
  --bg:#0b0b0d;
  --card: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.12);
  --text:#f5f5f5;
  --muted: rgba(245,245,245,.70);
  --accent: rgba(99,102,241,.26);
  --accentStroke: rgba(99,102,241,.70);
  --danger: rgba(239,68,68,.22);
  --dangerStroke: rgba(239,68,68,.60);
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --pos: rgba(34,197,94,.95);
  --neg: rgba(239,68,68,.95);
}

html[data-theme="paper"]{
  --bg:#f7f6f2;
  --card: rgba(0,0,0,.04);
  --stroke: rgba(0,0,0,.10);
  --text:#141414;
  --muted: rgba(20,20,20,.60);
  --accent: rgba(0,0,0,.06);
  --accentStroke: rgba(0,0,0,.18);
  --danger: rgba(239,68,68,.14);
  --dangerStroke: rgba(239,68,68,.30);
  --shadow: 0 14px 40px rgba(0,0,0,.12);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:
    radial-gradient(900px 600px at 15% 15%, rgba(99,102,241,.16), transparent 55%),
    radial-gradient(900px 600px at 85% 20%, rgba(34,211,238,.10), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(16,185,129,.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.app{ max-width: 1160px; margin:0 auto; padding:22px; }

.topbar{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:16px; margin-bottom:16px;
}
.topbar__title h1{ margin:0; font-size:26px; }
.sub{ margin:6px 0 0; color: var(--muted); }

.topbar__controls{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }

.seg{ display:grid; gap:6px; }
.seg__label{ font-size:12px; color: var(--muted); }
.seg__select{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  min-width: 120px; /* helps with EN/DE */
}
html[data-theme="paper"] .seg__select{
  background: rgba(255,255,255,.75);
}

.grid{ display:grid; grid-template-columns: 440px 1fr; gap:16px; }
@media (max-width: 980px){ .grid{ grid-template-columns: 1fr; } }

.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:16px;
  backdrop-filter: blur(10px);
}

h2{ margin:0 0 12px; font-size:18px; }
.hr{ border:0; border-top:1px solid var(--stroke); margin:14px 0; opacity:.9; }

.field{ display:grid; gap:6px; margin-bottom:12px; }
label{ font-size:13px; color: var(--muted); }

input, select, textarea{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding:11px 12px;
  border-radius:12px;
  outline:none;
}
input::placeholder, textarea::placeholder{ color: rgba(255,255,255,.35); }
html[data-theme="paper"] input,
html[data-theme="paper"] select,
html[data-theme="paper"] textarea{
  background: rgba(255,255,255,.75);
}
html[data-theme="paper"] input::placeholder,
html[data-theme="paper"] textarea::placeholder{
  color: rgba(0,0,0,.35);
}

textarea{ resize: vertical; }

.row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  align-items:end;
  margin-bottom:10px;
}
.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .row2{ grid-template-columns: 1fr; }
}

.radio{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  padding:10px 12px;
  border-radius:12px;
  display:flex;
  align-items:center;
  gap: 10px;
}

.hint{ margin:8px 0 0; color: var(--muted); font-size:13px; }

.btn{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;

  /* allow wrapping for longer EN labels */
  white-space: normal;
  line-height: 1.15;

  transition: transform .08s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:active{ transform: translateY(1px); }
.btn--primary{
  background: var(--accent);
  border-color: var(--accentStroke);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.btn--primary:hover{
  box-shadow: 0 0 18px rgba(99,102,241,.25), 0 14px 38px rgba(0,0,0,.22);
}
.btn--danger{
  background: var(--danger);
  border-color: var(--dangerStroke);
}
.btn--icon{ padding:6px 10px; white-space: nowrap; }
.btn--file{ display:inline-flex; align-items:center; gap:8px; white-space: nowrap; }
.btn--file input{ display:none; }

.summary{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
}
.summary__item{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:14px;
  padding:10px;
}
html[data-theme="paper"] .summary__item{ background: rgba(255,255,255,.65); }
.summary__label{ font-size:12px; color: var(--muted); }
.summary__value{ font-size:18px; font-weight:900; margin-top:4px; }

.listHeader{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:12px;
}
.listHeader__right{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }

.families{ display:grid; gap:10px; margin-top:10px; }
.familyCard{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:14px;
  padding:12px;
  display:grid;
  gap:10px;
}
html[data-theme="paper"] .familyCard{ background: rgba(255,255,255,.65); }

.familyTop{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.familyMeta{ min-width:0; display:grid; gap:4px; }
.familyName{
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.familySmall{
  font-size:12px; color: var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.badges{ display:flex; gap:8px; flex-wrap:wrap; }
.badge{
  display:inline-flex; align-items:center;
  padding:4px 8px; border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size:12px;
  gap:6px;
}
.badge--inactive{ opacity:.75; }
.badge--due{
  border-color: color-mix(in srgb, var(--dangerStroke) 50%, var(--stroke) 50%);
  color: color-mix(in srgb, var(--neg) 70%, var(--muted) 30%);
}
.amount{
  font-weight:950;
  font-size:16px;
}
.amount.pos{ color: var(--pos); }
.amount.neg{ color: var(--neg); }

.familyActions{
  display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;
}

.checklist{
  border:1px solid var(--stroke);
  border-radius:12px;
  background: rgba(255,255,255,.04);
  padding:10px;
  display:grid;
  gap:8px;
  max-height: 240px;
  overflow:auto;
}
.checkItem{
  display:flex; gap:10px; align-items:flex-start;
  padding:6px 8px;
  border-radius:10px;
}
.checkItem:hover{ background: rgba(255,255,255,.04); }
.checkItem__main{ display:grid; gap:2px; min-width:0; }
.checkItem__title{ font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.checkItem__sub{ font-size:12px; color: var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.ledger{ display:grid; gap:10px; margin-top:10px; }
.txRow{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:14px;
  padding:12px;
  display:grid;
  gap:8px;
}
html[data-theme="paper"] .txRow{ background: rgba(255,255,255,.65); }

.txTop{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.txTitle{ font-weight:900; }
.txMeta{ color: var(--muted); font-size:12px; line-height:1.35; white-space: pre-line; }
.txActions{ display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }

.empty{ margin-top: 12px; }
.muted{ color: var(--muted); }

.dialog{
  border:1px solid var(--stroke);
  border-radius:16px;
  background: rgba(10,10,11,.92);
  color: var(--text);
  padding:16px;
  width: min(760px, 92vw);
}
html[data-theme="paper"] .dialog{
  background: rgba(255,255,255,.92);
  color: var(--text);
}
.dialog--wide{ width: min(980px, 96vw); }
.dialog::backdrop{ background: rgba(0,0,0,.55); }
.dialog__head{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; margin-bottom:8px;
}
.exportText{
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.dialog__actions{
  display:flex; gap:10px; justify-content:flex-end; margin-top:10px;
  flex-wrap: wrap;
}

.emailGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .emailGrid{ grid-template-columns: 1fr; }
}
.preview{
  margin:0;
  white-space: pre-wrap;
  word-break: break-word;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:12px;
  padding:12px;
  min-height: 280px;
}
html[data-theme="paper"] .preview{ background: rgba(255,255,255,.75); }

.report{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:12px;
  padding:12px;
}
html[data-theme="paper"] .report{ background: rgba(255,255,255,.75); }

.report h3{ margin: 6px 0 8px; }
.report table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report th, .report td{
  padding: 8px 6px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: top;
}
.report th{ text-align:left; color: var(--muted); font-weight: 800; }

/* v1.1 reminder UI */
.reminderTop{
  display:flex;
  gap:14px;
  align-items:flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  padding:10px 12px;
  border-radius:12px;
  color: var(--muted);
}
.reminderList{
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  border-radius:12px;
  padding:10px;
  max-height: 420px;
  overflow:auto;
  display:grid;
  gap:10px;
}
html[data-theme="paper"] .reminderList{
  background: rgba(255,255,255,.75);
}
.remItem{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  border-radius:12px;
  padding:10px;
  display:grid;
  gap:6px;
}
.remItem__top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.remItem__name{ font-weight: 900; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.remItem__meta{ font-size:12px; color: var(--muted); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.remItem__due{ font-weight: 900; color: var(--neg); }
.small{ font-size:12px; margin-top: 8px; }

/* --- SEO / FAQ sections --- */

.seo-privacy,
.seo-faq{
  max-width: 1160px;
  margin: 18px auto 34px;
  padding: 16px 22px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--card) 70%, transparent 30%);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.seo-privacy h2,
.seo-faq h2{
  margin: 0 0 10px;
  font-size: 18px;
}

.seo-privacy p,
.seo-faq p{
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 92ch;
}

.seo-privacy hr{
  border: 0;
  border-top: 1px solid var(--stroke);
  margin: 14px 0;
  opacity: .9;
}

.seo-faq h3{
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.seo-faq p{
  margin: 0 0 10px;
}

@media (max-width: 980px){
  .seo-privacy,
  .seo-faq{
    padding: 14px;
    margin-left: 22px;
    margin-right: 22px;
  }
}
