:root {
  --deep: #17212b;
  --ocean: #224469;
  --sky: #2486c5;
  --pale-sky: #9eeafa;
  --grass: #148c60;
  --earth: #83562e;
  --hot: #f4542a;
  --gold: #fab10f;
  --paper: #faf1e5;
  --paper-light: #fffaf3;
  --line: rgba(23, 33, 43, 0.16);
  --muted: #687078;
  --success-bg: #dff4e9;
  --warning-bg: #fff0c9;
  --danger-bg: #fde3da;
  --shadow: 0 18px 48px rgba(23, 33, 43, 0.08);
  font-family: "Century Gothic", Avenir, Arial, sans-serif;
  color: var(--deep);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
}

button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  background: var(--paper);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 56px;
  color: var(--paper);
  background: var(--deep);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -170px;
  width: 430px;
  height: 430px;
  border: 84px solid var(--grass);
  border-radius: 50%;
  opacity: 0.9;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-name-panel {
  font-family: "ITC Garamond Std Book", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
}

.login-statement {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.login-statement h1,
.page-title,
.section-title,
.login-card h2 {
  margin: 0;
  font-family: "ITC Garamond Std Book", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
}

.login-statement h1 {
  max-width: 560px;
  font-size: 64px;
  line-height: 0.98;
}

.login-statement p {
  max-width: 520px;
  margin: 24px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(250, 241, 229, 0.74);
}

.login-form-area {
  display: grid;
  place-items: center;
  padding: 48px;
}

.login-card {
  width: min(460px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--hot);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-card h2 { font-size: 48px; line-height: 1; }
.login-help { margin: 14px 0 32px; color: var(--muted); line-height: 1.5; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--deep);
  background: var(--paper-light);
  outline: none;
}
.field input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(36, 134, 197, 0.14); }

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--grass);
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease;
}
.primary-button:hover { background: #10784f; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: 0.64; transform: none; }
.form-error { min-height: 22px; margin: 12px 0 0; color: #a3311a; font-size: 14px; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  color: var(--paper);
  background: var(--deep);
}

.client-chip {
  margin: 32px 0 20px;
  padding: 14px;
  border-top: 1px solid rgba(250, 241, 229, 0.16);
  border-bottom: 1px solid rgba(250, 241, 229, 0.16);
}
.client-chip small { display: block; margin-bottom: 4px; color: rgba(250,241,229,.55); }
.client-chip strong { font-size: 15px; }

.nav { display: grid; gap: 5px; }
.nav-button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  color: rgba(250, 241, 229, 0.65);
  background: transparent;
  text-align: left;
  transition: color 150ms ease, background 150ms ease;
}
.nav-button:hover { color: white; background: rgba(250, 241, 229, 0.08); }
.nav-button.active { color: white; background: var(--grass); font-weight: 600; }

.logout-button {
  margin-top: auto;
  min-height: 42px;
  border: 1px solid rgba(250,241,229,.2);
  border-radius: 5px;
  color: var(--paper);
  background: transparent;
}

.main { min-width: 0; padding: 30px 38px 64px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
}
.page-title { font-size: 46px; line-height: 1; }
.page-subtitle { margin: 10px 0 0; color: var(--muted); }
.stage-badge {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 4px;
  color: var(--earth);
  background: var(--warning-bg);
  font-size: 13px;
  font-weight: 600;
}

.view { animation: reveal 280ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  min-height: 134px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.72);
}
.metric-label { display: block; min-height: 38px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.metric-value { display: block; margin-top: 10px; font-size: 26px; font-weight: 700; }
.metric-source { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.section { margin-top: 42px; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-title { font-size: 31px; }
.section-note { margin: 0; color: var(--muted); font-size: 13px; }

.journey {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  margin-top: 18px;
  overflow-x: auto;
}
.journey-step {
  position: relative;
  min-height: 108px;
  padding: 16px 18px 16px 0;
}
.journey-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 10px;
  width: 28px;
  height: 1px;
  background: var(--line);
}
.journey-index { color: var(--hot); font-size: 12px; font-weight: 700; }
.journey-label { display: block; margin-top: 14px; font-weight: 600; }
.journey-value { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.split { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.plain-row strong { font-size: 14px; }
.plain-row span { color: var(--muted); font-size: 13px; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-not_connected, .status-blocked { color: #8d2e18; background: var(--danger-bg); }
.status-in_progress, .status-pending { color: #775500; background: var(--warning-bg); }
.status-complete { color: #0e6543; background: var(--success-bg); }

.priority-panel {
  padding: 26px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--ocean);
}
.priority-panel .eyebrow { color: var(--gold); }
.priority-panel h3 { margin: 0; font-size: 22px; line-height: 1.25; }
.priority-panel p { margin: 14px 0 0; color: rgba(250,241,229,.7); line-height: 1.55; }

.signal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.signal-card {
  min-height: 190px;
  padding: 22px;
  border-radius: 6px;
  background: var(--paper-light);
  border-top: 5px solid var(--grass);
  box-shadow: var(--shadow);
}
.signal-card:nth-child(2) { border-color: var(--gold); }
.signal-card:nth-child(3) { border-color: var(--sky); }
.signal-card h3 { margin: 0; font-size: 18px; }
.signal-card p { color: var(--muted); line-height: 1.5; }

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 40px;
  border: 1px dashed rgba(23,33,43,.24);
  border-radius: 6px;
  text-align: center;
}
.empty-state strong { display: block; font-size: 20px; }
.empty-state p { max-width: 540px; margin: 10px auto 0; color: var(--muted); line-height: 1.55; }

.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 360px; padding: 38px; }
  .login-statement h1 { font-size: 48px; }
  .login-form-area { padding: 40px 24px 64px; }
  .shell { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; width: 100%; min-width: 0; height: auto; overflow: hidden; padding: 18px 20px; }
  .sidebar .brand-lockup { margin-bottom: 16px; }
  .client-chip { display: none; }
  .nav { width: 100%; min-width: 0; grid-template-columns: repeat(6, minmax(130px, 1fr)); overflow-x: auto; overscroll-behavior-inline: contain; }
  .nav-button { text-align: center; }
  .logout-button { position: absolute; top: 18px; right: 20px; width: 70px; }
  .main { padding: 28px 24px 54px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .login-brand { min-height: 330px; padding: 28px 24px; }
  .login-statement h1 { font-size: 40px; }
  .login-statement p { font-size: 16px; }
  .login-card h2 { font-size: 40px; }
  .main { padding-inline: 18px; }
  .topbar { display: block; }
  .page-title { font-size: 38px; }
  .stage-badge { display: inline-block; margin-top: 18px; }
  .metric-grid, .signal-grid { grid-template-columns: 1fr; }
  .plain-row { grid-template-columns: 1fr auto; gap: 7px 14px; }
  .plain-row span { grid-column: 1 / -1; }
  .section-header { display: block; }
  .section-note { margin-top: 8px; }
}

