:root {
  --coal-950: #080809;
  --coal-900: #0d0d0f;
  --coal-850: #121214;
  --coal-800: #17171a;
  --coal-750: #1d1d21;
  --coal-700: #25252a;
  --bone-50: #faf8f3;
  --bone-100: #f1ede5;
  --bone-300: #c8c1b5;
  --bone-500: #8d877e;
  --fire-400: #ff6b35;
  --fire-500: #f4511e;
  --fire-600: #dc3910;
  --ember-400: #f3ae4b;
  --success-400: #4bc686;
  --danger-400: #f05d68;
  --info-400: #64a8ff;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.42);
  --shadow-fire: 0 18px 42px rgba(244, 81, 30, 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--coal-950);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--bone-100);
  background:
    radial-gradient(circle at 70% -10%, rgba(244, 81, 30, 0.09), transparent 32rem),
    var(--coal-950);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--fire-400);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.18;
}

.ambient--one {
  width: 28rem;
  height: 28rem;
  top: -12rem;
  right: 8%;
  background: var(--fire-500);
}

.ambient--two {
  width: 22rem;
  height: 22rem;
  bottom: -12rem;
  left: 30%;
  background: #7a240d;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

#loginScreen {
  display: none;
}

#accessScreen {
  display: none;
}

#loginScreen.active {
  display: flex;
}

#accessScreen.active {
  display: flex;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 107, 53, 0.48);
  border-radius: 12px;
  color: var(--fire-400);
  background: linear-gradient(145deg, rgba(244, 81, 30, 0.13), rgba(244, 81, 30, 0.02));
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-transform: uppercase;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--fire-400);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--bone-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow i {
  width: 18px;
  height: 2px;
  background: var(--fire-500);
  box-shadow: 0 0 12px rgba(244, 81, 30, 0.58);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 17px;
  color: var(--bone-100);
  background: transparent;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button--fire {
  border-color: var(--fire-500);
  background: linear-gradient(135deg, var(--fire-400), var(--fire-600));
  box-shadow: var(--shadow-fire);
}

.button--fire:hover {
  background: linear-gradient(135deg, #ff7a45, var(--fire-500));
}

.button--ember {
  border-color: rgba(243, 174, 75, 0.28);
  color: #1a1208;
  background: var(--ember-400);
}

.button--ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
}

.button--ghost:hover {
  border-color: rgba(255, 107, 53, 0.42);
  background: rgba(255, 107, 53, 0.08);
}

.button--light {
  color: #1a120f;
  background: var(--bone-50);
}

.button--wide {
  width: 100%;
}

/* Authentication */
.auth-layout {
  display: grid;
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
}

.auth-story {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 6vw, 78px);
  background:
    linear-gradient(115deg, rgba(8, 8, 9, 0.96), rgba(8, 8, 9, 0.44)),
    radial-gradient(circle at 82% 60%, rgba(255, 94, 35, 0.34), transparent 28rem),
    repeating-linear-gradient(115deg, transparent 0 18px, rgba(255, 255, 255, 0.018) 18px 19px),
    #101012;
}

.auth-story::after {
  position: absolute;
  right: -14%;
  bottom: -20%;
  width: 52vw;
  height: 52vw;
  border: 1px solid rgba(255, 107, 53, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 90px rgba(244, 81, 30, 0.07);
  content: "";
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 690px;
}

.auth-story-copy h1 {
  max-width: 640px;
  margin: 24px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(56px, 7.2vw, 108px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.87;
  text-transform: uppercase;
}

.auth-story-copy h1 em {
  color: var(--fire-400);
  font-style: normal;
}

.auth-story-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--bone-300);
  font-size: clamp(16px, 1.5vw, 20px);
}

.auth-proof {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.auth-proof span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--bone-300);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: rgba(10, 10, 11, 0.92);
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow-lg);
}

.auth-kicker,
.modal-kicker,
.queue-kicker {
  color: var(--fire-400);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 9px 0 12px;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.auth-card > p {
  margin: 0 0 26px;
  color: var(--bone-500);
}

.auth-feedback {
  min-height: 22px;
  margin: 14px 0 0 !important;
  color: var(--danger-400) !important;
  font-size: 13px;
}

.auth-security {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: var(--bone-500);
  font-size: 12px;
}

.auth-security span {
  color: var(--success-400);
}

/* Access waiting */
.access-shell {
  width: min(92%, 520px);
  margin: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  background: rgba(18, 18, 20, 0.92);
  box-shadow: var(--shadow-lg);
}

.access-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  place-items: center;
  border: 1px solid rgba(243, 174, 75, 0.35);
  border-radius: 50%;
  color: var(--ember-400);
  background: rgba(243, 174, 75, 0.08);
  font-size: 28px;
}

.access-shell h1 {
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  text-transform: uppercase;
}

.access-shell > p {
  margin: 0;
  color: var(--bone-500);
}

.access-user {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  color: var(--bone-300);
  background: rgba(255, 255, 255, 0.025);
}

/* App shell */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 258px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--border);
  padding: 28px 20px 20px;
  background: rgba(12, 12, 14, 0.88);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  padding: 0 8px;
}

.primary-nav {
  display: grid;
  gap: 6px;
  margin-top: 48px;
}

.nav-item {
  display: grid;
  min-height: 48px;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 12px;
  color: var(--bone-500);
  background: transparent;
  text-align: left;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--bone-50);
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  border-color: rgba(255, 107, 53, 0.18);
  box-shadow: inset 3px 0 var(--fire-500);
}

.nav-icon {
  color: var(--fire-400);
  font-size: 18px;
}

.nav-badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--fire-500);
  font-size: 10px;
  font-weight: 800;
}

.sidebar-pulse {
  margin-top: auto;
  border: 1px solid rgba(244, 81, 30, 0.18);
  border-radius: var(--radius-md);
  padding: 18px;
  background: linear-gradient(145deg, rgba(244, 81, 30, 0.1), rgba(244, 81, 30, 0.025));
}

.sidebar-pulse span,
.sidebar-pulse small {
  display: block;
  color: var(--bone-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-pulse strong {
  display: block;
  margin: 8px 0 2px;
  color: var(--fire-400);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding: 18px 4px 0;
}

.user-avatar {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  object-fit: cover;
  background: var(--coal-700);
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 12px;
}

.sidebar-user small {
  margin-top: 2px;
  color: var(--bone-500);
  font-size: 10px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--bone-500);
  background: transparent;
}

.icon-button:hover {
  color: var(--fire-400);
  border-color: rgba(255, 107, 53, 0.3);
}

.workspace {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 38px clamp(24px, 4vw, 58px) 64px;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.workspace-header h1 {
  margin: 9px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.94;
  text-transform: uppercase;
}

.workspace-header p {
  margin: 0;
  color: var(--bone-500);
}

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

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bone-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.connection-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-400);
  box-shadow: 0 0 10px rgba(75, 198, 134, 0.7);
}

.connection-status.error i {
  background: var(--danger-400);
  box-shadow: 0 0 10px rgba(240, 93, 104, 0.6);
}

.rescue-banner {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  border: 1px solid rgba(244, 81, 30, 0.3);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background:
    linear-gradient(100deg, rgba(244, 81, 30, 0.2), rgba(244, 81, 30, 0.045) 62%),
    var(--coal-850);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.rescue-banner.is-clear {
  border-color: rgba(75, 198, 134, 0.22);
  background: linear-gradient(100deg, rgba(75, 198, 134, 0.12), rgba(75, 198, 134, 0.025)), var(--coal-850);
}

.rescue-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 14px;
  color: var(--bone-50);
  background: var(--fire-500);
  font-size: 24px;
  box-shadow: var(--shadow-fire);
}

.rescue-banner span {
  display: block;
  color: var(--fire-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rescue-banner strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
}

.rescue-banner strong b {
  color: var(--fire-400);
}

.rescue-banner p {
  margin: 2px 0 0;
  color: var(--bone-500);
  font-size: 12px;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.stat-card::after {
  position: absolute;
  right: -32px;
  bottom: -54px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  filter: blur(38px);
  opacity: 0.09;
}

.stat-card--new { color: var(--fire-400); }
.stat-card--attention { color: var(--danger-400); }
.stat-card--today { color: var(--info-400); }
.stat-card--success { color: var(--success-400); }

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--bone-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-top i {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-style: normal;
}

.stat-card > strong {
  display: block;
  margin-top: 14px;
  color: var(--bone-50);
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.stat-card > small {
  color: var(--bone-500);
  font-size: 11px;
}

/* Queue */
.queue-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(16, 16, 18, 0.72);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.18);
}

.queue-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.queue-heading h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.queue-heading h2 small {
  margin-left: 8px;
  color: var(--bone-500);
  font-size: 11px;
  font-weight: 500;
}

.search-field {
  display: flex;
  width: min(100%, 390px);
  min-height: 43px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 13px;
  color: var(--bone-500);
  background: var(--coal-900);
}

.search-field:focus-within {
  border-color: rgba(255, 107, 53, 0.5);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--bone-100);
  background: transparent;
}

.search-field input::placeholder,
textarea::placeholder {
  color: #66615b;
}

.filters-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.015);
}

.filters-bar label > span {
  display: block;
  margin: 0 0 5px 2px;
  color: var(--bone-500);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.filters-bar select,
.inline-form input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--bone-300);
  background: var(--coal-900);
}

.filters-bar select {
  height: 39px;
  padding: 0 32px 0 11px;
}

.filter-clear {
  height: 39px;
  border: 0;
  padding: 0 8px;
  color: var(--bone-500);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.filter-clear:hover {
  color: var(--fire-400);
}

.leads-list {
  min-height: 280px;
}

.leads-header,
.lead-card {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(125px, 0.7fr) 120px 125px minmax(170px, 0.8fr);
  align-items: center;
  gap: 16px;
}

.leads-header {
  min-height: 38px;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  color: var(--bone-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.lead-card {
  position: relative;
  min-height: 88px;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background 160ms ease;
}

.lead-card:last-child {
  border-bottom: 0;
}

.lead-card:hover {
  background: rgba(255, 255, 255, 0.025);
}

.lead-card::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--urgency-color, transparent);
  content: "";
}

.lead-card[data-urgency="overdue"] { --urgency-color: var(--danger-400); }
.lead-card[data-urgency="urgent"] { --urgency-color: var(--fire-500); }
.lead-card[data-urgency="attention"] { --urgency-color: var(--ember-400); }
.lead-card[data-urgency="recent"] { --urgency-color: var(--info-400); }

.lead-person {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.lead-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--fire-400);
  background: rgba(244, 81, 30, 0.07);
  font-family: var(--font-display);
  font-size: 21px;
}

.lead-person strong,
.lead-person small,
.lead-cell strong,
.lead-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-person strong,
.lead-cell strong {
  color: var(--bone-100);
  font-size: 13px;
}

.lead-person small,
.lead-cell small {
  margin-top: 3px;
  color: var(--bone-500);
  font-size: 10px;
}

.urgency-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--bone-300);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.urgency-badge::before,
.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.urgency-badge--overdue { color: var(--danger-400); border-color: rgba(240, 93, 104, 0.25); }
.urgency-badge--urgent { color: var(--fire-400); border-color: rgba(255, 107, 53, 0.25); }
.urgency-badge--attention { color: var(--ember-400); border-color: rgba(243, 174, 75, 0.25); }
.urgency-badge--recent { color: var(--info-400); border-color: rgba(100, 168, 255, 0.22); }
.status-badge--convertido { color: var(--success-400); }
.status-badge--perdido { color: var(--danger-400); }
.status-badge--aguardando_retorno { color: var(--ember-400); }
.status-badge--em_contato { color: var(--info-400); }
.status-badge--novo { color: var(--fire-400); }

.lead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.lead-action {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 11px;
  color: var(--bone-300);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  font-weight: 800;
}

.lead-action--primary {
  border-color: rgba(75, 198, 134, 0.25);
  color: var(--success-400);
  background: rgba(75, 198, 134, 0.06);
}

.lead-action:hover {
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--bone-50);
}

.empty-state {
  padding: 70px 24px;
  text-align: center;
}

.empty-state > div {
  color: var(--fire-400);
  font-size: 36px;
}

.empty-state h3 {
  margin: 12px 0 3px;
}

.empty-state p,
.muted {
  margin: 0;
  color: var(--bone-500);
}

.loading-row {
  display: grid;
  min-height: 250px;
  place-items: center;
  color: var(--bone-500);
}

.mobile-nav {
  display: none;
}

/* Modals */
.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  background: rgba(3, 3, 4, 0.8);
  backdrop-filter: blur(12px);
}

.modal.active {
  display: flex;
}

.modal-panel {
  width: min(100%, 1080px);
  margin: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--coal-850);
  box-shadow: var(--shadow-lg);
}

.modal-panel--team {
  width: min(100%, 760px);
}

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

.modal-header h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--bone-500);
  background: transparent;
  font-size: 24px;
}

.modal-close:hover {
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--bone-50);
}

.lead-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(290px, 0.82fr);
}

.lead-main-column,
.activity-column {
  min-width: 0;
  padding: 24px;
}

.activity-column {
  border-left: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
}

.lead-detail-hero {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
}

.lead-detail-avatar {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(255, 107, 53, 0.28);
  border-radius: 16px;
  color: var(--fire-400);
  background: rgba(244, 81, 30, 0.08);
  font-family: var(--font-display);
  font-size: 30px;
}

.lead-detail-hero h3 {
  margin: 0;
  font-size: 21px;
}

.lead-detail-hero p {
  margin: 2px 0 0;
  color: var(--bone-500);
}

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

.detail-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.detail-card span {
  display: block;
  color: var(--bone-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-card strong,
.detail-card a {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--bone-100);
  font-size: 13px;
  text-decoration: none;
}

.detail-card a:hover {
  color: var(--fire-400);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.status-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.status-option {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--bone-500);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-option:hover,
.status-option.active {
  border-color: rgba(255, 107, 53, 0.35);
  color: var(--fire-400);
  background: rgba(244, 81, 30, 0.07);
}

.modal-section {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title span {
  display: block;
  color: var(--fire-400);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-title h3 {
  margin: 2px 0 0;
  font-size: 15px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 11px;
}

.inline-form input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  margin: 11px 0 8px;
  padding: 12px;
  resize: vertical;
}

.activity-list {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 20px;
}

.activity-item:not(:last-child)::after {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 13px;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.activity-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--fire-400);
  background: var(--coal-800);
  font-size: 11px;
}

.activity-content strong {
  display: block;
  font-size: 12px;
}

.activity-content p {
  margin: 3px 0;
  color: var(--bone-300);
  font-size: 12px;
  white-space: pre-wrap;
}

.activity-content small {
  color: var(--bone-500);
  font-size: 9px;
}

.team-section {
  padding: 22px 24px;
}

.team-section + .team-section {
  border-top: 1px solid var(--border);
}

.team-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.team-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.team-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  color: var(--fire-400);
  background: rgba(244, 81, 30, 0.08);
  font-family: var(--font-display);
  font-size: 20px;
}

.team-row strong,
.team-row small {
  display: block;
}

.team-row small {
  color: var(--bone-500);
  font-size: 10px;
}

.team-actions {
  display: flex;
  gap: 6px;
}

.team-actions button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--bone-300);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
}

.team-actions .approve {
  border-color: rgba(75, 198, 134, 0.24);
  color: var(--success-400);
}

.toast-region {
  position: fixed;
  z-index: 2200;
  top: 20px;
  right: 20px;
  display: grid;
  width: min(380px, calc(100vw - 40px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success-400);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--bone-100);
  background: rgba(24, 24, 27, 0.97);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  animation: toast-in 220ms ease both;
}

.toast.error {
  border-left-color: var(--danger-400);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .filters-bar { grid-template-columns: repeat(2, minmax(150px, 1fr)) auto; }
  .leads-header,
  .lead-card { grid-template-columns: minmax(190px, 1.3fr) 110px 110px minmax(155px, 0.8fr); }
  .leads-header > :nth-child(2),
  .lead-card > :nth-child(2) { display: none; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 48vh; padding-bottom: 44px; }
  .auth-story-copy h1 { font-size: clamp(54px, 12vw, 86px); }
  .auth-panel { min-height: auto; padding: 48px 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .workspace { padding-bottom: 100px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-modal-layout { grid-template-columns: 1fr; }
  .activity-column { border-top: 1px solid var(--border); border-left: 0; }
  .mobile-nav {
    position: fixed;
    z-index: 800;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 7px;
    background: rgba(17, 17, 19, 0.94);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
  }
  .mobile-nav button {
    display: flex;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    color: var(--bone-500);
    background: transparent;
    font-size: 9px;
    font-weight: 800;
  }
  .mobile-nav button.active { color: var(--fire-400); background: rgba(244, 81, 30, 0.08); }
  .mobile-nav span { font-size: 16px; }
}

@media (max-width: 720px) {
  .workspace { padding: 24px 14px 96px; }
  .workspace-header { align-items: flex-start; flex-direction: column; }
  .workspace-actions { width: 100%; justify-content: space-between; }
  .workspace-header p { font-size: 13px; }
  .rescue-banner { grid-template-columns: 44px 1fr; }
  .rescue-icon { width: 44px; height: 44px; }
  .rescue-banner .button { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 122px; padding: 14px; }
  .stat-card > strong { font-size: 35px; }
  .stat-top { font-size: 9px; }
  .queue-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .filters-bar { display: flex; overflow-x: auto; align-items: flex-end; padding: 12px 14px; scrollbar-width: none; }
  .filters-bar::-webkit-scrollbar { display: none; }
  .filters-bar label { min-width: 156px; }
  .filter-clear { min-width: 88px; }
  .leads-header { display: none; }
  .leads-list { display: grid; gap: 8px; padding: 10px; }
  .lead-card {
    grid-template-columns: 1fr auto;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
  }
  .lead-card > :nth-child(2) { display: block; }
  .lead-card .lead-cell { grid-column: 1 / 2; }
  .lead-card .lead-time { grid-column: 2; grid-row: 1; align-self: start; }
  .lead-actions { grid-column: 1 / -1; justify-content: stretch; }
  .lead-action { flex: 1; }
  .modal { padding: 0; }
  .modal-panel { min-height: 100vh; border: 0; border-radius: 0; }
  .modal-header,
  .lead-main-column,
  .activity-column,
  .team-section { padding: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-card--wide { grid-column: auto; }
  .inline-form { grid-template-columns: 1fr; }
  .access-shell { padding: 34px 22px; }
}

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