:root {
  color-scheme: light;
  --bg: #e8eefb;
  --surface: #ffffff;
  --panel: #f8fafc;
  --border: #dbe4f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.07), transparent 24%),
    linear-gradient(180deg, var(--bg), #f8fafc 60%, #eef2ff);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button {
  font: inherit;
}

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 clamp(250px, 18vw, 280px);
  padding: 16px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: default;
  user-select: none;
  pointer-events: none;
}
.brand h1 { margin: 0; font-size: 1rem; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; }
.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
}

.panel, .column, .kpi, .card, .modal, .subtask, .comment, .subtask-create, .comment-create {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.panel-head, .column-head, .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel h2, .column h3, .modal h2 {
  margin: 0;
  font-size: 0.88rem;
}

.stack { display: flex; flex-direction: column; gap: 7px; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
}
.row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.row.active { border-color: var(--accent); background: var(--accent-soft); }
.row strong { font-size: 0.88rem; }
.row span { color: var(--muted); font-size: 0.76rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}
.button-inline {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.82rem;
}
.button-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
}
.stack.compact .row {
  padding: 9px 11px;
}

.sidebar > .panel:last-of-type .button {
  width: 100%;
}

.sidebar .panel-head h2 {
  font-size: 0.82rem;
}
.sidebar-dropdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-dropdown > summary {
  list-style: none;
}
.sidebar-dropdown > summary::-webkit-details-marker {
  display: none;
}
.sidebar-dropdown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  cursor: pointer;
}
.sidebar-dropdown-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sidebar-dropdown-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.sidebar-dropdown-copy strong {
  font-size: 0.88rem;
}
.sidebar-dropdown-copy span {
  color: var(--muted);
  font-size: 0.76rem;
}
.sidebar-dropdown-chevron {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
}
.sidebar-dropdown[open] .sidebar-dropdown-chevron {
  transform: rotate(180deg);
}
.sidebar-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}
.sidebar-project-list .row {
  align-items: center;
}
.sidebar-project-list .row-main {
  gap: 2px;
}
.sidebar-project-list .row-main strong {
  font-size: 0.86rem;
}
.sidebar-project-list .row-main span {
  font-size: 0.74rem;
}
.sidebar-project-list .button-inline {
  flex: 0 0 auto;
}
.sidebar-dropdown .stack.compact .row {
  padding: 8px 10px;
}

.workspace {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
}
.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  overflow: visible;
}
.view-switcher {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.view-switch-item {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.view-switch-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.filter-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  margin-left: auto;
  flex: 0 1 auto;
  overflow: visible;
  isolation: isolate;
}
.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 168px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}
.filter-toggle-label {
  font-weight: 600;
  letter-spacing: 0;
}
.filter-toggle-meta {
  color: var(--muted);
  font-size: 0.76rem;
}
.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.searchbar > * {
  flex: 1 1 180px;
}
.searchbar .button {
  flex: 0 0 auto;
  gap: 10px;
}
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filters-sheet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  padding: 22px;
}
.filters-sheet input,
.filters-sheet select {
  width: 100%;
}
.filters-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.filters-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filters-sheet-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filters-sheet-title h3 {
  margin: 0;
  font-size: 0.94rem;
}
.filters-sheet-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 54ch;
}
.filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 220px;
  min-width: 190px;
}
.filter-field-wide {
  flex: 1 1 100%;
}
.filter-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.filters-dialog {
  width: min(1120px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.filters-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
}
.filters-dialog .filters-sheet {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
}
.searchbar input, .searchbar select, .form input, .form textarea, .subtask input, .subtask textarea, .subtask select, .subtask-create input, .subtask-create textarea, .comment-create textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text);
}
.form select,
.modal select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ffffff, #f9fbff),
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    0 0,
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: auto, 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.form select[multiple],
.modal select[multiple] {
  min-height: 168px;
  padding: 8px;
  background-image: none;
}
.form select:focus,
.modal select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.filter-field select,
.filter-field input[type="search"],
.filter-field input[type="date"] {
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.filter-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    calc(100% - 2.5rem) 50%;
  background-size: 6px 6px, 6px 6px, 1px 1.5rem;
  background-repeat: no-repeat;
}
.filter-field select:focus,
.filter-field input[type="search"]:focus,
.filter-field input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.filter-field select:hover,
.filter-field input[type="search"]:hover,
.filter-field input[type="date"]:hover {
  border-color: #cbd5e1;
}

.kpis,
.overview-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.kpi {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, #fff, #fafcff);
  flex: 1 1 120px;
}
.kpi span { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
.kpi strong { font-size: 1.2rem; }
.dashboard-overview {
  padding: 0 20px 20px;
}
.overview-panel {
  gap: 12px;
}

.visual-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.chart-panel {
  min-width: 0;
  flex: 1 1 300px;
}
.chart-panel-hero {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.insight-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.insight-kpi {
  flex: 1 1 150px;
  min-width: 150px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.insight-kpi span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.insight-kpi strong {
  font-size: 1.55rem;
  line-height: 1;
}
.insight-kpi small {
  color: var(--muted);
  font-size: 0.76rem;
}
.status-stack,
.bucket-chart,
.project-progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-stack-row,
.bucket-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.status-stack-meta,
.bucket-head,
.project-progress-head,
.project-progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status-stack-meta > div,
.bucket-head > div,
.project-progress-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.status-stack-meta strong,
.bucket-head strong,
.project-progress-head strong {
  font-size: 0.86rem;
}
.status-stack-meta small,
.bucket-head small,
.project-progress-head small {
  color: var(--muted);
  font-size: 0.74rem;
}
.status-track,
.bucket-track {
  height: 10px;
  border-radius: 999px;
  background: #e5ecf7;
  overflow: hidden;
}
.status-fill,
.bucket-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease;
}
.status-value {
  font-size: 0.76rem;
  color: var(--muted);
}
.project-progress-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-link {
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.project-link:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}
.project-progress-foot span {
  color: var(--muted);
  font-size: 0.76rem;
}
.chart-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.chart-hero > *:first-child {
  flex: 0 0 140px;
}
.chart-hero > *:last-child {
  flex: 1 1 220px;
}
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.donut-chart {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}
.donut-chart circle {
  fill: none;
  stroke-width: 16;
  stroke: #e2e8f0;
}
.donut-chart-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 0 289;
}
.chart-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chart-hero-copy strong {
  font-size: 1.55rem;
  line-height: 1;
}
.chart-hero-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}
.user-workspace {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.user-header-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.user-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 1rem;
}
.user-stat-value {
  font-size: 1.7rem;
  line-height: 1;
}
.user-stats-grid .panel {
  gap: 6px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--panel);
}
.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.legend-item span:last-of-type {
  color: var(--muted);
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}
.bar-meta span {
  color: var(--text);
}
.bar-meta strong {
  color: var(--muted);
}
.bar-track {
  height: 9px;
  border-radius: 999px;
  background: #e5ecf7;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.dashboard-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.section-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
  padding-bottom: 28px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.overview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.overview-grid > .panel {
  flex: 1 1 calc(50% - 7px);
  min-width: 0;
}
.dashboard-panels-three > .panel {
  flex: 1 1 300px;
}
.dashboard-visuals {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
  padding-top: 10px;
}
.dashboard-visuals > .panel {
  flex: 1 1 calc(50% - 7px);
  min-width: 0;
}
.project-health-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.project-health-grid > .panel {
  flex: 1 1 calc(50% - 7px);
  min-width: 0;
}
.project-context-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 0 20px 20px;
}
.project-context-team {
  flex: 1 1 calc(50% - 7px);
  min-width: 0;
}
.project-context-queue,
.project-context-activity {
  flex: 1 1 calc(25% - 10.5px);
  min-width: 0;
}
.project-insight-grid {
  margin-top: 2px;
}
.compact-bucket-chart {
  margin-top: 2px;
}
.section-wide {
  margin: 0 20px 20px;
}
.column {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  flex: 1 1 220px;
}
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, white, #fbfdff);
}
.card strong { font-size: 0.92rem; }
.card strong { font-size: 0.86rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.76rem; }
.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-flex;
  flex-shrink: 0;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
}
.avatar-stack {
  display: inline-flex;
}
.avatar-stack .avatar + .avatar {
  margin-left: -6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-red { background: #fee2e2; color: #b91c1c; border-color: transparent; }
.subtle { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.progress {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 260ms ease;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl th, .tbl td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}
.tbl th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.tbl tr:hover td {
  background: rgba(79, 70, 229, 0.03);
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
}
.timeline-board {
  gap: 12px;
}
.timeline-axis {
  position: relative;
  height: 24px;
  margin: 0 2px;
}
.timeline-axis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.timeline-track-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-lane {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fafcff);
}
.timeline-lane-copy {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 10px 4px;
}
.timeline-lane-copy strong {
  font-size: 0.9rem;
}
.timeline-lane-copy span:last-of-type {
  color: var(--muted);
  font-size: 0.75rem;
}
.timeline-track {
  position: relative;
  flex: 1 1 auto;
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.04), rgba(148, 163, 184, 0.08));
  background-size: 14.285% 100%, 100% 100%;
  overflow: hidden;
}
.timeline-track-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.timeline-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.18);
}
.timeline-bar {
  position: absolute;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.timeline-bar:hover {
  filter: brightness(1.03);
}
.timeline-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.timeline-bar-meta strong {
  font-size: 0.76rem;
  line-height: 1.15;
}
.timeline-bar-meta small {
  font-size: 0.64rem;
  opacity: 0.9;
}
.timeline-bar-progress {
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calendar-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calendar-head-row,
.calendar-week {
  display: flex;
  gap: 10px;
}
.calendar-head-row {
  padding: 0 2px;
}
.calendar-head {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1 1 0;
  text-align: center;
}
.calendar-cell {
  min-height: 132px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: start;
  flex: 1 1 0;
  min-width: 0;
}
.calendar-cell.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft) inset;
}
.calendar-cell.empty {
  background: transparent;
  border-style: dashed;
}
.calendar-day {
  font-size: 0.76rem;
  font-weight: 700;
}
.calendar-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calendar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1.2;
}
.calendar-item:hover {
  background: #dde4ff;
}
.calendar-item strong {
  font-size: 0.8rem;
}
.calendar-item span {
  color: var(--muted);
  font-size: 0.7rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.modal {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 16px;
}
.modal-wide {
  width: min(1240px, 100%);
}
.modal-body {
  display: flex;
  gap: 14px;
}
.modal-body-split {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
}
.modal-body-stack {
  display: flex;
  align-items: stretch;
}
.modal-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 540px;
}
.modal-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 18px;
  flex: 0 1 300px;
}
.summary-panel {
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-list div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
}
.summary-list span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}
.summary-list strong {
  font-size: 0.86rem;
}
.avatar-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.avatar-group .avatar {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
}
.form, .subtasks, .comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.form {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.form-note {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}
.form-section-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.form-section-head strong {
  font-size: 0.8rem;
}
.form-section-head span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}
.form-advanced {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
}
.form-advanced > summary {
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}
.form-advanced > summary::-webkit-details-marker {
  display: none;
}
.form-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.modal-actions .button {
  min-width: 118px;
}
.two-cols { display: flex; flex-wrap: wrap; gap: 10px; }
.two-cols > * { flex: 1 1 220px; }
.modal-main .form input,
.modal-main .form textarea,
.modal-main .form select,
.subtask input,
.subtask textarea,
.subtask select,
.subtask-create input,
.subtask-create textarea,
.comment-create textarea {
  width: 100%;
}
.modal-side .summary-panel {
  border-radius: 16px;
}
.settings-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}
.settings-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.settings-page-head h1 {
  margin: 2px 0 6px;
  font-size: 1.45rem;
  line-height: 1.1;
}
.settings-page-head p {
  margin: 0;
  max-width: 68ch;
}
.settings-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-page-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.settings-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
}
.settings-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.settings-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
}
.settings-section > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}
.settings-section > summary::-webkit-details-marker {
  display: none;
}
.settings-section-body {
  margin-top: 12px;
}
.people-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.people-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.people-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.people-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  flex: 1 1 220px;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}
.people-option input {
  width: auto !important;
  margin: 0;
  accent-color: var(--accent);
}
.people-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.people-option-copy strong {
  font-size: 0.86rem;
}
.people-option-copy span {
  color: var(--muted);
  font-size: 0.74rem;
}
.subtask, .subtask-create { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.subtask h4, .comment strong { margin: 0; }
.subtask textarea, .subtask-create textarea, .comment-create textarea { resize: vertical; }
.comment { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.checkbox-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.checkbox-inline input {
  width: auto !important;
}
.user-admin {
  gap: 14px;
}
.user-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-admin-create,
.user-admin-row {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-admin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.user-admin-grid > label {
  flex: 1 1 180px;
  min-width: 160px;
}
.user-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.user-admin-meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.user-admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}
.comment p { margin: 0; color: var(--text); }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-head-actions .button {
  min-width: 96px;
}

@media (max-width: 1200px) {
  .app-shell { flex-direction: column; }
  .sidebar { flex: 0 0 auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .grid { flex-direction: column; }
  .visual-grid { flex-direction: column; }
  .overview-grid { flex-direction: column; }
  .dashboard-panels { flex-direction: column; }
  .kpis { flex-direction: column; }
  .modal-body-split { flex-direction: column; }
  .modal-side { position: static; }
  .timeline-lane { flex-direction: column; }
  .timeline-lane-copy { flex: 0 0 auto; padding-right: 0; }
}

@media (max-width: 720px) {
  .searchbar, .two-cols, .grid, .kpis, .overview-grid, .dashboard-panels, .visual-grid, .timeline { flex-direction: column; }
  .chart-hero { flex-direction: column; justify-content: center; text-align: center; }
  .donut-chart { width: 120px; height: 120px; }
  .modal { padding: 14px; }
  .people-option { min-width: 100%; }
  .modal-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .timeline-axis {
    display: none;
  }
  .timeline-track {
    min-height: 120px;
  }
  .timeline-bar {
    position: relative;
    left: auto !important;
    width: auto !important;
    top: auto !important;
    margin: 8px 8px 0;
  }
}
