:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #172033;
  --muted: #68758b;
  --line: #e4e9f1;
  --accent: #1c5cff;
  --accent-soft: #eaf0ff;
  --success: #0f8a5f;
  --success-soft: #e7f7f1;
  --shadow: 0 18px 50px rgba(28, 45, 80, .08);
  --radius: 18px;
}

html[data-theme="dark"] {
  --bg: #0f1420;
  --surface: #171e2d;
  --surface-2: #1c2536;
  --text: #f3f6fb;
  --muted: #a8b3c7;
  --line: #293448;
  --accent: #79a0ff;
  --accent-soft: #202e50;
  --success: #5fd6aa;
  --success-soft: #173a32;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 28px 20px; background: #10182a; color: #fff; }
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg,#5e89ff,#1c5cff); font-size: 21px; font-weight: 800; box-shadow: 0 12px 24px rgba(28,92,255,.35); }
.brand h1 { margin: 2px 0 0; font-size: 18px; }
.eyebrow { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.sidebar .eyebrow { color: #8fa0bd; }
.nav { display: grid; gap: 6px; }
.nav-item { border: 0; border-radius: 12px; padding: 12px 14px; color: #c3ccdc; background: transparent; text-align: left; cursor: pointer; transition: .2s ease; }
.nav-item span,.nav-item small { display:block; }
.nav-item span { font-weight: 750; }
.nav-item small { margin-top: 3px; color: #7e8ca5; font-size: 11px; }
.nav-item:hover { background: #18243a; color:#fff; transform: translateX(2px); }
.nav-item.active { background: linear-gradient(135deg,#1e3155,#1c5cff); color:#fff; box-shadow: 0 10px 24px rgba(28,92,255,.22); }
.nav-item.active small { color:#d6e0ff; }
.sidebar-footer { margin-top: auto; display:flex; gap:10px; align-items:center; padding:14px; border:1px solid #26324a; border-radius:14px; background:#151f32; }
.sidebar-footer strong,.sidebar-footer small { display:block; }
.sidebar-footer small { color:#8fa0bd; margin-top:2px; }
.status-dot { width:9px; height:9px; border-radius:99px; background:#5fd6aa; box-shadow:0 0 0 5px rgba(95,214,170,.12); }
.main { min-width:0; padding: 30px 36px 50px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:18px; }
.topbar h2 { margin:4px 0 0; font-size:30px; }
.top-actions { display:flex; gap:10px; }
.primary,.secondary,.text-button { border-radius:11px; cursor:pointer; font-weight:750; }
.primary { border:1px solid var(--accent); background:var(--accent); color:#fff; padding:11px 15px; box-shadow:0 8px 18px rgba(28,92,255,.18); }
.secondary { border:1px solid var(--line); background:var(--surface); color:var(--text); padding:11px 15px; }
.text-button { border:0; background:transparent; color:var(--accent); padding:8px; }
.notice { margin-bottom:22px; padding:14px 16px; border:1px solid #cfdafa; border-radius:14px; background:var(--accent-soft); color:var(--text); font-size:14px; }
.view { display:none; animation:fade .22s ease; }
.view.active { display:block; }
@keyframes fade { from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none} }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin-bottom:18px; }
.metric-card,.panel,.stage,.feature-card,.settings-list article,.calendar-shell,.task-columns article { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.metric-card { padding:20px; }
.metric-card span,.metric-card small { display:block; color:var(--muted); }
.metric-card strong { display:block; margin:12px 0 8px; font-size:30px; }
.metric-card .text-value { font-size:18px; line-height:1.3; }
.content-grid { display:grid; grid-template-columns:2fr 1fr; gap:18px; }
.panel { padding:22px; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.panel h3,.section-intro h3 { margin:4px 0 0; font-size:20px; }
.timeline-empty { min-height:180px; display:flex; align-items:center; gap:18px; padding:20px; border-radius:14px; background:var(--surface-2); border:1px dashed var(--line); }
.timeline-empty p,.empty-state p,.section-intro p,.stage p,.feature-card p,.settings-list p { color:var(--muted); line-height:1.55; }
.empty-icon { flex:0 0 auto; width:64px; height:64px; display:grid; place-items:center; border-radius:18px; background:var(--accent-soft); color:var(--accent); font-weight:850; }
.empty-state { min-height:310px; display:grid; place-items:center; align-content:center; text-align:center; padding:40px; background:var(--surface); border:1px dashed var(--line); border-radius:var(--radius); }
.empty-state.compact { min-height:190px; padding:20px; }
.empty-symbol { width:50px; height:50px; display:grid; place-items:center; border-radius:16px; background:var(--accent-soft); color:var(--accent); font-size:22px; font-weight:900; margin-bottom:10px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th,td { padding:13px 12px; text-align:left; border-bottom:1px solid var(--line); font-size:14px; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.empty-cell { text-align:center; color:var(--muted); padding:34px; }
.check-list { list-style:none; padding:0; margin:0; display:grid; gap:13px; }
.check-list li { display:flex; gap:11px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.check-list li:last-child { border-bottom:0; }
.check-list strong,.check-list small { display:block; }
.check-list small { color:var(--muted); margin-top:3px; }
.check,.pending { width:26px; height:26px; display:grid; place-items:center; border-radius:99px; font-weight:900; }
.check { background:var(--success-soft); color:var(--success); }
.pending { background:var(--surface-2); color:var(--muted); }
.section-intro { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin:6px 0 24px; }
.section-intro p { max-width:700px; margin:8px 0 0; }
.stage-grid { display:grid; grid-template-columns:repeat(5,minmax(190px,1fr)); gap:14px; overflow:auto; padding-bottom:8px; }
.stage { padding:18px; min-height:210px; }
.stage header { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.stage header span { min-width:28px; height:28px; display:grid; place-items:center; border-radius:99px; background:var(--surface-2); color:var(--muted); }
.calendar-shell { overflow:hidden; }
.calendar-toolbar { display:flex; align-items:center; justify-content:space-between; padding:16px; border-bottom:1px solid var(--line); }
.week-grid { display:grid; grid-template-columns:repeat(5,1fr); min-height:420px; }
.day { padding:15px; border-right:1px solid var(--line); }
.day:last-child { border-right:0; }
.day strong,.day small { display:block; }
.day small { color:var(--muted); margin-top:4px; }
.day-empty { margin-top:18px; padding:14px; border-radius:12px; background:var(--surface-2); color:var(--muted); font-size:13px; }
.task-columns { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.task-columns article { padding:18px; min-height:260px; }
.task-columns h4 { margin:0 0 14px; }
.column-empty { display:grid; place-items:center; min-height:170px; border:1px dashed var(--line); border-radius:13px; color:var(--muted); }
.cards-three { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.feature-card { padding:24px; }
.feature-card span { display:inline-grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--accent-soft); color:var(--accent); font-weight:900; }
.settings-list { display:grid; gap:12px; }
.settings-list article { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:19px 20px; }
.settings-list p { margin:5px 0 0; }
.pill { padding:7px 10px; border-radius:99px; font-size:12px; font-weight:850; white-space:nowrap; }
.success { background:var(--success-soft); color:var(--success); }
.pending-pill { background:var(--surface-2); color:var(--muted); }
dialog { border:0; border-radius:20px; padding:0; background:var(--surface); color:var(--text); box-shadow:0 30px 90px rgba(0,0,0,.3); max-width:420px; }
dialog::backdrop { background:rgba(7,12,22,.62); backdrop-filter:blur(4px); }
dialog form { padding:30px; text-align:center; }
.dialog-icon { width:48px; height:48px; display:grid; place-items:center; margin:0 auto 12px; border-radius:15px; background:var(--accent-soft); color:var(--accent); font-weight:900; }

@media (max-width:1100px) {
  .metrics { grid-template-columns:repeat(2,1fr); }
  .stage-grid { grid-template-columns:repeat(5,230px); }
}
@media (max-width:850px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:relative; height:auto; }
  .nav { grid-template-columns:repeat(2,1fr); }
  .sidebar-footer { display:none; }
  .main { padding:24px 18px 40px; }
  .content-grid,.task-columns,.cards-three { grid-template-columns:1fr; }
  .week-grid { grid-template-columns:1fr; }
  .day { border-right:0; border-bottom:1px solid var(--line); min-height:120px; }
}
@media (max-width:580px) {
  .nav { grid-template-columns:1fr; }
  .topbar,.section-intro { flex-direction:column; align-items:stretch; }
  .top-actions { width:100%; }
  .top-actions button { flex:1; }
  .metrics { grid-template-columns:1fr; }
}
