/* ============================================================
   Karl-Tele – Haupt-Stylesheet (Hell & Dunkel)
   Themes über CSS-Variablen; data-theme="auto|light|dark" am <html>.
   ============================================================ */

:root {
  --bg:        #eef2f7;
  --bg-grad-1: #dbe6f3;
  --bg-grad-2: #f4f7fb;
  --surface:   #ffffff;
  --surface-2: #f6f8fb;
  --border:    #dde3ec;
  --text:      #1f2a37;
  --muted:     #6b7685;
  --primary:   #1f3b5c;
  --primary-2: #2a5483;
  --accent:    #2f80ed;
  --shadow:    0 8px 28px rgba(31, 59, 92, .10);
  --radius:    14px;

  --ok:    #16a34a;
  --warn:  #f59e0b;
  --err:   #dc2626;
}

html[data-theme="dark"] {
  --bg:        #0f141b;
  --bg-grad-1: #131b26;
  --bg-grad-2: #0c1118;
  --surface:   #161d27;
  --surface-2: #1c2531;
  --border:    #2a3645;
  --text:      #e6ebf2;
  --muted:     #93a1b3;
  --primary:   #4f86c6;
  --primary-2: #3f6fa8;
  --accent:    #5aa2ff;
  --shadow:    0 8px 28px rgba(0, 0, 0, .45);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:#0f141b; --bg-grad-1:#131b26; --bg-grad-2:#0c1118;
    --surface:#161d27; --surface-2:#1c2531; --border:#2a3645;
    --text:#e6ebf2; --muted:#93a1b3; --primary:#4f86c6; --primary-2:#3f6fa8;
    --accent:#5aa2ff; --shadow:0 8px 28px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
}
a { color: var(--accent); }

/* ---------------- Auth (Login / Setup / Update) ---------------- */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2) 60%);
}
.auth-wrap { width: 100%; max-width: 440px; padding: 20px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark {
  font-size: 24px; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
}
.brand-name { font-size: 20px; font-weight: 700; }
.brand-sub  { color: var(--muted); font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--text); font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--primary-2); border-color: transparent; }
.btn-danger { background: var(--err); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 13px; }

.note { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 0 0 12px; }
.note.ok   { background: #e7f6ec; color: #16653a; }
.note.err  { background: #fdeaea; color: #a31616; }
.note.warn { background: #fff4e0; color: #8a5a08; }
html[data-theme="dark"] .note.ok   { background: #14301f; color: #7ee2a8; }
html[data-theme="dark"] .note.err  { background: #3a1717; color: #ffb3b3; }
html[data-theme="dark"] .note.warn { background: #3a2c12; color: #ffd591; }

.muted { color: var(--muted); }
.section-h { margin: 8px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------------- App-Shell ---------------- */
body.app { display: grid; grid-template-columns: 86px 1fr; grid-template-rows: 56px 1fr; min-height: 100vh; }
.sidebar { grid-row: 1 / 3; grid-column: 1; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.side-brand { width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.side-link { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px; color: var(--muted); text-decoration: none; font-size: 10px; border-left: 3px solid transparent; text-align: center; }
.side-link .ic { font-size: 19px; }
.side-link:hover { color: var(--text); background: var(--surface-2); }
.side-link.on { color: var(--accent); border-left-color: var(--accent); background: var(--surface-2); }
.side-ver { margin-top: auto; padding: 8px 4px 10px; width: 100%; text-align: center; }
.ver-badge { display: inline-block; font-size: 10px; line-height: 1.2; color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 8px; }
.ver-up { color: #fff; background: var(--accent); font-weight: 700; box-shadow: var(--shadow); }
.ver-up:hover { filter: brightness(1.08); }

.topbar { grid-row: 1; grid-column: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tb-title { font-weight: 600; }
.tb-tenant { color: var(--muted); font-size: 13px; margin-left: 6px; }
.tb-ctx { margin-left: 10px; font-size: 13px; background: #fff4e0; color: #8a5a08; padding: 3px 10px; border-radius: 20px; }
html[data-theme="dark"] .tb-ctx { background: #3a2c12; color: #ffd591; }
.tb-ctx-exit { margin-left: 8px; font-size: 12px; text-decoration: none; color: var(--err); }
.tb-ctx-exit:hover { text-decoration: underline; }
.tb-right { display: flex; align-items: center; gap: 12px; }
.tb-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; text-decoration: none; font-size: 16px; }
.tb-user { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text); padding: 4px 6px; border-radius: 9px; }
.tb-user:hover { background: var(--surface-2); }
.tb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; border: 1px solid var(--border); }
.tb-name { font-size: 13px; }

.content { grid-row: 2; grid-column: 2; overflow: auto; }
.page-pad { padding: 22px 26px; }
.app-footer { padding: 16px 26px; margin-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: center; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0 0; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; }
.grow { flex: 1; min-width: 160px; }
.right { margin-left: auto; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }

/* ---------------- Kacheln / Karten ---------------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 4px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tile-h { font-weight: 600; margin-bottom: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 4px 0 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--text); display: block; }
.stat:hover { border-color: var(--accent); }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat .ic { font-size: 18px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.card-link { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.card-link:hover { border-color: var(--accent); }
.cl-ic { font-size: 24px; }
.cl-t { font-weight: 600; }
.cl-d { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------------- Tabellen ---------------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl a.obj { text-decoration: none; color: var(--text); font-weight: 600; }
.tbl a.obj:hover { color: var(--accent); }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Status-Badge */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-active   { background: #e7f6ec; color: #16653a; }
.st-planned  { background: #e6eefb; color: #28518c; }
.st-stock    { background: #eef0f3; color: #4a5663; }
.st-maint    { background: #fff4e0; color: #8a5a08; }
.st-defect   { background: #fdeaea; color: #a31616; }
.st-retired  { background: #eceef1; color: #7a828d; }
html[data-theme="dark"] .st-active  { background: #14301f; color: #7ee2a8; }
html[data-theme="dark"] .st-planned { background: #15233a; color: #9cc0f5; }
html[data-theme="dark"] .st-stock   { background: #232c38; color: #aeb8c6; }
html[data-theme="dark"] .st-maint   { background: #3a2c12; color: #ffd591; }
html[data-theme="dark"] .st-defect  { background: #3a1717; color: #ffb3b3; }
html[data-theme="dark"] .st-retired { background: #232c38; color: #8b94a2; }

/* ---------------- Formulare ---------------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.fg-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.field-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 4px; border-top: 1px solid var(--border); padding-top: 14px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; }
.req { color: var(--err); }

/* ---------------- Detail / Panels ---------------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.panel-h { font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv li:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }

/* ---------------- Self-Service – Drucker-Kacheln ---------------- */
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 6px; }
.printer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.printer-card.sel { outline: 2px solid var(--accent); }
.pc-top { display: flex; align-items: center; gap: 10px; }
.pc-ic { font-size: 26px; }
.pc-name { font-weight: 700; }
.pc-meta { color: var(--muted); font-size: 12px; }
.pc-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Raumplan ---------------- */
.plan-wrap { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); }
.plan-wrap img { display: block; max-width: 100%; height: auto; }
.plan-empty { display: grid; place-items: center; width: 640px; max-width: 100%; height: 360px; color: var(--muted); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 12px, var(--surface) 12px, var(--surface) 24px); }
.plan-pin { position: absolute; transform: translate(-50%, -100%); font-size: 26px; line-height: 1; text-decoration: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); cursor: pointer; }
.plan-pin .pin-label { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.plan-pin.defect { filter: grayscale(1) drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
[data-planpick] { cursor: crosshair; }
.plan-pick-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent); }

/* Historie / Verlauf */
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); position: relative; }
.hist li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hist .when { color: var(--muted); font-size: 12px; }

/* ---------------- Dokumentation ---------------- */
.doc-content { max-width: 820px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; line-height: 1.6; }
.doc-content h1 { font-size: 24px; margin: 0 0 14px; }
.doc-content h2 { font-size: 19px; margin: 22px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.doc-content h3 { font-size: 16px; margin: 16px 0 6px; }
.doc-content ul, .doc-content ol { margin: 6px 0 14px; padding-left: 22px; }
.doc-content li { margin: 3px 0; }
.doc-content p { margin: 8px 0; }

/* ---------------- Update / Changelog ---------------- */
.log-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, monospace; font-size: 13px; margin: 12px 0; }
.changelog { padding-left: 18px; }
.changelog li { margin: 6px 0; }
.tok { font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; user-select: all; word-break: break-all; }

/* Inline-Mini-Form */
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; }
form.inline { margin: 0; }

@media print {
  .sidebar, .topbar, .toolbar, .fg-actions, .no-print { display: none !important; }
  body.app { display: block; }
  .content { overflow: visible; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .kv li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 720px) {
  body.app { grid-template-columns: 64px 1fr; }
  .tb-name { display: none; }
  .side-link .tx { display: none; }
}


/* KARL_DARKMODE_OFF – Dunkelmodus abgeschaltet (22.09.2026): Umschalter ausblenden. */
[data-theme-toggle], #themeToggle { display: none !important; }

/* ============================================================
   Karl-Tele – Ergänzungen zum Verbund-Stylesheet
   Formularraster, Listen, Zustands-Plaketten und das Browser-Telefon.
   Farben kommen ausnahmslos aus den Variablen oben, damit Hell und
   Dunkel weiter zusammenpassen.
   ============================================================ */

/* ---- Formulare ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.form-row  { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.form-grid .span2, .form-row .span2 { grid-column: 1 / -1; }
.fg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fg.grow { flex: 1 1 220px; }
.fg > label, .form-grid label, .form-row label { font-size: 13px; font-weight: 600; color: var(--muted); }
.fg input, .fg select, .fg textarea { width: 100%; }
.fg .three { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
fieldset.fg { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
fieldset.fg legend { font-size: 13px; font-weight: 700; color: var(--text); padding: 0 6px; }
.checks-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--text); }
.ck input { width: auto; margin: 0; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 2px 0 0; }
.inline-form { display: inline-block; margin: 0 0 0 6px; }
.mini-form { display: grid; gap: 6px; padding: 10px; margin-top: 6px; min-width: 220px;
             background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.mini-form label { display: grid; gap: 3px; font-size: 12px; }

/* ---- Knopf-Varianten (kurze Schreibweise neben .btn-primary) ---- */
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger  { background: var(--err); color: #fff; border-color: transparent; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.ok      { background: var(--ok); color: #fff; border-color: transparent; }
.btn.small   { padding: 6px 11px; font-size: 13px; }

/* ---- Listen ---- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.list th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
                color: var(--muted); border-bottom: 1px solid var(--border); padding: 8px 12px 8px 0; white-space: nowrap; }
table.list td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr.dim { opacity: .55; }
table.list td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.row-actions form { margin: 0; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.small { font-size: 12.5px; }
.mono  { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.plain { list-style: none; padding: 0; margin: 8px 0 0; }
.plain li { padding: 4px 0; }
.steps { margin: 8px 0 0; padding-left: 22px; }
.steps li { margin: 5px 0; }

/* ---- Zustands-Plaketten ---- */
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
        background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.ok, .pill.st-active   { background: #e7f6ec; color: #16653a; border-color: #bfe6cd; }
.pill.warn, .pill.st-maint  { background: #fff4e0; color: #8a5a08; border-color: #f0dcb4; }
.pill.bad, .pill.st-defect  { background: #fdeaea; color: #a31616; border-color: #f2c7c7; }
.pill.st-planned            { background: #e8f0fd; color: #1d4ed8; border-color: #c6d9f8; }
html[data-theme="dark"] .pill.ok, html[data-theme="dark"] .pill.st-active  { background: #14301f; color: #7ee2a8; border-color: #245c3a; }
html[data-theme="dark"] .pill.warn, html[data-theme="dark"] .pill.st-maint { background: #3a2c12; color: #ffd591; border-color: #6b4f1a; }
html[data-theme="dark"] .pill.bad, html[data-theme="dark"] .pill.st-defect { background: #3a1717; color: #ffb3b3; border-color: #6b2b2b; }
html[data-theme="dark"] .pill.st-planned { background: #16233a; color: #9cc2ff; border-color: #2c4670; }

/* ---- Kennzahlen in Karten ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.stats .stat { box-shadow: none; }
.stat-n { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-l { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat-x { display: block; font-size: 12px; color: var(--muted); }

/* ---- Budget-Balken ---- */
.budget .bar { height: 10px; border-radius: 999px; background: var(--surface-2);
               border: 1px solid var(--border); overflow: hidden; }
.budget .bar span { display: block; height: 100%; background: var(--ok); }
.budget .bar span.hot { background: var(--err); }

/* ---- Zwei Spalten ---- */
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---- Anruflisten ---- */
.calls { list-style: none; margin: 6px 0 0; padding: 0; }
.calls li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto auto; gap: 10px;
            align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.calls li.vm-text { grid-template-columns: 1fr; color: var(--muted); font-size: 13px; font-style: italic;
                    border-bottom: 1px solid var(--border); padding-left: 32px; }
.calls li.unheard { font-weight: 600; }
.calls .call-dir { color: var(--muted); }
.calls .call-when, .calls .call-dur { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.book { list-style: none; margin: 6px 0 0; padding: 0; }
.book li { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.book a { text-decoration: none; color: var(--text); }
.book a:hover { color: var(--accent); }

/* ---- Blättern ---- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pager a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px;
           text-decoration: none; color: var(--text); font-size: 13px; }
.pager a.on { background: var(--primary); color: #fff; border-color: transparent; }

/* ---- Geheimnis einmalig anzeigen ---- */
.secret-box { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
              padding: 12px 14px; overflow-x: auto; }
.secret-box code { font-size: 14px; word-break: break-all; }
.card.accent { border-color: var(--accent); }

.block-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; }
.tb-ctx-mask { font-weight: 600; }

/* ============================================================
   Browser-Telefon
   ============================================================ */
.wp { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.wp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wp-state { font-weight: 700; font-size: 14px; color: var(--muted); }
.wp-state.ok   { color: var(--ok); }
.wp-state.bad  { color: var(--err); }
.wp-state.busy { color: var(--warn); }
.wp-state.ring { color: var(--accent); }
.wp-timer { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; }
.wp-peer  { min-height: 1.2em; margin: 6px 0 10px; font-size: 16px; font-weight: 600; }
.wp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wp-num { flex: 1 1 200px; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.wp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 260px; margin: 14px 0 0; }
.wp-pad button { padding: 12px 0; font-size: 18px; font-weight: 600; border: 1px solid var(--border);
                 border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.wp-pad button:hover { border-color: var(--accent); }
.wp-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.wp[data-phase="ringing"] { border-color: var(--accent); }
.wp[data-phase="incall"]  { border-color: var(--ok); }
