/* Planboard — palette modelled on ag-grid.com (navy #0E4491, accent #1E88E5,
   Quartz-like neutrals). No external fonts or assets: CSP is `self` only. */

:root {
  color-scheme: light;
  --brand: #0e4491;
  --brand-2: #00388f;
  --accent: #1e88e5;
  --accent-strong: #1377d1;
  --accent-soft: #e5effd;
  --accent-softer: #f4f8ff;
  --focus: #1082ec;

  --bg: #ffffff;
  --bg-app: #f5f7fa;
  --chrome: #f8f9fb;
  --chrome-2: #f2f4f7;
  --border: #eaecf0;
  --border-strong: #d0d5dd;
  --grid-line: #eef0f3;

  --text: #101828;
  --text-2: #344054;
  --text-3: #475467;
  --muted: #667085;

  --row-hover: #f4f8ff;
  --row-selected: #e5effd;
  --weekend: rgba(16, 24, 40, 0.035);
  --offhours: rgba(16, 24, 40, 0.025);
  --now: #f04438;

  --ok: #12b76a;
  --ok-soft: #e7f8f0;
  --warn: #f79009;
  --danger: #e2231a;
  --danger-soft: #fef1f0;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 20px 40px rgba(16, 24, 40, 0.18);

  --radius: 8px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "IBM Plex Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink-mix: #000;
  --ink-pct: 58%;
  --tint-pct: 16%;
  --done-pct: 34%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #0e4491;
  --accent: #3b9cf0;
  --accent-strong: #5aabf3;
  --accent-soft: rgba(33, 150, 243, 0.18);
  --accent-softer: rgba(33, 150, 243, 0.08);
  --focus: #5aabf3;

  --bg: #1f2836;
  --bg-app: #171f2b;
  --chrome: #253040;
  --chrome-2: #2c384a;
  --border: #354257;
  --border-strong: #46546b;
  --grid-line: #2b3647;

  --text: #f2f4f7;
  --text-2: #d0d5dd;
  --text-3: #b3bccb;
  --muted: #98a2b3;

  --row-hover: rgba(33, 150, 243, 0.07);
  --row-selected: rgba(33, 150, 243, 0.16);
  --weekend: rgba(255, 255, 255, 0.03);
  --offhours: rgba(255, 255, 255, 0.02);
  --now: #ff6b5e;

  --ok-soft: rgba(18, 183, 106, 0.16);
  --danger: #ff5a4f;
  --danger-soft: rgba(255, 90, 79, 0.14);

  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --ink-mix: #fff;
  --ink-pct: 42%;
  --tint-pct: 24%;
  --done-pct: 46%;
}

/* ---------- colour palette (tasks, resources, projects) ---------- */
.ev-blue   { --c: #1e88e5; }
.ev-cyan   { --c: #0bb4d6; }
.ev-teal   { --c: #14b89a; }
.ev-green  { --c: #3fae4f; }
.ev-indigo { --c: #4f5fe0; }
.ev-purple { --c: #8b5cf6; }
.ev-pink   { --c: #e64c8d; }
.ev-orange { --c: #f07a2e; }
.ev-amber  { --c: #e8a317; }
.ev-gray   { --c: #7d8799; }
[class^="ev-"], [class*=" ev-"] {
  --c-ink: color-mix(in srgb, var(--c) var(--ink-pct), var(--ink-mix));
  --c-tint: color-mix(in srgb, var(--c) var(--tint-pct), var(--bg));
  --c-done: color-mix(in srgb, var(--c) var(--done-pct), var(--bg));
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 0.8em; }
code { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-all; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- top bar (AG Grid site header gradient) ---------- */
.topbar {
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  position: relative;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.2px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; fill: #fff; stroke: none; }
.brand-mark rect:nth-child(2) { fill: #7cc4ff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.dialog .icon-btn:hover { background: var(--chrome-2); }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 4px 8px; border-radius: var(--radius-sm); }
.user-chip::-webkit-details-marker { display: none; }
.user-chip:hover { background: rgba(255, 255, 255, 0.12); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 12px; font-weight: 700; vertical-align: middle;
}
.topbar .avatar { background: rgba(255, 255, 255, 0.18); color: #fff; }
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--row-hover); text-decoration: none; }

/* ---------- layout ---------- */
main { flex: 1; min-height: 0; }
.page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 16px 48px; overflow: auto; }
.page-full { display: flex; flex-direction: column; min-height: 0; }
.page-scroll { overflow: auto; }
.page-inner { padding: 20px 16px 48px; display: grid; gap: 16px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.split { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card.narrow { max-width: 620px; width: 100%; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: baseline; }
.callout { border-color: var(--accent); background: var(--accent-softer); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- flash & toasts ---------- */
.flash-stack { position: fixed; top: 60px; right: 16px; display: grid; gap: 8px; z-index: 60; max-width: 420px; }
.flash, .toast {
  padding: 10px 14px; border-radius: var(--radius); background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent); box-shadow: var(--shadow);
  animation: slide-in 0.18s ease-out;
}
.flash-success, .toast-success { border-left-color: var(--ok); }
.flash-error, .toast-error { border-left-color: var(--danger); }
.flash-warning { border-left-color: var(--warn); }
.toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 70; max-width: 420px; }
@keyframes slide-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label, .field .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; color: var(--text); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; min-height: 34px; width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--accent); background: transparent; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.help { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 12px; }
.form-errors { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.form-errors p { margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 180px; overflow: auto; }
.check-grid label { display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--text); font-size: 13px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { width: auto; min-height: 30px; padding: 4px 8px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, #000); }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-2);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--chrome-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); background: var(--danger); }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 38px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn[data-nav="prev"], .btn-group .btn[data-nav="next"] { padding: 0 7px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 650; background: var(--chrome-2); color: var(--text-3); white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.role-owner { background: color-mix(in srgb, var(--brand) 14%, var(--bg)); color: color-mix(in srgb, var(--brand) 70%, var(--text)); }
:root[data-theme="dark"] .role-owner { color: #9cc3ff; background: rgba(14, 68, 145, 0.45); }
.role-editor { background: var(--accent-soft); color: var(--accent-strong); }
.role-viewer { background: var(--chrome-2); color: var(--text-3); }
.role-legend { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3);
  background: var(--chrome); padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--row-hover); }
.table .actions { text-align: right; }
.table tr.is-inactive td { opacity: 0.6; }

/* ---------- auth pages ---------- */
.page-auth main { display: grid; place-items: center; }
.page-auth .page { display: grid; place-items: center; min-height: 100%; }
.auth-card {
  width: min(400px, 100%); background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; box-shadow: var(--shadow);
}
.secret-box { display: flex; align-items: center; gap: 10px; background: var(--chrome); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0; }
.secret-box code { flex: 1; font-size: 14px; letter-spacing: 0.5px; }
.steps { padding-left: 20px; color: var(--text-2); }
.steps li { margin-bottom: 4px; }

/* ---------- dashboard ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card {
  display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s;
}
.project-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.project-card h2 { margin: 10px 0 4px; }
.project-card-top { display: flex; justify-content: space-between; align-items: center; }
.project-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.project-stats { display: flex; gap: 20px; margin: auto 0 0; padding-top: 12px; }
.project-stats dt { font-size: 11.5px; color: var(--muted); }
.project-stats dd { margin: 0; font-weight: 650; font-size: 16px; }
.new-project { position: relative; }
.new-project > summary { list-style: none; }
.new-project > summary::-webkit-details-marker { display: none; }
.popover-card { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 90vw); z-index: 15; box-shadow: var(--shadow-lg); }
.empty { text-align: center; padding: 60px 20px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- project bar & tabs ---------- */
.project-bar {
  flex: none; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 0 16px; min-height: 50px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.project-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-title h1 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tabs { display: flex; gap: 2px; align-self: stretch; margin-left: auto; }
.tabs a {
  display: flex; align-items: center; padding: 0 12px; color: var(--text-3); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--chrome); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- board ---------- */
.board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.toolbar {
  flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--chrome); border-bottom: 1px solid var(--border);
}
.seg { display: inline-flex; background: var(--chrome-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-3); font: inherit; font-weight: 550; font-size: 13px;
  height: 26px; padding: 0 10px; border-radius: 4px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input { height: 32px; min-height: 32px; padding-left: 30px; width: 200px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 32px; height: 18px; border-radius: 9px; background: var(--border-strong); position: relative; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.statusbar {
  flex: none; display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 12px;
  background: var(--chrome); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.statusbar .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .conflict { color: var(--danger); font-weight: 600; }

/* ---------- scheduler component ---------- */
.sch { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; user-select: none; -webkit-user-select: none; }
.sch-main { flex: 1; min-height: 0; display: flex; }
.sch-locked { flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border-strong); background: var(--bg); min-width: 160px; }
.sch-normal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sch-splitter { flex: none; width: 5px; margin-left: -3px; margin-right: -2px; cursor: col-resize; z-index: 5; position: relative; }
.sch-splitter:hover, .sch-splitter.is-active { background: var(--accent); opacity: 0.5; }

.sch-header { flex: none; height: 57px; background: var(--chrome); border-bottom: 1px solid var(--border-strong); overflow: hidden; position: relative; }
.sch-locked .sch-header { display: flex; align-items: flex-end; }
.sch-col-head { font-size: 12px; font-weight: 650; color: var(--text-3); padding: 0 12px 9px; }
.sch-col-head.grow { flex: 1; }
.sch-col-head.load { width: 64px; text-align: right; }
.sch-axis { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; }
.sch-axis-row { position: absolute; left: 0; height: 28px; width: 100%; }
.sch-axis-row.bottom { top: 28px; border-top: 1px solid var(--border); }
.sch-axis-cell {
  position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding: 0 6px;
  font-size: 12px; color: var(--text-3); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden;
}
.sch-axis-row.top .sch-axis-cell { font-weight: 650; color: var(--text-2); }
.sch-axis-row.bottom .sch-axis-cell { justify-content: center; padding: 0 2px; font-size: 11.5px; }
.sch-axis-cell.is-weekend { color: var(--muted); background: var(--weekend); }
.sch-axis-cell.is-today { color: var(--accent-strong); font-weight: 700; }

.sch-locked-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.sch-scroller { flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; }
.sch-canvas { position: relative; overflow: hidden; }

.sch-row {
  display: flex; align-items: center; border-bottom: 1px solid var(--grid-line);
  padding: 0 0 0 12px; gap: 10px; overflow: hidden; position: absolute; left: 0; right: 0;
}
.sch-row:hover, .sch-row.is-hover { background: var(--row-hover); }
.sch-row.is-drop-target { background: var(--row-selected); }
.sch-row .avatar { background: var(--c-tint); color: var(--c-ink); }
.sch-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sch-row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.sch-row-name.is-link { cursor: pointer; }
.sch-row-name.is-link:hover { color: var(--accent); text-decoration: underline; }
.sch-row-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-row-load { width: 64px; text-align: right; padding-right: 12px; font-size: 12px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sch-row-load.is-over { color: var(--danger); }
.sch-row.is-unassigned .sch-row-name { font-style: italic; color: var(--text-3); font-weight: 500; }
.sch-row.is-unassigned .avatar { background: var(--chrome-2); color: var(--muted); }

.sch-lane-bg { position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--grid-line); }
.sch-lane-bg.is-hover { background: var(--row-hover); }
.sch-lane-bg.is-drop-target { background: var(--row-selected); }
.sch-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid-line); }
.sch-tick.major { background: var(--border); }
.sch-weekend { position: absolute; top: 0; bottom: 0; background: var(--weekend); }
.sch-offhours { position: absolute; top: 0; bottom: 0; background: var(--offhours); }
.sch-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--now); z-index: 3; pointer-events: none; }
.sch-now::before { content: ""; position: absolute; top: 0; left: -4px; border: 5px solid transparent; border-top-color: var(--now); }

.sch-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.sch-dep { stroke: var(--text-3); stroke-width: 1.5; fill: none; opacity: 0.75; marker-end: url(#sch-arrow); }
.sch-dep-hit { stroke: transparent; stroke-width: 12; fill: none; pointer-events: stroke; cursor: pointer; }
.sch.is-dragging .sch-dep-hit { pointer-events: none; }
.sch-dep-g:hover .sch-dep, .sch-dep-g.is-highlight .sch-dep { stroke: var(--accent); opacity: 1; stroke-width: 2; marker-end: url(#sch-arrow-hi); }
.sch-dep-g.is-conflict .sch-dep { stroke: var(--danger); opacity: 1; stroke-dasharray: 4 3; marker-end: url(#sch-arrow-bad); }
.sch-dep-arrow { fill: var(--text-3); stroke: none; }
.sch-dep-arrow.hi { fill: var(--accent); }
.sch-dep-arrow.bad { fill: var(--danger); }
.sch-dep-temp { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }

.sch-ev {
  position: absolute; height: 28px; border-radius: 5px; z-index: 2;
  background: var(--c-tint); color: var(--c-ink);
  border-left: 3px solid var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
  display: flex; align-items: center; overflow: visible; cursor: pointer;
  transition: box-shadow 0.12s;
}
.sch-ev:hover { box-shadow: 0 0 0 1px var(--c), var(--shadow); z-index: 4; }
.sch-ev:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sch-ev.is-selected { box-shadow: 0 0 0 2px var(--c), var(--shadow); z-index: 4; }
.sch-ev.is-dragging { opacity: 0.9; box-shadow: 0 0 0 2px var(--c), var(--shadow-lg); z-index: 10; transition: none; cursor: grabbing; }
.sch-ev.is-dimmed { opacity: 0.25; }
.sch-ev.is-conflict { box-shadow: 0 0 0 2px var(--danger); }
.sch-ev.is-pending { opacity: 0.7; }
.sch-ev.is-link-target { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.sch-ev-clip { position: absolute; inset: 0; border-radius: 0 5px 5px 0; overflow: hidden; pointer-events: none; }
.sch-ev-progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-done); }
.sch-ev-label { position: relative; display: flex; gap: 6px; align-items: baseline; padding: 0 8px; min-width: 0; white-space: nowrap; overflow: hidden; pointer-events: none; font-size: 12.5px; }
.sch-ev-name { font-weight: 620; overflow: hidden; text-overflow: ellipsis; }
.sch-ev-pct { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.sch-ev-pin { width: 11px; height: 11px; flex: none; align-self: center; }
.sch-ev-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; }
.sch-ev-handle.start { left: -3px; }
.sch-ev-handle.end { right: -3px; }
.sch-ev-term {
  position: absolute; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--c); cursor: crosshair; z-index: 3;
  opacity: 0; transition: opacity 0.12s;
}
.sch-ev-term.start { left: -15px; }
.sch-ev-term.end { right: -15px; }
.sch-ev:hover .sch-ev-term, .sch.is-linking .sch-ev .sch-ev-term { opacity: 1; }
.sch-ev.is-dragging .sch-ev-term { opacity: 0; }
.sch-proxy { position: absolute; height: 28px; border-radius: 5px; background: var(--accent-soft); border: 1.5px dashed var(--accent); z-index: 6; pointer-events: none; }
.sch.is-readonly .sch-ev { cursor: default; }

.sch-tip {
  position: fixed; z-index: 80; pointer-events: none; min-width: 180px; max-width: 320px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12.5px;
}
.sch-tip-title { font-weight: 650; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.sch-tip-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.sch-tip dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.sch-tip dt { color: var(--muted); }
.sch-tip dd { margin: 0; font-variant-numeric: tabular-nums; }
.sch-tip.is-drag { min-width: 0; padding: 6px 10px; font-weight: 600; }
.sch-tip .warn { color: var(--danger); margin-top: 6px; }

.sch-menu {
  position: fixed; z-index: 85; min-width: 180px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px;
}
.sch-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: inherit; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.sch-menu button:hover, .sch-menu button:focus-visible { background: var(--row-hover); outline: none; }
.sch-menu button.danger { color: var(--danger); }
.sch-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* histogram */
.sch-hist { flex: none; height: 190px; display: flex; border-top: 2px solid var(--border-strong); background: var(--bg); }
.sch-hist .sch-locked { border-right: 1px solid var(--border-strong); }
.sch-hist-title { height: 28px; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 650; color: var(--text-3); background: var(--chrome); border-bottom: 1px solid var(--border); flex: none; }
.sch-hist-legend { height: 28px; display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 11.5px; color: var(--muted); background: var(--chrome); border-bottom: 1px solid var(--border); flex: none; }
.sch-hist-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.sch-hist-legend .ok { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.sch-hist-legend .over { background: var(--danger); }
.sch-hist-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.sch-hist-scroll { flex: 1; min-height: 0; overflow: hidden auto; position: relative; }
.sch-hist-row { position: absolute; left: 0; right: 0; height: 36px; border-bottom: 1px solid var(--grid-line); }
.sch-hist-label { display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 12.5px; }
.sch-hist-label .sch-row-name { font-weight: 550; flex: 1; }
.sch-hist-bar { position: absolute; bottom: 0; background: color-mix(in srgb, var(--accent) 55%, var(--bg)); border-radius: 2px 2px 0 0; }
.sch-hist-bar.is-over { background: var(--danger); }
.sch-hist-cap { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--danger) 60%, transparent); pointer-events: none; }

/* dialogs */
.dialog {
  border: 0; padding: 0; border-radius: 12px; background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(16, 24, 40, 0.45); }
.dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.dialog-head h2 { margin: 0; }
.dialog-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.dialog-tabs button { border: 0; background: none; font: inherit; font-weight: 550; color: var(--text-3); padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.dialog-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.dialog-body { padding: 16px 20px 4px; overflow: auto; }
.dialog-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--chrome); border-radius: 0 0 12px 12px; }
.subhead { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 12px 0 6px; }
.dep-list { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dep-list:empty::before { content: "—"; display: block; padding: 8px 12px; color: var(--muted); }
.dep-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dep-list li:last-child { border-bottom: 0; }
.dep-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-add { display: grid; grid-template-columns: 1fr 170px 80px auto; gap: 8px; margin-top: 12px; }
@media (max-width: 600px) { .dep-add { grid-template-columns: 1fr 1fr; } }
.dep-summary { font-weight: 600; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; white-space: pre-wrap; }

@media (max-width: 760px) {
  .tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  .search input { width: 140px; }
  .statusbar .hint { display: none; }
  .user-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* current block (this week / month / quarter) and bar badges */
.sch-current { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 6%, transparent); pointer-events: none; }
.sch-ev-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 1px 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, transparent); flex: none; align-self: center; }

/* ---------- breadcrumbs ---------- */
.crumb { color: var(--muted); font-weight: 550; font-size: 13px; }
.crumb-sep { color: var(--border-strong); }
.project-title h1 a { color: inherit; }
.project-bar > .new-project { margin-left: auto; }

/* ---------- modules & sprints overview ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.group-card {
  display: flex; flex-direction: column; gap: 8px; background: var(--bg);
  border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.group-card header, .group-card footer { display: flex; align-items: center; gap: 8px; }
.group-card h3 { margin: 0; font-size: 15px; }
.group-card h3 a { color: var(--text); }
.kind-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--c-tint, var(--accent-soft)); color: var(--c-ink, var(--accent-strong));
}
.progress meter { width: 100%; height: 8px; }
meter { accent-color: var(--ok); }
meter::-webkit-meter-bar { background: var(--chrome-2); border: 0; border-radius: 4px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--ok); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--ok); border-radius: 4px; }
.seg-inline { gap: 2px; align-self: flex-start; }
.seg-inline label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.seg-inline label:has(input:checked) { background: var(--bg); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.radio-list { display: grid; gap: 6px; }
.radio-list label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 13.5px; }

/* ---------- kanban ---------- */
.kanban-page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.kanban-head {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--chrome); border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--c);
}
.kanban-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.kanban-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.kanban-tools select { width: auto; min-height: 32px; height: 32px; padding: 0 8px; }
.group-switch { width: auto; font-weight: 650; font-size: 15px; min-height: 34px; max-width: 360px; }
.group-name { font-size: 15px; }
.kanban-goal { margin: 0; padding: 8px 16px 0; }
.kanban { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; padding: 12px 16px 16px; overflow: auto; }
.kanban-col {
  display: flex; flex-direction: column; min-height: 0; background: var(--chrome);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.kanban-col.is-over { border-color: var(--accent); background: var(--accent-softer); }
.kanban-col > header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.kanban-col h3 { margin: 0; font-size: 13px; font-weight: 650; color: var(--text-2); }
.col-count { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--chrome-2); border-radius: 10px; padding: 1px 8px; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-todo { background: #98a2b3; }
.status-in_progress { background: var(--accent); }
.status-review { background: #f79009; }
.status-done { background: var(--ok); }
.kanban-list { flex: 1; min-height: 60px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.issue-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 10px; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  border-left: 3px solid var(--border-strong);
}
.issue-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.issue-card.is-dragging { opacity: 0.4; }
.issue-card.prio-high { border-left-color: #f79009; }
.issue-card.prio-urgent { border-left-color: var(--danger); }
.issue-card.prio-low { border-left-color: #98a2b3; }
.issue-card.prio-medium { border-left-color: var(--accent); }
.issue-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.issue-key { font-family: var(--mono); color: var(--muted); font-weight: 600; }
.type-badge, .prio-badge { padding: 0 6px; border-radius: 3px; font-weight: 650; font-size: 10.5px; line-height: 18px; background: var(--chrome-2); color: var(--text-3); }
.type-bug .type-badge { background: var(--danger-soft); color: var(--danger); }
.type-story .type-badge { background: var(--ok-soft); color: var(--ok); }
.prio-badge { margin-left: auto; }
.prio-urgent .prio-badge { background: var(--danger); color: #fff; }
.prio-high .prio-badge { background: color-mix(in srgb, #f79009 18%, var(--bg)); color: #b54708; }
:root[data-theme="dark"] .prio-high .prio-badge { color: #fdb022; }
.issue-title { font-weight: 550; color: var(--text); line-height: 1.35; word-break: break-word; }
.issue-meta { display: flex; align-items: center; justify-content: space-between; min-height: 22px; font-size: 11.5px; color: var(--muted); }
.issue-meta .avatar { width: 22px; height: 22px; font-size: 10px; }
.drop-placeholder { height: 44px; border: 2px dashed var(--accent); border-radius: var(--radius-sm); background: var(--accent-softer); flex: none; }
.quick-add { padding: 8px; border-top: 1px solid var(--border); }
.quick-add input { background: transparent; border-color: transparent; }
.quick-add input:hover { background: var(--bg); border-color: var(--border); }
.quick-add input:focus { background: var(--bg); }
@media (max-width: 1000px) { .kanban { grid-template-columns: repeat(4, 260px); } }

/* ---------- paused / completed projects ---------- */
.badge-inactive { background: var(--chrome-2); color: var(--text-3); border: 1px dashed var(--border-strong); }
.inactive-banner {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: var(--chrome-2); color: var(--text-2); border-bottom: 1px solid var(--border); font-size: 13px;
}
.project-bar.is-inactive .project-dot { background: var(--muted); }
.sch-row.is-inactive, .sch-lane-bg.is-inactive { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--weekend) 8px 16px); }
.sch-row.is-inactive .sch-row-name, .sch-row.is-inactive .sch-row-load { color: var(--muted); }
.sch-row.is-inactive .avatar { filter: grayscale(1); opacity: 0.7; }
.sch-ev.is-inactive { filter: grayscale(1); opacity: 0.55; }
.sch-ev.is-inactive:hover { opacity: 0.8; }
.group-card.is-inactive { filter: grayscale(1); opacity: 0.7; }

/* ---------- row handle / menu / reorder ---------- */
.sch-row-handle {
  flex: none; width: 12px; margin-left: -8px; color: var(--border-strong); cursor: grab;
  font-size: 12px; letter-spacing: -2px; line-height: 1; user-select: none; touch-action: none;
}
.sch-row:hover .sch-row-handle { color: var(--muted); }
.sch-row.is-reordering { background: var(--row-selected); }
.sch-row-marker { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 5; pointer-events: none; }
.sch-row-menu {
  flex: none; width: 26px; height: 26px; margin: 0 6px 0 -6px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0;
}
.sch-row:hover .sch-row-menu, .sch-row-menu:focus-visible { opacity: 1; }
.sch-row-menu:hover { background: var(--chrome-2); color: var(--text); }
@media (hover: none) { .sch-row-menu { opacity: 1; } }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- backlog & sprint planning ---------- */
.planning { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.planning .toolbar select { width: auto; min-height: 32px; height: 32px; padding: 0 8px; }
.planning-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.3fr); gap: 16px; padding: 16px; overflow: hidden; }
.plan-backlog { display: flex; flex-direction: column; min-height: 0; }
.plan-backlog .plan-items { flex: 1; overflow-y: auto; }
.plan-groups { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.plan-list { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.plan-groups .plan-list { border-left: 4px solid var(--c); }
.plan-list.is-over { border-color: var(--accent); background: var(--accent-softer); }
.plan-list.is-finished { opacity: 0.75; }
.plan-list.is-active { box-shadow: 0 0 0 1px var(--ok), var(--shadow-sm); }
.plan-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.plan-head h2 { margin: 0; font-size: 15px; }
.plan-name { font-weight: 650; color: var(--text); }
.plan-stats { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-toggle { border: 0; background: none; color: var(--muted); cursor: pointer; width: 20px; padding: 0; font-size: 13px; }
.plan-items { padding: 4px; min-height: 44px; }
.plan-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 12.5px; text-align: center; }
.plan-item {
  display: grid; grid-template-columns: auto auto 1fr auto auto 32px 24px; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm); border-left: 3px solid transparent; cursor: pointer; font-size: 13px;
}
.plan-item + .plan-item { border-top: 1px solid var(--grid-line); }
.plan-item:hover { background: var(--row-hover); }
.plan-item.is-dragging { opacity: 0.4; }
.plan-item.is-done .plan-title { text-decoration: line-through; color: var(--muted); }
.plan-item.prio-urgent { border-left-color: var(--danger); }
.plan-item.prio-high { border-left-color: #f79009; }
.plan-item .prio-badge { margin-left: 0; }
.plan-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.plan-item .points { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; }
.plan-item .avatar { width: 22px; height: 22px; font-size: 10px; }
.plan-item .avatar.is-empty { background: transparent; border: 1px dashed var(--border-strong); }
.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 900px) {
  .planning-body { grid-template-columns: 1fr; overflow: auto; }
  .plan-item { grid-template-columns: auto 1fr auto 24px; }
  .plan-item .type-badge, .plan-item .status-chip, .plan-item .prio-badge { display: none; }
}
.badge-inactive.status-completed { border-style: solid; border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); background: var(--ok-soft); }
.badge-inactive.status-completed::before { content: "✓ "; }
.inactive-banner.status-completed { background: var(--ok-soft); }
.inactive-banner form { display: inline; }
.sch-row.is-completed .sch-row-name::after { content: " ✓"; color: var(--ok); }

/* ---------- portfolio folders (section rows) ---------- */
.sch-row.sch-section { background: var(--chrome); gap: 6px; padding-left: 6px; border-bottom-color: var(--border); }
.sch-row.sch-section:hover { background: var(--chrome-2); }
.sch-section-toggle { border: 0; background: none; color: var(--text-3); width: 22px; height: 22px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.sch-section-toggle:hover { background: var(--border); }
.sch-section-name { flex: 1; min-width: 0; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-section-count { font-size: 11px; font-weight: 650; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 0 7px; margin-right: 6px; }
.sch-section .sch-row-menu { margin: 0 6px 0 0; }
.sch-lane-bg.is-section { background: var(--chrome); border-bottom-color: var(--border); }

/* ---------- non-human resources ---------- */
.avatar.is-icon svg { width: 15px; height: 15px; stroke-width: 1.8; }
.avatar.is-icon { border-radius: 7px; }

/* ---------- single-line toolbar (keeps the timeline tall) ---------- */
@media (min-width: 900px) {
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .toolbar .search input { width: 150px; transition: width 0.15s; }
  .toolbar .search input:focus { width: 220px; }
}
.btn-group.add-group .btn-primary { position: relative; z-index: 1; }
.group-card footer .btn-danger-ghost { margin-right: auto; }
.plan-head .btn-sm { height: 24px; padding: 0 8px; }

/* in-page confirm / prompt */
.dialog-confirm { width: min(440px, calc(100vw - 32px)); }
.dialog-confirm .dialog-body p { margin: 0 0 8px; color: var(--text-2); }
.dialog-confirm .dialog-body input { margin: 6px 0 12px; }

/* completed projects: green & white (not faded like paused ones) */
.sch-row.is-completed, .sch-lane-bg.is-completed {
  background: repeating-linear-gradient(135deg, var(--bg) 0 8px, color-mix(in srgb, var(--ok) 14%, var(--bg)) 8px 16px);
}
.sch-row.is-completed .sch-row-name { color: var(--text); }
.sch-row.is-completed .sch-row-load, .sch-row.is-completed .sch-row-sub { color: var(--ok); }
.sch-row.is-completed .avatar { filter: none; opacity: 1; background: var(--ok-soft); color: var(--ok); }
.sch-ev.is-completed {
  --c: var(--ok);
  filter: none; opacity: 1;
  background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 55%, transparent);
}
.sch-ev.is-completed:hover { opacity: 1; box-shadow: 0 0 0 1px var(--ok), var(--shadow); }
.group-card.is-completed {
  filter: none; opacity: 1; --c: var(--ok);
  background: repeating-linear-gradient(135deg, var(--bg) 0 8px, color-mix(in srgb, var(--ok) 10%, var(--bg)) 8px 16px);
}
.project-bar.is-completed .project-dot { background: var(--ok); }

/* ===== members, invitations, ownership transfer (membership feature) ===== */
.menu-panel a.menu-invites { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
}
.invite-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.invite-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--c, var(--accent));
  border-radius: var(--radius-sm);
}
.invite-info { display: grid; gap: 4px; min-width: 0; }
.invitations-card { margin-bottom: 16px; }
.members-split { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .members-split { grid-template-columns: 1fr; } }
.transfer-card .radio-list { margin-top: 2px; }
.narrow-wrap { max-width: 620px; width: 100%; }
.auth-alt { margin: 16px 0 0; text-align: center; }
.auth-card .invite-actions { justify-content: flex-start; margin-top: 12px; }
.auth-card input[readonly] { background: var(--chrome); color: var(--text-2); }
/* ===== end membership feature ===== */

/* fold / unfold all groups */
.btn.icon-toggle { padding: 0 8px; }
.btn.icon-toggle svg[hidden] { display: none; }

/* ---------- top navigation + Bugün (Today) ---------- */
.topnav { display: flex; gap: 2px; margin-left: 12px; }
.topnav a { color: rgba(255, 255, 255, 0.78); padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 600; }
.topnav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.topnav a[aria-current="page"] { background: rgba(255, 255, 255, 0.18); color: #fff; }
.today .page-head { margin-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat.is-warn .stat-value { color: #b54708; }
.stat.is-danger .stat-value { color: var(--danger); }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 520px) { .today-grid { grid-template-columns: 1fr; } }
.today-group { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 -8px; border-radius: var(--radius-sm); color: var(--text); border-left: 3px solid var(--c); }
.today-group + .today-group { margin-top: 6px; }
.today-group:hover { background: var(--row-hover); text-decoration: none; }
.today-group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.today-group-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-group meter { width: 100%; height: 6px; }
.today-days { display: flex; flex-direction: column; align-items: flex-end; font-weight: 650; font-size: 13px; white-space: nowrap; }
.today-days.is-warn { color: #b54708; }
.today-days.is-danger { color: var(--danger); }
.badge-warn { background: color-mix(in srgb, #f79009 18%, var(--bg)); color: #b54708; }
.plain-list { margin: 0 0 12px; padding-left: 18px; }
.table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.is-due td:first-child { box-shadow: inset 3px 0 0 #f79009; }
@media (max-width: 760px) { .topnav { margin-left: 0; } .topnav a { padding: 6px 8px; } }

/* Teams & user administration */
.table-scroll { overflow-x: auto; }
.access-sources { min-width: 150px; }
.source-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--chrome); color: var(--text-2); font-size: 12px; white-space: nowrap; margin: 1px 4px 1px 0; }
.source-team { border-style: dashed; }
.grant-form { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) auto; gap: 0 12px; align-items: start; margin-top: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; margin-bottom: 4px; }
.filter-bar .field { min-width: 120px; }
.filter-bar .filter-grow { flex: 1 1 240px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding-top: 12px; }
.admin-tabs { margin-left: 0; align-self: flex-start; border-bottom: 1px solid var(--border); width: 100%; }
.admin-tabs a { padding: 8px 12px; }
.admin-narrow { max-width: 640px; width: 100%; }
.stack { display: grid; gap: 16px; min-width: 0; }
.action-list label { align-items: flex-start; }
.action-list input { margin-top: 3px; }
@media (max-width: 640px) { .grant-form, .admin-narrow .grid-2 { grid-template-columns: 1fr; } }
.fit-width > *, .fit-width .split > *, .fit-width .stack > * { min-width: 0; }

/* ---------- device enrollment (QR) ---------- */
.enroll-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.enroll-qr-wrap { flex: 0 0 auto; width: min(300px, 100%); }
/* Undo the global icon styling (svg { stroke-width: 2; stroke-linecap: round }): QR modules must stay square. */
.enroll-qr { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); background: #fff;
  fill: none; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; shape-rendering: crispEdges; }
.enroll-info { flex: 1 1 280px; min-width: 0; }
.enroll-info .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 0; }
.enroll-code code { font-size: 28px; font-weight: 700; letter-spacing: 3px; }
