/* TLE Manager — charte graphique TLS v1.4.2
   Blanc #f5f5f5 · Quasi-blanc #e8e8e8 · Noir #0a0a0a / #1a1a1a
   Cramoisi #b5202b (sombre #8a1420 · clair #d94350) · Gris #2c2c2c/#666/#999 */

@font-face {
  font-family: "TLS Display";
  src: url("/static/fonts/TLSDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/static/fonts/SourceSansPro-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/static/fonts/SourceSansPro-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans Pro";
  src: url("/static/fonts/SourceSansPro-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e8e8e8;
  --ink: #0a0a0a;
  --ink-soft: #2c2c2c;
  --muted: #666666;
  --muted-2: #999999;
  --red: #b5202b;
  --red-dark: #8a1420;
  --red-light: #d94350;
  --green: #2f7d43;
  --orange: #c07321;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(10, 10, 10, 0.07);
}

* { box-sizing: border-box; }
/* the hidden attribute must always win, even over display:flex rules */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: 70px; /* room for mobile tabbar */
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: "TLS Display", "Source Sans Pro", sans-serif; color: var(--ink); }
h2 { font-size: 1.05rem; letter-spacing: 0.02em; margin: 0 0 0.6rem; }
code { background: var(--border); border-radius: 4px; padding: 0 4px; font-size: 0.9em; }
.muted { color: var(--muted); font-weight: 400; }
.mt { margin-top: 1.2rem; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border-bottom: 3px solid var(--red);
  padding: 0.6rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-family: "TLS Display", sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.brand-dot { color: var(--red); padding: 0 2px; }
.mainnav { display: flex; gap: 0.4rem; flex: 1; }
.mainnav a {
  color: var(--ink-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
}
.mainnav a.active, .mainnav a:hover { background: var(--red); color: #fff; }
.userchip { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.userchip img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--red); }
.logout { font-size: 1.1rem; color: var(--muted); }

.container { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
.page-title { font-size: 1.5rem; margin: 0.2rem 0 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ── Mobile tab bar ──────────────────────────────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 760px) {
  .mainnav, .userchip span { display: none; }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 30;
  }
  .tabbar a {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0 0.6rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    display: flex; flex-direction: column; gap: 2px;
  }
  .tabbar a span { font-size: 1.25rem; }
  .tabbar a.active { color: var(--red); }
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--bg) 60%, #efe4e5 100%);
  padding: 1rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
}
.login-brand { font-family: "TLS Display", sans-serif; font-size: 2rem; }
.login-sub { color: var(--muted); margin: 0.3rem 0 1.5rem; }
.login-note { color: var(--muted-2); font-size: 0.85rem; margin-top: 1.4rem; }

/* ── Buttons, forms, flash ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted-2); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-danger { color: var(--red); border-color: var(--red-light); }
.btn-lg { font-size: 1.05rem; padding: 0.7rem 1.2rem; justify-content: center; width: 100%; }
.flash { border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; font-weight: 600; }
.flash-error { background: #fbeaec; color: var(--red-dark); border: 1px solid var(--red-light); }

input[type="text"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red-light); border-color: var(--red); }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.7rem; color: var(--ink-soft); }
label > input, label > select, label > textarea { margin-top: 0.25rem; font-weight: 400; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  max-width: 640px;
}
.form-plain { box-shadow: none; border: none; padding: 0; max-width: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.5rem; }
.chips-fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 0.8rem; padding: 0.6rem; }
.chips-fieldset legend { font-weight: 600; font-size: 0.85rem; padding: 0 0.3rem; }
.chip-check { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0.2rem 0.4rem 0.2rem 0; }
.chip-check input { accent-color: var(--red); }
.chip-check span { font-weight: 400; }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; }
.add-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.add-row input, .add-row select { flex: 1; }
.ghost-btn { background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 0.95rem; }
.ghost-btn:hover { color: var(--red); }
.danger-row { display: flex; gap: 1rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* ── Panels / stats / lists ──────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
}
.panel-alert { border-left: 4px solid var(--red); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.dash-grid .panel { margin-bottom: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
  position: relative;
}
.stat-value { font-family: "TLS Display", sans-serif; font-size: 1.8rem; color: var(--red); }
.stat-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat-spark { position: absolute; right: 0.8rem; bottom: 0.9rem; display: flex; gap: 3px; align-items: flex-end; }
.spark-bar { width: 7px; background: var(--red-light); border-radius: 2px; display: inline-block; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { border-bottom: 1px solid var(--border); }
.task-list li:last-child { border-bottom: none; }
.task-list-item { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.5rem 0.2rem; color: var(--ink); flex-wrap: wrap; }
.task-list-item:hover .task-title { color: var(--red); }
.task-title { font-weight: 600; flex: 1; min-width: 150px; }
.task-meta { color: var(--muted); font-size: 0.85rem; }
.status-emoji { flex: none; }
.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin-bottom: 0.2rem; }

.entity-chip {
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
}

/* ── Project cards ───────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  color: var(--ink);
  display: block;
  transition: transform 0.1s, border-color 0.1s;
}
.project-card:hover { transform: translateY(-2px); border-color: var(--red-light); color: var(--ink); }
.project-card-head { display: flex; align-items: center; gap: 0.6rem; }
.project-card-head h2 { margin: 0; }
.project-card-counts { display: flex; gap: 0.8rem; margin-top: 0.6rem; color: var(--ink-soft); font-size: 0.9rem; }

/* ── Board ───────────────────────────────────────────────────────────────── */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.board-actions { display: flex; gap: 0.6rem; align-items: flex-start; }
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 0.8rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 0.8rem;
}
.column {
  background: #efefef;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 230px;
}
.column-backlog { background: #eae8e8; }
.column-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 2px solid var(--red);
}
.column-count { color: var(--muted); font-weight: 600; }
.column-count.over-wip { color: var(--red); }
.column-count.over-wip::after { content: " ⚠️"; }
.cards { min-height: 40px; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted-2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card.prio-high { border-left-color: var(--red); }
.card.prio-medium { border-left-color: #d7a021; }
.card.prio-low { border-left-color: var(--green); }
.card-link { display: block; padding: 0.55rem 0.65rem; color: var(--ink); }
.card-title { font-weight: 600; font-size: 0.92rem; }
.blocked-badge { color: var(--red); font-weight: 700; }
.card-labels { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.label-chip {
  background: #f3e2e3;
  color: var(--red-dark);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 8px;
}
.flag-chip {
  background: #fdf1e3;
  color: var(--orange);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 8px;
  margin-left: 0.3rem;
}
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.card-assignees { display: flex; gap: 3px; }
.assignee-dot {
  background: var(--ink-soft);
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 0.62rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.card-deadline { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.sortable-ghost { opacity: 0.4; }
.settings-pop { position: relative; }
.settings-pop summary { list-style: none; }
.settings-form {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(10,10,10,0.14);
  padding: 1rem;
  width: 280px;
  z-index: 15;
}
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  margin: 0.6rem 0 1rem;
}
.filter-bar input[type="search"] { flex: 2; min-width: 140px; width: auto; }
.filter-bar select { flex: 1; min-width: 120px; width: auto; }
.btn-clear { color: var(--red); }
.thread-box { margin-top: 0.8rem; border-top: 1px dashed var(--border); padding-top: 0.6rem; }
.thread-box .add-row { flex-wrap: wrap; }

@media (max-width: 760px) {
  .board {
    display: flex;
    scroll-snap-type: x mandatory;
  }
  .column { flex: 0 0 84vw; scroll-snap-align: start; }
}

/* ── Task detail ─────────────────────────────────────────────────────────── */
.back-link { font-weight: 600; }
.task-head { margin-bottom: 1rem; }
.status-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
}
.pill:disabled { cursor: default; opacity: 0.7; }
.pill-active { background: var(--red); border-color: var(--red); color: #fff; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.task-grid .panel { margin-bottom: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; }
.checklist li.done .check-text { text-decoration: line-through; color: var(--muted-2); }
.check-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--red); }
.check-text { flex: 1; }
.activity { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.activity li { padding: 0.25rem 0; border-bottom: 1px dashed var(--border); }
.activity li:last-child { border-bottom: none; }

/* ── Releases ────────────────────────────────────────────────────────────── */
.forecast-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.forecast-green { background: var(--green); }
.forecast-orange { background: var(--orange); }
.forecast-red { background: var(--red); }
.progress-bar {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 0.5rem 0 0.3rem;
}
.progress-lg { height: 12px; }
.progress-fill { background: linear-gradient(90deg, var(--red-dark), var(--red-light)); height: 100%; }
.table-scroll { overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.plan-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--red);
  padding: 0.4rem 0.5rem;
}
.plan-table td { border-bottom: 1px solid var(--border); padding: 0.45rem 0.5rem; }
.row-late td { background: #fbeaec; }
.row-done td { color: var(--muted-2); }
.member-cell { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); grid-column: 1 / -1; }
.empty-state h1 { font-size: 2.5rem; margin: 0 0 0.5rem; }
.toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-left: 4px solid var(--red);
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(10,10,10,0.25);
  z-index: 50;
  max-width: 90vw;
  font-weight: 600;
}

/* ── Modal (popup task/project editing) ─────────────────────────────────── */
.modal {
  border: none;
  border-radius: var(--radius);
  border-top: 4px solid var(--red);
  box-shadow: 0 20px 60px rgba(10,10,10,0.3);
  padding: 0;
  width: min(620px, 94vw);
  max-height: 88vh;
}
.modal::backdrop { background: rgba(10,10,10,0.45); }
.modal-body { padding: 1.1rem 1.3rem 1.3rem; overflow-y: auto; max-height: 84vh; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-head-actions { display: flex; gap: 0.4rem; align-items: center; flex: none; }
.modal-sub { margin: 0.2rem 0 0.8rem; }
.modal-close { font-size: 1.2rem; }
.prereq-box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.8rem 0;
  font-size: 0.92rem;
}
.prereq-box.prereq-blocked { border-left-color: var(--red); background: #fdf5f5; }
.prereq-hint { color: var(--red-dark); font-weight: 600; font-size: 0.9rem; }
.lock-badge { color: var(--red-dark); font-size: 0.8rem; font-weight: 700; }
.card-project { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.text-red { color: var(--red); font-weight: 700; }
.mr { margin-right: 0.6rem; }

/* ── Load bars (team & dashboard) ───────────────────────────────────────── */
.load-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; flex-wrap: wrap; }
.load-name { font-weight: 600; min-width: 110px; }
.load-bar { flex: 1; min-width: 120px; background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; }
.load-fill { height: 100%; background: linear-gradient(90deg, #7aa66a, #d7a021); border-radius: 999px; }
.load-fill.load-hot { background: linear-gradient(90deg, #d7a021, var(--red)); }
.load-meta { font-size: 0.82rem; color: var(--muted); }

/* ── Dashboard hero + ☕ clicker ──────────────────────────────────────────── */
.dash-hero { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.dash-hello { flex: 1; min-width: 0; }
.dash-quote { font-family: "Libre Baskerville", Georgia, serif; font-style: italic; color: var(--muted); margin: 0.2rem 0 0; }
.coffee-box { position: relative; text-align: center; flex: none; }
.coffee-btn {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 3px solid #6f4e37;
  background: radial-gradient(circle at 30% 25%, #a9825f, #6f4e37 65%);
  font-size: 2.2rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(111, 78, 55, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
}
.coffee-btn:hover { transform: scale(1.06); }
.coffee-btn:active { transform: scale(0.92); box-shadow: 0 2px 6px rgba(111, 78, 55, 0.45); }
.coffee-pop { animation: coffee-pop 0.25s ease; }
@keyframes coffee-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.16) rotate(-6deg); }
  100% { transform: scale(1); }
}
.coffee-count { font-family: "TLS Display", sans-serif; font-size: 1.05rem; margin-top: 0.35rem; }
.coffee-float {
  position: absolute; top: -6px;
  font-size: 0.85rem; font-weight: 700; color: #6f4e37;
  pointer-events: none;
  animation: coffee-float 0.9s ease-out forwards;
}
@keyframes coffee-float {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-46px); }
}
.focus-panel { border-left: 4px solid var(--red); }
.focus-panel .task-title { font-size: 1.02rem; }
.coffee-chip {
  background: #f3e9df; color: #6f4e37;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
  padding: 2px 9px;
  flex: none;
}

/* ── Team page ──────────────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.member-card { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 0; }
.member-head { display: flex; align-items: center; gap: 0.6rem; }
.member-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.member-id strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-role { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.avatar-md { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-family: "TLS Display", sans-serif; font-size: 1.1rem;
}
.member-stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.member-stats li { background: var(--surface); text-align: center; padding: 0.45rem 0.2rem; }
.member-stats b { display: block; font-size: 1.05rem; font-family: "TLS Display", sans-serif; }
.member-stats span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.member-stats .stat-bad b { color: var(--red); }
.member-tasks { border-top: 1px dashed var(--border); padding-top: 0.4rem; }
.member-tasks .muted { margin: 0.2rem 0; }
.member-foot { margin-top: auto; }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; user-select: none;
}
.toggle-chip:has(input:checked) { border-color: var(--red); color: var(--red-dark); background: #fbeaec; }
.toggle-chip input { accent-color: var(--red); margin: 0; }
.team-search { width: 200px; }

/* ── API tokens page ────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table th, .data-table td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.data-table tr:last-child td { border-bottom: none; }
.token-reveal { border-left: 4px solid var(--green); margin-bottom: 1rem; }
.token-secret { display: block; margin: 0.5rem 0; padding: 0.5rem 0.7rem; background: var(--ink); color: #7aa66a; border-radius: 8px; cursor: copy; word-break: break-all; }
.member-card .task-list { margin-top: 0.4rem; }
.stat-alert { border-left: 4px solid var(--red); }
.stat-alert .stat-value { color: var(--red-dark); }

/* ── Timeline ───────────────────────────────────────────────────────────── */
.tl-wrap {
  position: relative;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: min(62vh, 640px);
  cursor: grab;
  touch-action: pan-y;
}
.tl-wrap:active { cursor: grabbing; }
.tl-inner { position: relative; min-height: 100%; }
.tl-axis {
  position: sticky; top: 0;
  height: 44px;
  background: var(--surface);
  border-bottom: 2px solid var(--red);
  z-index: 6;
}
.tl-month {
  position: absolute; top: 2px;
  font-family: "TLS Display", sans-serif;
  font-size: 0.85rem;
  padding-left: 5px;
  border-left: 2px solid var(--red-light);
  white-space: nowrap;
}
.tl-tick { position: absolute; top: 24px; font-size: 0.68rem; color: var(--muted-2); border-left: 1px solid var(--border); padding-left: 2px; height: 18px; }
.tl-tick-month { border-left-color: var(--red-light); }
.tl-band-label {
  position: sticky; left: 8px;
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  padding: 4px 0 0 8px;
  z-index: 5;
}
.tl-band { position: relative; min-height: 40px; border-bottom: 1px dashed var(--border); }
.tl-events { min-height: 46px; }
.tl-releases { min-height: 38px; }
.tl-period {
  position: absolute; top: 6px;
  height: 30px;
  border: 1.5px solid;
  border-radius: 8px;
  font-size: 0.78rem; font-weight: 600;
  display: flex; align-items: center;
  padding: 0 8px;
  white-space: nowrap; overflow: hidden;
  cursor: pointer;
}
.tl-marker {
  position: absolute; top: 4px;
  transform: translateX(-50%);
  text-align: center;
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer;
  z-index: 4;
  white-space: nowrap;
}
.tl-marker-icon { display: block; font-size: 1.05rem; }
.tl-marker-line {
  position: absolute; top: 44px; bottom: 0;
  border-left: 2px dashed;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}
.tl-agenda { min-height: 34px; }
.tl-appt {
  position: absolute; top: 4px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 2px 9px;
  white-space: nowrap;
  cursor: pointer;
  z-index: 4;
  box-shadow: var(--shadow);
}
.tl-appt-rdv { border-left-color: var(--red); }
.tl-appt:hover { border-color: var(--red-light); }
.dropdown-check { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.6rem; font-size: 0.88rem; cursor: pointer; border-radius: 6px; }
.dropdown-check:hover { background: var(--bg); }
.dropdown-check input { accent-color: var(--red); margin: 0; }
.agenda-actions { white-space: nowrap; }
.agenda-actions .inline-form { display: inline; }
.tl-release {
  position: absolute; top: 6px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px;
  white-space: nowrap;
  z-index: 4;
}
.tl-release em { font-style: normal; opacity: 0.75; }
.tl-release.tl-late { background: var(--red); }
.tl-release.tl-done { background: var(--green); }
.tl-lane { position: relative; border-bottom: 1px solid var(--border); }
.tl-lane-label {
  position: sticky; left: 0;
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface);
  font-weight: 700; font-size: 0.85rem;
  color: var(--ink);
  padding: 6px 10px 4px;
  z-index: 5;
  border-bottom-right-radius: 8px;
}
.tl-pill {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted-2);
  border-radius: 999px;
  font-size: 0.76rem;
  padding: 3px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: grab;
  box-shadow: var(--shadow);
  z-index: 3;
  user-select: none;
}
.tl-pill.prio-high { border-left-color: var(--red); }
.tl-pill.prio-medium { border-left-color: #d7a021; }
.tl-pill.prio-low { border-left-color: var(--green); }
.tl-pill.st-in_progress { background: #fdf7ec; }
.tl-pill.tl-blocked { background: #fbeaec; }
.tl-pill.tl-dragging { opacity: 0.6; cursor: grabbing; z-index: 10; }
.tl-pill.tl-bar {
  border-radius: 7px;
  border-left-width: 4px;
  border-right: 3px solid var(--muted-2);
}
.tl-pill.tl-bar.prio-high { border-right-color: var(--red); }
.tl-pill.tl-bar.prio-medium { border-right-color: #d7a021; }
.tl-pill.tl-bar.prio-low { border-right-color: var(--green); }
.tl-today { position: absolute; top: 44px; bottom: 0; border-left: 2px solid var(--red); z-index: 2; pointer-events: none; }
.tl-cursor {
  position: absolute; top: 44px; bottom: 0;
  border-left: 2px dashed var(--ink);
  opacity: 0.55;
  z-index: 2;
  pointer-events: none;
}
.tl-cursor-handle {
  position: absolute; top: 46px;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 9px;
  white-space: nowrap;
  cursor: grab;
  z-index: 5;
  user-select: none;
}
.tl-cursor-handle:active { cursor: grabbing; }
#tl-deps { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2; }
/* dependency links: blue = required order OK, red dashed = order violated */
#tl-deps marker path { fill: #4a6fa5; }
#tl-deps marker#tlArrowBad path { fill: var(--red); }
.tl-dep-g { transition: opacity 0.15s ease; }
.tl-dep-g path {
  fill: none;
  stroke: #4a6fa5;
  stroke-width: 1.7;
  opacity: 0.55;
  marker-end: url(#tlArrow);
  pointer-events: visibleStroke;
}
.tl-dep-g circle { fill: #4a6fa5; opacity: 0.55; }
.tl-dep-g.bad path {
  stroke: var(--red);
  stroke-width: 2.1;
  stroke-dasharray: 6 4;
  opacity: 0.85;
  marker-end: url(#tlArrowBad);
}
.tl-dep-g.bad circle { fill: var(--red); opacity: 0.85; }
#tl-deps.dim .tl-dep-g:not(.hi) { opacity: 0.08; }
.tl-dep-g.hi path { opacity: 1; stroke-width: 2.6; }
.tl-dep-g.hi circle { opacity: 1; r: 4; }
.tl-lane:nth-child(even) { background: rgba(20, 20, 30, 0.025); }
.tl-pill.tl-pinned::after { content: "📌"; font-size: 0.6rem; margin-left: 4px; opacity: 0.6; }
.tl-legend {
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  font-size: 0.78rem;
  padding: 0.35rem 0.2rem 0;
}
.tl-legend .lg { display: inline-flex; align-items: center; gap: 0.35rem; }
.tl-legend svg { overflow: visible; }
.tl-legend .lg-ok { stroke: #4a6fa5; stroke-width: 2; fill: none; }
.tl-legend .lg-ok-head { fill: #4a6fa5; }
.tl-legend .lg-bad { stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 3; fill: none; }
.tl-legend .lg-bad-head { fill: var(--red); }
.tl-drag-date {
  position: fixed;
  background: var(--ink); color: #fff;
  border-radius: 6px;
  font-size: 0.8rem; font-weight: 700;
  padding: 3px 8px;
  z-index: 60;
  pointer-events: none;
}
.tl-tray-box { margin-top: 0.9rem; }
.tl-tray-box summary { font-weight: 700; cursor: pointer; padding: 0.3rem 0; }
.tl-tray { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 0; }
.tl-tray-pill { position: static !important; max-width: 260px; }
.tl-form-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.45);
  z-index: 40;
  display: flex; align-items: center; justify-content: center;
}
.tl-form {
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 4px solid var(--red);
  box-shadow: 0 20px 60px rgba(10,10,10,0.3);
  padding: 1.2rem;
  width: min(420px, 92vw);
}
.tl-form h3 { font-family: "TLS Display", sans-serif; margin: 0 0 0.8rem; }
input[type="color"] { padding: 2px; height: 38px; }

/* ── Create dropdown (timeline toolbar) ─────────────────────────────────── */
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  display: flex; flex-direction: column;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(10,10,10,0.18);
  padding: 0.3rem;
  z-index: 30;
}
.dropdown-menu button, .dropdown-menu a {
  background: none; border: none;
  text-align: left;
  font: inherit; color: var(--ink);
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--bg); color: var(--red); }

/* ── Weekly capacity overrides (team page) ──────────────────────────────── */
.cap-weeks { margin-top: 0.5rem; }
.cap-weeks-row { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.25rem; }
.cap-week { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.cap-week input { width: 4.2rem; }

/* ── Unavailability calendar (agenda page) ──────────────────────────────── */
.abs-panel { padding: 1rem; margin-bottom: 1rem; }
.abs-toolbar { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0.9rem; }
.abs-nav { display: flex; gap: 0.35rem; }
.abs-field { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--muted); }
.abs-field input, .abs-field select { min-width: 12rem; }

.abs-cal {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem; user-select: none; touch-action: none;
}
.abs-month {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.abs-month-head {
  background: var(--red); color: #fff; font-weight: 600; text-align: center;
  text-transform: capitalize; padding: 0.45rem 0; letter-spacing: 0.02em;
}
.abs-grid {
  display: grid; grid-template-columns: 1.7rem repeat(7, 1fr);
  padding: 0.35rem 0.45rem 0.5rem;
}
.abs-wd {
  font-size: 0.7rem; font-weight: 600; color: var(--muted); text-align: center;
  padding: 0.3rem 0 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 3px;
}
.abs-wk {
  font-size: 0.65rem; color: var(--muted); opacity: 0.7;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border); margin-right: 3px;
}
.abs-day {
  position: relative; height: 2.1rem; border: 0; background: transparent;
  color: var(--text); font-size: 0.85rem; cursor: pointer; border-radius: 7px; margin: 1px 0;
}
.abs-day.we { color: var(--muted); background: rgba(128, 128, 128, 0.07); }
.abs-day:hover:not(:disabled):not(.off) { background: #b5202b22; }
.abs-day.today { box-shadow: inset 0 0 0 2px var(--red); font-weight: 700; }
.abs-day.past { opacity: 0.3; cursor: default; }
.abs-day.off {
  background: var(--red); color: #fff; font-weight: 600; border-radius: 0; margin: 1px 0;
}
.abs-day.off:hover { background: #8f1a22; }
.abs-day.off.off-start { border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.abs-day.off.off-end { border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.abs-day.sel { outline: 2px dashed var(--red); outline-offset: -2px; background: #b5202b33; }
.abs-day.off.sel { outline: 2px dashed #fff; background: #d4737a; }

.abs-legend {
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  margin-top: 0.8rem; font-size: 0.8rem; color: var(--muted);
}
.abs-legend i { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; vertical-align: -2px; margin-right: 0.3rem; }
.abs-legend .lg-off { background: var(--red); }
.abs-legend .lg-today { box-shadow: inset 0 0 0 2px var(--red); }
.abs-legend .lg-we { background: rgba(128, 128, 128, 0.15); }
.team-absence { color: var(--muted); font-size: 0.85rem; }
