:root {
  --bg: #f4efe6;
  --panel: rgba(255, 251, 244, 0.88);
  --panel-strong: #fffaf3;
  --line: rgba(70, 52, 27, 0.12);
  --line-strong: rgba(70, 52, 27, 0.2);
  --text: #281d14;
  --muted: #6d5f50;
  --primary: #b85c2d;
  --primary-strong: #8f431b;
  --accent: #176b63;
  --shadow: 0 24px 56px rgba(82, 58, 29, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(184, 92, 45, 0.2), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(23, 107, 99, 0.14), transparent 22%),
    linear-gradient(180deg, #f5efe6 0%, #ebe2d4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 88%);
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-shell {
  width: min(1260px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 0 28px;
}

.auth-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
  padding: 24px;
  align-items: center;
}

.auth-copy {
  display: grid;
  gap: 12px;
}

.auth-logo {
  width: min(190px, 48vw);
  height: auto;
  display: block;
  margin-bottom: 2px;
}

.auth-description {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.auth-domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-domain-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(23, 107, 99, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.auth-panel {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  align-content: start;
}

.auth-connection {
  min-width: 0;
}

.google-signin {
  min-height: 44px;
  display: grid;
  place-items: center;
}

.auth-user-info {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.auth-user-info strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.auth-user-info span {
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-signout {
  width: 100%;
}

.header-logoff-btn {
  min-width: 96px;
  padding: 10px 14px;
  font-size: 0.92rem;
  border-radius: 14px;
}

.auth-card .connection-card {
  padding: 12px 14px;
  border-radius: 18px;
}

.auth-card .connection-label,
.auth-card .connection-meta {
  font-size: 0.8rem;
}

.auth-card strong {
  font-size: 0.98rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(255, 251, 244, 0.96), rgba(247, 233, 208, 0.84)),
    var(--panel);
}

.hero-copy {
  max-width: 820px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-logo {
  width: min(220px, 38vw);
  max-width: 220px;
  height: auto;
  display: block;
  flex: none;
}

.hero-brand-copy {
  display: grid;
  gap: 2px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3,
h4,
th {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.92;
}

.hero p:last-child {
  margin: 16px 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: end;
  align-items: end;
}

.connection-card {
  min-width: 210px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.connection-label,
.connection-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #d67b3a);
  color: #fff8f2;
}

.btn-secondary {
  background: rgba(23, 107, 99, 0.12);
  color: var(--accent);
}

.top-nav {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: end;
  padding: 14px 14px 0;
  margin-top: 14px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid rgba(70, 52, 27, 0.12);
  box-shadow: 0 18px 36px rgba(82, 58, 29, 0.08);
  overflow: visible;
  z-index: 10;
}

.nav-group {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 1 1 0;
  border: 1px solid transparent;
  border-bottom: 0;
  cursor: pointer;
  padding: 14px 18px 16px;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  transition: 180ms ease;
  position: relative;
  top: 1px;
}

.tab-btn-placeholder {
  cursor: default;
  opacity: 0.72;
}

.tab-btn-placeholder:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.24);
  border-color: transparent;
  box-shadow: none;
}

.tab-btn-parent {
  width: 100%;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 14px 28px rgba(82, 58, 29, 0.1);
  z-index: 11;
}

.nav-group.is-open .nav-menu,
.nav-group:hover:not(.is-locked) .nav-menu,
.nav-group:focus-within .nav-menu {
  display: flex;
}

body.is-editing-record .nav-menu {
  display: none !important;
}

body.is-editing-record .nav-group:hover .nav-menu,
body.is-editing-record .nav-group:focus-within .nav-menu {
  display: none !important;
}

body.is-lead-editing .top-nav {
  display: none;
}

.tab-btn-child {
  width: 100%;
  flex: none;
  border: 1px solid transparent;
  border-radius: 10px;
  justify-content: flex-start;
  padding: 10px 12px;
  top: 0;
  box-shadow: none;
  background: transparent;
}

.nav-group.is-open .tab-btn-parent,
.tab-btn-parent[aria-expanded="true"] {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 -1px 0 rgba(255, 250, 243, 0.96), 0 -6px 14px rgba(82, 58, 29, 0.06);
  z-index: 9;
}

.nav-group.is-locked .tab-btn-parent {
  box-shadow: 0 -1px 0 rgba(255, 250, 243, 0.96), 0 -6px 14px rgba(82, 58, 29, 0.06);
}

.tab-btn.is-active,
.tab-btn:hover {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 -1px 0 rgba(255, 250, 243, 0.92), 0 -8px 18px rgba(82, 58, 29, 0.08);
  z-index: 1;
}

.tab-btn.is-active {
  font-weight: 700;
  color: var(--primary-strong);
  box-shadow: 0 -1px 0 rgba(255, 250, 243, 0.96), 0 -10px 22px rgba(82, 58, 29, 0.1);
}

.tab-btn-parent::after {
  content: "▾";
  font-size: 0.8em;
  margin-left: 8px;
  opacity: 0.55;
  transform: translateY(-1px);
  transition: transform 160ms ease, opacity 160ms ease;
}

.nav-group:hover .tab-btn-parent::after,
.nav-group:focus-within .tab-btn-parent::after,
.nav-group.is-open .tab-btn-parent::after,
.tab-btn-parent[aria-expanded="true"]::after {
  opacity: 0.9;
  transform: translateY(-1px) rotate(180deg);
}

.view-stack {
  margin-top: 0;
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.view-panel {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.summary-panel {
  margin-top: 0;
  padding: 24px;
}

.overview-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.overview-heading {
  margin-bottom: 20px;
}

.overview-heading .panel-note {
  min-width: 180px;
}

.search-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  min-width: min(100%, 360px);
}

.search-field input,
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.overview-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.overview-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.overview-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.overview-card-heading h3 {
  font-size: 1.1rem;
}

.overview-stage-mix .stage-status-grid {
  gap: 10px;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-stats .metric-card {
  min-height: 120px;
}

.lead-pipeline-body {
  display: grid;
  gap: 14px;
}

.lead-board {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 8px 10px 4px;
  box-sizing: border-box;
}

.lead-board .lead-stage-column {
  display: grid;
  flex: 0 0 clamp(220px, 15vw, 260px);
  gap: 12px;
  align-content: start;
  min-height: clamp(360px, 46vw, 560px);
  min-width: clamp(220px, 15vw, 260px);
  overflow: hidden;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(242, 235, 224, 0.34));
  border: 1px solid var(--line);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.lead-board .lead-stage-column.is-drop-target {
  border-color: rgba(23, 107, 99, 0.42);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 99, 0.18), 0 18px 36px rgba(23, 107, 99, 0.08);
  transform: translateY(-1px);
}

.lead-board .lead-stage-column.lead-stage-targeted {
  background: linear-gradient(180deg, rgba(235, 238, 242, 1), rgba(219, 224, 232, 1));
}

.lead-board .lead-stage-column.lead-stage-contacted {
  background: linear-gradient(180deg, rgba(255, 231, 240, 1), rgba(247, 194, 218, 1));
}

.lead-board .lead-stage-column.lead-stage-conversation {
  background: linear-gradient(180deg, rgba(255, 244, 204, 1), rgba(246, 227, 151, 1));
}

.lead-board .lead-stage-column.lead-stage-presented {
  background: linear-gradient(180deg, rgba(217, 237, 255, 1), rgba(186, 219, 247, 1));
}

.lead-board .lead-stage-column.lead-stage-project-opportunity {
  background: linear-gradient(180deg, rgba(219, 247, 225, 1), rgba(182, 228, 191, 1));
}

.lead-board .lead-stage-column.lead-stage-archive {
  background: linear-gradient(180deg, rgba(241, 234, 227, 1), rgba(224, 214, 205, 1));
}

.lead-board .lead-stage-column.lead-stage-targeted .count-pill {
  background: rgba(70, 82, 96, 0.12);
  color: #4f5b69;
}

.lead-board .lead-stage-column.lead-stage-contacted .count-pill {
  background: rgba(177, 91, 40, 0.12);
  color: #a14c17;
}

.lead-board .lead-stage-column.lead-stage-conversation .count-pill {
  background: rgba(172, 128, 0, 0.12);
  color: #916900;
}

.lead-board .lead-stage-column.lead-stage-presented .count-pill {
  background: rgba(23, 107, 163, 0.12);
  color: #1d6f9f;
}

.lead-board .lead-stage-column.lead-stage-project-opportunity .count-pill {
  background: rgba(44, 123, 66, 0.12);
  color: #2a7a49;
}

.lead-board .lead-stage-column.lead-stage-archive .count-pill {
  background: rgba(92, 99, 110, 0.12);
  color: #5c636e;
}

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

.lead-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.lead-card:hover,
.lead-card:focus-visible {
  border-color: rgba(23, 107, 99, 0.34);
  box-shadow: 0 12px 24px rgba(82, 58, 29, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.lead-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.lead-card-head h4 {
  margin-bottom: 4px;
}

.lead-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.lead-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-card-body span {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.lead-card-body strong {
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-card-actions {
  display: flex;
  justify-content: end;
}

.lead-card-actions .btn {
  min-width: 132px;
}

.lead-board .lead-card {
  cursor: grab;
  background: var(--panel-strong);
  backdrop-filter: none;
}

.lead-board .lead-card.is-dragging {
  opacity: 0.45;
  transform: rotate(1deg) scale(0.99);
  box-shadow: 0 16px 36px rgba(82, 58, 29, 0.16);
}

.lead-records-shell {
  display: grid;
  gap: 14px;
}

.lead-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-strong);
  background: rgba(184, 92, 45, 0.1);
}

.lead-targeted .lead-pill {
  color: #4f5b69;
  background: rgba(70, 82, 96, 0.12);
}

.lead-contacted .lead-pill {
  color: #a14c17;
  background: rgba(177, 91, 40, 0.12);
}

.lead-conversation .lead-pill {
  color: #916900;
  background: rgba(172, 128, 0, 0.12);
}

.lead-presented .lead-pill {
  color: #1d6f9f;
  background: rgba(23, 107, 163, 0.12);
}

.lead-project-opportunity .lead-pill {
  color: #2a7a49;
  background: rgba(44, 123, 66, 0.12);
}

.lead-archive .lead-pill {
  color: #5c636e;
  background: rgba(92, 99, 110, 0.12);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 28, 14, 0.44);
  backdrop-filter: blur(6px);
  z-index: 39;
}

.lead-drawer {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px));
  height: min(90vh, 920px);
  margin: 0;
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: transparent;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lead-drawer-shell {
  height: 100%;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffaf6 0%, #f4ebdf 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lead-drawer-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.lead-drawer-heading h3 {
  font-size: 1.4rem;
}

.lead-drawer-form {
  display: grid;
  gap: 16px;
}

.lead-drawer-form .form-section {
  background: rgba(255, 255, 255, 0.62);
}

.lead-drawer-actions {
  margin-top: 2px;
}

.overview-list {
  display: grid;
  gap: 10px;
}

.overview-item {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.overview-item:hover,
.overview-item:focus-visible {
  border-color: rgba(23, 107, 99, 0.34);
  box-shadow: 0 12px 24px rgba(82, 58, 29, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.overview-item strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}

.overview-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.close-date {
  color: inherit;
}

.close-date.is-overdue {
  color: #a63b3b;
  font-weight: 700;
}

.overview-range {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 160px;
}

.overview-range span {
  font-weight: 600;
}

.overview-divider {
  height: 1px;
  margin: 22px 0 18px;
  background: linear-gradient(90deg, transparent, rgba(70, 52, 27, 0.16), transparent);
}

.overview-subheading {
  margin-bottom: 16px;
}

.overview-subheading h3 {
  margin-top: 4px;
  font-size: 1.25rem;
}

.section-caption {
  margin: 0;
  color: var(--muted);
  max-width: 34ch;
  text-align: right;
  font-size: 0.92rem;
  line-height: 1.45;
}

.stage-status-grid {
  display: grid;
  gap: 10px;
}

.stage-status-card {
  --stage-fill: var(--accent);
  display: block;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(70, 52, 27, 0.08);
  box-shadow: 0 10px 18px rgba(82, 58, 29, 0.04);
}

.stage-status-label {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.stage-status-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.stage-status-copy {
  display: grid;
  gap: 4px;
}

.stage-status-count {
  font: 600 0.84rem/1.1 "Space Grotesk", sans-serif;
  color: var(--muted);
  white-space: nowrap;
}

.stage-status-track {
  display: grid;
  gap: 6px;
  align-items: center;
}

.stage-status-track .progress-track {
  height: 9px;
  background: rgba(70, 52, 27, 0.08);
}

.stage-status-card.stage-new-0 .stage-status-label {
  color: #4f5b69;
}

.stage-status-card.stage-identified-10 .stage-status-label {
  color: #916900;
}

.stage-status-card.stage-pitching-25 .stage-status-label {
  color: #6142b5;
}

.stage-status-card.stage-proposed-50 .stage-status-label {
  color: #1d6f9f;
}

.stage-status-card.stage-negotiation-75 .stage-status-label {
  color: #a14c17;
}

.stage-status-card.stage-won-100 .stage-status-label {
  color: #2a7a49;
}

.stage-status-card.stage-lost .stage-status-label {
  color: #a63b3b;
}

.stage-status-percent {
  font: 700 0.96rem/1 "Space Grotesk", sans-serif;
  color: var(--stage-fill);
  white-space: nowrap;
  justify-self: end;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(70, 52, 27, 0.1);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--stage-fill) 92%, white), var(--stage-fill));
}

.stage-new-0 {
  --stage-fill: #4f5b69;
}

.stage-identified-10 {
  --stage-fill: #916900;
}

.stage-pitching-25 {
  --stage-fill: #6142b5;
}

.stage-proposed-50 {
  --stage-fill: #1d6f9f;
}

.stage-negotiation-75 {
  --stage-fill: #a14c17;
}

.stage-won-100 {
  --stage-fill: #2a7a49;
}

.stage-lost {
  --stage-fill: #a63b3b;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  min-height: 156px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  gap: 14px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font: 700 clamp(1.85rem, 2.8vw, 2.8rem) / 0.98 "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card span {
  font-size: 0.9rem;
}

.metric-card small {
  display: block;
  line-height: 1.4;
}

.panel-note {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-note strong {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-panel > .panel {
  padding: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.board {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 8px 10px 4px;
  box-sizing: border-box;
}

.stage-column {
  display: grid;
  flex: 0 0 clamp(240px, 16vw, 280px);
  gap: 12px;
  align-content: start;
  min-height: clamp(360px, 46vw, 560px);
  min-width: clamp(240px, 16vw, 280px);
  overflow: hidden;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(242, 235, 224, 0.96));
  border: 1px solid var(--line);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stage-column.is-drop-target {
  border-color: rgba(23, 107, 99, 0.42);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 99, 0.18), 0 18px 36px rgba(23, 107, 99, 0.08);
  transform: translateY(-1px);
}

.stage-new-0 {
  background: linear-gradient(180deg, rgba(235, 238, 242, 0.96), rgba(219, 224, 232, 0.98));
}

.stage-identified-10 {
  background: linear-gradient(180deg, rgba(255, 244, 204, 0.96), rgba(246, 227, 151, 0.98));
}

.stage-pitching-25 {
  background: linear-gradient(180deg, rgba(235, 226, 255, 0.96), rgba(214, 198, 248, 0.98));
}

.stage-proposed-50 {
  background: linear-gradient(180deg, rgba(217, 237, 255, 0.96), rgba(186, 219, 247, 0.98));
}

.stage-negotiation-75 {
  background: linear-gradient(180deg, rgba(255, 230, 205, 0.96), rgba(246, 202, 156, 0.98));
}

.stage-won-100 {
  background: linear-gradient(180deg, rgba(219, 247, 225, 0.96), rgba(182, 228, 191, 0.98));
}

.stage-lost {
  background: linear-gradient(180deg, rgba(255, 231, 231, 0.96), rgba(244, 188, 188, 0.98));
}

.column-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.count-pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.count-pill {
  background: rgba(23, 107, 99, 0.1);
  color: var(--accent);
}

.stage-new-0 .count-pill {
  background: rgba(70, 82, 96, 0.12);
  color: #4f5b69;
}

.stage-identified-10 .count-pill {
  background: rgba(172, 128, 0, 0.12);
  color: #916900;
}

.stage-pitching-25 .count-pill {
  background: rgba(96, 69, 174, 0.12);
  color: #6142b5;
}

.stage-proposed-50 .count-pill {
  background: rgba(23, 107, 163, 0.12);
  color: #1d6f9f;
}

.stage-negotiation-75 .count-pill {
  background: rgba(177, 91, 40, 0.12);
  color: #a14c17;
}

.stage-won-100 .count-pill {
  background: rgba(44, 123, 66, 0.12);
  color: #2a7a49;
}

.stage-lost .count-pill {
  background: rgba(184, 63, 63, 0.14);
  color: #a63b3b;
}

.column-body {
  display: grid;
  gap: 12px;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  cursor: grab;
  user-select: none;
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.record-card:active {
  cursor: grabbing;
}

.record-card.is-dragging {
  opacity: 0.45;
  transform: rotate(1deg) scale(0.99);
  box-shadow: 0 16px 36px rgba(82, 58, 29, 0.16);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.card-top h4 {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.tag {
  background: rgba(184, 92, 45, 0.1);
  color: var(--primary-strong);
}

.stage-new-0 .tag {
  background: rgba(70, 82, 96, 0.14);
  color: #4f5b69;
}

.stage-identified-10 .tag {
  background: rgba(172, 128, 0, 0.14);
  color: #916900;
}

.stage-pitching-25 .tag {
  background: rgba(96, 69, 174, 0.14);
  color: #6142b5;
}

.stage-proposed-50 .tag {
  background: rgba(23, 107, 163, 0.14);
  color: #1d6f9f;
}

.stage-negotiation-75 .tag {
  background: rgba(177, 91, 40, 0.14);
  color: #a14c17;
}

.stage-won-100 .tag {
  background: rgba(44, 123, 66, 0.14);
  color: #2a7a49;
}

.stage-lost .tag {
  background: rgba(184, 63, 63, 0.14);
  color: #a63b3b;
}

.card-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  color: var(--muted);
}

.card-meta span {
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.card-meta strong {
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  background: rgba(255, 255, 255, 0.72);
}

.client-table {
  table-layout: fixed;
  min-width: 880px;
}

.client-table th,
.client-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.client-table th:nth-child(1),
.client-table td:nth-child(1) {
  width: 200px;
}

.client-table th:nth-child(2),
.client-table td:nth-child(2) {
  width: 140px;
}

.client-table th:nth-child(3),
.client-table td:nth-child(3) {
  width: 108px;
}

.client-table th:nth-child(4),
.client-table td:nth-child(4) {
  width: 128px;
}

.client-table th:nth-child(5),
.client-table td:nth-child(5) {
  width: 220px;
}

.client-table th:nth-child(6),
.client-table td:nth-child(6) {
  width: 240px;
}

.client-table th:nth-child(7),
.client-table td:nth-child(7) {
  width: 240px;
}

thead {
  background: rgba(23, 107, 99, 0.08);
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(184, 92, 45, 0.08);
}

tbody tr {
  cursor: pointer;
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

.dialog {
  width: min(780px, calc(100% - 28px));
  border: 0;
  padding: 0;
  border-radius: 28px;
  background: transparent;
  z-index: 40;
}

.dialog::backdrop {
  background: rgba(40, 28, 14, 0.48);
  backdrop-filter: blur(6px);
}

.form-shell {
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffaf6 0%, #f4ebdf 100%);
  box-shadow: var(--shadow);
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.dialog-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 48ch;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(70, 52, 27, 0.08);
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}

.form-sections {
  display: grid;
  gap: 16px;
}

.form-section {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.lead-board .lead-stage-column,
.lead-board .lead-card {
  position: relative;
}

.form-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.form-section-heading h3 {
  font-size: 1rem;
}

.form-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-grid label span {
  font-weight: 600;
}

.field-group {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.select-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  text-align: left;
}

.select-field span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-menu {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(82, 58, 29, 0.12);
  z-index: 1;
}

.select-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.select-menu button:hover,
.select-menu button:focus-visible {
  background: rgba(23, 107, 99, 0.1);
  outline: none;
}

.lead-drawer input:disabled,
.lead-drawer textarea:disabled,
.lead-drawer select:disabled,
.dialog input:disabled,
.dialog textarea:disabled,
.dialog select:disabled {
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.currency-field {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

.currency-field input {
  padding-left: 28px;
}

.full-width {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.dialog-actions-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-ghost {
  background: rgba(70, 52, 27, 0.08);
  color: var(--text);
}

.danger {
  background: rgba(184, 63, 63, 0.12);
  color: #9f3232;
}

@media (max-width: 1100px) {
  .auth-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 18px;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-logo {
    width: min(170px, 58vw);
  }

  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-nav {
    overflow: visible;
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1 1 220px;
  }

  .nav-group {
    flex: 1 1 220px;
  }

  .nav-menu {
    position: static;
    margin-top: 6px;
    border-radius: 12px;
    padding: 6px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .overview-dashboard {
    grid-template-columns: 1fr;
  }

  .overview-stats {
    grid-template-columns: 1fr;
  }

  .lead-drawer {
    inset: 50% auto auto 50%;
    width: min(720px, calc(100vw - 24px));
    height: min(90vh, 920px);
  }

  .lead-board {
    gap: 12px;
  }

  .lead-board .lead-stage-column {
    flex-basis: clamp(180px, 18vw, 220px);
    min-width: clamp(180px, 18vw, 220px);
  }

  .dialog-actions {
    justify-content: stretch;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 18px;
  }

  .auth-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 18px;
  }

  .hero,
  .summary-panel,
  .view-panel > .panel {
    padding: 18px;
  }

  .hero-brand {
    align-items: flex-start;
    gap: 12px;
  }

  .hero-logo {
    width: min(170px, 44vw);
  }

  .nav-group {
    flex-basis: 100%;
  }

  .tab-btn {
    flex-basis: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .card-meta {
    grid-template-columns: 1fr;
  }

  .lead-card-body {
    grid-template-columns: 1fr;
  }

  .lead-board {
    gap: 10px;
    padding-inline: 2px;
  }

  .lead-board .lead-stage-column {
    flex-basis: 170px;
    min-width: 170px;
  }

  .lead-drawer {
    inset: 50% auto auto 50%;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dialog-actions-primary {
    width: 100%;
  }
}
