/* Gläubigerportal – klares, ruhiges Layout für sensible Verfahrensdaten. */

:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --ink:       #1a2230;
  --ink-soft:  #55607a;
  --ink-faint: #8a93a6;
  --line:      #e4e7ee;
  --line-soft: #eef0f5;
  --brand:     #1f3a5f;   /* tiefes Kanzlei-Blau */
  --brand-600: #274d80;
  --brand-050: #eef3fa;
  --accent:    #2f6f4f;   /* für „festgestellt“ */
  --warn:      #9a5b1c;
  --danger:    #9b2c34;
  --radius:    8px;
  --radius-sm: 7px;
  --shadow:    0 1px 2px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.06);
  --shadow-sm: 0 1px 2px rgba(20,30,50,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.12rem; }
p  { margin: 0 0 .6rem; }

/* ---------- Buttons ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand); color: #fff; border: 0;
  padding: .7rem 1.15rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; justify-content: center; }

.btn-ghost {
  background: transparent; color: #dbe4f0; border: 1px solid rgba(255,255,255,.25);
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand-050); color: var(--brand-600);
  border: 1px solid #d6e0ee; padding: .5rem .85rem;
  border-radius: var(--radius-sm); font-weight: 600;
}
.btn-secondary:hover { background: #e2ebf7; text-decoration: none; }

/* ---------- App-Shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar { background: var(--brand); color: #fff; }
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: .8rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(255,255,255,.14); border-radius: 10px;
  font-weight: 700; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .98rem; }
.brand-text small { color: #b8c6db; font-size: .78rem; }

.layout {
  max-width: 1120px; width: 100%; margin: 0 auto; padding: 1.75rem 1.75rem 3rem;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem;
  flex: 1;
}

.sidenav { display: flex; flex-direction: column; gap: .15rem; }
.sidenav a {
  color: var(--ink-soft); padding: .6rem .8rem; border-radius: var(--radius-sm);
  font-weight: 550; border: 1px solid transparent;
}
.sidenav a:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.sidenav a.is-active {
  background: var(--surface); color: var(--brand); border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.content { min-width: 0; }

.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 1rem 1.75rem;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--ink-faint); font-size: .82rem; flex-wrap: wrap; gap: .5rem;
}
.footer-inner nav { display: flex; gap: 1.1rem; }
.footer-inner a { color: var(--ink-soft); }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 1.4rem; }
.page-head .eyebrow {
  color: var(--ink-faint); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem;
}
.page-head p.lead { color: var(--ink-soft); margin: .35rem 0 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem 1.55rem;
}
.card + .card,
.notice + .card,
.grid-2 + .card,
.grid-2 + .notice { margin-top: 1.1rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}
.card h2 { font-size: 1.02rem; }

.grid-2 {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem; align-items: start;
}
.overview-grid {
  grid-template-columns: minmax(430px, 1.35fr) minmax(300px, .85fr);
}

/* ---------- Definition rows ---------- */
.deflist { display: grid; gap: .1rem; }
.deflist .row {
  display: grid; grid-template-columns: minmax(140px, 38%) minmax(0, 1fr);
  gap: 1.25rem; align-items: start;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft);
}
.deflist .row:last-child { border-bottom: 0; }
.deflist dt { color: var(--ink-soft); font-size: .9rem; line-height: 1.45; }
.deflist dd {
  margin: 0; font-weight: 550; line-height: 1.45;
  overflow-wrap: break-word;
}
.muted { color: var(--ink-faint); font-weight: 400; }

/* ---------- Hinweis-Box ---------- */
.notice {
  border: 1px solid #dfe6d6; background: #f5f8f0;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.notice h3 { font-size: .9rem; margin-bottom: .3rem; }
.notice p { margin: 0; }
.notice.brand { border-color: #d6e0ee; background: var(--brand-050); border-left-color: var(--brand); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.1rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--ink-faint); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.5rem; font-weight: 680; margin-top: .2rem;
  font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  border: 1px solid transparent;
}
.badge.ok    { background: #e9f3ec; color: var(--accent); border-color: #cfe4d5; }
.badge.warn  { background: #fbf1e3; color: var(--warn);   border-color: #eeddc2; }
.badge.stop  { background: #fbeaec; color: var(--danger); border-color: #eecdd1; }
.badge.info  { background: var(--brand-050); color: var(--brand-600); border-color: #d6e0ee; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td {
  text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data th { color: var(--ink-soft); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #fafbfc; }
table.data tfoot td { font-weight: 680; border-top: 2px solid var(--line); }

/* ---------- Forderungs-Karten ---------- */
.claim {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.claim + .claim { margin-top: 1rem; }
.claim-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem; background: #fbfcfd; border-bottom: 1px solid var(--line-soft);
}
.claim-head .lfd { color: var(--ink-faint); font-size: .85rem; font-weight: 600; }
.claim-head .grund { font-weight: 600; }
.claim-body { padding: .4rem 1.2rem 1.1rem; }
.claim-note {
  margin: .8rem 1.2rem 1.1rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: #f7f8fa; border: 1px solid var(--line-soft); font-size: .9rem;
}
.claim-note strong { display: block; color: var(--ink-soft); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: .4rem; padding-left: 1.6rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: .4rem; bottom: .4rem;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 1.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.6rem; top: .35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand);
}
.tl-item.past::before { border-color: var(--ink-faint); }
.tl-date { color: var(--ink-faint); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; }
.tl-title { font-weight: 650; margin: .1rem 0 .15rem; }
.tl-text { color: var(--ink-soft); font-size: .92rem; }

/* ---------- Dokumentliste ---------- */
.doc {
  display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.doc + .doc { margin-top: .7rem; }
.doc-icon {
  flex: none; width: 42px; height: 42px; border-radius: 10px;
  background: var(--brand-050); color: var(--brand); display: grid; place-items: center;
  font-weight: 700; font-size: .72rem; letter-spacing: .02em;
}
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; }
.doc-meta { color: var(--ink-faint); font-size: .82rem; margin-top: .15rem; }
.doc-meta .dot { margin: 0 .45rem; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; color: var(--ink-faint); padding: 2.5rem 1rem;
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem;
  background:
    radial-gradient(1200px 600px at 50% -20%, #24466f 0%, rgba(36,70,111,0) 60%),
    var(--brand);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(10,20,40,.35); overflow: hidden;
}
.auth-top { padding: 1.9rem 1.9rem 1.2rem; text-align: center; }
.auth-logo {
  width: 54px; height: 54px; margin: 0 auto .9rem; border-radius: 14px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 1.05rem;
}
.auth-top h1 { font-size: 1.2rem; }
.auth-top p { color: var(--ink-soft); font-size: .92rem; margin-top: .4rem; }
.auth-body { padding: .4rem 1.9rem 1.9rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: .35rem; }
.field input {
  width: 100%; padding: .8rem .9rem; font: inherit; letter-spacing: .15em;
  text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfd; transition: border .15s, box-shadow .15s;
}
.field input:focus {
  outline: none; border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(39,77,128,.15); background: #fff;
}
.auth-error {
  background: #fbeaec; color: var(--danger); border: 1px solid #eecdd1;
  border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .88rem;
  margin-bottom: 1rem;
}
.auth-foot {
  text-align: center; color: var(--ink-faint); font-size: .82rem;
  padding: 1rem 1.9rem; border-top: 1px solid var(--line-soft);
}
.auth-foot a { color: var(--ink-soft); }
.auth-foot .sep { margin: 0 .5rem; }

/* ---------- Static content page ---------- */
.static-wrap { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.static-wrap .back { display: inline-block; margin-bottom: 1.5rem; font-size: .9rem; }
.static-wrap h1 { margin-bottom: 1rem; }
.static-wrap h2 { margin: 1.6rem 0 .5rem; font-size: 1.05rem; }
.static-wrap .card { line-height: 1.65; }

/* ---------- Error page ---------- */
.error-wrap {
  min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem;
}
.error-wrap .code { font-size: 3.5rem; font-weight: 700; color: var(--brand); }
.error-wrap p { color: var(--ink-soft); max-width: 34ch; margin: .5rem auto 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 1.1rem; }
  .sidenav {
    flex-direction: row; overflow-x: auto; gap: .4rem;
    padding-bottom: .3rem; -webkit-overflow-scrolling: touch;
  }
  .sidenav a { white-space: nowrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .deflist .row { grid-template-columns: 1fr; gap: .1rem; padding: .55rem 0; }
  .deflist dt { font-size: .82rem; }
}
