:root {
  --bg: #efe6d8;
  --bg-deep: #e7dccb;
  --ink: #241c17;
  --muted: #6f645b;
  --line: #ddcfc0;
  --card: #fffdf8;
  --red: #c4161c;
  --red-dark: #8d1015;
  --sidebar: #241c17;
  --sidebar-soft: #3a3029;
  --cream: #f6efe4;
  --good: #1c6b45;
  --good-bg: #e5f4ec;
  --warn: #8d5608;
  --warn-bg: #fff1d8;
  --info: #1d4e89;
  --info-bg: #e7f0fa;
  --shadow: 0 18px 40px rgba(55, 36, 18, 0.08);
  --radius: 18px;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 253, 248, 0.85), transparent 34%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}

* { box-box: border-box; }
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view {
  width: min(520px, calc(100% - 32px));
  margin: 8vh auto 48px;
  animation: rise 0.55s ease both;
}

.login-view h1,
.page-head h1,
.lead-card h3,
.panel h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.login-view h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1.05;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 62ch;
}

.panel, .lead-card, .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 22px; margin-top: 22px; display: grid; gap: 14px; }

.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field.wide, .wide { grid-column: 1 / -1; }

input, textarea, select {
  width: 100%;
  background: #fff;
  border: 1px solid #d9cec1;
  border-radius: 12px;
  padding: 11px 12px;
}

textarea { resize: vertical; line-height: 1.45; }

input:focus, textarea:focus, select:focus {
  outline: 2px solid #e7b4b4;
  border-color: var(--red);
}

.primary, .ghost, .danger {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
}

.primary { background: var(--red); color: #fff; }
.primary:hover { background: var(--red-dark); }
.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid #5a4c42;
}
.ghost.ink {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}
.danger { background: var(--ink); color: #fff; }

.error { margin: 0; color: var(--red-dark); font-size: 14px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

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

.sidebar {
  background: var(--sidebar);
  color: var(--cream);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--red);
  display: grid;
  place-items: center;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.brand strong { display: block; font-size: 15px; font-weight: 600; }
.brand em { display: block; margin-top: 2px; font-style: normal; color: #cbbbaa; font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: #efe4d6;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 500;
}
.nav button.active, .nav button:hover { background: var(--sidebar-soft); }

.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.sidebar-note { margin: 0; color: #cbbbaa; font-size: 13px; line-height: 1.45; }
.name-field { color: #cbbbaa; }
.name-field input {
  background: var(--sidebar-soft);
  border-color: #5a4c42;
  color: var(--cream);
}
.name-field input::placeholder { color: #9a8878; }

.workspace { padding: 32px 36px 56px; max-width: 1100px; }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 22px;
  animation: rise 0.45s ease both;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.chip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.stat { padding: 16px; }
.stat b {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 34px;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.stat span { color: var(--muted); font-size: 14px; }

.view-panel { display: grid; gap: 12px; animation: rise 0.4s ease both; }

.form-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.form-grid h2 { margin: 0; font-size: 1.5rem; grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.lead-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(55, 36, 18, 0.12);
}

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

.lead-card h3 { margin: 0; font-size: 1.35rem; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--cream);
  color: var(--muted);
}
.badge.ready { background: var(--good-bg); color: var(--good); }
.badge.waiting { background: var(--warn-bg); color: var(--warn); }
.badge.claimed, .badge.contacted { background: var(--info-bg); color: var(--info); }
.badge.converted { background: var(--good-bg); color: var(--good); }
.badge.closed { background: #f1e7df; color: #6a584c; }

.notes {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cream);
}
.notes strong { display: block; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.notes p { margin: 4px 0 0; line-height: 1.45; }

.contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 14px;
}
.contact-row span { color: var(--muted); display: block; font-size: 12px; }

.follow-box {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { gap: 18px; padding: 20px; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace { padding: 22px 18px 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid, .contact-row { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
