/* ============================================================
   Unterweisungen – Portal-Modul
   Design tokens, light/dark themes, components
   ============================================================ */

:root {
  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Radii */
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --sp-6: 30px;
  --sp-7: 42px;

  /* Status hues (shared) */
  --ok: oklch(0.62 0.13 155);
  --ok-soft: oklch(0.62 0.13 155 / 0.13);
  --warn: oklch(0.74 0.14 75);
  --warn-soft: oklch(0.74 0.14 75 / 0.16);
  --bad: oklch(0.58 0.18 27);
  --bad-soft: oklch(0.58 0.18 27 / 0.14);

  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-2: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-3: 0 18px 48px rgba(15, 23, 42, 0.18), 0 6px 18px rgba(15, 23, 42, 0.10);

  --speed: 160ms;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: oklch(0.975 0.004 245);
  --bg-grad: oklch(0.96 0.006 245);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.978 0.004 245);
  --surface-3: oklch(0.955 0.006 245);
  --border: oklch(0.915 0.006 245);
  --border-strong: oklch(0.86 0.008 245);
  --text: oklch(0.27 0.02 255);
  --text-muted: oklch(0.52 0.02 255);
  --text-faint: oklch(0.66 0.018 255);
  --primary: oklch(0.55 0.13 248);
  --primary-strong: oklch(0.48 0.14 248);
  --primary-soft: oklch(0.55 0.13 248 / 0.10);
  --primary-contrast: #fff;
  --ring: oklch(0.55 0.13 248 / 0.35);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: oklch(0.19 0.012 255);
  --bg-grad: oklch(0.22 0.014 255);
  --surface: oklch(0.235 0.014 255);
  --surface-2: oklch(0.265 0.015 255);
  --surface-3: oklch(0.30 0.016 255);
  --border: oklch(0.32 0.016 255);
  --border-strong: oklch(0.40 0.018 255);
  --text: oklch(0.95 0.006 255);
  --text-muted: oklch(0.72 0.014 255);
  --text-faint: oklch(0.58 0.014 255);
  --primary: oklch(0.70 0.13 248);
  --primary-strong: oklch(0.78 0.12 248);
  --primary-soft: oklch(0.70 0.13 248 / 0.16);
  --primary-contrast: oklch(0.18 0.02 255);
  --ring: oklch(0.70 0.13 248 / 0.40);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.35);
  --shadow-3: 0 18px 48px rgba(0,0,0,0.5);
  --ok-soft: oklch(0.62 0.13 155 / 0.20);
  --warn-soft: oklch(0.74 0.14 75 / 0.20);
  --bad-soft: oklch(0.58 0.18 27 / 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--bg-grad), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}

::selection { background: var(--primary-soft); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ============================================================
   App shell
   ============================================================ */
#root { min-height: 100%; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--sp-6);
  height: 64px;
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--primary), var(--primary-strong));
  color: var(--primary-contrast); font-weight: 700; font-size: 16px;
  box-shadow: var(--shadow-1);
}
.brand-name { font-size: 15.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-faint); font-weight: 500; margin-top: -2px; }

.topnav { display: flex; gap: 2px; margin-left: var(--sp-4); }
.topnav a {
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); text-decoration: none; transition: var(--speed);
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--primary-soft); color: var(--primary-strong); }

.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--border);
}

/* ---- Content frame ---- */
.content { max-width: 1320px; width: 100%; margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-7); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.page-desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--text-faint); font-size: 13px; margin-bottom: 6px; }
.breadcrumb button { background: none; border: 0; color: var(--text-muted); font-size: 13px; padding: 0; }
.breadcrumb button:hover { color: var(--primary-strong); text-decoration: underline; }

/* ---- Sub navigation (segmented) ---- */
.subnav { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.subnav button {
  border: 0; background: none; color: var(--text-muted); font-weight: 500; font-size: 13.5px;
  padding: 7px 16px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 7px; transition: var(--speed);
}
.subnav button:hover { color: var(--text); }
.subnav button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: var(--speed);
  background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(0.5px); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: transparent; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--border); }
.btn-danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center;
  position: relative; transition: var(--speed);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }

.dot-badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center; border: 2px solid var(--surface); font-family: var(--font-mono);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--sp-5); }

.grid { display: grid; gap: var(--sp-4); }
.grid-kpi { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1080px) { .grid-kpi { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-kpi { grid-template-columns: 1fr; } }

/* KPI */
.kpi { padding: var(--sp-5); display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi-icon .ico { width: 18px; height: 18px; }
.kpi-value { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--font-mono); line-height: 1; }
.kpi-foot { font-size: 12.5px; color: var(--text-faint); }
.kpi-accent::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kpi.ok::after { background: var(--ok); }
.kpi.warn::after { background: var(--warn); }
.kpi.bad::after { background: var(--bad); }
.kpi.neutral::after { background: var(--primary); }

/* ============================================================
   Status pills + traffic light
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.pill .pdot { width: 7px; height: 7px; border-radius: 50%; }
.pill.ok { background: var(--ok-soft); color: oklch(0.5 0.13 155); } .pill.ok .pdot { background: var(--ok); }
.pill.warn { background: var(--warn-soft); color: oklch(0.55 0.14 65); } .pill.warn .pdot { background: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.bad .pdot { background: var(--bad); }
.pill.muted { background: var(--surface-3); color: var(--text-muted); } .pill.muted .pdot { background: var(--text-faint); }
[data-theme="dark"] .pill.ok { color: oklch(0.78 0.13 155); }
[data-theme="dark"] .pill.warn { color: oklch(0.82 0.13 80); }
[data-theme="dark"] .pill.bad { color: oklch(0.74 0.16 30); }

.tlight { display: inline-flex; gap: 4px; align-items: center; }
.tlight i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.tlight.ok i.g { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.tlight.warn i.y { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tlight.bad i.r { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ============================================================
   Unterweisungsart cards
   ============================================================ */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-4); }
.art-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-5); cursor: pointer; transition: var(--speed); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: var(--sp-4); position: relative;
}
.art-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.art-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.art-ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-strong);
}
.art-ic .ico { width: 23px; height: 23px; }
.art-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.art-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.art-stats { display: flex; gap: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.art-stat-l { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.art-stat-v { font-size: 15px; font-weight: 600; font-family: var(--font-mono); }

/* progress bar */
.bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width 400ms; }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--speed); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .name-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.mini-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: var(--speed); }
.tbl tbody tr:hover .row-actions { opacity: 1; }

.empty {
  text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
}
.empty .ico { width: 38px; height: 38px; color: var(--text-faint); }

/* ============================================================
   Inputs
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.input, .select, textarea.input {
  height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; transition: var(--speed); width: 100%;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--text-faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }

.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-faint); pointer-events: none; }
.search input { padding-left: 38px; min-width: 240px; }

.filter-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.filter-bar .spacer { flex: 1; }

.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; transition: var(--speed);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary-soft); color: var(--primary-strong); border-color: transparent; }
.chip .cnt { font-family: var(--font-mono); font-size: 11.5px; opacity: 0.8; }

/* ============================================================
   Modal / dialog
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: var(--sp-5);
  animation: fade var(--speed) ease;
}
[data-theme="dark"] .overlay { background: rgba(0,0,0,0.6); }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  animation: pop 200ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--border); }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.modal-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--sp-3); position: sticky; bottom: 0; background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2);
  min-width: 280px; animation: slidein 240ms cubic-bezier(0.2,0.9,0.3,1); font-size: 13.5px; font-weight: 500;
}
.toast .ico { width: 20px; height: 20px; flex-shrink: 0; }
.toast.ok .ico { color: var(--ok); }
.toast.info .ico { color: var(--primary); }
.toast.bad .ico { color: var(--bad); }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }

/* ============================================================
   Notification panel
   ============================================================ */
.popover {
  position: absolute; top: 52px; right: 0; width: 380px; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); z-index: 60; animation: pop 180ms ease;
}
.popover-head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); }
.popover-title { font-weight: 600; font-size: 15px; }
.notif {
  display: flex; gap: 12px; padding: 13px var(--sp-5); border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--speed);
}
.notif:hover { background: var(--surface-2); }
.notif:last-child { border-bottom: 0; }
.notif-ic { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; }
.notif-ic.warn { background: var(--warn-soft); color: oklch(0.55 0.14 65); }
.notif-ic.bad { background: var(--bad-soft); color: var(--bad); }
.notif-body { font-size: 13px; }
.notif-body b { font-weight: 600; }
.notif-time { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.menu-pos { position: relative; }

/* ============================================================
   Document / import area
   ============================================================ */
.doc-card { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.doc-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); flex-shrink: 0; }
.doc-ic .ico { width: 22px; height: 22px; }
.doc-name { font-weight: 600; font-size: 14px; word-break: break-all; }
.doc-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.doc-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; cursor: pointer; transition: var(--speed);
}
.doc-list-row:hover { border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); }
.doc-card-inline { flex: 1; min-width: 240px; border: 0; background: transparent; padding: 0; }
.doc-list-actions { flex-shrink: 0; }
.uw-file-input {
  position: fixed; left: -9999px; top: 0;
  width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--sp-6);
  text-align: center; color: var(--text-muted); transition: var(--speed); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); background: var(--surface-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.dropzone .ico { width: 30px; height: 30px; }

/* section title */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.sec-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.sec-title .ico { width: 18px; height: 18px; color: var(--text-muted); }
.sec-desc { font-size: 13px; color: var(--text-muted); }

.stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }

/* detail header */
.detail-hero { display: flex; align-items: flex-start; gap: var(--sp-5); padding: var(--sp-5); }
.detail-ic { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); flex-shrink: 0; }
.detail-ic .ico { width: 32px; height: 32px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.meta-item { }
.meta-item .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.meta-item .v { font-size: 15px; font-weight: 600; margin-top: 3px; }

/* history timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding-bottom: var(--sp-4); position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border); z-index: 1; }
.tl-dot .ico { width: 14px; height: 14px; color: var(--text-muted); }
.tl-body { font-size: 13.5px; padding-top: 2px; }
.tl-time { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* checkbox */
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }

/* toggle switch */
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; transition: var(--speed); flex-shrink: 0; }
.switch.on { background: var(--primary); border-color: transparent; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: var(--speed); box-shadow: var(--shadow-1); }
.switch.on::after { left: 20px; }

.help { font-size: 12px; color: var(--text-faint); }
.divider { height: 1px; background: var(--border); margin: var(--sp-2) 0; }

.tag { font-size: 11.5px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-muted); }

/* fade-in for views */
.view-enter { animation: viewin 240ms ease both; }
@keyframes viewin { from { transform: translateY(7px); } to { transform: translateY(0); } }

/* ============================================================
   Print – signature list
   ============================================================ */
.print-only { display: none; }
@media print {
  .topbar, .filter-bar, .row-actions, .toast-wrap, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .print-only { display: block; }
  .app .content { display: none; }
}
#print-mount { display: none; }
@media print {
  #print-mount { display: block; position: absolute; inset: 0; padding: 26px 30px; background: #fff; color: #000; font-size: 12px; }
}
.psheet { color: #000; }
.psheet h1 { font-size: 20px; margin-bottom: 4px; }
.psheet .psub { font-size: 12px; color: #444; margin-bottom: 16px; }
.psheet .pmeta { display: flex; gap: 30px; font-size: 12px; margin-bottom: 18px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 10px 0; }
.psheet table { width: 100%; border-collapse: collapse; }
.psheet th, .psheet td { border: 1px solid #999; padding: 8px 10px; text-align: left; font-size: 12px; }
.psheet th { background: #eee; }
.psheet .sig-cell { height: 42px; }
.psheet .pfoot { margin-top: 24px; font-size: 11px; color: #555; display: flex; justify-content: space-between; }
