:root {
  color-scheme: light;
  --ink: #142029;
  --muted: #63717c;
  --line: #dce5e8;
  --panel: #ffffff;
  --soft: #f3f7f6;
  --soft-strong: #e8f0ee;
  --accent: #19a78e;
  --accent-dark: #087b6c;
  --gold: #d49a28;
  --red: #bf4d4d;
  --blue: #3366cc;
  --shadow: 0 24px 60px rgba(20, 32, 41, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(25, 167, 142, 0.09), transparent 34%),
    linear-gradient(180deg, #f7faf9 0%, #edf4f2 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: #13242b;
  color: #f6fffc;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #76dccb;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.06rem;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

h4 {
  margin-bottom: 12px;
  font-size: 0.96rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d9e8e5;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(118, 220, 203, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #76dccb;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-panel p {
  margin-bottom: 0;
  color: #d5e7e3;
  line-height: 1.45;
}

.panel-label,
.card-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-panel .panel-label {
  margin-bottom: 8px;
  color: #76dccb;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.status-strip strong {
  margin-right: 4px;
  color: var(--ink);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.96fr) minmax(420px, 1.04fr);
  gap: 22px;
}

.control-surface,
.results-pane,
.chart-card,
.table-card,
.governance-card,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.control-surface,
.results-pane,
.chart-card,
.table-card,
.governance-card,
.timeline-card {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 335px;
  padding: 14px;
  resize: vertical;
  line-height: 1.52;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(25, 167, 142, 0.72);
  box-shadow: 0 0 0 3px rgba(25, 167, 142, 0.12);
}

.textarea-label {
  margin-bottom: 8px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary-btn,
.secondary-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  background: var(--accent);
  color: #ffffff;
}

.secondary-btn {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.compact-btn {
  min-height: 38px;
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

.score-card strong {
  display: block;
  font-size: 3.2rem;
  line-height: 1;
}

.score-ring {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 82%, #dbe8e5 0);
  box-shadow: inset 0 0 0 13px #ffffff;
}

.result-grid,
.dashboard-grid,
.governance-grid {
  display: grid;
  gap: 14px;
}

.result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.mini-card,
.quote-card,
.risk-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

.mini-card h4 {
  margin-bottom: 0;
  line-height: 1.35;
}

.insight-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.insight-columns article,
.risk-card {
  border-radius: 8px;
  background: #f8fbfa;
  padding: 16px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 8px;
  line-height: 1.4;
}

li:last-child {
  margin-bottom: 0;
}

blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.45rem;
}

.chart-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-strong);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.action-table {
  display: grid;
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.7fr 0.7fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.muted {
  color: var(--muted);
  background: var(--soft);
}

.intake-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 20px;
}

#workflow-form {
  display: grid;
  gap: 14px;
}

.workflow-board {
  display: grid;
  gap: 12px;
}

.workflow-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.workflow-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.workflow-card p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workflow-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.governance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 26px;
}

.check-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.check-list .done::before {
  content: "✓";
  background: rgba(25, 167, 142, 0.16);
  color: var(--accent-dark);
}

.check-list .todo::before {
  content: "!";
  background: rgba(212, 154, 40, 0.16);
  color: #956711;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.timeline div {
  padding-top: 12px;
  border-top: 4px solid var(--accent);
}

.timeline span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline strong {
  display: block;
  margin-bottom: 8px;
}

.timeline p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .app-shell,
  .analysis-grid,
  .intake-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-panel {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .workflow-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .nav-list,
  .field-grid,
  .result-grid,
  .insight-columns,
  .dashboard-grid,
  .chart-layout,
  .governance-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

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

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}
