/* NF CRM — Designsystem
   Basis: nfcosmetics.de (Dunkelgrün-Schwarz, Silber-Verlauf, feine Glas-Kanten, 2px-Buttons, 8px-Karten)
   Marke: NATURFACTOR® (Didot für Schaufenster-Momente, Deep Forest Green, Grau-Blau-Eyebrows, Moss als Verlauf) */

:root {
  --bg: #030705;
  --bg-mid: #071209;
  --surface: #0b170e;
  --surface-2: #0f1f13;
  --card-from: rgba(20, 31, 23, 0.96);
  --card-to: rgba(8, 15, 10, 0.98);
  --line: rgba(188, 200, 214, 0.10);
  --line-hi: rgba(210, 225, 240, 0.20);
  --glass: rgba(255, 255, 255, 0.025);
  --glass-hi: rgba(255, 255, 255, 0.05);
  --text: #f0f4f8;
  --text-2: #b0bec8;
  --muted: #7a8a99;
  --eyebrow: #8c9198;
  --silver: linear-gradient(135deg, #96a4b6 0%, #d8e2ee 30%, #eef3f8 50%, #ccd6e4 70%, #a0afc2 100%);
  --silver-flat: #c8d4e0;
  --on-silver: #040806;
  --forest: #1c2f22;
  --forest-hi: #2d4a35;
  --moss: linear-gradient(90deg, #18402c 0%, #3d6b3a 45%, #a9c86a 80%, #e8f499 100%);
  --sage: #9cc5a1;
  --amber: #d9b26a;
  --rose: #d98a8a;
  --blue: #9fb6d1;
  --glow: rgba(46, 150, 76, 0.16);
  --shadow: 0 1px 0 0 rgba(255, 255, 255, 0.06) inset, 0 6px 24px rgba(0, 0, 0, 0.35);
  --radius: 2px;
  --card-radius: 8px;
  --serif: Didot, "Linotype Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --side: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #e9eeed;
  --bg-mid: #dfe7e3;
  --surface: #f4f8f6;
  --surface-2: #e8efeb;
  --card-from: rgba(250, 253, 251, 0.98);
  --card-to: rgba(238, 245, 240, 0.98);
  --line: rgba(20, 40, 32, 0.10);
  --line-hi: rgba(20, 40, 32, 0.18);
  --glass: rgba(20, 40, 32, 0.025);
  --glass-hi: rgba(20, 40, 32, 0.05);
  --text: #141e1a;
  --text-2: #2e4050;
  --muted: #5a6e7a;
  --eyebrow: #6b7178;
  --silver: linear-gradient(135deg, #3a4e5a 0%, #1e2e3a 30%, #0e1e2a 50%, #2a3a48 70%, #4a5e6a 100%);
  --silver-flat: #2a3a4a;
  --on-silver: #f0f4f8;
  --forest: #1c2f22;
  --forest-hi: #2d4a35;
  --sage: #2f6b3d;
  --amber: #9a6a12;
  --rose: #a83c3c;
  --blue: #2f5a8a;
  --glow: rgba(46, 150, 76, 0.07);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 4px 18px rgba(20, 40, 32, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, var(--glow) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 60%, rgba(36, 120, 60, 0.05) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(156, 197, 161, 0.35); }

/* ---------- Typo ---------- */
.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--eyebrow);
}
.eyebrow.silver { background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1.display, .display {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.08;
  font-size: clamp(30px, 4.2vw, 44px); margin: 6px 0 0;
}
h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-2); margin: 0; }
h3 { font-size: 16px; font-weight: 600; margin: 0; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 26, 13, 0.55), rgba(3, 7, 5, 0.2));
}
:root[data-theme="light"] .side { background: rgba(255, 255, 255, 0.35); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { width: 34px; height: 34px; }
.brand .t { line-height: 1.15; }
.brand .t b { font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: 0.02em; display: block; }
.searchbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; text-align: left;
}
.searchbtn:hover { border-color: var(--line-hi); color: var(--text-2); }
.searchbtn kbd { margin-left: auto; font: 11px var(--sans); border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius); color: var(--text-2);
  border: 1px solid transparent; position: relative;
}
.nav a:hover { background: var(--glass); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, rgba(45, 74, 53, 0.55), rgba(28, 47, 34, 0.15)); border-color: var(--line); color: var(--text); }
:root[data-theme="light"] .nav a.on { background: rgba(28, 47, 34, 0.08); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px; background: var(--silver); }
.nav a .badge { margin-left: auto; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 0 6px; }

main { min-width: 0; }
main > .wrap { max-width: 1320px; margin: 0 auto; padding: 30px clamp(16px, 3.2vw, 44px) 80px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.topbar, .tabbar { display: none; }

/* ---------- Bausteine ---------- */
.card {
  background: linear-gradient(160deg, var(--card-from), var(--card-to));
  border: 1px solid var(--line); border-radius: var(--card-radius); box-shadow: var(--shadow);
  padding: 18px 20px; min-width: 0;
}
.card.flat { background: var(--glass); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .r { display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1180px) { .main-side { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; min-height: 38px;
  border-radius: var(--radius); border: 1px solid var(--line-hi); background: var(--glass); color: var(--text);
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
  transition: border-color .2s ease, background .2s ease, transform .1s ease;
}
.btn:hover { border-color: var(--silver-flat); background: var(--glass-hi); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--silver); color: var(--on-silver); border: 0; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.forest { background: var(--forest); border-color: var(--forest-hi); color: #eef3f8; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--glass); border-color: var(--line); }
.btn.sm { padding: 6px 10px; min-height: 30px; font-size: 11px; letter-spacing: 0.08em; }
.btn.lg { padding: 14px 26px; min-height: 50px; font-size: 13px; }
.btn.danger { color: var(--rose); }
.btn.icon { padding: 0; width: 36px; min-height: 36px; letter-spacing: 0; }
.btn.icon.sm { width: 30px; min-height: 30px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg, .ic { width: 16px; height: 16px; flex: none; }
.btn.lg svg { width: 18px; height: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-hi);
  background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.chip:hover { border-color: var(--silver-flat); color: var(--text); }
.chip.on { background: var(--forest); border-color: var(--forest-hi); color: #eef3f8; }
.chip.big { padding: 10px 16px; min-height: 44px; font-size: 14px; border-radius: var(--radius); }
.chip.big.good { border-color: rgba(156, 197, 161, 0.45); }
.chip.big.bad { border-color: rgba(217, 138, 138, 0.35); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line-hi); color: var(--text-2); white-space: nowrap; line-height: 1.5;
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-neu { color: var(--blue); }
.badge.s-kontaktiert { color: var(--text-2); }
.badge.s-gespraech { color: #b9d7bd; }
.badge.s-muster { color: var(--sage); }
.badge.s-angebot { color: var(--amber); }
.badge.s-partner, .badge.s-aktiv { color: #e8f499; border-color: rgba(232, 244, 153, 0.35); }
:root[data-theme="light"] .badge.s-partner, :root[data-theme="light"] .badge.s-aktiv { color: #3d6b3a; border-color: rgba(61, 107, 58, 0.4); }
.badge.a-verloren, .badge.a-passt_nicht { color: var(--rose); }
.badge.a-wiedervorlage { color: var(--amber); }
.badge.a-dublette, .badge.a-beendet { color: var(--muted); }
.badge.warn { color: var(--amber); }
.badge.bad { color: var(--rose); }
.badge.good { color: var(--sage); }
.badge.solid { background: var(--forest); color: #eef3f8; border-color: var(--forest-hi); }
.score { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 3px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-hi); color: var(--text-2); }
.score.s9, .score.s10 { background: var(--silver); color: var(--on-silver); border: 0; }
.score.s8 { border-color: var(--silver-flat); color: var(--text); }
.score.u { color: var(--muted); border-style: dashed; font-weight: 500; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--line-hi); background: rgba(0, 0, 0, 0.18);
  color: var(--text); min-height: 40px; outline: none; transition: border-color .2s;
}
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: rgba(255, 255, 255, 0.7); }
input:focus, select:focus, textarea:focus { border-color: var(--silver-flat); box-shadow: 0 0 0 3px rgba(200, 212, 224, 0.12); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #2d4a35; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Listen */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); min-width: 0;
  flex-wrap: wrap; row-gap: 8px;
}
.item:first-child { border-top: 0; }
.item .main { flex: 1 1 200px; min-width: 0; }
.item .main .t { font-weight: 600; display: flex; gap: 8px; align-items: center; min-width: 0; }
.item .main .s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.item .acts { display: flex; gap: 6px; flex: none; margin-left: auto; }
.item.link { cursor: pointer; border-radius: 4px; }
.item.link:hover { background: var(--glass); }
.due { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.due.over { color: var(--rose); }
.due.today { color: var(--amber); }
.due.later { color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line-hi); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--glass); }
.tbl td.r, .tbl th.r { text-align: right; }

.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .serif { font-size: 22px; color: var(--text-2); display: block; margin-bottom: 4px; }

/* Kennzahlen */
.stat { padding: 16px 18px; }
.stat .v { font-family: var(--serif); font-size: 34px; line-height: 1; margin-top: 8px; }
.stat .v small { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 4px; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--moss); border-radius: 4px; }
.goal { display: flex; align-items: center; gap: 18px; padding: 16px 20px; flex-wrap: wrap; }
.goal .g { flex: 1; min-width: 220px; }
.goal .g .row { justify-content: space-between; }

/* Stufen-Pfeile (aus NORA) */
.pfeile { display: flex; gap: 3px; margin-top: 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pfeil {
  flex: 1 0 auto; padding: 7px 14px 7px 18px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--glass-hi); color: var(--muted); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
  white-space: nowrap; text-align: center;
}
.pfeil:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: 12px; }
.pfeil.done { background: rgba(45, 74, 53, 0.55); color: var(--text-2); }
.pfeil.on { background: var(--silver); color: var(--on-silver); }
:root[data-theme="light"] .pfeil.done { background: rgba(45, 74, 53, 0.18); color: var(--text); }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.kachel { padding: 14px; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--glass); cursor: pointer; transition: border-color .2s; }
.kachel:hover { border-color: var(--line-hi); }
.kachel .n { font-family: var(--serif); font-size: 28px; margin-top: 6px; }
.kachel .m { font-size: 12px; color: var(--muted); }

/* Pipeline-Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--glass); border: 1px solid var(--line); border-radius: var(--card-radius); padding: 12px; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding: 0 2px; }
.col-head .n { font-family: var(--serif); font-size: 22px; }
.pcard { padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: linear-gradient(160deg, var(--card-from), var(--card-to)); cursor: pointer; }
.pcard:hover { border-color: var(--line-hi); }
.pcard .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pcard .s { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Verlauf */
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl:first-child { border-top: 0; }
.tl .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-hi); color: var(--text-2); }
.tl .ico svg { width: 14px; height: 14px; }
.tl .h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl .h b { font-weight: 600; font-size: 14px; }
.tl .h .when { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.tl .b { font-size: 14px; color: var(--text-2); white-space: pre-wrap; margin-top: 2px; word-break: break-word; }
.tl .x { opacity: 0; transition: opacity .2s; }
.tl:hover .x { opacity: 1; }

/* Akte */
.akte-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.akte-head .title { min-width: 0; flex: 1; }
.actionbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.brief { font-size: 14px; color: var(--text-2); }
.brief .held { font-family: var(--serif); font-size: 20px; color: var(--text); line-height: 1.25; margin: 4px 0 12px; }
.brief ol { margin: 6px 0 0; padding-left: 18px; }
.brief li { margin: 4px 0; }
.brief .ew { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--line-hi); background: var(--glass); }
.brief .ew b { color: var(--text); }

/* Anrufliste / Dialer */
.dialer { max-width: 860px; margin: 0 auto; }
.dial-card { padding: 26px 28px; }
.dial-card .name { font-family: var(--serif); font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 8px 0 6px; }
.callbtn { width: 100%; margin-top: 20px; font-size: 15px; letter-spacing: 0.06em; min-height: 58px; }
.progress { display: flex; gap: 3px; margin: 14px 0 22px; }
.progress i { flex: 1; height: 3px; background: var(--line); border-radius: 2px; }
.progress i.done { background: var(--silver-flat); }
.progress i.cur { background: var(--sage); }

/* Overlay, Sheet, Toast */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fade .15s ease; }
.sheet {
  width: min(620px, 100%); max-height: 84vh; overflow: auto; background: linear-gradient(160deg, var(--card-from), var(--card-to));
  border: 1px solid var(--line-hi); border-radius: 10px; box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6); padding: 22px 24px; animation: rise .18s ease;
}
:root[data-theme="light"] .sheet { background: var(--surface); }
.sheet.wide { width: min(860px, 100%); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface-2); border: 1px solid var(--line-hi); border-radius: 6px; padding: 11px 14px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; font-size: 14px; animation: rise .2s ease; max-width: 420px; }
.toast.err { border-color: rgba(217, 138, 138, 0.5); }
.toast button { background: none; border: 0; color: var(--sage); font-weight: 700; cursor: pointer; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }

.search-box input { font-size: 18px; padding: 14px 16px; min-height: 52px; }
.search-results { margin-top: 10px; }
.search-results .grp { margin-top: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs a.on { color: var(--text); border-image: var(--silver) 1; border-bottom: 2px solid; }

.note { padding: 12px 14px; border: 1px solid var(--line); border-left: 2px solid var(--amber); border-radius: 4px; background: var(--glass); font-size: 13.5px; color: var(--text-2); }
.note.ok { border-left-color: var(--sage); }
.note.info { border-left-color: var(--blue); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
pre.mail { white-space: pre-wrap; font: 14px/1.55 var(--sans); background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin: 0; max-height: 46vh; overflow: auto; }
:root[data-theme="light"] pre.mail { background: rgba(255, 255, 255, 0.7); }

.hbars .r { display: grid; grid-template-columns: 170px 1fr 54px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.hbars .r .b { height: 10px; background: var(--line); border-radius: 2px; overflow: hidden; }
.hbars .r .b i { display: block; height: 100%; background: var(--moss); }
.vbars { display: flex; gap: 8px; align-items: flex-end; height: 150px; padding-top: 10px; }
.vbars .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbars .c .b { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 2px 2px 0 0; overflow: hidden; }
.vbars .c .b i { display: block; }
.vbars .c .l { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(420px, 100%); padding: 34px 30px; text-align: center; }
.login img { width: 64px; height: 64px; margin-bottom: 14px; }
.login form { margin-top: 24px; text-align: left; }

.hide { display: none !important; }

/* ---------- Mobil (iPhone zuerst) ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
    background: rgba(3, 7, 5, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  }
  :root[data-theme="light"] .topbar { background: rgba(233, 238, 237, 0.85); }
  .topbar img { width: 28px; height: 28px; }
  .topbar b { font-family: var(--serif); font-weight: 400; font-size: 18px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(var(--safe-b) + 6px); background: rgba(3, 7, 5, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  :root[data-theme="light"] .tabbar { background: rgba(233, 238, 237, 0.92); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--text); }
  .tabbar a .badge { position: absolute; top: 0; left: 55%; padding: 0 5px; font-size: 10px; background: var(--forest); color: #eef3f8; border: 0; }
  main > .wrap { padding: 18px 16px calc(96px + var(--safe-b)); }
  .g2, .g3, .main-side { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 26px; margin-top: 4px; }
  .stat .eyebrow { letter-spacing: 0.2em; }
  .goal { padding: 14px 16px; gap: 12px; }
  .pagehead { margin-bottom: 18px; }
  .scrim { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .2s ease; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + var(--safe-b)); }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .tbl.cards td { display: inline; border: 0; padding: 0 6px 0 0; }
  .tbl.cards td.t { display: block; font-weight: 600; margin-bottom: 4px; }
  .tbl.cards td.hide-m { display: none; }
  .hbars .r { grid-template-columns: 110px 1fr 44px; }
  .form .two { grid-template-columns: 1fr; }
  .dial-card { padding: 20px 18px; }
  .kv { grid-template-columns: 100px 1fr; }
  .hide-m { display: none !important; }
}
@media (min-width: 901px) { .only-m { display: none !important; } }
@media (max-width: 520px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
