:root {
  color-scheme: light;
  --ink: #102129;
  --muted: #64737c;
  --line: #d9e4e8;
  --paper: #f6f8f9;
  --panel: #ffffff;
  --brand: #005a70;
  --brand-2: #0f8b8d;
  --accent: #d94f30;
  --success: #17805a;
  --shadow: 0 18px 50px rgba(16, 33, 41, 0.1);
}

* {
  box-sizing: border-box;
}

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

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

button,
a.link {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  background:
    linear-gradient(rgba(7, 28, 35, 0.72), rgba(7, 28, 35, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect fill='%23102129' width='1400' height='900'/%3E%3Cg stroke='%230f8b8d' stroke-width='2' opacity='.45'%3E%3Cpath d='M140 160h270v180H140zM500 120h360v210H500zM930 180h300v160H930zM230 450h360v230H230zM760 430h410v250H760z' fill='none'/%3E%3Cpath d='M410 250h90M860 230h70M590 560h170M630 225l160 0M1040 340v90M410 340l0 110'/%3E%3Ccircle cx='140' cy='160' r='9' fill='%23d94f30'/%3E%3Ccircle cx='860' cy='230' r='9' fill='%23d94f30'/%3E%3Ccircle cx='1170' cy='680' r='9' fill='%23d94f30'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.brand-panel {
  color: white;
  padding: clamp(32px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
}

.brand-mark,
.logo span {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: var(--accent);
  color: white;
}

.eyebrow {
  color: var(--brand-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 18px 0 10px;
}

.brand-panel h1 {
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  line-height: 1;
  margin: 0 0 22px;
  max-width: 780px;
}

.brand-panel p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.12rem;
  line-height: 1.7;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-strip span {
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 9px 12px;
  border-radius: 999px;
  color: white;
}

.auth-card {
  align-self: center;
  margin: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
}

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

h2 {
  font-size: 1.18rem;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  background: var(--brand);
  font-weight: 850;
}

.primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost,
.logout {
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  padding: 10px;
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #102129;
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

nav {
  display: grid;
  gap: 7px;
}

nav button {
  text-align: left;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 750;
}

nav button.active,
nav button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.logout {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
}

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

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

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.user-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  display: grid;
  gap: 2px;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(16, 33, 41, 0.06);
}

.user-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.metric,
.panel,
.report-card,
.price-card,
.chat-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(16, 33, 41, 0.06);
}

.metric {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric strong {
  font-size: 1.7rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.panel {
  padding: 20px;
}

.empty-state {
  max-width: 680px;
  display: grid;
  gap: 12px;
}

.empty-state .primary {
  justify-self: start;
}

.audit-list,
.client-grid {
  display: grid;
  gap: 12px;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 42px;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

meter {
  width: 100%;
  height: 12px;
}

.notice,
.client-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 10px;
}

.notice p,
.client-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.client-card span {
  color: var(--brand);
  display: block;
  margin-top: 5px;
}

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

.wide {
  max-width: 920px;
}

.report-grid,
.pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 18px;
}

.report-card,
.price-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.score {
  display: inline-flex;
  color: white;
  background: var(--success);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  margin-bottom: 12px;
}

.report-card ul {
  padding-left: 20px;
  color: var(--muted);
}

.price-card strong {
  font-size: 2.2rem;
}

.price-card strong span {
  font-size: 0.9rem;
  color: var(--muted);
}

.price-card.featured {
  border-color: var(--brand-2);
  outline: 3px solid rgba(15, 139, 141, 0.14);
}

.chat-panel {
  min-height: 620px;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 18px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 4px;
}

.msg {
  max-width: min(720px, 84%);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.5;
}

.msg.ai {
  background: #e7f4f3;
  align-self: flex-start;
}

.msg.me {
  background: var(--brand);
  color: white;
  align-self: flex-end;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .metric-grid,
  .report-grid,
  .pricing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auth-layout,
  .shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 420px;
  }

  .auth-card {
    margin: 18px;
  }

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

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

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .report-grid,
  .pricing {
    grid-template-columns: 1fr;
  }

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

  .chat-form {
    grid-template-columns: 1fr;
  }
}
