/* =========================================================================
   TGT MEDIA — CRM DESIGN SYSTEM
   Foundation tokens, primitives, components.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Brand */
  --tgt-ink: #1A1A1A;
  --tgt-ink-2: #242424;
  --tgt-ink-3: #303030;
  --tgt-accent: #FFD100;
  --tgt-accent-hover: #E9BD00;
  --tgt-accent-press: #B89200;
  --tgt-accent-2: #FFE873;
  --tgt-amber: #FFD100;
  --tgt-accent-soft: rgba(255, 209, 0, 0.14);
  --tgt-accent-softer: rgba(255, 209, 0, 0.08);
  --tgt-accent-border: rgba(255, 209, 0, 0.36);
  --tgt-accent-ring: rgba(255, 209, 0, 0.34);
  --tgt-glow: 0 0 0 1px var(--tgt-accent-border), 0 10px 32px -10px rgba(255, 209, 0, 0.55);
  --tgt-glow-strong: 0 0 0 1px var(--tgt-accent-border), 0 18px 48px -14px rgba(255, 209, 0, 0.62), 0 0 0 4px rgba(255, 209, 0, 0.10);
  --tgt-gradient: linear-gradient(135deg, #FFD100 0%, #FFE05A 55%, #FFF2A8 100%);
  --tgt-gradient-soft: linear-gradient(135deg, rgba(255, 209, 0, 0.14), rgba(255, 242, 168, 0.08));

  /* Surfaces */
  --bg: #FAF9F6;
  --bg-2: #F1F0EC;
  --surface: #FAF9F6;
  --surface-2: #F6F4EF;
  --surface-sunken: #EFEEE9;
  --surface-hover: #F6F4EF;
  --surface-strong: #E5E3DD;
  --surface-glass: rgba(250, 249, 246, 0.72);
  --surface-glass-strong: rgba(250, 249, 246, 0.88);

  /* Text */
  --text: #1A1A1A;
  --text-2: #43464D;
  --text-3: #767982;
  --text-4: #A0A2A8;
  --text-on-accent: #1A1A1A;
  --text-on-ink: #FAF9F6;

  /* Borders */
  --line: #ECECEF;
  --line-strong: #D9DADD;
  --line-stronger: #C5C7CC;

  /* Semantic */
  --success: #1F9D55;
  --success-soft: rgba(31, 157, 85, 0.12);
  --warn: #C97C18;
  --warn-soft: rgba(201, 124, 24, 0.12);
  --danger: #DC3535;
  --danger-soft: rgba(220, 53, 53, 0.10);
  --danger-border: rgba(220, 53, 53, 0.22);
  --info: #2563EB;
  --info-soft: rgba(37, 99, 235, 0.10);

  /* Stage palette */
  --stage-novo: #2563EB;
  --stage-em_contato: #C97C18;
  --stage-qualificado: #167C6B;
  --stage-proposta: #7B61D6;
  --stage-ganho: #1F9D55;
  --stage-perdido: #9A9DA8;

  /* Elevation — refined ladder with cooler, deeper black */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(26, 26, 26, 0.05), 0 0 0 1px rgba(26, 26, 26, 0.04);
  --shadow-2: 0 3px 6px -1px rgba(26, 26, 26, 0.08), 0 1px 2px rgba(26, 26, 26, 0.05), 0 0 0 1px rgba(26, 26, 26, 0.05);
  --shadow-3: 0 14px 28px -8px rgba(26, 26, 26, 0.14), 0 6px 12px -3px rgba(26, 26, 26, 0.08), 0 0 0 1px rgba(26, 26, 26, 0.06);
  --shadow-4: 0 32px 64px -16px rgba(26, 26, 26, 0.24), 0 16px 32px -8px rgba(26, 26, 26, 0.14), 0 0 0 1px rgba(26, 26, 26, 0.07);
  --shadow-inset: inset 0 1px 0 rgba(250, 249, 246, 0.55);
  --shadow-card-hover: 0 16px 32px -12px rgba(26, 26, 26, 0.12), 0 6px 14px -6px rgba(26, 26, 26, 0.08), 0 0 0 1px rgba(26, 26, 26, 0.06);
  --shadow-button-primary: 0 1px 0 rgba(250, 249, 246, 0.35) inset, 0 6px 14px -4px rgba(255, 209, 0, 0.56), 0 1px 2px rgba(184, 146, 0, 0.38);

  /* Focus ring */
  --ring: 0 0 0 3px var(--tgt-accent-ring);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  /* Spacing scale (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-10: 64px;

  /* Motion */
  --dur-instant: 80ms;
  --dur-fast: 140ms;
  --dur-base: 200ms;
  --dur-slow: 260ms;
  --dur-slower: 360ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* Layout */
  --sidebar: 236px;
  --topbar: 56px;
  --row-h: 44px;

  /* Type */
  --font-sans: "Geist", "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --fs-display: clamp(40px, 5vw, 56px);
  --fs-h1: 26px;
  --fs-h2: 20px;
  --fs-h3: 15px;
  --fs-body: 13.5px;
  --fs-small: 12.5px;
  --fs-micro: 11px;

  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "calt";
}

/* =========================================================================
   RESET & BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 0% -10%, rgba(255, 209, 0, 0.05), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(26, 26, 26, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  letter-spacing: -0.003em;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
}

img, svg { display: block; max-width: 100%; }

svg.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

/* Selection */
::selection { background: var(--tgt-accent-soft); color: var(--tgt-accent-press); }

/* Caret color */
input, textarea { caret-color: var(--tgt-accent); }

/* Focus ring (universal) */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* Scrollbars (subtle) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--text-4); background-clip: content-box; }

/* =========================================================================
   TYPOGRAPHY UTILITIES
   ========================================================================= */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; line-height: 1.2; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p  { margin: 0; }

.kicker {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* =========================================================================
   KEYBOARD HINT (kbd)
   ========================================================================= */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 500 10.5px var(--font-mono);
  color: var(--text-2);
  line-height: 1;
}

/* =========================================================================
   FORM CONTROLS
   ========================================================================= */
input, select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-body);
  transition: border-color var(--dur-fast) var(--ease-std), box-shadow var(--dur-fast) var(--ease-std), background var(--dur-fast);
}
textarea { min-height: 120px; padding-top: 9px; padding-bottom: 9px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:hover, select:hover, textarea:hover { border-color: var(--line-stronger); }
input:focus, select:focus, textarea:focus {
  border-color: var(--tgt-accent);
  box-shadow: var(--ring);
  outline: none;
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunken);
  color: var(--text-3);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767982' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

label {
  display: grid;
  gap: 6px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-2);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.button, .icon-button, .nav-item, .segment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
  font-weight: 550;
  white-space: nowrap;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std),
              border-color var(--dur-fast) var(--ease-std),
              box-shadow var(--dur-fast) var(--ease-std),
              transform var(--dur-instant) var(--ease-std);
}

.button {
  height: 34px;
  padding: 0 12px;
}
.button.full { width: 100%; }
.button.lg { height: 40px; padding: 0 16px; }
.button.sm { height: 28px; padding: 0 10px; font-size: var(--fs-small); }

.button:active { transform: scale(0.98); }

.button.primary {
  position: relative;
  background: var(--tgt-gradient);
  background-size: 140% 140%;
  background-position: 0% 50%;
  color: var(--text-on-accent);
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-button-primary);
  transition: background-position var(--dur-slow) var(--ease-out),
              transform var(--dur-instant) var(--ease-std),
              box-shadow var(--dur-fast) var(--ease-std);
}
.button.primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 1px 0 rgba(250, 249, 246, 0.22) inset, 0 10px 22px -6px rgba(184, 146, 0, 0.55), 0 1px 2px rgba(184, 146, 0, 0.45);
}
.button.primary:active { background-position: 100% 50%; transform: scale(0.98); }
.button.primary:disabled { background: var(--text-4); box-shadow: none; }

.button.ink {
  background: linear-gradient(180deg, var(--tgt-ink-3) 0%, var(--tgt-ink) 100%);
  color: #FAF9F6;
  box-shadow: 0 1px 0 rgba(250, 249, 246, 0.06) inset, 0 4px 10px -4px rgba(26, 26, 26, 0.4);
}
.button.ink:hover { background: linear-gradient(180deg, #303030 0%, #1A1A1A 100%); }

.button.ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line);
}
.button.ghost:hover { background: var(--surface-sunken); color: var(--text); border-color: var(--line-strong); }

.button.subtle {
  background: var(--surface-sunken);
  color: var(--text);
}
.button.subtle:hover { background: var(--surface-strong); }

.button.danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
}
.button.danger:hover { background: var(--danger-soft); }

.button :is(i, svg), .icon-button :is(i, svg), .nav-item :is(i, svg), .segment-button :is(i, svg) {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
  flex: 0 0 auto;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--text-2);
}
.icon-button:hover { background: var(--surface-sunken); color: var(--text); }
.icon-button.compact { width: 26px; height: 26px; }
.icon-button.compact :is(i, svg) { width: 13px; height: 13px; }
.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* =========================================================================
   AUTH VIEW — split-screen (premium, conversion-tuned)
   ========================================================================= */
.auth-view {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
  background: var(--surface);
}

.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 28% 32%, rgba(255, 209, 0, 0.18), transparent 65%),
    radial-gradient(ellipse 60% 60% at 78% 84%, rgba(255, 209, 0, 0.10), transparent 65%),
    linear-gradient(160deg, #242424 0%, #1A1A1A 55%, #111111 100%);
  color: #FAF9F6;
  padding: 48px 56px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 32px;
}

/* Animated aurora wash */
.auth-aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 65%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(255, 209, 0, 0.35), transparent 70%) 18% 30%/45% 60% no-repeat,
    radial-gradient(closest-side, rgba(255, 209, 0, 0.18), transparent 70%) 72% 52%/40% 50% no-repeat;
  filter: blur(60px) saturate(140%);
  opacity: 0.85;
  animation: auroraDrift 14s var(--ease-std) infinite alternate;
  z-index: 0;
}
@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3%, 4%, 0) scale(1.06); }
}

/* Subtle dot grid layered on top of aurora */
.auth-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(250, 249, 246, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 35% 50%, #1A1A1A 22%, transparent 78%);
          mask-image: radial-gradient(ellipse at 35% 50%, #1A1A1A 22%, transparent 78%);
  z-index: 0;
}

/* Decorative pulsing ring keyed to the logo bullseye */
.auth-brand::after {
  content: "";
  position: absolute;
  left: 28%; top: 50%;
  width: 540px; height: 540px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 209, 0, 0.32);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 0, 0.06),
    inset 0 0 0 80px rgba(255, 209, 0, 0.035),
    0 0 80px -20px rgba(255, 209, 0, 0.35);
  animation: pulseRing 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.auth-brand-inner {
  position: relative;
  z-index: 2;
  display: contents;
}

@keyframes pulseRing {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.9; }
  50%      { transform: translate(-50%, -50%) scale(1.06); opacity: 0.55; }
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #FAF9F6;
}
.brand-wordmark .brand-logo {
  width: 30px;
  height: 30px;
  color: #FAF9F6;
  filter: drop-shadow(0 4px 14px rgba(255, 209, 0, 0.45));
}
.brand-wordmark .brand-name { color: #FAF9F6; font-weight: 600; letter-spacing: -0.01em; }
.brand-wordmark .brand-dim { color: rgba(250, 249, 246, 0.5); font-weight: 400; margin-left: 2px; }

.auth-hero {
  display: grid;
  align-content: center;
  gap: 20px;
  max-width: 520px;
}
.auth-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 249, 246, 0.62);
}
.auth-hero .eyebrow::before {
  content: "";
  width: 22px; height: 1.5px;
  background: var(--tgt-gradient);
  border-radius: 2px;
}
.auth-hero h2 {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: #FAF9F6;
}
.auth-hero h2 em {
  font-style: normal;
  background: var(--tgt-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  position: relative;
}
.auth-hero p {
  color: rgba(250, 249, 246, 0.7);
  font-size: 15px;
  line-height: 1.55;
  max-width: 460px;
}

.auth-props {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  max-width: 460px;
}
.auth-prop {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: center;
  color: rgba(250, 249, 246, 0.78);
  font-size: 13.5px;
}
.auth-prop-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 209, 0, 0.18);
  color: var(--tgt-accent);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 0, 0.4);
}
.auth-prop-icon svg { width: 12px; height: 12px; }
/* Legacy dot retained for compatibility */
.auth-prop-dot {
  margin-top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tgt-accent);
  box-shadow: 0 0 0 4px rgba(255, 209, 0, 0.18);
  justify-self: center;
}
.auth-prop strong { color: #FAF9F6; font-weight: 600; }

.auth-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid rgba(250, 249, 246, 0.08);
  max-width: 520px;
}
.auth-stat {
  display: grid;
  gap: 4px;
}
.auth-stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #FAF9F6;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.auth-stat-value .auth-stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: rgba(250, 249, 246, 0.55);
  margin-left: 2px;
}
.auth-stat-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 249, 246, 0.5);
}

.auth-form-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px 32px;
  background:
    radial-gradient(800px 400px at 90% -10%, rgba(255, 209, 0, 0.04), transparent 60%),
    var(--surface);
  animation: fadeUp var(--dur-slower) var(--ease-out);
}
.auth-panel {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 26px;
}
.auth-panel .heading {
  display: grid;
  gap: 6px;
}
.auth-panel .heading .auth-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tgt-accent);
}
.auth-panel .heading h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
}
.auth-panel .heading p {
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.5;
}

.auth-form { display: grid; gap: 16px; }
.auth-form label { gap: 8px; font-size: 12.5px; }
.auth-form .field-wrap input { height: 44px; font-size: 14px; }
.auth-form .button.primary.lg { height: 46px; font-size: 14px; gap: 9px; }

.setup-form {
  padding-top: 22px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.auth-divider {
  margin-top: 2px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.auth-divider button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 4px 0;
  border-radius: var(--r-xs);
  transition: color var(--dur-fast);
}
.auth-divider button :is(i, svg) { width: 12px; height: 12px; transition: transform var(--dur-fast) var(--ease-std); }
.auth-divider button:hover { color: var(--tgt-accent); }
.auth-divider button:hover :is(i, svg) { transform: translate(2px, -2px); }

.demo-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--tgt-accent-softer);
  border: 1px solid var(--tgt-accent-border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tgt-accent-press);
}
.demo-hint :is(i, svg) { width: 12px; height: 12px; color: var(--tgt-accent); }
.demo-hint strong { color: var(--tgt-accent-press); font-weight: 600; }

.auth-footer {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-4);
  justify-self: center;
}
.auth-footer-sep { opacity: 0.6; }

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

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

/* ----- Sidebar ----- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px 12px;
  background:
    linear-gradient(180deg, var(--surface) 0%, rgba(250, 249, 246, 0.96) 100%);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 209, 0, 0.30), transparent 65%),
    linear-gradient(160deg, var(--tgt-ink-3) 0%, var(--tgt-ink) 100%);
  color: #FAF9F6;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow:
    inset 0 1px 0 rgba(250, 249, 246, 0.06),
    inset 0 0 0 1px rgba(250, 249, 246, 0.06),
    0 6px 14px -6px rgba(26, 26, 26, 0.4);
  overflow: hidden;
}
.brand-mark .brand-mark-logo {
  width: 22px;
  height: 22px;
  color: #FAF9F6;
  filter: drop-shadow(0 2px 4px rgba(255, 209, 0, 0.6));
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px rgba(31, 157, 85, 0.3);
}
.brand-lockup .brand-text { min-width: 0; }
.brand-lockup h1 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
.brand-lockup p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-lockup p::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: connectionPulse 2.4s ease-in-out infinite;
}
@keyframes connectionPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); }
  50%      { box-shadow: 0 0 0 5px rgba(31, 157, 85, 0.08); }
}
.brand-lockup.compact { /* compatibility */ margin-bottom: 0; }

.nav-list {
  display: grid;
  align-content: start;
  gap: 1px;
  padding-top: 6px;
}
.nav-section-label {
  margin-top: 14px;
  padding: 4px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}
.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  position: relative;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  justify-content: flex-start;
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  border-radius: 8px;
}
.nav-item :is(i, svg) { color: var(--text-3); transition: color var(--dur-fast); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover :is(i, svg) { color: var(--text-2); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(255, 209, 0, 0.10) 0%, rgba(255, 209, 0, 0.06) 100%);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 0, 0.16);
}
.nav-item.active :is(i, svg) { color: var(--tgt-accent); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tgt-gradient);
  box-shadow: 0 0 8px rgba(255, 209, 0, 0.55);
  animation: barIn var(--dur-slow) var(--ease-out);
}
@keyframes barIn {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.sidebar-footer {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.user-chip {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr 14px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.user-chip:hover { background: var(--surface-sunken); border-color: var(--line); }
.user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tgt-accent), #FFE873);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: -0.01em;
}
.user-chip .user-meta { min-width: 0; }
.user-chip .name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .role {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.user-chip :is(i, svg) { width: 14px; height: 14px; color: var(--text-3); }

.user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 4px;
  z-index: 10;
  animation: popIn var(--dur-base) var(--ease-out);
  transform-origin: bottom left;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  color: var(--text-2);
  font-size: 12.5px;
  background: transparent;
  border: 0;
  text-align: left;
  font-weight: 500;
}
.user-menu-item:hover { background: var(--surface-sunken); color: var(--text); }
.user-menu-item :is(i, svg) { width: 13px; height: 13px; color: var(--text-3); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-soft); }
.user-menu-item.danger :is(i, svg) { color: var(--danger); }
.user-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.user-menu-label {
  padding: 6px 10px 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ----- Workspace ----- */
.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--topbar) 1fr;
}

/* ----- Topbar ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  height: var(--topbar);
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(220px, 460px) 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface-glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(250, 249, 246, 0.6) inset, 0 4px 24px -16px rgba(26, 26, 26, 0.18);
}

.search-box {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 8px 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.search-box:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.search-box:focus-within {
  border-color: var(--tgt-accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
.search-box :is(i, svg) { width: 14px; height: 14px; color: var(--text-3); }
.search-box input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
}
.search-box input:focus { box-shadow: none; }
.search-box .kbd-hint { display: inline-flex; gap: 3px; }

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

.company-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 10px;
  max-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  cursor: pointer;
  position: relative;
}
.company-switcher:hover { background: var(--surface-2); border-color: var(--line-strong); }
.company-switcher:disabled { cursor: default; opacity: 1; }
.company-switcher .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-soft);
  flex: 0 0 auto;
}
.company-switcher .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.company-switcher .chev { width: 14px; height: 14px; color: var(--text-3); }

/* Popover (custom dropdown) */
.popover {
  position: fixed;
  z-index: 50;
  min-width: 240px;
  max-width: 320px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  animation: popIn var(--dur-base) var(--ease-out);
  transform-origin: top right;
}
.popover-search {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.popover-search :is(i, svg) { width: 13px; height: 13px; color: var(--text-3); }
.popover-search input {
  height: 28px;
  padding: 0;
  border: 0;
  font-size: 13px;
  background: transparent;
}
.popover-search input:focus { box-shadow: none; }
.popover-list { display: grid; gap: 1px; max-height: 320px; overflow-y: auto; }
.popover-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  border: 0;
  text-align: left;
}
.popover-item:hover, .popover-item.focus { background: var(--surface-sunken); }
.popover-item .meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.popover-item .check { width: 13px; height: 13px; color: var(--tgt-accent); opacity: 0; }
.popover-item[data-selected="true"] .check { opacity: 1; }
.popover-item[data-selected="true"] { color: var(--text); font-weight: 600; }

/* =========================================================================
   CONTENT
   ========================================================================= */
.content {
  min-width: 0;
  padding: 22px 24px 32px;
}
.content.is-transitioning {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast) var(--ease-std), transform var(--dur-fast) var(--ease-std);
}

/* ----- Page header ----- */
.page-header {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.breadcrumbs .sep { color: var(--text-4); }

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title h2 {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.022em;
}
.page-title .sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
}
.page-title .sub .tabular { color: var(--text-2); font-weight: 600; }

/* ----- KPI strip ----- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 18px;
}
.kpi {
  position: relative;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(250, 249, 246, 1) 0%, rgba(246, 244, 239, 1) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-fast), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-1);
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--tgt-gradient);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 0, 0.10), transparent 65%);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
.kpi:hover {
  border-color: rgba(255, 209, 0, 0.18);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.kpi:hover::before { opacity: 1; }
.kpi:hover::after { opacity: 1; }
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.kpi-label :is(i, svg) { width: 13px; height: 13px; color: var(--text-4); }
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.kpi-delta {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta :is(i, svg) { width: 11px; height: 11px; }

/* ----- Toolbar ----- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ----- Segments (magic-move) ----- */
.segments {
  position: relative;
  display: inline-flex;
  padding: 3px;
  height: 32px;
  background: var(--surface-sunken);
  border-radius: var(--r-pill);
  isolation: isolate;
}
.segments .thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-slow) var(--ease-out), width var(--dur-slow) var(--ease-out);
  z-index: 0;
  will-change: transform, width;
}
.segment-button {
  position: relative;
  z-index: 1;
  height: 26px;
  padding: 0 12px;
  background: transparent;
  color: var(--text-3);
  font-weight: 500;
  font-size: 12.5px;
}
.segment-button:hover { color: var(--text-2); }
.segment-button.active { color: var(--text); font-weight: 600; }

/* ----- Filter chips ----- */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.filter-add:hover { border-color: var(--text-4); color: var(--text-2); background: var(--surface-2); }
.filter-add :is(i, svg) { width: 12px; height: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--text-2);
  animation: chipIn var(--dur-base) var(--ease-out);
}
.chip strong { color: var(--text); font-weight: 600; }
.chip .chip-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--text-3);
}
.chip .chip-remove:hover { background: var(--surface-sunken); color: var(--text); }
.chip .chip-remove :is(i, svg) { width: 11px; height: 11px; }
@keyframes chipIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}

.density-toggle {
  display: inline-flex;
  height: 28px;
  padding: 2px;
  background: var(--surface-sunken);
  border-radius: var(--r-sm);
  gap: 1px;
}
.density-toggle button {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
}
.density-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.density-toggle button:hover:not(.active) { color: var(--text-2); }
.density-toggle button :is(i, svg) { width: 13px; height: 13px; }

/* =========================================================================
   PANEL
   ========================================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

/* =========================================================================
   TABLE
   ========================================================================= */
.table-wrap { overflow: auto; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}
.data-table thead th.num { text-align: right; }
.data-table tbody td {
  height: var(--row-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-2);
}
.data-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.data-table tbody tr {
  position: relative;
  background: var(--surface);
  transition: background var(--dur-fast);
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--tgt-gradient);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-out);
}
.data-table tbody tr:hover::before { transform: scaleY(1); }
.data-table tbody tr[data-stage="ganho"]:hover::before  { background: var(--success); }
.data-table tbody tr[data-stage="perdido"]:hover::before { background: var(--text-4); }
.data-table tbody tr[data-pending="true"] { opacity: 0.62; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.lead-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
.lead-company {
  color: var(--text-3);
  font-size: 11.5px;
  margin-top: 1px;
}

.cell-owner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.owner-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-sunken), var(--surface-strong));
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.row-actions {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.data-table tbody tr:hover .row-actions,
.data-table tbody tr:focus-within .row-actions { opacity: 1; }

.data-table tbody tr td .stage-select {
  height: 28px;
  font-size: 12px;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
  color: var(--text);
  padding-left: 8px;
  padding-right: 24px;
  width: auto;
  min-width: 0;
}
.data-table tbody tr td .stage-select:hover { border-color: var(--line-strong); background: var(--surface); }
.data-table tbody tr td .stage-select:focus { border-color: var(--tgt-accent); background: var(--surface); }

/* Density variants */
.data-table.density-compact   { --row-h: 36px; font-size: 12.5px; }
.data-table.density-comfortable { --row-h: 44px; }
.data-table.density-spacious  { --row-h: 56px; }

/* =========================================================================
   MOBILE LEAD CARDS
   ========================================================================= */
.mobile-lead-list {
  display: none;
  gap: 10px;
}
.mobile-lead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  display: grid;
  gap: 10px;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.mobile-lead:active { transform: scale(0.995); border-color: var(--line-strong); }
.ml-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.ml-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ml-meta { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.ml-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ml-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  color: var(--text-2);
  font-size: 12px;
}
.ml-next :is(i, svg) { width: 12px; height: 12px; color: var(--text-3); }
.ml-next.due-soon { background: var(--tgt-accent-soft); color: var(--tgt-accent-press); }
.ml-next.due-soon :is(i, svg) { color: var(--tgt-accent); }
.ml-value {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* =========================================================================
   KANBAN
   ========================================================================= */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 268px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.kanban-column {
  position: relative;
  min-height: 540px;
  background: linear-gradient(180deg, var(--surface-sunken) 0%, rgba(239, 238, 233, 0.6) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  scroll-snap-align: start;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.kanban-column:hover { box-shadow: var(--shadow-1); }
.kanban-column::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stage-color, var(--text-4)), color-mix(in srgb, var(--stage-color, var(--text-4)) 60%, transparent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--stage-color, var(--text-4)) 30%, transparent);
}
.kanban-column[data-stage="novo"]        { --stage-color: var(--stage-novo); }
.kanban-column[data-stage="em_contato"]  { --stage-color: var(--stage-em_contato); }
.kanban-column[data-stage="qualificado"] { --stage-color: var(--stage-qualificado); }
.kanban-column[data-stage="proposta"]    { --stage-color: var(--stage-proposta); }
.kanban-column[data-stage="ganho"]       { --stage-color: var(--stage-ganho); }
.kanban-column[data-stage="perdido"]     { --stage-color: var(--stage-perdido); }

.kanban-header {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--surface-sunken) 60%, rgba(239, 238, 233, 0.95));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 1;
  border-bottom: 1px solid rgba(26, 26, 26, 0.04);
}
.kanban-header strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.kanban-header .meta {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.kanban-header .count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
}

.kanban-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 4px 8px 10px;
  overflow-y: auto;
}

.lead-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  display: grid;
  gap: 8px;
  cursor: grab;
  transition: box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-fast),
              transform var(--dur-base) var(--ease-out);
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
  overflow: hidden;
}
.lead-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--stage-color, transparent);
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.kanban-column[data-stage="novo"]        .lead-card { --stage-color: var(--stage-novo); }
.kanban-column[data-stage="em_contato"]  .lead-card { --stage-color: var(--stage-em_contato); }
.kanban-column[data-stage="qualificado"] .lead-card { --stage-color: var(--stage-qualificado); }
.kanban-column[data-stage="proposta"]    .lead-card { --stage-color: var(--stage-proposta); }
.kanban-column[data-stage="ganho"]       .lead-card { --stage-color: var(--stage-ganho); }
.kanban-column[data-stage="perdido"]     .lead-card { --stage-color: var(--stage-perdido); }
.lead-card:hover {
  border-color: rgba(26, 26, 26, 0.10);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.lead-card:hover::before { opacity: 1; }
.lead-card[draggable="true"]:active { cursor: grabbing; }
.lead-card.dragging {
  opacity: 0.6;
  transform: scale(0.97) rotate(-0.6deg);
  box-shadow: var(--shadow-3);
  cursor: grabbing;
}

.lc-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}
.lc-title {
  min-width: 0;
}
.lc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.lc-company {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lc-value-pill {
  align-self: start;
  padding: 3px 8px;
  background: linear-gradient(180deg, var(--surface-sunken), var(--surface-strong));
  border: 1px solid rgba(26, 26, 26, 0.05);
  border-radius: var(--r-sm);
  color: var(--text);
  font: 600 11px var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.lc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 500;
}
.lc-pill :is(i, svg) { width: 11px; height: 11px; }
.lc-pill.due-soon { color: var(--tgt-accent); font-weight: 600; }

.kanban-column.drag-over::after {
  content: "";
  position: absolute;
  inset: 10px 8px 8px;
  border: 1.5px dashed var(--stage-color);
  border-radius: var(--r-md);
  pointer-events: none;
  animation: pulse-bg 1.4s ease-in-out infinite;
}
@keyframes pulse-bg {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

.empty-column {
  margin: 6px 8px;
  padding: 18px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text-4);
  font-size: 11.5px;
  text-align: center;
  display: grid;
  gap: 6px;
  place-items: center;
}
.empty-column :is(i, svg) { width: 14px; height: 14px; }

/* =========================================================================
   EMPTY & LOADING STATES
   ========================================================================= */
.empty-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 40px 32px;
  text-align: center;
}
.empty-state .inner {
  display: grid;
  gap: 12px;
  place-items: center;
  max-width: 380px;
}
.empty-state .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}
.empty-state .icon-wrap :is(i, svg) { width: 22px; height: 22px; color: var(--text-3); }
.empty-state h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.012em;
}
.empty-state p {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.55;
}
.empty-state .ctas {
  display: inline-flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

/* Skeletons */
.skeleton-pulse,
.skel-line,
.skel-block,
.skel-circle {
  background: var(--surface-sunken);
  animation: skel-pulse 1.4s ease-in-out infinite;
}
.skel-line   { height: 11px; border-radius: 4px; }
.skel-block  { border-radius: var(--r-sm); }
.skel-circle { border-radius: 50%; }
@keyframes skel-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.92; }
}

.skel-table-wrap { padding: 0; }
.skel-table-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 0.9fr 0.9fr 0.9fr 0.8fr 80px;
  gap: 16px;
  align-items: center;
  padding: 0 14px;
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
}
.skel-table-row:last-child { border-bottom: 0; }
.skel-table-row .stack { display: grid; gap: 6px; }

.skel-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 268px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.skel-kanban-col {
  min-height: 380px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.skel-kanban-col .head { display: flex; justify-content: space-between; align-items: center; }
.skel-kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  display: grid;
  gap: 10px;
}

/* =========================================================================
   STAGE PILLS
   ========================================================================= */
.stage-pill {
  --pc: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--pc) 12%, var(--surface));
  color: var(--pc);
  border: 1px solid color-mix(in srgb, var(--pc) 22%, transparent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.stage-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pc);
  flex: 0 0 auto;
}
.stage-pill[data-stage="novo"]        { --pc: var(--stage-novo); }
.stage-pill[data-stage="em_contato"]  { --pc: var(--stage-em_contato); }
.stage-pill[data-stage="qualificado"] { --pc: var(--stage-qualificado); }
.stage-pill[data-stage="proposta"]    { --pc: var(--stage-proposta); }
.stage-pill[data-stage="ganho"]       { --pc: var(--stage-ganho); }
.stage-pill[data-stage="perdido"]     { --pc: var(--stage-perdido); }

/* Generic role-pill / pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

/* Status pill (live indicator) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
}
.status-pill.active   { background: var(--success-soft); color: var(--success); }
.status-pill.inactive { background: var(--surface-sunken); color: var(--text-3); }
.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.active::before {
  animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

/* =========================================================================
   DRAWER
   ========================================================================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(26, 26, 26, 0.48);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  animation: backdropIn var(--dur-slow) var(--ease-out);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.drawer-backdrop.closing { animation: backdropOut var(--dur-fast) var(--ease-std) forwards; }
@keyframes backdropOut { to { opacity: 0; } }

.drawer {
  width: min(100%, 580px);
  height: 100%;
  background: var(--surface);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  box-shadow: var(--shadow-4);
  overflow: hidden;
  border-left: 1px solid var(--line);
  animation: drawerIn var(--dur-slow) var(--ease-out);
}
@keyframes drawerIn {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.drawer.closing { animation: drawerOut var(--dur-fast) var(--ease-std) forwards; }
@keyframes drawerOut {
  to { transform: translateX(24px); opacity: 0; }
}

.drawer-header {
  padding: 20px 22px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 70%, var(--surface-2));
  position: relative;
}
.drawer-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tgt-accent-border), transparent);
}
.drawer-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.drawer-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.state-pill.new  { background: var(--tgt-accent-soft); color: var(--tgt-accent-press); }
.state-pill.edit { background: var(--info-soft); color: var(--info); }
.state-pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.drawer-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  align-content: start;
}

.drawer-note {
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid .wide { grid-column: 1 / -1; }

.field-wrap {
  position: relative;
}
.field-wrap > .prefix {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.field-wrap input.has-prefix,
.field-wrap select.has-prefix { padding-left: 34px; }

.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.drawer-actions .right { display: inline-flex; gap: 8px; }

/* =========================================================================
   SECTION CARDS (for settings)
   ========================================================================= */
.section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.section-head {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}
.section-head .sub {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
}
.section-body {
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: end;
}
.inline-form label { min-width: 0; }
@media (max-width: 720px) {
  .inline-form { grid-template-columns: 1fr; }
}

/* Switch */
.switch {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--line-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-std);
  border: 0;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FAF9F6;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.18);
  transition: transform var(--dur-base) var(--ease-out);
}
.switch[data-on="true"] { background: var(--tgt-accent); }
.switch[data-on="true"]::after { transform: translateX(14px); }
.switch:focus-visible { box-shadow: var(--ring); }

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* =========================================================================
   TOASTS
   ========================================================================= */
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  overflow: hidden;
  animation: toastIn var(--dur-slow) var(--ease-out);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warn); }
.toast.info    { border-left-color: var(--info); }

.toast .toast-icon { width: 16px; height: 16px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warn); }
.toast.info    .toast-icon { color: var(--info); }

.toast .toast-body { min-width: 0; }
.toast .toast-title { font-weight: 600; color: var(--text); }
.toast .toast-desc  { color: var(--text-3); font-size: 12px; margin-top: 2px; }

.toast .toast-action {
  align-self: center;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
}
.toast .toast-action:hover { background: var(--surface-sunken); color: var(--text); }

.toast .toast-close {
  align-self: start;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
}
.toast .toast-close:hover { background: var(--surface-sunken); color: var(--text); }
.toast .toast-close :is(i, svg) { width: 11px; height: 11px; }

.toast .progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
  transform-origin: left;
  animation: toastDecay var(--toast-duration, 4000ms) linear forwards;
}
.toast.success .progress { color: var(--success); }
.toast.error   .progress { color: var(--danger); }
.toast.warning .progress { color: var(--warn); }
.toast.info    .progress { color: var(--info); }

.toast.exiting { animation: toastOut var(--dur-fast) var(--ease-std) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(28px); }
}
@keyframes toastDecay {
  to { transform: scaleX(0); }
}

/* Stack offset for older toasts */
.toast-region .toast:nth-last-child(2) { transform: translateY(-3px) scale(0.99); opacity: 0.9; }
.toast-region .toast:nth-last-child(3) { transform: translateY(-6px) scale(0.97); opacity: 0.75; }
.toast-region .toast:nth-last-child(n+4) { display: none; }

/* =========================================================================
   COMMAND PALETTE
   ========================================================================= */
.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(26, 26, 26, 0.42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  animation: backdropIn var(--dur-base) var(--ease-out);
}
.command-palette {
  width: min(560px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-4);
  overflow: hidden;
  animation: paletteIn var(--dur-base) var(--ease-out);
  transform-origin: top center;
}
@keyframes paletteIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.command-search {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.command-search :is(i, svg) { width: 16px; height: 16px; color: var(--text-3); }
.command-search input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
}
.command-search input:focus { box-shadow: none; }
.command-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.command-group-label {
  padding: 10px 8px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}
.command-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.command-item :is(i, svg) { width: 14px; height: 14px; color: var(--text-3); }
.command-item .label { font-weight: 500; }
.command-item .shortcut {
  display: inline-flex;
  gap: 3px;
}
.command-item.focus,
.command-item:hover { background: var(--surface-sunken); }
.command-item.focus :is(i, svg) { color: var(--tgt-accent); }
.command-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* =========================================================================
   STATE FEEDBACK (optimistic UI)
   ========================================================================= */
[data-pending="true"] {
  position: relative;
}
.pulse-confirm {
  animation: pulseConfirm 520ms var(--ease-out);
}
@keyframes pulseConfirm {
  0%   { box-shadow: 0 0 0 0 var(--success-soft); }
  60%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.shake {
  animation: shake 240ms var(--ease-out);
}
@keyframes shake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* Inline spinner */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   VISIBILITY HELPERS
   ========================================================================= */
.platform-only, .admin-only { /* default visible; toggled by JS */ }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-brand {
    padding: 28px 24px;
    grid-template-rows: auto auto;
    gap: 18px;
    min-height: 260px;
  }
  .auth-brand::after { width: 320px; height: 320px; left: 78%; }
  .auth-hero h2 { font-size: 30px; line-height: 1.1; }
  .auth-hero p { font-size: 14px; }
  .auth-props { display: none; }
  .auth-trust { display: none; }
  .auth-form-wrap { padding: 32px 22px; }
  .auth-panel .heading h1 { font-size: 24px; }
}

@media (max-width: 900px) {
  :root { --sidebar: 1fr; --topbar: auto; }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 64px;
  }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    height: 64px;
    padding: 6px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    grid-template-rows: none;
  }
  .brand-lockup,
  .sidebar-footer,
  .nav-section-label { display: none; }
  .nav-list {
    display: flex;
    width: 100%;
    max-width: 520px;
    justify-content: space-around;
    gap: 2px;
    padding: 0;
  }
  .nav-item {
    flex: 1 0 0;
    flex-direction: column;
    height: 52px;
    padding: 6px 4px;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 500;
    border-radius: var(--r-sm);
  }
  .nav-item :is(i, svg) { width: 18px; height: 18px; }
  .nav-item.active { background: transparent; color: var(--tgt-accent); }
  .nav-item.active :is(i, svg) { color: var(--tgt-accent); }
  .nav-item.active::before {
    left: 50%;
    top: -6px;
    bottom: auto;
    width: 22px;
    height: 2px;
    transform: translateX(-50%);
    border-radius: 0 0 2px 2px;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 10px 12px;
    gap: 8px;
  }
  .topbar-actions { justify-content: flex-start; flex-wrap: wrap; }

  .content { padding: 14px 14px 24px; }

  .kpi-strip { grid-template-columns: repeat(2, 1fr); }

  .page-title { flex-direction: column; align-items: flex-start; gap: 8px; }
  .toolbar { flex-direction: column; align-items: stretch; }

  .table-wrap { display: none; }
  .mobile-lead-list { display: grid; }

  .kanban { grid-auto-columns: 82vw; }
  .kanban-column { min-height: 460px; }

  .skel-table-wrap { display: none; }
}

@media (max-width: 560px) {
  .content { padding: 12px; }
  .topbar { padding: 10px; }
  .kpi-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 19px; }

  .drawer { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer-actions { flex-direction: column-reverse; align-items: stretch; }
  .drawer-actions .right { display: flex; flex-direction: column-reverse; gap: 8px; }
  .drawer-actions .button { width: 100%; }
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 80ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton-pulse, .skel-line, .skel-block, .skel-circle { animation: none; opacity: 0.7; }
  .auth-brand::after { animation: none; }
  .kanban-column.drag-over::after { animation: none; }
  .status-pill.active::before { animation: none; }
}
