/* Mail-Agent Admin – Farben und Schriften wie die Kunden-App (Design „Briefkontor“) */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f2f3f5;
  --paper: #ffffff;
  --ink: #1e1d1b;
  --muted: #6b6863;
  --line: #e2e2df;
  --accent: #2b3f5c;
  --airmail: #b5483a;
  --danger: #a1271a;
  --ok: #2f6b4f;
  --radius: 6px;
  --btn-shadow: 0 1px 2px rgba(30, 29, 27, 0.06), 0 1px 1px rgba(30, 29, 27, 0.04);
  --sans: Geist, "Helvetica Neue", Arial, sans-serif;
  --serif: Newsreader, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { font: 500 30px/1.15 var(--serif); margin: 0 0 20px; }
h2 { font: 500 21px/1.2 var(--serif); margin: 32px 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--danger); font-weight: 500; }
.empty { color: var(--muted); }
.notice { background: var(--paper); border-left: 3px solid var(--ok); padding: 10px 14px; }
.error { color: var(--danger); }
code { font-size: 13px; }

.seal {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 500 18px/1 var(--serif);
}
.brand { display: flex; align-items: center; gap: 10px; font: 500 20px/1 var(--serif); }

/* Seitenleiste + Inhalt */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: var(--radius); }
.side nav a:hover { background: var(--bg); }
.side nav a[aria-current="page"] { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.logout { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.content { padding: 32px 40px 64px; min-width: 0; max-width: 1200px; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .value { font: 500 28px/1.1 var(--serif); }
.tile .label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.big { font: 500 26px/1.2 var(--serif); }

/* Tabellen */
.list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.list th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; background: #fafaf9; }
.list tr:last-child td { border-bottom: 0; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list a { color: var(--ink); }

/* Fakten eines Nutzers */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
.facts div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.plain-list { margin: 0; padding-left: 18px; }

/* Formulare und Knöpfe */
.search { display: flex; gap: 8px; margin-bottom: 8px; max-width: 560px; }
input { font: inherit; color: inherit; }
.search input, .passkey input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); min-width: 0;
}
.btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff; font: 500 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; box-shadow: var(--btn-shadow);
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.outline { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.passkey { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.stack { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.stack input { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: 15px; min-width: 0; }
.stack .row { display: flex; gap: 12px; flex-wrap: wrap; }
.stack .row label { flex: 1; min-width: 140px; }
.stack .btn { align-self: flex-start; }
.btn.small { padding: 5px 10px; font-size: 13px; box-shadow: none; }
code.link { font-size: 13px; overflow-wrap: anywhere; }
.passkey label { font-size: 13px; color: var(--muted); }

/* Ohne Menü: Anmelden, Einrichten */
.plain { display: grid; place-items: start center; min-height: 100vh; padding: 12vh 16px 32px; }
.card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card .brand { margin-bottom: 28px; }
.card .passkey .btn { width: 100%; }

/* Handy: Menü oben, Tabellen als Karten */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 2px 4px; }
  .side nav a { white-space: nowrap; padding: 6px 10px; }
  .side nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .logout { margin-top: 0; flex-direction: row; align-items: center; gap: 10px; }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 26px; }
  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list thead { display: none; }
  .list { background: none; border: 0; }
  .list tr { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; padding: 6px 0; }
  .list td { border: 0; padding: 4px 12px; }
  .list td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .list .num { text-align: left; }
}
