:root {
  color-scheme: light;
  --ink: #202725;
  --muted: #727b76;
  --line: #e3e8e3;
  --canvas: #f5f7f4;
  --paper: #ffffff;
  --sidebar: #202a27;
  --sidebar-ink: #d7dfda;
  --accent: #bd5b2d;
  --accent-hover: #a84e26;
  --accent-soft: #fbede6;
  --green: #34755d;
  --green-soft: #eaf3ee;
  --shadow: 0 8px 24px rgb(32 39 37 / 4%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7ece8;
  --muted: #a0aaa3;
  --line: #343d38;
  --canvas: #171d1a;
  --paper: #202824;
  --sidebar: #111815;
  --sidebar-ink: #d7dfda;
  --accent: #ed956c;
  --accent-hover: #f0a580;
  --accent-soft: #3c2921;
  --green: #82b79a;
  --green-soft: #263a30;
  --shadow: 0 8px 24px rgb(0 0 0 / 16%);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.5 "IBM Plex Sans", "Segoe UI", sans-serif; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 8px 12px; transform: translateY(-150%); background: var(--paper); color: var(--ink); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 248px; flex-direction: column; padding: 25px 16px 18px; background: var(--sidebar); color: var(--sidebar-ink); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 32px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 0; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; }
.brand-light { color: #bfcac3; font-weight: 400; }
.sidebar-label, .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.sidebar-label { padding: 0 11px 10px; color: #829089; }
.main-nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; border-radius: 6px; color: #bac5be; font-size: 13px; }
.nav-link i { width: 17px; font-size: 15px; }
.nav-link:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.nav-link.is-active { background: rgb(255 255 255 / 10%); color: #fff; font-weight: 600; }
.nav-link.is-active i { color: #ed956c; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 15px 10px 0; border-top: 1px solid rgb(255 255 255 / 12%); color: #9eaaa2; font-size: 11px; }
.environment-dot { width: 7px; height: 7px; border-radius: 50%; background: #83bd9a; }
.workspace { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: var(--paper); }
.breadcrumb, .topbar-actions, .account-indicator { display: flex; align-items: center; }
.breadcrumb { gap: 11px; color: var(--muted); font-size: 12px; }
.breadcrumb i { font-size: 9px; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { gap: 17px; }
.logout-form { margin: 0; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--muted); cursor: pointer; }
.icon-button:hover { color: var(--accent); }
.topbar-divider { width: 1px; height: 24px; background: var(--line); }
.account-indicator { gap: 9px; color: var(--muted); font-size: 12px; }
.avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.main-content { width: min(1440px, 100%); margin: 0 auto; padding: 34px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 7px; color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: 27px; line-height: 1.2; font-weight: 650; letter-spacing: 0; }
.page-description { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; font-weight: 600; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--paper); color: var(--ink); }
.button:disabled { cursor: not-allowed; opacity: .58; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.metric-panel, .overview-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.metric-panel { display: grid; min-height: 132px; align-content: space-between; padding: 16px 17px; }
.metric-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-topline i { color: var(--green); font-size: 15px; }
.metric-value { font-size: 28px; line-height: 1; font-weight: 650; }
.metric-value small { margin-left: 2px; font-size: 14px; }
.metric-note { color: var(--muted); font-size: 10px; }
.overview-panel { min-height: 310px; padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: 0; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.text-link { color: var(--green); font-size: 11px; font-weight: 600; }
.text-link i { margin-left: 4px; }
.empty-state { display: grid; justify-items: center; padding: 38px 16px 29px; text-align: center; }
.empty-mark { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 50%; background: var(--canvas); color: var(--accent); font-size: 19px; }
.empty-state h3 { margin-bottom: 5px; font-size: 14px; font-weight: 650; }
.empty-state p { max-width: 460px; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.data-panel, .form-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.data-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--canvas); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--canvas) 62%, transparent); }
.table-primary-link, .table-primary-text { display: block; color: var(--ink); font-weight: 650; }
.table-primary-link:hover { color: var(--green); }
.table-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.date-separator { padding: 0 5px; color: var(--muted); }
.status-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.status-label::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-active { background: var(--green-soft); color: var(--green); }
.status-muted { background: var(--canvas); color: var(--muted); }
.status-label.status-muted::before { background: var(--muted); }
.form-panel { max-width: 920px; padding: 24px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.field { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea, .inline-create-form input, .inline-create-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; }
.field textarea { min-height: 108px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-create-form input:focus, .inline-create-form select:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgb(52 117 93 / 12%); }
.field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.detail-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.detail-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; }
.detail-panel > strong { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; font-weight: 650; }
.detail-description { margin-bottom: 14px; }
.detail-description p { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; }
.project-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-section-grid .data-panel { padding: 18px; }
.count-label { display: grid; min-width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--canvas); color: var(--muted); font-size: 11px; }
.section-empty { margin: 20px 0; color: var(--muted); font-size: 12px; }
.phase-list, .member-list { display: grid; }
.phase-row, .member-row { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.phase-marker { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid var(--green); border-radius: 50%; }
.phase-marker.is-milestone { border-radius: 2px; border-color: var(--accent); background: var(--accent); transform: rotate(45deg); }
.phase-content, .member-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.phase-content strong, .member-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.phase-content span, .member-copy span { color: var(--muted); font-size: 10px; }
.member-row .avatar { flex: 0 0 auto; }
.member-row form { margin: 0; }
.inline-create-form { display: grid; grid-template-columns: minmax(120px, 1.5fr) minmax(110px, 1fr) minmax(110px, 1fr) auto auto; align-items: center; gap: 7px; padding-top: 14px; }
.inline-create-form .button { min-height: 38px; }
.milestone-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.milestone-toggle input { width: auto; min-height: 0; accent-color: var(--accent); }
.member-add-form { grid-template-columns: minmax(120px, 1fr) minmax(110px, .8fr) auto; }
.project-danger-zone { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.project-danger-zone form { margin: 0; }
.project-danger-zone span { color: var(--muted); font-size: 10px; }
.button-danger { border-color: #c68d7e; background: var(--paper); color: #963e2b; }
.button-danger:hover { background: #fff1ec; }
.topbar-actions .logout-form { display: flex; }

@media (max-width: 1000px) {
  .sidebar { width: 205px; }
  .workspace { margin-left: 205px; }
  .main-content { padding: 26px 22px; }
  .topbar { padding: 0 22px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-create-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .sidebar { position: static; width: auto; padding: 12px 15px; }
  .brand { padding: 0 2px 11px; }
  .sidebar-label, .sidebar-footer { display: none; }
  .main-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
  .nav-link { min-width: max-content; min-height: 36px; padding: 0 9px; font-size: 11px; }
  .nav-link i { width: auto; }
  .workspace { margin-left: 0; }
  .topbar { height: 52px; padding: 0 15px; }
  .breadcrumb { gap: 7px; font-size: 10px; }
  .account-label, .topbar-divider { display: none; }
  .topbar-actions { gap: 9px; }
  .main-content { padding: 25px 15px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  h1 { font-size: 24px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { gap: 9px; }
  .metric-panel { min-height: 122px; padding: 13px; }
  .metric-topline { font-size: 10px; }
  .metric-value { font-size: 25px; }
  .metric-note { font-size: 9px; }
  .overview-panel { min-height: 290px; padding: 16px 14px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .field-grid, .project-section-grid { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .form-panel { padding: 17px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .detail-panel { padding: 12px; }
  .inline-create-form, .member-add-form { grid-template-columns: minmax(0, 1fr); }
  .project-danger-zone { align-items: flex-start; flex-direction: column; }
}