/* Rolling Plan Intelligence — static prototype styles.
   Plain CSS only. No build step, no preprocessor. */

:root {
  --background: #ffffff;
  --foreground: #252525;
  --card: #ffffff;
  --primary: #030213;
  --primary-foreground: #ffffff;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --border: rgba(0, 0, 0, 0.1);
  --input-background: #f3f3f5;
  --ring: #b5b5b5;

  --sidebar: #fafafa;
  --sidebar-foreground: #252525;
  --sidebar-border: #ebebeb;
  --sidebar-accent: #f5f5f5;
  --sidebar-accent-foreground: #333333;

  --radius: 0.625rem;
}

.dark {
  --background: #252525;
  --foreground: #fbfbfb;
  --card: #1f1f1f;
  --primary: #fbfbfb;
  --primary-foreground: #333333;
  --muted: #444444;
  --muted-foreground: #b5b5b5;
  --accent: #444444;
  --border: #444444;
  --input-background: #2e2e2e;
  --ring: #707070;

  --sidebar: #333333;
  --sidebar-foreground: #fbfbfb;
  --sidebar-border: #444444;
  --sidebar-accent: #444444;
  --sidebar-accent-foreground: #fbfbfb;
}

* {
  box-sizing: border-box;
}

/* ---------- Icons ---------- */
.ic { width: 1.25rem; height: 1.25rem; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ic-xs { width: 0.75rem; height: 0.75rem; }
.ic-sm { width: 1rem; height: 1rem; }
.ic-lg { width: 1.5rem; height: 1.5rem; }
.ic-xl { width: 2rem; height: 2rem; }
.ico-c { display: inline-flex; align-items: center; }

html {
  font-size: 16px;
}

body {
  margin: 0;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 { font-size: 1.5rem; font-weight: 500; line-height: 1.5; }
h2 { font-size: 1.25rem; font-weight: 500; line-height: 1.5; }
h3 { font-size: 1.125rem; font-weight: 500; line-height: 1.5; }
h4 { font-size: 1rem; font-weight: 500; line-height: 1.5; }

/* ---------- Layout ---------- */
.app {
  display: flex;
  height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content {
  flex: 1;
  overflow-y: auto;
}

.page {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page.hidden { display: none; }

.page-head h1 { margin-bottom: 0.5rem; }
.muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-head h2 { color: var(--sidebar-foreground); }
.sidebar-head p { margin-top: 0.25rem; }

.sidebar-nav {
  flex: 1;
  padding: 1rem;
}

.nav-group { display: flex; flex-direction: column; gap: 0.25rem; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  color: var(--sidebar-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}
.nav-item:hover { background: var(--sidebar-accent); }
.nav-item.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.phase2 { margin-top: 2rem; }
.phase2-label {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.nav-item.locked {
  color: var(--muted-foreground);
  opacity: 0.5;
  cursor: not-allowed;
}
.nav-item.locked:hover { background: transparent; }

.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- Top bar ---------- */
.topbar {
  height: 4rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}
.topbar-search {
  flex: 1;
  max-width: 42rem;
  position: relative;
}
.topbar-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}
.field {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background: var(--input-background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  font-size: 0.875rem;
}
.field:focus { outline: 2px solid var(--ring); outline-offset: 0; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1.5rem;
}
.icon-btn {
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  color: var(--foreground);
  cursor: pointer;
}
.icon-btn:hover { background: var(--accent); }

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.9; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-bottom: 1rem; }

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.row { display: flex; align-items: center; justify-content: space-between; }
.row-start { display: flex; align-items: flex-start; gap: 0.75rem; }
.flex-icon { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }

/* ---------- KPI card ---------- */
.kpi { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi-title { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.kpi-value { font-size: 1.875rem; margin-bottom: 0.5rem; line-height: 1.2; }
.kpi-tile {
  padding: 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Muted list rows ---------- */
.muted-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.5rem;
}
.muted-box {
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.5rem;
}

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.pill-round { border-radius: 9999px; padding: 0.25rem 0.75rem; }
.pill-solid-blue { background: #2563eb; color: #ffffff; }
.chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
}

/* ---------- Progress ---------- */
.progress {
  height: 0.5rem;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}
.progress .bar { height: 100%; background: #16a34a; }

/* ---------- Notes / info boxes ---------- */
.note { padding: 1rem; border: 1px solid; border-radius: 0.5rem; }
.note-title { font-size: 0.875rem; margin-bottom: 0.25rem; }
.note-body { font-size: 0.75rem; }

/* ---------- "What changed" circles ---------- */
.tile-block {
  text-align: center;
  padding: 1.5rem;
  background: var(--muted);
  border-radius: 0.5rem;
}
.tile-block .big { font-size: 1.875rem; margin-bottom: 0.5rem; }
.circle {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 500;
}

.count-block {
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--muted);
}
.count-block .big { font-size: 1.5rem; margin-bottom: 0.25rem; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--muted); }
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}
td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:hover { background: var(--muted); }
.cell-muted { color: var(--muted-foreground); }
.cell-prov { font-size: 0.75rem; color: var(--muted-foreground); }
.cell-prov span { display: inline-flex; align-items: center; gap: 0.25rem; }
.truncate { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filters { display: flex; gap: 1rem; }
.filters .topbar-search { max-width: none; }
.select {
  padding: 0.5rem 1rem;
  background: var(--input-background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  font-size: 0.875rem;
}

.flex-tags { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.lead { line-height: 1.7; }

/* ---------- Check rows ---------- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.5rem;
}
.check-row .grow { flex: 1; }
.check-row .ico { flex-shrink: 0; margin-top: 0.125rem; color: #16a34a; display: inline-flex; }
.check-name { font-size: 0.875rem; margin-bottom: 0.25rem; }

.method-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.method-row .ico { color: #16a34a; flex-shrink: 0; margin-top: 0.125rem; display: inline-flex; }

/* ---------- Comparison rows (change detection) ---------- */
.compare {
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: var(--muted);
}
.compare-grid { display: flex; align-items: flex-start; gap: 1rem; }
.compare-grid .col { flex: 1; }
.compare .arrow { margin-top: 1.5rem; flex-shrink: 0; color: var(--muted-foreground); }
.compare-diff { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #bfdbfe; }
.dark .compare-diff { border-top-color: #1e3a8a; }

/* ---------- Color helpers: soft icon tiles ---------- */
.tile-blue { background: #eff6ff; color: #2563eb; }
.tile-green { background: #f0fdf4; color: #16a34a; }
.tile-orange { background: #fff7ed; color: #ea580c; }
.tile-purple { background: #faf5ff; color: #9333ea; }
.dark .tile-blue { background: #172554; color: #60a5fa; }
.dark .tile-green { background: #052e16; color: #4ade80; }
.dark .tile-orange { background: #431407; color: #fb923c; }
.dark .tile-purple { background: #3b0764; color: #c084fc; }

/* circles */
.circle-green { background: #dcfce7; color: #16a34a; }
.circle-blue { background: #dbeafe; color: #2563eb; }
.circle-orange { background: #ffedd5; color: #ea580c; }
.circle-red { background: #fee2e2; color: #dc2626; }
.dark .circle-green { background: #052e16; color: #4ade80; }
.dark .circle-blue { background: #172554; color: #60a5fa; }
.dark .circle-orange { background: #431407; color: #fb923c; }
.dark .circle-red { background: #450a0a; color: #f87171; }

/* pills (soft) */
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-green { background: #dcfce7; color: #15803d; }
.pill-orange { background: #ffedd5; color: #c2410c; }
.pill-purple { background: #f3e8ff; color: #7e22ce; }
.dark .pill-blue { background: #172554; color: #93c5fd; }
.dark .pill-green { background: #052e16; color: #86efac; }
.dark .pill-orange { background: #431407; color: #fdba74; }
.dark .pill-purple { background: #3b0764; color: #d8b4fe; }

/* soft note boxes */
.note-blue { background: #eff6ff; border-color: #bfdbfe; }
.note-blue .note-title { color: #1e3a8a; }
.note-blue .note-body, .note-blue .single { color: #1d4ed8; }
.note-green { background: #f0fdf4; border-color: #bbf7d0; }
.note-green .note-title { color: #14532d; }
.note-green .note-body, .note-green .single { color: #15803d; }
.dark .note-blue { background: #172554; border-color: #1e3a8a; }
.dark .note-blue .note-title { color: #dbeafe; }
.dark .note-blue .note-body, .dark .note-blue .single { color: #93c5fd; }
.dark .note-green { background: #052e16; border-color: #14532d; }
.dark .note-green .note-title { color: #dcfce7; }
.dark .note-green .note-body, .dark .note-green .single { color: #86efac; }

.note-blue .single { font-size: 0.875rem; }

/* count blocks colored (domain "what changed") */
.count-green { background: #f0fdf4; border-color: #bbf7d0; }
.count-green .big { color: #14532d; }
.count-green .lbl { color: #15803d; }
.count-blue { background: #eff6ff; border-color: #bfdbfe; }
.count-blue .big { color: #1e3a8a; }
.count-blue .lbl { color: #1d4ed8; }
.dark .count-green { background: #052e16; border-color: #14532d; }
.dark .count-green .big { color: #dcfce7; }
.dark .count-green .lbl { color: #86efac; }
.dark .count-blue { background: #172554; border-color: #1e3a8a; }
.dark .count-blue .big { color: #dbeafe; }
.dark .count-blue .lbl { color: #93c5fd; }

/* modified action box (domain timeline) */
.action-modified { background: #eff6ff; border: 1px solid #bfdbfe; }
.dark .action-modified { background: #172554; border-color: #1e3a8a; }

.green-text { color: #16a34a; }
.blue-text { color: #2563eb; }
.orange-text { color: #ea580c; }
.purple-text { color: #9333ea; }
.dark .green-text { color: #4ade80; }
.dark .blue-text { color: #60a5fa; }
.dark .orange-text { color: #fb923c; }
.dark .purple-text { color: #c084fc; }

.note-source {
  padding: 1rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.note-source .text-xs { color: var(--muted-foreground); display: inline-flex; align-items: center; gap: 0.25rem; }

.between { display: flex; align-items: center; justify-content: space-between; font-size: 0.875rem; color: var(--muted-foreground); }
