:root {
  --ink: #071525;
  --muted: #52615f;
  --green-950: #061b16;
  --green-900: #08261f;
  --green-800: #0b3d34;
  --green-700: #0a6f63;
  --green-600: #0b8b7d;
  --mint-100: #dff6ed;
  --mint-050: #f0fbf6;
  --gold: #d7a43b;
  --canvas: #eef3f0;
  --paper: #ffffff;
  --line: #d8e3df;
  --danger: #a7352a;
  --radius: 6px;
  --shadow: 0 16px 46px rgba(7, 21, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Aptos, Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(6, 27, 22, 0.94), rgba(10, 111, 99, 0.82)),
    var(--green-950);
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid rgba(215, 164, 59, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card img {
  width: 100%;
  max-width: 360px;
  display: block;
  margin-bottom: 18px;
}

.auth-card h1 {
  color: var(--green-950);
  margin-bottom: 10px;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-secondary {
  color: var(--green-950);
  background: var(--mint-100);
}

.auth-status,
.sync-status {
  margin: 8px 0 0;
  color: var(--gold);
  font-weight: 700;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: var(--green-950);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-card {
  background: #fff;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(215, 164, 59, 0.36);
}

.brand-card img {
  display: block;
  width: 100%;
  height: auto;
}

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

.nav-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #d8eee9;
  text-align: left;
  padding: 13px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: var(--green-600);
  color: #fff;
}

.client-portal [data-view="intake"],
.client-portal [data-view="plan"],
.client-portal [data-view="actions"],
.client-portal #saveClient,
.client-portal #newClient,
.client-portal #resetSample {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--gold);
  color: var(--ink);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace {
  padding: 24px 30px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  padding: 24px 28px;
  background: var(--green-900);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

.client-chip {
  min-width: 240px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.06);
}

.client-chip span,
.client-chip strong {
  display: block;
}

.client-chip span {
  color: #d8eee9;
  margin-bottom: 4px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}

.section-heading span {
  background: var(--green-700);
  color: #fff;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: var(--radius);
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
}

.guided-form {
  display: grid;
  gap: 18px;
}

.client-drawer {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px);
  gap: 18px;
  align-items: end;
}

.client-drawer h3 {
  margin-bottom: 4px;
}

.client-drawer p {
  margin: 0;
  color: var(--muted);
}

.form-panel,
.output-panel,
.report-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(7, 21, 37, 0.06);
}

.form-panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  background: var(--green-700);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
}

.panel-title h3 {
  margin: 0;
}

.compact {
  margin-top: 0;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

label[data-help]::after {
  content: attr(data-help);
  min-height: 28px;
  color: #657572;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: none;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--mint-050);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(11, 139, 125, 0.25);
  border-color: var(--green-600);
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.goal-table {
  display: grid;
  gap: 10px;
}

.goal-row {
  display: grid;
  grid-template-columns: 0.55fr 1.25fr 0.8fr 0.62fr 0.8fr 0.8fr 0.7fr 0.58fr 0.58fr;
  gap: 10px;
}

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

.metric-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.output-panel {
  padding: 18px;
}

.output-panel h3,
.report-sheet h3 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--green-700);
}

.portfolio-list {
  display: grid;
  gap: 10px;
}

.asset-row {
  display: grid;
  grid-template-columns: 120px 1fr 82px;
  gap: 12px;
  align-items: center;
}

.bar {
  height: 10px;
  background: var(--mint-100);
  border-radius: 20px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green-600);
}

.conversation-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.conversation-list dt {
  color: var(--muted);
  font-weight: 800;
}

.conversation-list dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  vertical-align: top;
}

th {
  background: var(--green-700);
  color: #fff;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-card {
  display: grid;
  grid-template-columns: 1fr 110px 120px;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.priority-high {
  color: var(--danger);
  font-weight: 800;
}

.report-sheet {
  padding: 26px;
  max-width: 980px;
}

.print-brand {
  display: none;
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--green-700);
}

.print-brand img {
  width: 260px;
  max-width: 45%;
  height: auto;
}

.print-brand strong,
.print-brand span {
  display: block;
}

.print-brand strong {
  color: var(--green-950);
  font-size: 22px;
}

.print-brand span {
  margin-top: 5px;
  color: var(--muted);
}

.report-sheet h3 {
  color: var(--green-800);
}

.report-grid {
  display: grid;
  gap: 14px;
}

.report-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.report-line strong {
  color: var(--green-800);
}

.report-table {
  margin: 8px 0 22px;
}

.report-actions {
  margin-bottom: 20px;
}

.report-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.quality-list {
  display: grid;
  gap: 10px;
}

.quality-note {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.quality-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quality-row span {
  font-weight: 900;
  color: var(--green-800);
  text-align: right;
}

.quality-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .field-grid.three,
  .field-grid.four,
  .client-drawer,
  .goal-row,
  .two-column,
  .dashboard-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar,
  .section-heading,
  .view:not(#view-report) {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
    padding: 0;
  }

  #view-report {
    display: block;
  }

  .report-sheet {
    box-shadow: none;
    border: 0;
    max-width: none;
  }

  .print-brand {
    display: flex;
  }
}
