/* Values from the zero theme of kette-tokens 5.26 (theme_shadcn_zero) */
:root {
  --background: #ffffff;
  --canvas: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --text-muted: #475569;
  --border: #e2e8f0;
  --control-border: #8492a6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --on-primary: #ffffff;
  --destructive: #dc2626;
  --destructive-hover: #b91c1c;
  --destructive-soft: #fef2f2;
  --destructive-text: #b91c1c;
  --focus-ring: #2563eb;
  --scrim: rgba(15, 23, 42, .28);
  --radius-control: 8px;
  --radius-item: 6px;
  --radius-card: 12px;
  --shadow-surface: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-raised: 0 16px 40px rgba(15, 23, 42, .16);
  --s-backlog: #94a3b8;
  --s-geplant: #2563eb;
  --s-arbeit: #f59e0b;
  --s-fertig: #059669;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --content: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--foreground); font-family: var(--font-sans); font-size: 14px; line-height: 1.45; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.view-root:focus, #page-title:focus { outline: none; }

/* app bar and content edge as in the shared zero frame (kampagnenplaner) */
.topbar { background: var(--background); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: var(--content); margin: 0 auto; padding: 0 28px; height: 52px; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; flex: none; border-radius: var(--radius-control); border: 1px solid var(--border); color: var(--foreground); display: grid; place-items: center; }
.brand-name { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* page */
.page { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ph-text { min-width: 0; }
.ph h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 29px; }
.ph p { margin: 4px 0 0; font-size: 13px; line-height: 16px; color: var(--muted-foreground); }
.ph .act { display: flex; gap: 8px; flex-shrink: 0; }

/* KPI strip */
.kpis { display: flex; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--background); min-height: 54px; }
.kpis[hidden] { display: none; }
.kp { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 16px; border-left: 1px solid var(--border); }
.kp:first-child { border-left: 0; }
.kp small { font-size: 12px; color: var(--muted-foreground); line-height: 16px; }
.kp .v { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kp b { font-size: 16px; font-weight: 600; line-height: 22px; font-variant-numeric: tabular-nums; }
.kp .d { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tabs (segmented, neutral) */
.tabs { align-self: flex-start; display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 2px; background: var(--muted); border-radius: var(--radius-control); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-item); color: var(--text-muted); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--foreground); }
.tab[aria-current="page"] { background: var(--background); border-color: #cbd5e1; color: var(--foreground); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.tab .c { font-size: 12px; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--background); color: var(--foreground); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: .6; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--muted); }
.btn-danger { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.btn-danger:hover { background: var(--destructive-hover); border-color: var(--destructive-hover); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--destructive-text); }
.btn-danger-ghost:hover { background: var(--muted); }
.btn-danger-outline { color: var(--destructive-text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

.view-root { min-width: 0; }

/* board: neutral columns, white cards with hairline */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; }
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.col-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.col-head .count { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.col[data-status="backlog"]  .dot { background: var(--s-backlog); }
.col[data-status="geplant"]  .dot { background: var(--s-geplant); }
.col[data-status="in_arbeit"] .dot { background: var(--s-arbeit); }
.col[data-status="fertig"]   .dot { background: var(--s-fertig); }
.col-body { display: flex; flex-direction: column; gap: 8px; }

.card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; background: var(--background); box-shadow: var(--shadow-surface); cursor: pointer; transition: border-color .12s; }
.card:hover { border-color: #cbd5e1; }
.card .c-title { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; font-size: 14px; color: var(--foreground); text-align: left; cursor: pointer; border-radius: 4px; }
.card .c-desc { font-size: 13px; color: var(--muted-foreground); margin-top: 4px; }
.card .c-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.vote { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; border: 1px solid var(--border); border-radius: var(--radius-item); padding: 0 10px; cursor: pointer; font: inherit; font-weight: 500; font-size: 12px; color: var(--foreground); background: var(--background); font-variant-numeric: tabular-nums; }
.vote:hover { background: var(--muted); }
.vote[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.vote:disabled { cursor: progress; opacity: .6; }
.vote svg { width: 14px; height: 14px; }
.fb-chip { font-size: 12px; color: var(--muted-foreground); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.card .moves { margin-left: auto; display: flex; gap: 4px; }
.mv, .mv-spacer { width: 28px; height: 28px; }
.mv { border: 1px solid var(--border); background: var(--background); border-radius: var(--radius-item); display: grid; place-items: center; cursor: pointer; color: var(--text-muted); padding: 0; }
.mv:hover { background: var(--muted); color: var(--foreground); }
.col-empty { color: var(--muted-foreground); font-size: 13px; text-align: center; padding: 16px 8px; border: 1px dashed var(--border); border-radius: var(--radius-card); }

/* feedback list */
.fb-wrap { max-width: 780px; }
.panel { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-surface); overflow: hidden; }
.panel-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.fb-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fb-row:last-child { border-bottom: 0; }
.fb-text { font-size: 14px; overflow-wrap: anywhere; }
.fb-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-assign { min-height: 28px; max-width: 220px; padding: 0 8px; border: 1px solid var(--control-border); border-radius: var(--radius-item); background: var(--background); color: var(--foreground); font: inherit; font-size: 12px; }
.fb-meta .btn { margin-left: auto; }

/* dialogs */
.modal { border: 1px solid var(--border); padding: 0; background: var(--background); color: var(--foreground); border-radius: var(--radius-card); width: calc(100% - 32px); max-width: 460px; box-shadow: var(--shadow-raised); }
.modal::backdrop { background: var(--scrim); }
.modal[open] { animation: pop .14s; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 20px 4px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted-foreground); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 20px 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal-foot .push-left { margin-right: auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.field input, .field select, .field textarea { width: 100%; min-height: 36px; padding: 8px 12px; border: 1px solid var(--control-border); border-radius: var(--radius-control); font-size: 14px; font-family: inherit; color: var(--foreground); background: var(--background); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-foreground); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
.field [aria-invalid="true"] { border-color: var(--destructive); }
.field-error { margin: 0; font-size: 13px; color: var(--destructive-text); }
.field-error:empty { display: none; }
.field textarea { resize: vertical; min-height: 72px; }

/* toasts: neutral, errors marked with a red dot */
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 8px; background: var(--foreground); color: #fff; padding: 10px 16px; border-radius: var(--radius-control); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-raised); animation: toastIn .2s; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #f87171; flex: none; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.loading { padding: 44px; text-align: center; color: var(--muted-foreground); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--muted-foreground); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-error { max-width: 420px; margin: 24px auto; padding: 24px; text-align: center; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-card); }
.state-error h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.state-error p { margin: 0 0 16px; color: var(--muted-foreground); font-size: 13px; }

.demo-note { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px 20px; font-size: 12px; color: var(--muted-foreground); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1023px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; }
  .page { padding: 20px 16px 24px; gap: 16px; }
}
@media (max-width: 767px) {
  .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp:nth-child(odd) { border-left: 0; }
  .kp:nth-child(n+3) { border-top: 1px solid var(--border); }
  .vote, .fb-assign, .btn-sm { min-height: 40px; height: auto; }
  .mv, .mv-spacer { width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .mv, .mv-spacer { width: 44px; height: 44px; }
  .vote, .btn-sm, .fb-assign { min-height: 44px; height: auto; }
}
