:root {
  color-scheme: light;
  --paper: #f1eee4;
  --ink: #172016;
  --muted: #667064;
  --line: rgba(23, 32, 22, 0.16);
  --acid: #d9ee59;
  --forest: #223426;
  --rust: #bb623f;
  --cream: #fffdf5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: var(--paper);
}

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

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: .045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(112deg, rgba(217, 238, 89, .92) 0 31%, transparent 31%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(23,32,22,.06) 80px),
    var(--forest);
}

.auth-card {
  width: min(100%, 620px);
  padding: clamp(28px, 7vw, 64px);
  border: 1px solid rgba(255,255,255,.15);
  background: var(--cream);
  box-shadow: 18px 18px 0 rgba(14, 20, 14, .6);
  animation: card-in .65s cubic-bezier(.2,.8,.2,1) both;
}

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

.brand-lockup > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--acid);
  background: var(--ink);
  font: 400 15px/1 "Archivo Black", sans-serif;
  letter-spacing: -.08em;
  transform: rotate(-4deg);
}

.brand-lockup strong {
  font: 400 12px/1.05 "Archivo Black", sans-serif;
  text-transform: uppercase;
}

.eyebrow {
  margin: 52px 0 14px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 400 clamp(2.55rem, 8vw, 5.3rem)/.88 "Archivo Black", sans-serif;
  letter-spacing: -.065em;
  text-transform: uppercase;
}

h1 em { color: var(--rust); font-style: normal; }

.auth-copy {
  max-width: 480px;
  margin: 26px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.login-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid var(--ink);
  background: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}

.login-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }

.password-login { display: grid; gap: 13px; }
.password-login label, .password-dialog-card label { display: grid; gap: 6px; }
.password-login label > span, .password-dialog-card label > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.password-login input, .password-dialog-card input { height: 48px; padding: 0 13px; font-size: 14px; }
.login-button { border: 0; color: var(--acid); background: var(--ink); box-shadow: 5px 5px 0 var(--rust); cursor: pointer; }
.login-button:disabled { opacity: .55; cursor: wait; }
.forgot-button { display: block; margin: 15px auto 0; padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.forgot-button:hover { color: var(--rust); }
.auth-message { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-message.is-error { color: #9b352b; font-weight: 700; }

.compliance-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.compliance-strip span, .system-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #80a92f;
  box-shadow: 0 0 0 4px rgba(128,169,47,.16);
}

.dashboard { width: min(100% - 36px, 1520px); margin: 0 auto; padding: 24px 0 70px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup.compact > span { width: 40px; height: 40px; }

.session-block { display: flex; align-items: center; gap: 14px; }
.session-block > div { display: grid; text-align: right; }
.session-block small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.session-block strong { font-size: 12px; }

.text-button, .icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.text-button { padding: 0 14px; }
.icon-button { width: 38px; font-size: 20px; }
.text-button:hover, .icon-button:hover { background: var(--ink); color: var(--paper); }

.dashboard-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding: 56px 0 40px;
}
.dashboard-intro .eyebrow { margin-top: 0; }
.dashboard-intro h1 { font-size: clamp(3.5rem, 8vw, 7.6rem); }

.system-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,253,245,.62);
}
.system-card div { display: grid; }
.system-card small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.system-card strong { font-size: 14px; }

.pipeline-board {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 1fr) minmax(300px, .9fr);
  gap: 16px;
  align-items: start;
}

.pipeline-column {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255,253,245,.54);
}
.column-contacted { margin-top: 42px; }
.column-active { margin-top: 84px; }

.column-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.column-header h2 { margin: 0; font: 400 20px/1 "Archivo Black", sans-serif; text-transform: uppercase; }
.column-header p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.column-count { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--acid); font-weight: 700; }

.lead-list { display: grid; gap: 10px; padding: 10px; }

.lead-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--cream);
  box-shadow: 0 10px 28px rgba(23,32,22,.06);
  animation: lead-in .4s ease both;
}

.lead-heading { display: flex; justify-content: space-between; gap: 16px; }
.lead-id { color: var(--rust); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.lead-heading h3 { margin: 5px 0 0; font-size: 19px; line-height: 1.1; }

.stage-dot { width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; background: var(--rust); }
.stage-contacted { background: #c19a38; }
.stage-active { background: #6f963b; }

.lead-address { margin: 10px 0 16px; color: var(--muted); font-size: 12px; }
.contact-row { display: grid; gap: 3px; padding: 12px 0; border-block: 1px solid var(--line); }
.contact-name { font-size: 11px; font-weight: 700; }
.contact-link { color: var(--rust); font-size: 12px; overflow-wrap: anywhere; }

.lead-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 14px; }
.control-field { display: grid; gap: 6px; }
.control-field > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.control-notes, .card-footer { grid-column: 1 / -1; }

select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: white;
  outline: none;
}
select, input { height: 38px; padding: 0 9px; font-size: 11px; }
textarea { resize: vertical; min-height: 68px; padding: 9px; font-size: 11px; line-height: 1.45; }
select:focus, input:focus, textarea:focus { border-color: var(--rust); box-shadow: 0 0 0 2px rgba(187,98,63,.12); }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer-copy { color: var(--muted); font-size: 10px; }
.save-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: var(--ink);
  color: var(--acid);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.save-button:hover { background: var(--rust); color: white; }
.save-button:disabled { opacity: .6; }
.save-button.is-error { background: #9b352b; color: white; }

.empty-state { min-height: 190px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; text-align: center; border: 1px dashed var(--line); }
.empty-mark { display: grid; width: 42px; height: 42px; place-items: center; color: var(--muted); border: 1px solid var(--line); font: 400 12px/1 "Archivo Black", sans-serif; transform: rotate(-4deg); }
.empty-state strong { font-size: 13px; }
.empty-state p { max-width: 220px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.skeleton-column { height: 390px; border: 1px solid var(--line); background: linear-gradient(100deg, rgba(255,255,255,.25) 20%, rgba(255,255,255,.65) 36%, rgba(255,255,255,.25) 52%); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
.is-loading { opacity: .55; pointer-events: none; }

.password-dialog { width: min(100% - 28px, 510px); padding: 0; border: 0; background: transparent; }
.password-dialog::backdrop { background: rgba(14,20,14,.8); backdrop-filter: blur(7px); }
.password-dialog-card { display: grid; gap: 16px; padding: 30px; border: 1px solid rgba(255,255,255,.2); background: var(--cream); box-shadow: 12px 12px 0 var(--acid); }
.password-dialog-card .eyebrow { margin: 0 0 8px; }
.password-dialog-card h2 { margin: 0; font: 400 27px/1 "Archivo Black", sans-serif; text-transform: uppercase; }
.password-dialog-card > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; font-size: 24px; cursor: pointer; }
.dialog-close:hover { color: var(--cream); background: var(--ink); }

@keyframes card-in { from { opacity: 0; transform: translateY(22px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes lead-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position-x: -220%; } }

@media (max-width: 1060px) {
  .pipeline-board { grid-template-columns: 1fr 1fr; }
  .column-active { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 700px) {
  .auth-shell { padding: 18px; background: var(--acid); }
  .auth-card { padding: 28px; box-shadow: 10px 10px 0 rgba(14,20,14,.7); }
  .eyebrow { margin-top: 40px; }
  .dashboard { width: min(100% - 24px, 1520px); }
  .topbar, .dashboard-intro { align-items: start; }
  .topbar { gap: 18px; }
  .session-block > div { display: none; }
  .dashboard-intro { grid-template-columns: 1fr; padding-top: 38px; }
  .system-card { min-width: 0; }
  .pipeline-board { grid-template-columns: 1fr; }
  .column-contacted, .column-active { grid-column: auto; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
