:root {
  --navy: #0b1827;
  --navy-2: #13283d;
  --paper: #f4f1e8;
  --paper-2: #ebe5d7;
  --ink: #15191e;
  --muted: #66707a;
  --line: rgba(21, 25, 30, .14);
  --red: #7a0b0b;
  --gold: #b79a55;
  --green: #3f6b58;
  --shadow: 0 20px 50px rgba(11, 24, 39, .12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--navy);
  color: white;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { width: 49px; height: 49px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold); font-weight: 900; letter-spacing: -.05em; }
.brand strong { display: block; letter-spacing: .14em; font-size: 14px; }
.brand span { display: block; color: rgba(255,255,255,.55); font-size: 11px; margin-top: 4px; }
.nav { display: grid; gap: 5px; margin-top: 26px; }
.nav-item {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.65);
  text-align: left;
  padding: 12px 13px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 13px;
  transition: .18s ease;
}
.nav-item span { color: var(--gold); font-size: 10px; letter-spacing: .1em; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.08); transform: translateX(2px); }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 10px; align-items: center; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { color: rgba(255,255,255,.5); margin-top: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #79bf91; box-shadow: 0 0 0 5px rgba(121,191,145,.12); }

.main { min-width: 0; }
.topbar { min-height: 110px; border-bottom: 1px solid var(--line); padding: 24px clamp(22px, 4vw, 58px); display: flex; align-items: center; gap: 18px; justify-content: space-between; }
.topbar h1 { font-family: Georgia, serif; font-weight: 500; margin: 5px 0 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; }
.eyebrow { display: block; color: var(--red); font-size: 10px; letter-spacing: .18em; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.taurus-trigger, .primary-button { background: var(--red); color: white; border: 0; border-radius: 999px; padding: 11px 17px; font-weight: 700; }
.menu-button { display: none; border: 0; background: transparent; font-size: 20px; }
.view-root { padding: 34px clamp(22px, 4vw, 58px) 70px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 22px; }
.panel, .metric, .project-card, .decision-card, .knowledge-card, .idea-card, .timeline-card, .settings-card {
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(11,24,39,.05);
}
.panel { padding: 26px; }
.panel.dark { background: var(--navy); color: white; border-color: transparent; }
.panel h2, .section-head h2 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.03em; margin: 0; }
.panel h2 { font-size: 28px; }
.panel p { color: var(--muted); line-height: 1.6; }
.panel.dark p { color: rgba(255,255,255,.68); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 38px 0 16px; }
.section-head h2 { font-size: 28px; }
.section-head p { margin: 7px 0 0; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.metric { padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; font-family: Georgia, serif; font-size: 34px; margin-top: 8px; }
.metric small { color: var(--muted); }

.signal-list { display: grid; gap: 12px; margin-top: 20px; }
.signal { border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
.signal:first-child { border-top: 0; padding-top: 0; }
.signal b { color: var(--gold); display: block; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 6px; }
.signal span { line-height: 1.5; font-size: 14px; }

.project-grid, .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card, .decision-card, .knowledge-card, .idea-card, .settings-card { padding: 21px; }
.project-card { position: relative; overflow: hidden; }
.project-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--red); }
.project-card h3, .decision-card h3, .knowledge-card h3, .idea-card h3 { margin: 8px 0; font-size: 18px; }
.project-card p, .decision-card p, .knowledge-card p, .idea-card p { color: var(--muted); line-height: 1.5; font-size: 14px; }
.tag, .status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tag { background: var(--paper-2); color: var(--ink); }
.status-pill.on-track { background: rgba(63,107,88,.12); color: var(--green); }
.status-pill.at-risk { background: rgba(122,11,11,.1); color: var(--red); }
.card-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; align-items: center; }
.progress { height: 5px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-top: 16px; }
.progress span { display: block; height: 100%; background: var(--red); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.56); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secondary-button { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius); padding: 42px; text-align: center; color: var(--muted); }

.timeline { display: grid; gap: 0; }
.timeline-card { margin-left: 18px; padding: 20px 22px; position: relative; border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; }
.timeline-card + .timeline-card { margin-top: 12px; }
.timeline-card time { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.timeline-card h3 { margin: 7px 0 5px; }
.timeline-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.integration-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.integration-row:last-child { border-bottom: 0; }
.integration-row b, .integration-row span { display: block; }
.integration-row span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.connection { font-size: 11px; font-weight: 800; color: var(--green); }
.connection.off { color: var(--muted); }

.taurus-dialog, .idea-dialog { width: min(760px, calc(100vw - 28px)); border: 0; border-radius: 22px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.taurus-dialog::backdrop, .idea-dialog::backdrop { background: rgba(5,13,22,.72); backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 25px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-family: Georgia, serif; font-weight: 500; font-size: 30px; margin: 4px 0 0; }
.icon-button { border: 0; background: transparent; font-size: 27px; color: var(--muted); }
.taurus-principle { background: var(--navy); color: rgba(255,255,255,.78); padding: 14px 25px; font-size: 13px; }
.taurus-output { min-height: 270px; max-height: 46vh; overflow: auto; padding: 24px 25px; white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
.quick-prompts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 25px 17px; }
.quick-prompts button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 11px; font-size: 11px; }
.taurus-form { border-top: 1px solid var(--line); display: flex; gap: 10px; padding: 18px 25px 24px; }
.taurus-form input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; }
.taurus-form button { border: 0; border-radius: 12px; background: var(--red); color: white; padding: 0 18px; font-weight: 700; }
.idea-dialog form { padding-bottom: 25px; }
.idea-dialog label { display: grid; gap: 7px; padding: 0 25px; margin-top: 16px; font-size: 12px; font-weight: 700; }
.idea-dialog input, .idea-dialog textarea, .idea-dialog select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: white; color: var(--ink); }
.idea-dialog .primary-button { margin: 22px 25px 0; }
.loading { opacity: .6; animation: pulse 1s infinite alternate; }
.taurus-project-block { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.62); }
.taurus-project-block h2 { font-family: Georgia, serif; font-weight: 500; margin: 5px 0 20px; }
.taurus-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.taurus-summary-grid div { padding: 14px; background: var(--paper-2); border-radius: 12px; }
.taurus-summary-grid small, .taurus-summary-grid strong { display: block; }
.taurus-summary-grid small { color: var(--muted); margin-bottom: 7px; }
.evidence { margin-top: 18px; }
.evidence summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
@keyframes pulse { to { opacity: 1; } }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-102%); transition: .22s ease; width: min(290px, 86vw); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .menu-button { display: block; }
  .topbar { min-height: 90px; padding: 18px; }
  .topbar-actions time { display: none; }
  .view-root { padding: 24px 18px 50px; }
  .metrics, .project-grid, .card-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .taurus-form { align-items: stretch; flex-direction: column; }
  .taurus-form button { padding: 12px; }
  .taurus-summary-grid { grid-template-columns: 1fr 1fr; }
}
