:root {
  color-scheme: light;
  --ink: #121416;
  --muted: #626a73;
  --soft: #f3f0e9;
  --panel: #ffffff;
  --line: #ded8cc;
  --green: #136f63;
  --green-soft: #e4f3ef;
  --blue: #2e5d8d;
  --blue-soft: #e8f0f8;
  --gold: #9a6a15;
  --gold-soft: #f7edcf;
  --red: #a74335;
  --red-soft: #f8e9e5;
  --shadow: 0 20px 50px rgba(26, 29, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1,
.brand-lockup h1,
.topbar h2,
.brief-band h3,
.section-header h3,
.card h4 {
  margin: 0;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: 42px;
}

.login-card label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-card input,
.agent-command-form input,
.agent-command-form select,
.agent-command-form textarea,
.command-box input {
  width: 100%;
  outline: 0;
  color: var(--ink);
}

.login-card input,
.agent-command-form input,
.agent-command-form select,
.agent-command-form textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fbfaf7;
}

.agent-command-form textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.command-box input {
  border: 0;
  background: transparent;
}

.error-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #181a1d;
  color: #f9f4e9;
  padding: 28px 22px;
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #f7c04a;
  color: #171717;
  font-weight: 800;
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow,
.sidebar .panel-label {
  color: rgba(249, 244, 233, 0.62);
}

.muted,
.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(249, 244, 233, 0.72);
  padding: 0 10px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff8eb;
}

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

.policy-panel ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: rgba(249, 244, 233, 0.78);
  font-size: 13px;
}

main {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.command-box {
  display: grid;
  grid-template-columns: 32px minmax(240px, 410px);
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 12px;
  box-shadow: var(--shadow);
}

.command-box span {
  color: var(--gold);
  font-weight: 800;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.brief-band,
.surface,
.metric-card,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brief-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #fff9e8;
  padding: 24px;
}

.brief-band h3 {
  font-size: clamp(24px, 3vw, 34px);
}

.brief-band p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  padding: 0 14px;
}

.primary-action {
  border-color: #111315;
  background: #111315;
  color: #fff;
}

.secondary-action {
  background: var(--panel);
  color: var(--ink);
}

.danger-action {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

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

.metric-card,
.surface,
.card {
  padding: 18px;
}

.metric-value {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
}

.metric-card p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

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

.command-surface {
  margin-bottom: 18px;
}

.agent-command-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(140px, 0.3fr);
  gap: 12px;
}

.agent-command-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wide-field,
.checkbox-field {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.stack,
.card-grid {
  display: grid;
  gap: 12px;
}

.decision-section + .decision-section {
  margin-top: 18px;
}

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

.item-panel,
.card {
  display: grid;
  gap: 10px;
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  margin: 0;
  font-weight: 750;
}

.item-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.decision-card {
  scroll-margin: 24px;
}

.decision-card.highlight {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(247, 192, 74, 0.3), var(--shadow);
}

.decision-instructions {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 12px;
}

.decision-instructions ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

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

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

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

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

@media (max-width: 980px) {
  .app-shell,
.metric-grid,
.two-column,
.card-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px;
  }

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

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 56px;
    text-align: center;
    font-size: 12px;
  }

  .policy-panel {
    display: none;
  }

  main {
    padding: 18px;
  }

  .topbar,
  .brief-band,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-box {
    grid-template-columns: 32px 1fr;
    width: 100%;
  }
}
