/* todo.printcos.app — shared styles. Vanilla, no framework. */
:root {
  --bg: #0f1216;
  --panel: #171b22;
  --panel-2: #1e242d;
  --border: #2a313c;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --accent: #4f9cf9;
  --accent-2: #2b6fd6;
  --green: #37b24d;
  --green-dim: #2b8a3e;
  --red: #e03131;
  --amber: #f59f00;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: 0.3px; }
.topbar .brand span { color: var(--accent); }
.topbar nav { display: flex; gap: 14px; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .userchip { color: var(--muted); font-size: 13px; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }
.container.narrow { max-width: 460px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent); }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { background: #262d38; }
.btn.danger { background: transparent; border: 1px solid var(--red); color: #ff8787; }
.btn.danger:hover { background: rgba(224, 49, 49, 0.12); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Landing: one long wide row per project */
.project-list { display: flex; flex-direction: column; gap: 12px; }
.project-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  cursor: pointer;
}
.project-row:hover { border-color: var(--accent); }
.project-row .pr-title { flex: 0 0 26%; min-width: 180px; }
.project-row .pr-name { font-weight: 700; font-size: 17px; }
.project-row .pr-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.project-row .pr-progress { flex: 1; min-width: 160px; }
.project-row .pr-counts { flex: 0 0 auto; text-align: right; font-size: 12.5px; color: var(--muted); min-width: 150px; }
.project-row .pr-counts b { color: var(--text); }
@media (max-width: 720px) {
  .project-row { flex-wrap: wrap; }
  .project-row .pr-title, .project-row .pr-counts { flex-basis: 100%; text-align: left; }
}

/* Project cards */
.project-card { display: flex; flex-direction: row; align-items: center; gap: 16px; cursor: pointer; }
.project-card:hover { border-color: var(--accent); }
.project-card .pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.project-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.project-card .pc-name { font-weight: 700; font-size: 16px; }
.project-card .pc-meta { color: var(--muted); font-size: 13px; }

/* Ship-date countdown */
.countdown {
  flex: 0 0 auto;
  text-align: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.countdown .cd-num { font-size: 34px; font-weight: 800; line-height: 1.05; }
.countdown .cd-unit { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-top: 2px; }
.countdown.big { min-width: 110px; padding: 12px 16px; }
.countdown.big .cd-num { font-size: 52px; }
.countdown.big .cd-unit { font-size: 12px; }
/* colour tiers */
.countdown.ok      .cd-num { color: #37b24d; }
.countdown.soon    .cd-num { color: #a9e34b; }
.countdown.warn    .cd-num { color: #f59f00; }
.countdown.crit    .cd-num { color: #ff6b6b; }
.countdown.overdue { border-color: #e03131; background: rgba(224,49,49,0.12); }
.countdown.overdue .cd-num  { color: #ff5252; }
.countdown.overdue .cd-unit { color: #ff8787; }
.countdown.crit    { border-color: rgba(255,107,107,0.5); }
.countdown.none    .cd-num  { color: var(--muted); font-size: 26px; }
.badge {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  color: var(--muted);
}

/* Progress bar */
.progress { background: var(--panel-2); border-radius: 999px; height: 10px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--green); transition: width 0.3s; }
.progress.full > div { background: var(--green-dim); }
.pct-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pct-label b { color: var(--text); }

/* Checklist */
.section-title {
  margin: 22px 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  font-weight: 700;
}
.todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 7px;
}
.todo.done { opacity: 0.62; }
.todo.done .todo-title { text-decoration: line-through; }
.todo .chk {
  width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px;
  accent-color: var(--green); cursor: pointer;
}
.todo .todo-main { flex: 1; min-width: 0; }
.todo .todo-title { font-weight: 600; }
.todo .todo-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.todo .todo-qty { color: var(--amber); font-size: 12px; font-weight: 600; margin-left: 6px; }
.todo .todo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.todo .resp-select { width: 150px; font-size: 13px; padding: 5px 8px; }
.todo .done-meta { color: var(--muted); font-size: 11px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover td { background: var(--panel-2); }

.muted { color: var(--muted); }
.error { color: #ff8787; font-size: 13px; margin-top: 8px; min-height: 16px; }
.ok { color: #69db7c; font-size: 13px; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.hidden { display: none !important; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; width: 100%; max-width: 440px; }
.modal h3 { margin: 0 0 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---- Project view: wide workshop-display layout ---------------------- */
.container.wide { max-width: 1600px; }

/* View toolbar (Sektionen / Personen / Vollbild / PDF) */
.view-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel); color: var(--muted); border: none; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent-2); color: #fff; }

/* Multi-column board so the checklist fills a wide screen in any orientation */
.checklist.cols { column-width: 400px; column-gap: 22px; }
.section-block { break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid; margin-bottom: 14px; }

.resp-print { display: none; }

/* Bigger touch target for the back navigation */
.touch-back { font-size: 16px; padding: 12px 22px; margin-top: 4px; }
body.present .touch-back { display: none; }

/* Print-only subtitle (which list / which person the PDF is for) */
.print-sub { display: none; }

/* Presentation / fullscreen mode — big and legible from across a workshop */
body.present .topbar { display: none; }
body.present .container { max-width: 100%; padding: 16px 30px 40px; }
body.present { font-size: 20px; }
body.present h1 { font-size: 34px; }
body.present .section-title { font-size: 20px; }
body.present .todo { padding: 14px 16px; }
body.present .todo .chk { width: 30px; height: 30px; }
body.present .todo .todo-title { font-size: 20px; }
body.present .todo .todo-note { font-size: 15px; }
body.present .checklist.cols { column-width: 460px; }
body.present .countdown.big .cd-num { font-size: 72px; }
body.present .backlink, body.present .todo-side a { display: none; }

/* ---- Print / PDF export --------------------------------------------- */
@media print {
  .topbar, .view-toolbar, .inline-actions, .backlink, #modal,
  .todo-side a, .todo-side .resp-select, #shipInput, #shipOk { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .container { max-width: 100%; padding: 0; }
  .card { border: 1px solid #bbb; box-shadow: none; }
  .todo { border: 1px solid #ccc; break-inside: avoid; }
  .todo.done { opacity: 1; }
  .section-title { color: #000; }
  .resp-print { display: inline; color: #333; font-size: 11px; }
  .checklist.cols { column-width: 340px; }
  .todo .chk { -webkit-appearance: checkbox; appearance: checkbox; }
  a { color: #000; text-decoration: none; }
  .print-sub { display: block; font-size: 14px; font-weight: 600; color: #000; margin: 2px 0 12px; }
}
