/* Fortis Tasks: the portal's look (static/custom/portal/portal.css) without
   Metronic. Same tokens: navy and mint, Sora, 24px cards, pill buttons, the
   portal's status colours. No inline styles anywhere (the page's CSP). */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/sora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308,
    U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 1 · Tokens ─────────────────────────────────────────────────────────── */
:root {
  --navy: #001435;
  --navy2: #002060;
  --mint: #06d6a0;
  --mint2: #00b386;
  --mint-ink: #00875f;
  --mint-rgb: 6 214 160;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text-rgb: 13 24 46;
  --text: rgb(var(--text-rgb));
  --muted: rgb(var(--text-rgb) / 0.56);
  --faint: rgb(var(--text-rgb) / 0.4);
  --line: rgb(var(--text-rgb) / 0.08);
  --line-strong: rgb(var(--text-rgb) / 0.14);
  --field: rgb(var(--text-rgb) / 0.03);
  --shadow: 0 1px 2px rgb(13 24 46 / 0.04), 0 8px 24px -12px rgb(13 24 46 / 0.12);
  --shadow-lg: 0 4px 10px rgb(13 24 46 / 0.06), 0 24px 60px -20px rgb(13 24 46 / 0.24);

  /* The portal's status ramp */
  --blue: #2a78d6;   --blue-rgb: 42 120 214;
  --amber: #eda100;  --amber-rgb: 237 161 0;
  --purple: #4a3aa7; --purple-rgb: 74 58 167;
  --green: #1baf7a;  --green-rgb: 27 175 122;
  --red: #e34948;    --red-rgb: 227 73 72;
  --neutral: #5b6b82; --neutral-rgb: 91 107 130;

  --r-card: 24px;
  --r-panel: 16px;
  --r-field: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sb-w: 264px;
  --font: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
a { color: var(--mint-ink); text-decoration: none; }
a:hover { color: var(--mint2); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgb(var(--mint-rgb) / 0.28); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.pc-empty { color: var(--faint); }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ── 2 · Shell: sidebar and main ────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sb {
  position: sticky; top: 0;
  width: var(--sb-w); height: 100vh; flex: none;
  display: flex; flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.sb-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px 0 24px;
  border-bottom: 1px solid var(--line);
}
.sb-brand { display: flex; align-items: center; gap: 10px; }
.sb-logo { height: 30px; width: auto; display: block; }
.sb-product {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: rgb(var(--mint-rgb) / 0.14); color: var(--mint-ink);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.sb .sb-close { display: none; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sb-label {
  margin: 18px 12px 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint);
}
.sb-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  margin: 2px 0; padding: 10px 12px;
  border-radius: var(--r-field);
  color: rgb(var(--text-rgb) / 0.82); font-size: 15px; font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sb-item .i { width: 20px; height: 20px; color: rgb(var(--text-rgb) / 0.62); }
.sb-item > span:first-of-type { flex: 1; }
.sb-item:hover { background: rgb(var(--text-rgb) / 0.04); color: var(--text); }
.sb-item.active { background: rgb(var(--mint-rgb) / 0.13); color: var(--mint-ink); font-weight: 600; }
.sb-item.active .i { color: var(--mint2); }
.sb-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--mint);
}
.sb-count {
  min-width: 24px; padding: 1px 8px; border-radius: var(--r-pill);
  background: rgb(var(--text-rgb) / 0.06); color: var(--muted);
  font-size: 12px; font-weight: 600; text-align: center;
}
.sb-item.active .sb-count { background: rgb(var(--mint-rgb) / 0.2); color: var(--mint-ink); }
.sb-count-urgent { background: rgb(var(--red-rgb) / 0.12) !important; color: var(--red) !important; }
.sb-foot { padding: 16px 12px 16px; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; }
.sb-user-name { font-weight: 600; font-size: 15px; }
.sb-user-note { font-size: 12px; color: var(--mint-ink); font-weight: 500; }
.sb-logout {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; border-radius: var(--r-field);
  border: 1px solid var(--line-strong); background: var(--card);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sb-logout:hover { background: rgb(var(--text-rgb) / 0.03); border-color: rgb(var(--text-rgb) / 0.22); }
.sb-backdrop { display: none; }

/* English or German (_macros.html, language_switch) */
.lang { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; }
.lang-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.lang-label .i { width: 17px; height: 17px; }
.sb .lang-label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-switch { display: flex; flex: 1; padding: 3px; border-radius: var(--r-pill); background: rgb(var(--text-rgb) / 0.06); }
.lang-opt {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.lang-opt:hover { color: var(--text); }
.lang-opt.is-on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgb(13 24 46 / 0.16); cursor: default; }
.lang-auth { justify-content: center; margin: 26px 0 0; }
.lang-auth .lang-switch { flex: none; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { width: 100%; max-width: 1240px; padding: 36px 32px 64px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r-field);
  border: 1px solid var(--line-strong); background: var(--card); cursor: pointer;
}
.icon-btn:hover { background: rgb(var(--text-rgb) / 0.03); }

/* ── 3 · Page head ──────────────────────────────────────────────────────── */
.ph {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 24px;
}
.ph-text { min-width: 0; flex: 1 1 auto; }
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
}
.ph h1 { margin-top: 6px; font-size: 30px; line-height: 1.2; overflow-wrap: anywhere; }
.ph-sub { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 640px; }
.ph-actions { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.ph-actions form { margin: 0; }
.ph-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ph-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ph-task { align-items: flex-start; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.back .i { width: 16px; height: 16px; }
.back:hover { color: var(--text); }

/* ── 4 · Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: none;
  font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.15s, border-color 0.15s, color 0.15s;
}
.btn .i { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: 0.6; pointer-events: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--mint) 0%, var(--mint2) 100%);
  box-shadow: 0 8px 20px -8px rgb(var(--mint-rgb) / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.2);
}
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px -8px rgb(var(--mint-rgb) / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.2); transform: translateY(-1px); }
.btn-secondary { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { color: var(--text); border-color: rgb(var(--text-rgb) / 0.24); background: rgb(var(--text-rgb) / 0.02); }
.btn-ghost { color: rgb(var(--text-rgb) / 0.75); }
.btn-ghost:hover { background: rgb(var(--text-rgb) / 0.05); color: var(--text); }
.btn-danger { background: var(--card); border-color: rgb(var(--red-rgb) / 0.3); color: var(--red); }
.btn-danger:hover { background: rgb(var(--red-rgb) / 0.06); color: var(--red); border-color: rgb(var(--red-rgb) / 0.5); }
.btn-danger-solid { background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgb(var(--red-rgb) / 0.7); }
.btn-danger-solid:hover { color: #fff; background: #d63c3b; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--red); }

/* ── 5 · Cards, stats, badges, people ───────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid rgb(var(--text-rgb) / 0.05);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card-pad { padding: 24px; }
.card-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.card-title .i { width: 17px; height: 17px; color: var(--faint); }
.card-title .opt { margin-left: 2px; }
.card-count {
  padding: 1px 8px; border-radius: var(--r-pill);
  background: rgb(var(--text-rgb) / 0.06); font-size: 11px; letter-spacing: 0; color: var(--muted);
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; border-radius: var(--r-card);
  background: var(--card); border: 1px solid rgb(var(--text-rgb) / 0.05);
  box-shadow: var(--shadow); color: var(--text);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
a.stat:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: transparent; }
.stat-on::before { background: var(--mint); }
.stat-red.stat-on::before { background: var(--red); }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-label .i { width: 16px; height: 16px; color: var(--mint2); }
.stat-red .stat-label .i { color: var(--red); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.stat-red .stat-value { color: var(--red); }
.stat-note { font-size: 12px; color: var(--faint); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.badge .i { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-red { background: rgb(var(--red-rgb) / 0.1); color: #c62f2e; }
.badge-blue { background: rgb(var(--blue-rgb) / 0.1); color: #1f63b5; }
.badge-amber { background: rgb(var(--amber-rgb) / 0.14); color: #9a6a00; }
.badge-mint { background: rgb(var(--mint-rgb) / 0.14); color: var(--mint-ink); }
.badge-purple { background: rgb(var(--purple-rgb) / 0.1); color: var(--purple); }
.badge-neutral { background: rgb(var(--neutral-rgb) / 0.1); color: #4a596e; }

.av {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
}
.av-kim { background: linear-gradient(135deg, #06d6a0, #00a67c); }
.av-reza { background: linear-gradient(135deg, #3987e5, #2160b8); }
.av-kunal { background: linear-gradient(135deg, #001435, #0b3a8a); }
.av-other { background: rgb(var(--neutral-rgb) / 0.18); color: #4a596e; }
.av-lg { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.av-xs { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; }
.person { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.person-name { font-weight: 500; color: var(--text); white-space: nowrap; }
.person-unknown .person-name { color: var(--muted); font-style: italic; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r-panel);
  font-size: 14px; font-weight: 500;
}
.alert-red { background: rgb(var(--red-rgb) / 0.08); color: #b83332; border: 1px solid rgb(var(--red-rgb) / 0.2); }
.alert .i { margin-top: 1px; }

/* ── 6 · Filters and chips ──────────────────────────────────────────────── */
.filters {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.filters-log { flex-direction: column; align-items: flex-start; gap: 10px; }
.search { position: relative; flex: 1 1 280px; display: block; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.search .input { padding-left: 42px; border-radius: var(--r-pill); }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--card);
  color: rgb(var(--text-rgb) / 0.78); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip .i { width: 15px; height: 15px; }
.chip:hover { color: var(--text); border-color: rgb(var(--text-rgb) / 0.25); }
.chip-on, .chip-on:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-urgent .i { color: var(--red); }
.chip-urgent.chip-on { background: var(--red); border-color: var(--red); }
.chip-urgent.chip-on .i { color: #fff; }
.chip-soft.chip-on { background: rgb(var(--mint-rgb) / 0.14); border-color: rgb(var(--mint-rgb) / 0.4); color: var(--mint-ink); }

/* ── 7 · The task list ──────────────────────────────────────────────────── */
.tl-head, .tl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 70px 160px 92px;
  align-items: center; gap: 16px;
  padding: 0 20px 0 24px;
}
.tl-head {
  height: 42px; background: rgb(var(--text-rgb) / 0.025);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.tl-row {
  position: relative; min-height: 72px; padding-top: 14px; padding-bottom: 14px;
  border-top: 1px solid var(--line); color: var(--text);
  transition: background 0.15s;
}
.tl-row:hover { background: rgb(var(--mint-rgb) / 0.04); color: var(--text); }
.tl-row:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
.tl-urgent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.tl-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-no { color: var(--faint); font-weight: 600; font-size: 13px; flex: none; }
.tl-title-text { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tl-snippet { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-files { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tl-files .i { width: 15px; height: 15px; }
.tl-when { display: flex; flex-direction: column; font-size: 13px; }
.tl-by { color: var(--faint); font-size: 12px; }
.tl-go { display: flex; justify-content: flex-end; }
.tl-go .i { width: 15px; height: 15px; margin-right: -4px; }
.tl-row:hover .tl-go .btn { background: var(--card); border-color: var(--line-strong); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px 60px; }
.empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px;
  background: rgb(var(--mint-rgb) / 0.12); color: var(--mint2);
}
.empty-icon .i { width: 28px; height: 28px; }
.empty h2 { font-size: 19px; }
.empty p { color: var(--muted); max-width: 420px; margin-bottom: 8px; }
.empty-error .empty-icon { background: rgb(var(--red-rgb) / 0.1); color: var(--red); }

/* ── 8 · One task ───────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.col-main, .col-side { min-width: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; }
.prose a { text-decoration: underline; }

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--r-panel);
  border: 1px solid var(--line); background: rgb(var(--text-rgb) / 0.012);
}
.fi {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: rgb(var(--blue-rgb) / 0.1); color: var(--blue);
}
.fi-image { background: rgb(var(--mint-rgb) / 0.13); color: var(--mint2); }
.fi-video { background: rgb(var(--purple-rgb) / 0.1); color: var(--purple); }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.file-name:hover { color: var(--mint-ink); }
.file-meta { font-size: 12px; color: var(--faint); }
.file-actions { display: flex; gap: 4px; flex: none; }
.sp { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sp .i { width: 13px; height: 13px; }
.sp-in { color: var(--mint-ink); }
.sp-pending { color: #9a6a00; }

.facts { margin: 0; display: flex; flex-direction: column; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; text-align: right; font-weight: 500; display: flex; flex-direction: column; align-items: flex-end; }
.facts small { color: var(--faint); font-weight: 400; font-size: 12px; }

.history { list-style: none; margin: 0; padding: 0; }
.hist { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.hist:last-child { padding-bottom: 0; }
.hist::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.hist:last-child::before { display: none; }
.hist-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; flex: none; background: var(--neutral); box-shadow: 0 0 0 4px var(--card); position: relative; }
.hist-blue .hist-dot { background: var(--blue); }
.hist-amber .hist-dot { background: var(--amber); }
.hist-mint .hist-dot { background: var(--mint); }
.hist-red .hist-dot { background: var(--red); }
.hist-body { min-width: 0; }
.hist-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-who { font-weight: 600; font-size: 13px; }
.hist-note { margin-top: 3px; color: rgb(var(--text-rgb) / 0.75); font-size: 13px; overflow-wrap: anywhere; }
.hist-meta { margin-top: 2px; color: var(--faint); font-size: 12px; }

/* ── 9 · The form ───────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-label { padding: 0; font-size: 13px; font-weight: 600; color: rgb(var(--text-rgb) / 0.85); }
.req, .opt { font-style: normal; font-weight: 500; font-size: 11px; margin-left: 6px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-field);
  background: var(--field); color: var(--text); font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: rgb(var(--text-rgb) / 0.38); }
.input:hover { border-color: rgb(var(--text-rgb) / 0.22); }
.input:focus { outline: none; border-color: var(--mint2); background: var(--card); box-shadow: 0 0 0 4px rgb(var(--mint-rgb) / 0.16); }
.input-lg { font-size: 17px; font-weight: 500; padding: 14px 16px; }
.textarea { resize: vertical; min-height: 180px; line-height: 1.6; }
.input-icon { position: relative; display: block; }
.input-icon > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-icon .input { padding-left: 44px; }
.field-error { color: var(--red); font-size: 13px; font-weight: 500; }
.field-error:empty { display: none; }
.has-error .input { border-color: rgb(var(--red-rgb) / 0.55); background: rgb(var(--red-rgb) / 0.03); }

.who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.who-option { position: relative; display: block; cursor: pointer; }
.who-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.who-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px; border-radius: var(--r-panel);
  border: 1.5px solid var(--line-strong); background: var(--card);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.who-name { font-weight: 600; font-size: 14px; }
.who-check {
  position: absolute; top: 7px; right: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--mint); color: #fff;
  opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.2s var(--ease);
}
.who-check .i { width: 12px; height: 12px; stroke-width: 3; }
.who-option:hover .who-card { border-color: rgb(var(--text-rgb) / 0.26); }
.who-option input:checked + .who-card { border-color: var(--mint2); background: rgb(var(--mint-rgb) / 0.07); box-shadow: 0 0 0 4px rgb(var(--mint-rgb) / 0.12); }
.who-option input:checked + .who-card .who-check { opacity: 1; transform: scale(1); }
.who-option input:focus-visible + .who-card { outline: 2px solid var(--mint); outline-offset: 2px; }
.has-error .who-card { border-color: rgb(var(--red-rgb) / 0.45); }

.switch { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; padding: 14px; border-radius: var(--r-panel); border: 1px solid var(--line-strong); transition: border-color 0.15s, background 0.15s; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgb(var(--text-rgb) / 0.16); transition: background 0.2s; margin-top: 1px; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.25s var(--ease); }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.switch-text strong .i { width: 16px; height: 16px; color: var(--red); }
.switch-text small { color: var(--muted); font-size: 12px; }
.switch input:checked + .switch-track { background: var(--red); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch:has(input:checked) { border-color: rgb(var(--red-rgb) / 0.4); background: rgb(var(--red-rgb) / 0.04); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--mint); outline-offset: 2px; }

.drop { position: relative; margin-top: 4px; }
.drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border-radius: var(--r-panel); cursor: pointer;
  border: 2px dashed rgb(var(--text-rgb) / 0.15); background: rgb(var(--text-rgb) / 0.015);
  transition: border-color 0.15s, background 0.15s;
}
.drop-label:hover, .drop.is-over .drop-label { border-color: var(--mint2); background: rgb(var(--mint-rgb) / 0.06); }
.drop-input:focus-visible + .drop-label { outline: 2px solid var(--mint); outline-offset: 2px; }
.drop-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 15px; background: rgb(var(--mint-rgb) / 0.13); color: var(--mint2); margin-bottom: 4px; }
.drop-icon .i { width: 24px; height: 24px; }
.drop-title { font-weight: 600; font-size: 15px; }
.drop-title u { color: var(--mint-ink); text-underline-offset: 3px; }
.drop-hint { color: var(--faint); font-size: 13px; }
.drop.has-error .drop-label { border-color: rgb(var(--red-rgb) / 0.45); }
.files-edit { margin-bottom: 14px; }
.picked { margin-top: 12px; }
.picked .file { background: rgb(var(--mint-rgb) / 0.04); border-color: rgb(var(--mint-rgb) / 0.25); }
.picked-total { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: right; }
.picked-total.is-over { color: var(--red); font-weight: 600; }

.remove-toggle { position: relative; flex: none; cursor: pointer; }
.remove-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.remove-toggle > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; color: rgb(var(--text-rgb) / 0.7); transition: all 0.15s; }
.remove-toggle .i { width: 15px; height: 15px; }
.remove-toggle:hover > span { border-color: rgb(var(--red-rgb) / 0.45); color: var(--red); }
.remove-toggle input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
.remove-on { display: none; }
.remove-toggle input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.remove-toggle input:checked + span .remove-off { display: none; }
.remove-toggle input:checked + span .remove-on { display: inline; }
.file:has(.remove-toggle input:checked) .file-name { text-decoration: line-through; color: var(--muted); }
.file:has(.remove-toggle input:checked) { border-color: rgb(var(--red-rgb) / 0.3); background: rgb(var(--red-rgb) / 0.03); }

.submit-card { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; }
.card + .submit-card { margin-top: 20px; }
.submit-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--faint); font-size: 12px; margin-top: 2px; }
.submit-note .i { width: 14px; height: 14px; }
.progress { margin-bottom: 6px; }
.progress-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.progress-track { height: 8px; border-radius: 999px; background: rgb(var(--text-rgb) / 0.08); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--mint), var(--mint2)); transition: width 0.2s linear; }
.progress .link-btn { margin-top: 8px; }

/* ── 10 · The log ───────────────────────────────────────────────────────── */
.lg-head, .lg-row {
  display: grid;
  grid-template-columns: 124px 124px minmax(0, 1fr) 128px 132px 80px;
  align-items: center; gap: 14px; padding: 0 20px 0 24px;
}
.lg-head { height: 42px; background: rgb(var(--text-rgb) / 0.025); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.lg-row { min-height: 56px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.lg-row:hover { background: rgb(var(--text-rgb) / 0.015); }
.lg-when { color: rgb(var(--text-rgb) / 0.8); white-space: nowrap; }
.lg-what { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; min-width: 0; }
.lg-task { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.lg-task:hover { color: var(--mint-ink); }
.lg-task-gone { color: var(--muted); text-decoration: line-through; }
.lg-note { color: var(--muted); overflow-wrap: anywhere; }
.lg-ip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: rgb(var(--text-rgb) / 0.8); overflow-wrap: anywhere; }
.lg-device { color: var(--muted); }
/* "Nicht angemeldet" is longer than the column: it wraps rather than runs on. */
.lg-who .person-name { white-space: normal; line-height: 1.3; }
.mail { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.mail .i { width: 14px; height: 14px; }
.mail-sent { color: var(--mint-ink); }
.mail-pending { color: #9a6a00; }
.mail-failed { color: var(--red); }
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.pager-count { color: var(--muted); font-size: 13px; font-weight: 500; }
.pager-note { grid-column: 3; text-align: right; color: var(--faint); font-size: 12px; }
.pages { grid-column: 2; display: flex; align-items: center; gap: 4px; }
.page {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r-pill);
  border: 1px solid transparent; color: rgb(var(--text-rgb) / 0.78);
  font-size: 13px; font-weight: 600; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.page .i { width: 15px; height: 15px; }
a.page:hover { background: rgb(var(--text-rgb) / 0.05); color: var(--text); }
.page.is-on { background: var(--navy); color: #fff; }
.page-step { border-color: var(--line-strong); padding: 0 14px; }
a.page-step:hover { border-color: rgb(var(--text-rgb) / 0.25); background: var(--card); }
.page-step.is-off { opacity: 0.4; }
.page-gap { min-width: 20px; text-align: center; color: var(--faint); }

/* ── 11 · Toasts and the dialog ─────────────────────────────────────────── */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 14px 16px; border-radius: var(--r-panel);
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--mint);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toast-in 0.4s var(--ease);
}
.toast-info { border-left-color: var(--blue); }
.toast-icon { color: var(--mint2); margin-top: 1px; }
.toast-info .toast-icon { color: var(--blue); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: none; padding: 2px; color: var(--faint); cursor: pointer; }
.toast-close .i { width: 16px; height: 16px; }
.toast.is-leaving { opacity: 0; transform: translateX(16px); transition: opacity 0.3s, transform 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.dialog {
  width: min(460px, calc(100vw - 32px)); padding: 28px; border: 0;
  border-radius: var(--r-card); background: var(--card); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgb(0 20 53 / 0.45); backdrop-filter: blur(3px); }
.dialog form { margin: 0; }
.dialog h2 { font-size: 19px; margin: 14px 0 8px; }
.dialog p { color: rgb(var(--text-rgb) / 0.75); margin-bottom: 10px; }
.dialog p.muted { color: var(--muted); font-size: 13px; }
.dialog-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 15px; }
.dialog-icon-red { background: rgb(var(--red-rgb) / 0.1); color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── 12 · Sign-in and error pages ───────────────────────────────────────── */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 20px; min-height: 100vh; padding: 20px; }
.auth-card { display: flex; align-items: center; justify-content: center; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 48px 32px; }
.auth-inner { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-brand img { height: 44px; width: auto; }
.auth-title { text-align: center; font-size: 26px; }
.auth-sub { text-align: center; color: var(--muted); margin: 8px 0 28px; }
.auth-form .btn { margin-top: 6px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: var(--faint); font-size: 13px; }
.auth-note .i { width: 16px; height: 16px; }
.auth-side {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-card); padding: 48px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(var(--mint-rgb) / 0.32) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgb(42 120 214 / 0.35) 0%, transparent 60%),
    linear-gradient(160deg, var(--navy2) 0%, var(--navy) 70%);
  color: #fff;
}
.auth-side-inner { max-width: 460px; }
.auth-side-eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mint); font-weight: 600; }
.auth-side h2 { color: #fff; font-size: 34px; line-height: 1.2; margin: 12px 0 28px; letter-spacing: -0.02em; }
.auth-points { list-style: none; margin: 0 0 36px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.auth-points li { display: flex; gap: 14px; color: rgb(255 255 255 / 0.78); font-size: 15px; }
.auth-points strong { color: #fff; font-weight: 600; }
.auth-point-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: rgb(255 255 255 / 0.1); color: var(--mint); }
.auth-mock { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.12); backdrop-filter: blur(6px); }
.auth-mock-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgb(255 255 255 / 0.95); }
.auth-mock-line { height: 9px; border-radius: 9px; background: rgb(13 24 46 / 0.12); }
.auth-mock-line.w70 { width: 62%; } .auth-mock-line.w55 { width: 50%; } .auth-mock-line.w40 { width: 38%; }
.auth-mock-row .badge { margin-left: auto; }
.auth-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-center .card { width: min(520px, 100%); }

/* ── 13 · Narrower screens ──────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-head, .lg-row { grid-template-columns: 130px 130px minmax(0, 1fr) 130px 84px; }
  .lg-head > :nth-child(5), .lg-row > .lg-device { display: none; }
}
@media (max-width: 1080px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .submit-card { position: static; }
  .tl-head, .tl-row { grid-template-columns: minmax(0, 1fr) 130px 60px 140px; }
  .tl-head > :nth-child(5), .tl-row > .tl-go { display: none; }
}
@media (max-width: 900px) {
  .sb {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto;
    transform: translateX(-102%); transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .nav-open .sb { transform: none; }
  .sb .sb-close { display: inline-flex; }
  .nav-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(0 20 53 / 0.4); }
  .topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 16px;
    background: rgb(255 255 255 / 0.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; }
  .topbar-brand img { height: 26px; }
  .main { padding: 24px 16px 48px; }
  .ph { flex-direction: column; align-items: stretch; }
  .ph h1 { font-size: 24px; }
  .ph-actions { justify-content: flex-start; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .auth-side { display: none; }
  .auth-card { padding: 40px 20px; }
}
@media (max-width: 720px) {
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 24px; }
  .filters { padding: 14px; }
  .tl-head, .lg-head { display: none; }
  .tl-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main main" "who when";
    gap: 10px 12px; padding: 14px 16px 14px 18px;
  }
  .tl-row:first-of-type { border-top: 0; }
  .tl-main { grid-area: main; }
  .tl-row > .tl-who { grid-area: who; }
  .tl-files { display: none; }
  .tl-when { grid-area: when; align-items: flex-end; text-align: right; }
  .tl-title-text { white-space: normal; }
  .lg-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .lg-row > .lg-what { grid-column: 1 / -1; order: -1; }
  .lg-row > .lg-who { order: -3; }
  .lg-row > .lg-when { order: -2; text-align: right; color: var(--muted); font-size: 12px; }
  .lg-row > .lg-mail:has(.pc-empty) { display: none; }
  .lg-row > .lg-ip, .lg-row > .lg-mail { font-size: 12px; }
  .lg-row > .lg-device { display: block; grid-column: 1 / -1; font-size: 12px; }
  .lg-row > .lg-device::before, .lg-row > .lg-ip::before { content: attr(data-label) ": "; color: var(--faint); font-family: var(--font); }
  .pager { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 14px 12px; }
  .pages { grid-column: 1; order: -1; gap: 2px; }
  .pager-note { grid-column: 1; text-align: center; }
  .page { min-width: 32px; height: 32px; padding: 0 6px; }
  .page-step { padding: 0 9px; }
  .page-step > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .file { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .who { gap: 8px; }
  .input { font-size: 16px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
}

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