:root {
  --side-panel-width: 380px;
  --nav-bg: #050b16;
  --nav-bg-strong: #0b1526;
  --nav-text: rgba(255, 255, 255, 0.84);
  --nav-text-strong: #ffffff;
  --nav-border: rgba(255, 255, 255, 0.1);
  --page-bg: #f2f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #eef3f8;
  --surface-border: #dfe7f0;
  --text: #111c2f;
  --muted: #68758a;
  --accent-red: #ff3347;
  --accent-orange: #ff8c4d;
  --accent-blue: #37a6e6;
  --accent-violet: #7267f0;
  --shadow-soft: 0 1px 3px rgba(16, 27, 45, 0.07);
  --shadow-card: 0 8px 24px rgba(16, 27, 45, 0.08);
  --status-todo-bg: #eef2f7;
  --status-todo-text: #667387;
  --status-progress-bg: #e2f3ff;
  --status-progress-text: #15608d;
  --status-review-bg: #fff1da;
  --status-review-text: #975f06;
  --status-done-bg: #dff8ec;
  --status-done-text: #1b7a55;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  overflow-x: hidden;
}

.frame-selector-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(55, 166, 230, 0.08), transparent 30%),
    linear-gradient(180deg, #eef4fb, #f7faff);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow: hidden;
}

.left-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(5, 11, 22, 0.88), rgba(11, 21, 38, 0.94)),
    url("./assets/background.png");
  background-size: cover;
  background-position: center;
  box-shadow: 2px 0 14px rgba(0, 0, 0, 0.18);
}

.logo-section {
  padding: 20px 18px;
  border-bottom: 1px solid var(--nav-border);
}

.brand-mark {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 82px;
  height: auto;
  object-fit: contain;
}

.footer-label,
.table-header,
.board-summary,
.meta-label,
.section-label,
.artifact-meta,
.breadcrumb-link {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-items {
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  width: 100%;
  padding: 11px 18px;
  border: none;
  background: transparent;
  color: var(--nav-text);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: 0.22s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nav-text-strong);
}

.nav-item.active-accent {
  background: linear-gradient(90deg, rgba(255, 51, 71, 0.16), rgba(255, 140, 77, 0.08));
  color: var(--nav-text-strong);
  border-left-color: var(--accent-red);
}

.nav-divider {
  margin: 10px 18px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-section-heading {
  padding: 0 18px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.54);
}

.nav-subitem {
  padding-left: 34px;
  font-size: 14px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-footer {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--nav-border);
  color: rgba(255, 255, 255, 0.8);
}

.footer-label {
  font-size: 10px;
  margin-bottom: 10px;
  opacity: 0.72;
}

.footer-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.footer-stat:last-child {
  border-bottom: none;
}

.footer-stat strong {
  color: #fff;
  font-size: 18px;
}

.main-content {
  flex: 1;
  width: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(55, 166, 230, 0.08), transparent 28%),
    linear-gradient(135deg, #ffffff, #f8fbff);
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange), transparent);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left {
  flex: 1;
  min-width: 0;
}

.detail-header-left {
  gap: 18px;
}

.detail-heading {
  min-width: 0;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.page-eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.breadcrumb-link {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  pointer-events: none;
}

.search-input,
.chat-input {
  width: 100%;
  border: 1.5px solid var(--surface-border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  transition: 0.22s ease;
}

.search-input {
  padding: 10px 14px 10px 38px;
}

.search-input:focus,
.chat-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 140, 77, 0.12);
}

.view-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.22s ease;
}

.view-toggle-btn:hover {
  background: rgba(255, 89, 79, 0.08);
  color: var(--accent-red);
}

.view-toggle-btn.active {
  background: #fff;
  color: var(--accent-red);
  box-shadow: var(--shadow-soft);
}

.view-icon,
.btn-icon {
  width: 16px;
  height: 16px;
}

.primary-btn,
.open-full-task-btn,
.send-btn {
  border: none;
  cursor: pointer;
  transition: 0.22s ease;
}

.panel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 140, 77, 0.22);
  background: rgba(255, 140, 77, 0.1);
  color: #b04f24;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.22s ease;
}

.panel-action-btn.subtle {
  border-color: var(--surface-border);
  background: #fff;
  color: var(--text);
}

.panel-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.22s ease;
}

.secondary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.secondary-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.primary-btn,
.open-full-task-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  box-shadow: 0 8px 18px rgba(255, 104, 72, 0.22);
}

.primary-btn:hover,
.open-full-task-btn:hover,
.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.flash-banner {
  margin: 10px 20px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 140, 77, 0.1);
  border: 1px solid rgba(255, 140, 77, 0.18);
  font-size: 14px;
  font-weight: 600;
}

.content-area {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 20px;
}

.content-wrapper {
  width: 100%;
  min-width: 0;
}

.frame-selector-shell {
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.frame-selector-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.selector-logo {
  width: 88px;
  height: auto;
}

.selector-title {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 0.98;
  font-weight: 900;
}

.selector-copy,
.selector-card-copy {
  max-width: 860px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

.selector-create-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

.selector-card-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.selector-grid {
  gap: 18px;
}

.home-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96));
  box-shadow: var(--shadow-soft);
}

.home-intro-copy {
  max-width: 760px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.home-create-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.frame-name-input,
.frame-card-name-input {
  width: 100%;
  border: 1.5px solid var(--surface-border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  transition: 0.22s ease;
}

.frame-name-input {
  min-width: 240px;
  padding: 11px 14px;
}

.frame-card-name-input {
  padding: 10px 12px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.frame-name-input:focus,
.frame-card-name-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 140, 77, 0.12);
}

.frames-grid {
  display: grid;
  gap: 16px;
}

.frame-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: var(--shadow-soft);
}

.frame-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.frame-card-kind {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.frame-card-kind.historical {
  color: #92520f;
}

.frame-card-kind.fresh {
  color: #2a6bac;
}

.frame-rename-btn {
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.frame-card-copy {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.frame-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.frame-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
}

.frame-stat span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.frame-stat strong {
  font-size: 18px;
}

.frame-team-list {
  display: grid;
  gap: 10px;
}

.frame-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: #fff;
}

.frame-team-name {
  font-size: 15px;
  font-weight: 800;
}

.frame-team-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.frame-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.board-summary,
.detail-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.team-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.team-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: 0.2s ease;
}

.team-tab.active {
  color: var(--text);
  border-color: rgba(255, 140, 77, 0.24);
  box-shadow: var(--shadow-soft);
  background: linear-gradient(180deg, #ffffff, #fff7f2);
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.summary-chip.accent {
  background: rgba(255, 89, 79, 0.08);
  border-color: rgba(255, 140, 77, 0.16);
  color: #bf4d23;
}

.tasks-table,
.kanban-column,
.gantt-view,
.side-panel,
.meta-item,
.output-content,
.subtask-item,
.detail-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.tasks-table {
  border-radius: 16px;
  overflow: hidden;
}

.table-header,
.task-row {
  display: grid;
  grid-template-columns: 100px 150px minmax(360px, 5fr) 82px 78px 120px 104px 34px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
}

.table-header {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--surface-border);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.task-row {
  border-bottom: 1px solid #ecf1f6;
  cursor: pointer;
  transition: 0.2s ease;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 var(--accent-red);
}

.task-id {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-red);
}

.task-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.task-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.task-inline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.heartbeat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.heartbeat-pill.waiting {
  color: #975f06;
  background: #fff5e6;
  border-color: #f4d6a2;
}

.heartbeat-pill.in-progress {
  color: #15608d;
  background: #e7f4ff;
  border-color: #b8dcf5;
}

.heartbeat-pill.done {
  color: #1b7a55;
  background: #e6f8ef;
  border-color: #bfebd5;
}

.heartbeat-pill.cancelled {
  color: #8a3940;
  background: #ffe8ea;
  border-color: #f3c3c7;
}

.heartbeat-pill.failed {
  color: #8b1e2d;
  background: #ffe3e7;
  border-color: #f1b3bf;
}

.heartbeat-pill.review {
  color: #7d5600;
  background: #fff3d4;
  border-color: #f0d28b;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
}

.assignee-avatar.analyst {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
}

.assignee-name {
  font-size: 13px;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.todo {
  background: var(--status-todo-bg);
  color: var(--status-todo-text);
}

.status-badge.waiting {
  background: #fff3d4;
  color: #8a5a00;
}

.status-badge.in-progress {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
}

.status-badge.review {
  background: var(--status-review-bg);
  color: var(--status-review-text);
}

.status-badge.done {
  background: var(--status-done-bg);
  color: var(--status-done-text);
}

.status-badge.cancelled {
  background: #ffe8ea;
  color: #8a3940;
}

.status-badge.failed {
  background: #ffe3e7;
  color: #8b1e2d;
}

.task-chevron {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #97a3b2;
}

.task-row:hover .task-chevron {
  background: rgba(255, 89, 79, 0.08);
  color: var(--accent-red);
}

.chevron-icon {
  width: 16px;
  height: 16px;
}

.kanban-board {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.kanban-board.active,
.gantt-view.active {
  display: grid;
}

.kanban-column {
  border-radius: 16px;
  padding: 14px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9eef5;
}

.kanban-column-title {
  font-size: 14px;
  font-weight: 800;
}

.kanban-count {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.kanban-cards {
  display: grid;
  gap: 10px;
}

.kanban-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: #fff;
  cursor: pointer;
  transition: 0.22s ease;
}

.kanban-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 140, 77, 0.18);
  box-shadow: var(--shadow-card);
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 8px;
}

.kanban-card-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.kanban-card-meta {
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.kanban-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gantt-view {
  display: none;
  gap: 14px;
  border-radius: 18px;
  padding: 16px;
}

.gantt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gantt-title {
  font-size: 20px;
  font-weight: 800;
}

.gantt-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip,
.gantt-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  font-size: 12px;
  font-weight: 700;
  color: #526075;
}

.gantt-shell {
  display: grid;
  gap: 8px;
}

.gantt-top,
.gantt-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.gantt-task-col-header,
.gantt-week {
  padding: 12px 10px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(180deg, var(--surface-soft), #fff);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gantt-weeks,
.gantt-bar-lane {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.gantt-row {
  cursor: pointer;
  transition: 0.2s ease;
}

.gantt-row:hover {
  transform: translateY(-1px);
}

.gantt-task,
.gantt-track {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--surface-border);
  background: #fff;
}

.gantt-task {
  display: grid;
  gap: 6px;
}

.gantt-task-id {
  font-size: 11px;
  color: var(--muted);
}

.gantt-task-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.gantt-task-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.gantt-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gantt-track {
  background:
    linear-gradient(90deg, rgba(223, 231, 240, 0.7) 1px, transparent 1px),
    linear-gradient(180deg, rgba(246, 249, 253, 0.6), rgba(255, 255, 255, 0.96));
  background-size: calc(100% / 8) 100%;
}

.gantt-bar-lane {
  align-items: center;
  height: 100%;
}

.gantt-bar {
  min-height: 28px;
  margin: 0 5px;
  padding: 0 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 27, 45, 0.12);
}

.gantt-bar.high {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
}

.gantt-bar.medium {
  background: linear-gradient(135deg, var(--accent-blue), #58c0f5);
}

.gantt-bar.low {
  background: linear-gradient(135deg, var(--accent-violet), #8b7dff);
}

.empty-state {
  display: none;
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--surface-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.empty-state.active {
  display: block;
}

.empty-title,
.panel-placeholder-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.empty-description,
.panel-placeholder-copy,
.output-copy,
.artifact-preview,
.detail-copy {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--side-panel-width);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s ease;
  z-index: 200;
  box-shadow: -8px 0 28px rgba(16, 27, 45, 0.12);
}

.side-panel.open {
  transform: translateX(0);
}

.panel-resize-handle {
  position: absolute;
  top: 0;
  left: -6px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}

.panel-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 3px;
  height: 72px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 51, 71, 0.2), rgba(255, 140, 77, 0.55), rgba(255, 51, 71, 0.2));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.side-panel.open .panel-resize-handle::before,
.panel-resize-handle:hover::before {
  opacity: 1;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--surface-border);
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.side-panel-title {
  font-size: 20px;
  font-weight: 800;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-full-task-btn {
  font-size: 13px;
  padding: 9px 14px;
}

.close-panel-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.close-panel-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.side-panel-content {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.panel-stack,
.subtask-list,
.source-list,
.artifact-grid {
  display: grid;
  gap: 14px;
}

.task-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.meta-item,
.output-content,
.subtask-item,
.detail-card {
  border-radius: 14px;
  padding: 14px;
}

.output-shell {
  display: grid;
  gap: 14px;
}

.output-head {
  display: grid;
  gap: 6px;
}

.output-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.output-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.output-subtitle,
.output-footnote {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.output-frame {
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
  overflow: hidden;
}

.pending-doc {
  background: linear-gradient(180deg, #fff9f5, #ffffff);
}

.output-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.output-table-wrap {
  overflow: auto;
}

.output-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.output-table th,
.output-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8eef5;
  vertical-align: top;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}

.output-table th {
  position: sticky;
  top: 0;
  background: #f4f8fc;
  color: #55647a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 1;
}

.output-table td {
  color: var(--text);
}

.output-doc {
  padding: 18px 18px 14px;
}

.output-doc h1,
.output-doc h2,
.output-doc h3 {
  color: var(--text);
  font-weight: 800;
  line-height: 1.3;
}

.output-doc h1 {
  font-size: 22px;
  margin-bottom: 12px;
}

.output-doc h2 {
  font-size: 18px;
  margin: 18px 0 10px;
}

.output-doc h3 {
  font-size: 15px;
  margin: 16px 0 8px;
}

.output-doc p {
  margin-bottom: 10px;
  color: #4f6076;
  font-size: 14px;
  line-height: 1.7;
}

.output-doc ul {
  margin: 0 0 10px 18px;
  color: #4f6076;
}

.output-doc li {
  margin-bottom: 7px;
  line-height: 1.6;
}

.output-code {
  margin: 0;
  padding: 18px;
  background: linear-gradient(180deg, #f7faff, #f2f7fd);
  color: #41516a;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.meta-label,
.section-label,
.artifact-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.meta-value {
  font-size: 14px;
  font-weight: 800;
}

.output-content pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-copy strong {
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.subtask-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.subtask-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 3px;
}

.subtask-item.done .subtask-check {
  background: linear-gradient(135deg, #32b86f, #68d391);
}

.subtask-item.in-progress .subtask-check {
  background: linear-gradient(135deg, var(--accent-blue), #58c0f5);
}

.subtask-item.todo .subtask-check {
  background: #d8e1ec;
}

.subtask-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.subtask-state {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.artifact-card {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--surface-border);
  background: #fff;
}

.artifact-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.artifact-path {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.artifact-preview {
  margin-top: 8px;
  white-space: pre-wrap;
}

.side-panel-chat {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--surface-border);
  background: #fff;
}

.chat-thread {
  display: grid;
  gap: 10px;
  max-height: 208px;
  overflow: auto;
  padding-right: 4px;
}

.chat-message {
  max-width: 92%;
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
}

.chat-message.agent {
  justify-self: start;
  border-top-left-radius: 6px;
  background: linear-gradient(180deg, #f8fbff, #f2f7fd);
}

.chat-message.user {
  justify-self: end;
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 51, 71, 0.1), rgba(255, 140, 77, 0.08));
  border-color: rgba(255, 140, 77, 0.18);
}

.chat-message-role {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-message-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.chat-empty {
  padding: 10px 12px;
  border: 1px dashed var(--surface-border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(247, 250, 255, 0.7);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  min-height: 44px;
  max-height: 120px;
  padding: 11px 13px;
  resize: none;
}

.send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 104, 72, 0.22);
}

.send-btn:disabled {
  background: #e1e8f1;
  color: #95a1b1;
  cursor: not-allowed;
  box-shadow: none;
}

.panel-placeholder {
  padding-top: 12px;
}

.drive-shell {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.drive-table {
  display: grid;
  min-width: 1080px;
  width: max(100%, 1080px);
}

.drive-header,
.drive-row {
  display: grid;
  grid-template-columns: 260px minmax(360px, 1.6fr) 240px 230px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.drive-header {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--surface-border);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drive-row {
  border-bottom: 1px solid #ecf1f6;
}

.drive-row:last-child {
  border-bottom: none;
}

.drive-empty-state {
  padding: 28px 16px 32px;
  font-size: 14px;
  color: var(--muted);
}

.drive-name-cell,
.drive-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drive-agent-cell {
  min-width: 0;
}

.drive-name-meta {
  min-width: 0;
}

.drive-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.drive-kind,
.drive-task {
  font-size: 13px;
  line-height: 1.55;
}

.drive-kind,
.drive-task {
  color: var(--muted);
}

.drive-task {
  word-break: break-word;
}

.drive-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: 0.22s ease;
}

.report-link:hover {
  border-color: rgba(255, 140, 77, 0.24);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 1360px) {
  .table-header,
  .task-row {
    grid-template-columns: 94px 138px minmax(320px, 4.6fr) 74px 74px 108px 100px 30px;
    gap: 10px;
  }

  .gantt-top,
  .gantt-row {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .left-nav {
    width: 200px;
  }

  .kanban-board.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root {
    --side-panel-width: 340px;
  }
}

@media (max-width: 920px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .header-left,
  .header-right,
  .gantt-header,
  .home-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .selector-create-card {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    max-width: none;
  }

  .kanban-board.active {
    grid-template-columns: 1fr;
  }

  .tasks-table {
    overflow-x: auto;
  }

  .table-header,
  .task-row {
    min-width: 1040px;
  }

  .gantt-view {
    overflow-x: auto;
  }

  .gantt-shell {
    min-width: 980px;
  }

  .detail-grid,
  .task-meta-grid {
    grid-template-columns: 1fr;
  }

  .drive-shell {
    overflow-x: auto;
  }

  .drive-header,
  .drive-row {
    min-width: 1080px;
  }

  .frame-stats {
    grid-template-columns: 1fr 1fr;
  }
}

.workforce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.workforce-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: var(--shadow-soft);
}

.workforce-empty-card {
  min-height: 180px;
  align-content: center;
}

.workforce-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.workforce-subtitle,
.workforce-copy {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.workforce-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.workforce-stat {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.workforce-stat strong {
  color: var(--text);
  font-size: 16px;
}

.report-viewer-shell {
  border-radius: 16px;
  overflow: hidden;
}

.report-viewer-content {
  min-height: 420px;
  background: #fff;
}

@media (max-width: 760px) {
  .left-nav {
    display: none;
  }

  .content-area {
    padding: 14px;
  }

  .side-panel {
    width: 100%;
  }

  .panel-resize-handle {
    display: none;
  }

  .chat-thread {
    max-height: 164px;
  }
}
