:root {
  --bg: #f7f3ee;
  --paper: #fffdfa;
  --card: #ffffff;
  --line: #eadfd6;
  --text: #2f2722;
  --muted: #6b5f58;
  --gold: #c89b63;
  --gold-dark: #a8753f;
  --dark: #3b2f2a;
  --ok: #166534;
  --lock: #8a5f13;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8f4ef 0%, #ffffff 100%);
}

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

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--dark);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #f5eee8;
  color: var(--dark);
  border: 1px solid var(--line);
}

button.gold { background: var(--gold); }
button:disabled { opacity: .65; cursor: not-allowed; }

.portal-shell { width: 100%; min-height: 100vh; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(59, 47, 42, .08);
}

.brand {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  font-weight: 500;
}

.subtitle { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
}

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #d8cfc8;
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
}

.field textarea { min-height: 92px; resize: vertical; }

.error, .success {
  margin: 0 0 14px;
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
}

.error { background: #fee2e2; color: #991b1b; }
.success { background: #dcfce7; color: var(--ok); }

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar { background: var(--dark); color: #fff; padding: 22px; }

.sidebar h1 {
  margin: 0 0 8px;
  color: #f7dca8;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
}

.sidebar p { margin: 0 0 22px; color: #e8dbc9; line-height: 1.5; font-size: 13px; }

.nav-button {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.nav-button.active { background: #f7dca8; color: var(--dark); }
.content { padding: 28px; overflow: auto; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 14px;
  background: #f1e7dc;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.page-title {
  margin: 12px 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 48px;
  line-height: 1;
  font-weight: 500;
}

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

.metric, .feature-card, .panel, .lead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(59, 47, 42, .045);
}

.metric { padding: 18px; }
.metric strong { display: block; font-size: 30px; color: var(--dark); }
.metric span, .muted { color: var(--muted); font-size: 13px; }

.feature-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.feature-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.feature-card button, .feature-card a { margin-top: auto; }

.status {
  width: max-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ecfdf5;
  color: var(--ok);
  font-size: 11px;
  font-weight: 800;
}

.status.locked { background: #fff7ed; color: var(--lock); }
.panel { padding: 22px; margin-bottom: 16px; }

.panel h2 {
  margin: 0 0 14px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
  gap: 16px;
}

.split.compact { grid-template-columns: 1fr 110px; }
.package-list, .lead-list { display: grid; gap: 12px; }
.lead-card { padding: 18px; }
.lead-head { display: flex; justify-content: space-between; gap: 12px; }
.lead-head strong { font-size: 18px; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.public-link {
  display: block;
  word-break: break-word;
  color: var(--gold-dark);
  font-weight: 700;
  text-decoration: none;
}

.inline-link { color: var(--gold-dark); font-weight: 800; text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

.avatar-preview {
  width: 150px;
  height: 150px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 1fr; }
  .summary-grid, .feature-grid, .split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content { padding: 20px; }
  .topbar { display: block; }
  .page-title { font-size: 38px; }
}

