/* App-Shell (Phase 1) — ergänzt shared.css (Tokens --bg/--bg2/--teal/...) */

body.app { margin: 0; }

/* Native Checkboxen/Radios klar sichtbar im Dark-Mode (NICHT die verborgenen
   .switch-/.tgl-Slider-Inputs). accent-color = Highlight-Farbe bei „checked",
   color-scheme dark = der Browser zeichnet auch die LEERE Box dunkel-sichtbar. */
input[type="checkbox"]:not(.switch input):not(.tgl input),
input[type="radio"]:not(.switch input):not(.tgl input) {
  accent-color: var(--teal, #2a9d8f);
  width: 16px; height: 16px; cursor: pointer; vertical-align: middle;
  color-scheme: dark;
}
/* Schieberegler mit Beschriftung daneben (Ersatz für native Checkboxen) */
.sw-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.sw-line .switch { flex: 0 0 auto; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 50; overflow-y: auto;
}
.app-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; font-weight: 700; font-size: 16px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.app-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.app-nav { flex: 1; padding: 12px 10px; }
.app-nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 16px 12px 6px; }
.app-nav a, .app-nav button.navitem {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; margin: 2px 0; border-radius: 8px; box-sizing: border-box;
  color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
  background: none; border: none; text-align: left; font-family: inherit;
}
.app-nav a:hover, .app-nav button.navitem:hover { background: var(--bg3); }
.app-nav a.active { background: var(--teal-dim); color: var(--teal); font-weight: 600; }
.app-nav a.locked { color: var(--muted); cursor: not-allowed; opacity: .55; }
.app-nav a.locked:hover { background: none; }
.app-nav a.locked .lock { margin-left: auto; font-size: 12px; }
.app-nav .nav-ico { width: 18px; text-align: center; opacity: .85; }
.app-sidebar-foot { padding: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ── Main ──────────────────────────────────────────────────────────── */
.app-main { margin-left: 240px; min-height: 100vh; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 58px; border-bottom: 1px solid var(--border);
  background: var(--bg2); position: sticky; top: 0; z-index: 20;
}
.app-topbar h1 { font-size: 18px; margin: 0; color: var(--text); }
.app-topbar .sub { font-size: 12px; color: var(--muted); }
.app-content { padding: 26px 28px 60px; max-width: 1300px; }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--bg2); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 32px; width: 340px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.muted { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 5px; }
.login-card input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text); font-size: 14px; }
.login-card .err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ── Kanban-Board ──────────────────────────────────────────────────── */
.board-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.board-filters select, .board-filters input {
  padding: 8px 10px; border-radius: 8px; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text); font-size: 13px;
}
.board-filters input[type=search] { min-width: 220px; }
.kanban { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; }
.kanban-col { flex: 1 1 0; min-width: 0; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; }
.kanban-col-head .title { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.kanban-col-head .cnt { font-size: 12px; color: var(--muted); background: var(--bg3);
  padding: 1px 9px; border-radius: 20px; }
.kanban-cards { padding: 10px; overflow-y: auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; cursor: pointer; transition: border-color .12s; min-width: 0;
  overflow: hidden; flex: 0 0 auto; }
.kcard:hover { border-color: var(--teal-border); }
.kcard .nm { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3;
  overflow-wrap: anywhere; }
.kcard .hl { font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 100%;
  line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.kcard .draft-flag { font-size: 10px; color: var(--amber); }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 8px; }

/* Drawer/Detail reuse .modal-overlay/.modal-box from shared.css */
.detail-row { display: flex; gap: 8px; font-size: 13px; margin: 6px 0; }
.detail-row .k { color: var(--muted); min-width: 90px; }
.draft-editor { width: 100%; box-sizing: border-box; min-height: 150px; padding: 10px 12px;
  border-radius: 8px; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-family: inherit; resize: vertical; }

/* Klickbare Container (ganze Karte/Zeile öffnet Detail/Bearbeiten) */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--bg3); }
.clickable-card { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.clickable-card:hover { border-color: var(--accent, var(--teal-border)); box-shadow: 0 0 0 1px var(--accent, var(--teal-border)) inset; }
.clickable-card [data-act], .clickable-card [data-edit], .clickable-card [data-del], .clickable-card [data-buy], .clickable-card [data-portal] { position: relative; z-index: 1; }

/* Toggle-Switch (Schieberegler) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 26px; cursor: pointer; transition: background .2s, border-color .2s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--muted); border-radius: 50%; transition: transform .2s, background .2s; }
.switch input:checked + .slider { background: var(--teal); border-color: var(--teal); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }
.switch input:disabled + .slider { opacity: .55; cursor: default; }
