/* devunox Review – Oberfläche
   Idee: ein Korrekturabzug. Ruhiges kühles Papier, dunkle Tinte, Blau für Aktionen –
   und die Rotstift-Pins als einziges lautes Element. Jede Karte zeigt die Stelle, an der der Kunde den Pin gesetzt hat. */

@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/sg-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/sg-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/sg-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/fonts/sg-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #ffffff;
  --wash: #f3f5f9;
  --wash-2: #e9edf4;
  --line: #e1e5ee;
  --line-2: #cfd5e1;
  --ink: #121a2e;
  --ink-2: #566078;
  --ink-3: #8790a3;
  --blue: #2148f5;
  --blue-2: #1736c8;
  --blue-soft: #eef2ff;
  --s-offen: #e5372b;
  --s-in_arbeit: #e08a00;
  --s-pruefen: #7a4dff;
  --s-erledigt: #1e9457;
  --s-abgelehnt: #8a93a6;
  --r-s: 8px;
  --r: 12px;
  --r-l: 16px;
  --shadow: 0 1px 2px rgba(18, 26, 46, .06), 0 0 0 1px rgba(18, 26, 46, .05);
  --shadow-l: 0 24px 60px rgba(18, 26, 46, .22), 0 0 0 1px rgba(18, 26, 46, .06);
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 15px/1.5 var(--font); color: var(--ink); background: var(--wash); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.s-offen { --c: var(--s-offen); } .s-in_arbeit { --c: var(--s-in_arbeit); } .s-pruefen { --c: var(--s-pruefen); }
.s-erledigt { --c: var(--s-erledigt); } .s-abgelehnt { --c: var(--s-abgelehnt); }

/* ---------- Grundbausteine */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--paper);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn.good { background: var(--s-erledigt); border-color: var(--s-erledigt); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--wash-2); }
.btn.danger { color: #b4231a; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; padding: 11px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { flex: none; }
.iconbtn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--wash-2); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=date], select, textarea {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; background: var(--paper); width: 100%; outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33, 72, 245, .14); }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; }
.err { background: #fdeceb; color: #a3211a; border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 0 0 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--wash); color: var(--ink-2); white-space: nowrap; }
.chip.st { background: color-mix(in srgb, var(--c) 13%, #fff); color: color-mix(in srgb, var(--c) 78%, #000); }
.chip.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.chip.hot { background: #fdeceb; color: #a3211a; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }

/* Der Pin: Tropfen mit Spitze unten links – die Spitze zeigt genau auf die Stelle */
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--c, var(--s-offen)); color: #fff; display: inline-grid; place-items: center;
  font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(18, 26, 46, .3); flex: none; }

/* ---------- Anmelden */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
.auth-art { position: relative; overflow: hidden; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; }
.auth-art h1 { font-size: clamp(30px, 3.4vw, 46px); max-width: 15ch; letter-spacing: -.025em; }
.auth-art p { max-width: 46ch; color: var(--ink-2); font-size: 17px; }
.proof { position: relative; margin: 32px 0; max-width: 560px; aspect-ratio: 16 / 10; border-radius: var(--r-l); background: var(--wash); box-shadow: var(--shadow); padding: 18px; }
.proof i { display: block; background: var(--wash-2); border-radius: 6px; height: 12px; margin-bottom: 10px; }
.proof .bar { height: 26px; width: 40%; background: var(--line); margin-bottom: 18px; }
.proof .card { height: 74px; background: var(--paper); box-shadow: var(--shadow); }
.proof .pin { position: absolute; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { margin-bottom: 6px; }
.auth-box > p { margin: 0 0 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.brand .logo::after { content: ""; width: 13px; height: 13px; border-radius: 50% 50% 50% 0; background: var(--s-offen); transform: translate(1px, -1px); }
.brand b { font-weight: 500; color: var(--ink-2); }

/* ---------- Rahmen */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--line); background: var(--wash); }
.side .brand { padding: 4px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--wash-2); color: var(--ink); }
.nav a.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.nav .dot { margin-left: auto; }
.side h4 { margin: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.side .projects { overflow: auto; flex: 1; }
.side .me { border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.avatar.team { background: var(--blue); }
.shell > div { min-width: 0; }
.main { min-width: 0; padding: 28px 32px 60px; }
.topbar { display: none; }
.pagehead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead .sub { color: var(--ink-2); margin-top: 4px; font-size: 14px; }
.pagehead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Projektübersicht */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 14px; }
.pcard:hover { box-shadow: var(--shadow), 0 6px 18px rgba(18, 26, 46, .08); }
.pcard .client { font-size: 13px; color: var(--ink-2); }
.pcard h3 { font-size: 17px; margin-top: 2px; }
.stack { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--wash-2); }
.stack span { background: var(--c); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend b { color: var(--ink); font-weight: 600; margin-right: 3px; font-variant-numeric: tabular-nums; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pcard .foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-top: auto; }
.empty { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-l); padding: 36px; text-align: center; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 17px; }
.empty .btn { margin-top: 14px; }

/* ---------- Projekt: Leiste */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { width: 220px; }
.filters select { width: auto; }
.seg { display: inline-flex; background: var(--wash-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 26, 46, .12); }

/* ---------- Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--wash-2); border-radius: var(--r-l); padding: 10px; min-height: 160px; }
.col.over { outline: 2px dashed var(--blue); outline-offset: -2px; background: var(--blue-soft); }
.colhead { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 14px; }
.colhead::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.colhead .n { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.colitems { display: flex; flex-direction: column; gap: 10px; }
.colempty { color: var(--ink-3); font-size: 13px; padding: 8px 6px; }

.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; display: block; text-decoration: none; color: inherit; border: 0; text-align: left; padding: 0; width: 100%; }
.card:hover { box-shadow: var(--shadow), 0 6px 16px rgba(18, 26, 46, .1); }
.card[draggable=true] { cursor: grab; }
.card.dragging { opacity: .5; }
/* Ausschnitt des Screenshots rund um den Pin */
.crop { position: relative; height: 112px; background-color: var(--wash); background-repeat: no-repeat; border-bottom: 1px solid var(--line); }
.crop .pin { position: absolute; transform: translate(0, -100%); }
.card .cb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.card .ct { display: flex; gap: 8px; align-items: flex-start; }
.card .ct .pin { width: 22px; height: 22px; font-size: 10px; box-shadow: none; margin-top: 1px; }
.card .ttl { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.card .meta .sp { flex: 1; }
.card .meta svg { width: 14px; height: 14px; }
.card .meta .m { display: inline-flex; align-items: center; gap: 3px; }
.todo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.todo-mark svg { width: 13px; height: 13px; }

/* ---------- Liste */
.table { background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--wash); }
.table .t { font-weight: 600; }
.table .nowrap { white-space: nowrap; }

/* ---------- Detail (Schublade) */
.drawer-back { position: fixed; inset: 0; background: rgba(18, 26, 46, .28); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow-l); }
.dh { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.dh .pin { width: 30px; height: 30px; font-size: 12px; }
.dh .grow { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.db { flex: 1; overflow: auto; padding: 20px 22px 28px; }
.db h2 { font-size: 21px; margin: 10px 0 8px; }
.db .body { white-space: pre-wrap; margin: 0 0 14px; }
.shot { position: relative; display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); margin: 14px 0; background: var(--wash); }
.shot img { display: block; width: 100%; height: auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 14px 0; padding: 14px; background: var(--wash); border-radius: var(--r); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.box { background: var(--wash); border-radius: var(--r); padding: 14px; margin: 14px 0; }
.box p { margin: 0 0 10px; font-size: 14px; }
.ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.ctl .field { margin: 0; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.file { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; text-decoration: none; color: var(--ink); font-size: 13px; max-width: 100%; background: var(--paper); }
.file img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; }
.file .fi { width: 32px; height: 32px; border-radius: 7px; background: var(--wash); display: grid; place-items: center; color: var(--ink-2); }
.file .fn { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fs { color: var(--ink-3); font-size: 12px; }
.file .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 2px; display: grid; }
.thread { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; }
.msg .bubble { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px var(--r) var(--r) var(--r); padding: 10px 13px; }
.msg.team .bubble { background: var(--blue-soft); border-color: #dbe2ff; }
.msg .mh { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.msg .mh time { color: var(--ink-3); font-size: 12px; }
.msg p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ev { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-2); padding-left: 10px; }
.ev .d { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; margin: 0 10px 0 1px; }
.ev b { color: var(--ink); font-weight: 600; }
.ev time { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ev .note { display: block; color: var(--ink); white-space: pre-wrap; }
.composer { margin-top: 18px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; transition: background .15s; }
.composer.over { background: var(--blue-soft); outline: 2px dashed var(--blue); }
.composer textarea { border: 0; box-shadow: none !important; padding: 8px; min-height: 70px; }
.composer .bar { display: flex; align-items: center; gap: 6px; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; }
.atts:not(:empty) { margin: 4px 6px 8px; }
.att { display: inline-flex; align-items: center; gap: 6px; background: var(--wash); border-radius: 8px; padding: 4px 4px 4px 9px; font-size: 13px; }
.att span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att button { border: 0; background: none; cursor: pointer; color: var(--ink-3); display: grid; padding: 2px; }

/* ---------- Kunden */
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--wash); color: var(--ink-2); }
.badge.ok { background: #e3f4ea; color: #146c3f; }
.badge.wait { background: #fff2dc; color: #8a5300; }
.badge.off { background: var(--wash-2); color: var(--ink-3); }

/* ---------- Dialog, Code, Toast */
dialog { border: 0; border-radius: var(--r-l); padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-l); color: var(--ink); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(18, 26, 46, .35); }
.dlg { padding: 22px 24px 20px; }
.dlg h2 { margin-bottom: 4px; }
.dlg > p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg fieldset { border: 0; padding: 0; margin: 0 0 6px; }
.dlg legend { font-weight: 600; font-size: 14px; margin-bottom: 10px; padding: 0; }
.copy { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.copy code, .code { flex: 1; min-width: 0; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.panel { background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 22px 24px; max-width: 720px; margin-bottom: 18px; }
.panel h2 { margin-bottom: 4px; }
.panel > p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow-l); font-size: 14px; max-width: calc(100vw - 32px); }

/* ---------- Handy */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-l); }
  .shell.menu .side { transform: none; }
  .shell.menu::after { content: ""; position: fixed; inset: 0; background: rgba(18, 26, 46, .3); z-index: 49; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--wash); padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .main { padding: 18px 14px 60px; }
  h1 { font-size: 22px; }
  .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .filters input[type=search] { width: 100%; }
  .pagehead .acts { margin-left: 0; width: 100%; }
  .pagehead .acts .btn.primary { flex: 1; }
  .grid2 { grid-template-columns: 1fr; }
  .db { padding: 16px; }
  .hide-m { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
