:root {
  --font-sans: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --color-bg: #f4f7fb;
  --color-bg-deep: #eaf0f8;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-surface-raised: #ffffff;
  --color-overlay: rgba(15, 23, 42, 0.42);

  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-border-focus: #2563eb;

  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-900: #1e3a8a;
  --color-primary: var(--color-primary-600);
  --color-primary-hover: var(--color-primary-700);

  --color-success-50: #ecfdf5;
  --color-success-100: #dcfce7;
  --color-success-600: #16a34a;
  --color-success-700: #15803d;

  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;

  --color-danger-50: #fef2f2;
  --color-danger-100: #fee2e2;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;

  --color-status-done: #22c55e;
  --color-status-done-soft: #dcfce7;
  --color-status-progress: #3b82f6;
  --color-status-progress-soft: #dbeafe;
  --color-status-blocked: #ef4444;
  --color-status-blocked-soft: #fee2e2;
  --color-status-planned: #94a3b8;
  --color-status-planned-soft: #f1f5f9;

  --color-priority-critical: #dc2626;
  --color-priority-high: #ea580c;
  --color-priority-medium: #d97706;
  --color-priority-low: #64748b;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.18);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;

  --leading-tight: 1.2;
  --leading-normal: 1.45;
  --leading-relaxed: 1.6;

  --header-height: 64px;
  --control-height: 36px;
  --control-height-sm: 30px;
  --control-height-lg: 42px;
  --content-max-width: 1600px;
  --page-padding: 24px;
  --page-padding-wide: 32px;

  --gantt-label-width: 420px;
  --gantt-row-height: 42px;
  --gantt-header-height: 56px;

  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

@media (min-width: 1920px) {
  :root {
    --page-padding: 32px;
    --content-max-width: 1800px;
  }
}



* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  min-width: 1024px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.demo-switcher {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.demo-switcher button {
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  padding: 7px 12px;
  font-size: var(--text-sm);
}

.demo-switcher button.active {
  background: var(--color-primary);
  color: #fff;
}

body.shot .demo-switcher {
  display: none;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: var(--text-3xl);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 46% 54%;
  background: var(--color-bg);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  color: #fff;
  background:
    radial-gradient(circle at 75% 20%, rgba(96, 165, 250, 0.38), transparent 34%),
    radial-gradient(circle at 20% 90%, rgba(45, 212, 191, 0.18), transparent 30%),
    linear-gradient(145deg, #0f172a 0%, #142a54 52%, #1e3a8a 100%);
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 84%);
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.auth-brand-copy h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.auth-brand-copy p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.auth-points {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  max-width: 480px;
}

.auth-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-md);
}

.auth-point .icon {
  color: #86efac;
  margin-top: 2px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.auth-card {
  width: min(440px, 100%);
}

.auth-card h2 {
  margin: 0;
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
}

.auth-card .muted {
  margin: 8px 0 28px;
  color: var(--color-text-muted);
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--color-text-secondary);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 7px 11px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #94a3b8;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: var(--focus-ring);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

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

.field-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-hint {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.checkbox-line {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.checkbox-line input {
  margin-top: 2px;
  accent-color: var(--color-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--control-height);
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 650;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-surface-muted);
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.btn-ghost {
  color: var(--color-text-muted);
}

.btn-danger {
  background: var(--color-danger-600);
  border-color: var(--color-danger-600);
  color: #fff;
}

.btn-sm {
  min-height: var(--control-height-sm);
  padding: 5px 9px;
  font-size: var(--text-xs);
}

.btn-lg {
  min-height: var(--control-height-lg);
  padding: 9px 18px;
  font-size: var(--text-md);
}

.btn-icon {
  width: var(--control-height);
  padding: 0;
}

.btn-block {
  width: 100%;
}

.auth-submit {
  margin-top: 2px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: var(--text-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--color-border);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 var(--page-padding-wide);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--color-text);
  white-space: nowrap;
}

.app-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1d4ed8, #0f172a);
  border-color: transparent;
  color: #fff;
}

.app-brand .brand-mark svg {
  width: 21px;
  height: 21px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.app-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.app-nav a:hover {
  color: var(--color-text);
}

.app-nav a.active {
  color: var(--color-text);
}

.app-nav a.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
}

.app-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.header-icon:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.notice-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-danger-500);
  border: 2px solid #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e0e7ff;
  color: #3730a3;
  font-size: var(--text-xs);
  font-weight: 800;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.page {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 26px var(--page-padding-wide) 40px;
}

.page.has-drawer {
  padding-right: calc(var(--page-padding-wide) + 360px);
}

@media (min-width: 1800px) {
  .page.has-drawer {
    padding-right: var(--page-padding-wide);
  }
}

.breadcrumbs {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.breadcrumbs .sep {
  color: var(--color-text-subtle);
}

.breadcrumbs strong {
  color: var(--color-text-secondary);
  font-weight: 650;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 18px;
}

.tab {
  position: relative;
  padding: 10px 13px 12px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 650;
  background: transparent;
  border: 0;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
}

.tab .count {
  margin-left: 7px;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

.toolbar-search {
  position: relative;
  width: 280px;
}

.toolbar-search .icon {
  position: absolute;
  left: 10px;
  top: 9px;
  width: 16px;
  height: 16px;
  color: var(--color-text-subtle);
}

.toolbar-search .input {
  padding-left: 33px;
}

.toolbar-spacer {
  flex: 1;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #fbfdff;
}

.table .name-cell {
  font-weight: 650;
  color: var(--color-text);
}

.table .muted {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.table .actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--color-primary-50);
  color: var(--color-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 650;
  white-space: nowrap;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.badge-primary {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.badge-success {
  background: var(--color-success-100);
  color: var(--color-success-700);
}

.badge-warning {
  background: var(--color-warning-100);
  color: var(--color-warning-700);
}

.badge-danger {
  background: var(--color-danger-100);
  color: var(--color-danger-700);
}

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.pager {
  display: flex;
  gap: 4px;
}

.pager button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.pager button.active {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.gantt-page {
  max-width: none;
  padding: 18px var(--page-padding-wide) 24px;
}

.gantt-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.gantt-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gantt-title {
  margin: 0;
  font-size: var(--text-2xl);
  letter-spacing: -0.025em;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-success-700);
  font-size: var(--text-xs);
  font-weight: 650;
}

.sync-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success-500);
  box-shadow: 0 0 0 3px #dcfce7;
}

.gantt-toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page.has-drawer .gantt-toolbar {
  gap: 4px;
  padding: 7px;
}

.page.has-drawer .gantt-toolbar .divider {
  margin: 0 1px;
}

.page.has-drawer .gantt-chip {
  gap: 5px;
  padding-right: 6px;
  padding-left: 6px;
}

.gantt-toolbar .divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 3px;
}

.gantt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
}

.gantt-chip.active {
  border-color: var(--color-primary-200);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.gantt-frame {
  display: grid;
  grid-template-columns: var(--gantt-label-width) minmax(0, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.gantt-labels {
  border-right: 1px solid var(--color-border);
  min-width: 0;
}

.gantt-label-head {
  height: var(--gantt-header-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gantt-row-label {
  height: var(--gantt-row-height);
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: var(--text-sm);
}

.gantt-row-label.direction {
  background: #fbfcfe;
}

.gantt-row-label.task {
  padding-left: 25px;
}

.gantt-row-label.subtask {
  padding-left: 45px;
  color: var(--color-text-secondary);
}

.gantt-row-label .caret {
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: var(--color-text-subtle);
  padding: 0;
}

.gantt-row-label .label-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.gantt-row-label.direction .label-name {
  font-weight: 750;
}

.gantt-row-label .label-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gantt-timeline {
  overflow: hidden;
  min-width: 0;
}

.gantt-time-head {
  height: var(--gantt-header-height);
  position: relative;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.gantt-month {
  position: absolute;
  top: 0;
  height: 27px;
  border-left: 1px solid var(--color-border);
  padding: 6px 8px;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.gantt-week {
  position: absolute;
  top: 27px;
  height: 29px;
  border-left: 1px solid #eef2f7;
  padding: 7px 7px;
  color: var(--color-text-subtle);
  font-size: 9px;
  font-weight: 650;
}

.gantt-canvas {
  position: relative;
  height: calc(var(--gantt-row-height) * 9);
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.65) 1px, transparent 1px);
  background-size: 7.1428% 100%, 100% var(--gantt-row-height);
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 47%;
  width: 1px;
  background: #ef4444;
  z-index: 5;
}

.gantt-today::before {
  content: "Сегодня";
  position: absolute;
  top: 5px;
  left: 5px;
  color: #dc2626;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.gantt-bar {
  position: absolute;
  height: 20px;
  top: calc(var(--gantt-row-height) * var(--row) + 11px);
  left: var(--left);
  width: var(--width);
  border-radius: 6px;
  background: var(--color-status-progress-soft);
  border: 1px solid #93c5fd;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.05);
  z-index: 2;
}

.gantt-bar .fill {
  height: 100%;
  width: var(--pct);
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.gantt-bar.done {
  background: var(--color-status-done-soft);
  border-color: #86efac;
}

.gantt-bar.done .fill {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

.gantt-bar.blocked {
  background: var(--color-status-blocked-soft);
  border-color: #fca5a5;
}

.gantt-bar.blocked .fill {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.gantt-bar.planned {
  background: var(--color-status-planned-soft);
  border-color: #cbd5e1;
}

.gantt-bar.planned .fill {
  background: #cbd5e1;
}

.gantt-bar.critical {
  outline: 1.5px solid #0f172a;
  outline-offset: 1px;
}

.gantt-bar-label {
  position: absolute;
  left: 7px;
  top: 2px;
  color: #1e3a8a;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 3;
}

.gantt-dependency {
  position: absolute;
  height: 1px;
  background: #94a3b8;
  z-index: 1;
  transform-origin: left center;
}

.gantt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border-strong);
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.10);
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--color-border);
}

.drawer-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  letter-spacing: -0.015em;
}

.drawer-head p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.drawer-body {
  padding: 16px 18px;
  overflow: auto;
}

.comment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.comment:last-child {
  border-bottom: 0;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-name {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 700;
}

.comment-time {
  color: var(--color-text-subtle);
  font-size: 10px;
}

.comment-text {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.comment-actions {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  color: var(--color-text-muted);
  font-size: 10px;
}

.composer {
  border-top: 1px solid var(--color-border);
  padding: 13px 18px 18px;
  background: var(--color-surface-muted);
}

.composer .textarea {
  min-height: 74px;
  background: #fff;
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.composer-hint {
  color: var(--color-text-subtle);
  font-size: 10px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

.filter-bar .input,
.filter-bar .select {
  width: auto;
  min-width: 150px;
  min-height: 32px;
  font-size: var(--text-sm);
}

.audit-table .table {
  table-layout: fixed;
}

.audit-table .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-table .action-name {
  font-weight: 650;
}

.audit-table .action-code {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
}

.detail-drawer {
  width: 440px;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  font-size: var(--text-sm);
}

.detail-row dt {
  color: var(--color-text-muted);
}

.detail-row dd {
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.code-block {
  margin: 8px 0 0;
  padding: 10px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #dbeafe;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  overflow: auto;
}

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-nav {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.settings-nav a {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.settings-nav a.active {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.settings-panel {
  padding: 20px;
}

.settings-panel h2 {
  margin: 0 0 4px;
  font-size: var(--text-xl);
}

.settings-panel > p {
  margin: 0 0 20px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.settings-grid {
  display: grid;
  gap: 15px;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-label {
  font-weight: 650;
  color: var(--color-text);
}

.setting-desc {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.toggle {
  width: 39px;
  height: 23px;
  position: relative;
  border: 0;
  border-radius: var(--radius-pill);
  background: #cbd5e1;
}

.toggle::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.toggle.on {
  background: var(--color-primary);
}

.toggle.on::after {
  left: 19px;
}

.modal-preview {
  width: 680px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 22px 14px;
  border-bottom: 1px solid var(--color-border);
}

.modal-head h3 {
  margin: 0;
  font-size: var(--text-xl);
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.modal-body {
  padding: 18px 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.kit-panel {
  padding: 18px;
}

.kit-panel h3 {
  margin: 0 0 14px;
  font-size: var(--text-lg);
}

.kit-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.swatch {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.swatch-label {
  color: var(--color-text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
}

.kit-note {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}

@media (max-width: 1279px) {
  .app-header {
    gap: 16px;
  }

  .app-nav a {
    padding: 0 8px;
  }

  .page-head {
    gap: 14px;
  }

  .gantt-frame {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .gantt-drawer {
    width: 330px;
  }
}
