@import url("theme-update.css");
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

:root {
  --bg: #eef3fb;
  --bg-elevated: #e2ebf8;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-border: rgba(15, 23, 42, 0.08);
  --text: #132238;
  --text-muted: #62738c;
  --sidebar-bg: #09111f;
  --sidebar-bg-soft: rgba(17, 24, 39, 0.82);
  --sidebar-text: #dbe4f2;
  --sidebar-muted: #93a3bb;
  --accent: #2563eb;
  --accent-secondary: #06b6d4;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-ring: rgba(37, 99, 235, 0.18);
  --accent-shadow: rgba(37, 99, 235, 0.22);
  --accent-glow: rgba(37, 99, 235, 0.18);
  --success: #16a34a;
  --warning: #f97316;
  --danger: #dc2626;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 16px 34px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --status-new: #2563eb;
  --status-interested: #16a34a;
  --status-not-interested: #dc2626;
  --status-follow-up: #f97316;
  --status-contacted: #6366f1;
  --status-closed: #475569;
  --priority-hot: #dc2626;
  --priority-warm: #f59e0b;
  --priority-cold: #0ea5e9;
  --source-instagram: #ec4899;
  --source-facebook-ads: #2563eb;
  --source-website: #0f766e;
  --source-whatsapp: #16a34a;
  --source-reference: #8b5cf6;
}

html[data-accent="cobalt"] {
  --accent: #2563eb;
  --accent-secondary: #06b6d4;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-ring: rgba(37, 99, 235, 0.18);
  --accent-shadow: rgba(37, 99, 235, 0.22);
  --accent-glow: rgba(37, 99, 235, 0.18);
}

html[data-accent="emerald"] {
  --accent: #0f766e;
  --accent-secondary: #22c55e;
  --accent-soft: rgba(15, 118, 110, 0.14);
  --accent-ring: rgba(15, 118, 110, 0.18);
  --accent-shadow: rgba(15, 118, 110, 0.22);
  --accent-glow: rgba(15, 118, 110, 0.18);
}

html[data-accent="sunset"] {
  --accent: #ea580c;
  --accent-secondary: #f59e0b;
  --accent-soft: rgba(234, 88, 12, 0.14);
  --accent-ring: rgba(234, 88, 12, 0.18);
  --accent-shadow: rgba(234, 88, 12, 0.22);
  --accent-glow: rgba(234, 88, 12, 0.18);
}

html[data-accent="slate"] {
  --accent: #334155;
  --accent-secondary: #6366f1;
  --accent-soft: rgba(51, 65, 85, 0.14);
  --accent-ring: rgba(51, 65, 85, 0.18);
  --accent-shadow: rgba(51, 65, 85, 0.22);
  --accent-glow: rgba(51, 65, 85, 0.18);
}

html[data-theme="dark"] {
  --bg: #07101d;
  --bg-elevated: #111d31;
  --surface: rgba(9, 18, 32, 0.84);
  --surface-solid: #101b2d;
  --surface-strong: rgba(10, 18, 31, 0.94);
  --surface-border: rgba(148, 163, 184, 0.16);
  --text: #e7effc;
  --text-muted: #99aec9;
  --sidebar-bg: #020814;
  --sidebar-bg-soft: rgba(4, 11, 22, 0.88);
  --sidebar-text: #d8e2f0;
  --sidebar-muted: #8496b0;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.4);
  --shadow-soft: 0 16px 34px rgba(2, 6, 23, 0.28);
}

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

html {
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 10%, var(--accent-glow), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
h5,
h6,
.topbar__title,
.brand-mark strong,
.panel__title,
.metric-card__value {
  font-family: "Plus Jakarta Sans", "Manrope", sans-serif;
  letter-spacing: -0.03em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.btn {
  border-radius: 999px;
  font-weight: 700;
  border-width: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-color: transparent;
  box-shadow: 0 14px 28px var(--accent-shadow);
}

.btn-outline-secondary {
  border-color: var(--surface-border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
}

.btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.18);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #22c55e);
  border: none;
}

.form-control,
.form-select {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--text-muted) 82%, transparent);
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus {
  box-shadow: 0 0 0 0.22rem var(--accent-ring);
  border-color: color-mix(in srgb, var(--accent) 38%, white);
}

.form-label {
  margin-bottom: 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--surface-border));
}

.icon-button svg,
.sidebar__link-icon svg,
.sidebar__collapse svg,
.topbar__menu-icon svg {
  width: 18px;
  height: 18px;
}

.icon-button--ghost {
  width: 40px;
  height: 40px;
  box-shadow: none;
  background: transparent;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: 292px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.15rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, var(--sidebar-bg), color-mix(in srgb, var(--sidebar-bg) 88%, #16233a));
  color: var(--sidebar-text);
  box-shadow: 18px 0 42px rgba(2, 6, 23, 0.16);
  transition: width 0.28s ease, padding 0.28s ease, transform 0.28s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  min-width: 0;
}

.brand-mark__copy,
.user-chip__copy,
.sidebar__status-copy,
.sidebar__link-label {
  min-width: 0;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.brand-mark__icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 28px var(--accent-shadow);
  flex-shrink: 0;
}

.brand-mark strong,
.user-chip strong {
  display: block;
  font-size: 0.98rem;
}

.brand-mark small,
.user-chip small {
  color: var(--sidebar-muted);
  font-size: 0.84rem;
}

.sidebar__collapse {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar__collapse:hover {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar__nav-block {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.sidebar__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(219, 228, 242, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem 0.7rem;
}

.sidebar__nav {
  display: grid;
  gap: 0.42rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.78rem;
  color: var(--sidebar-text);
  padding: 0.72rem 0.85rem;
  border-radius: 18px;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
}

.sidebar__link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar__link:hover,
.sidebar__link.is-active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.sidebar__link:hover::before,
.sidebar__link.is-active::before {
  opacity: 1;
}

.sidebar__link-icon,
.topbar__menu-icon {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  color: currentColor;
  flex-shrink: 0;
}

.sidebar__link-label {
  position: relative;
  z-index: 1;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar__footer {
  display: grid;
  gap: 0.9rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  font-weight: 700;
  font-size: 0.88rem;
}

.sidebar__status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-chip__avatar,
.topbar__profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 14px 28px var(--accent-shadow);
  flex-shrink: 0;
}

body.sidebar-collapsed .sidebar {
  width: 104px;
  padding-inline: 0.75rem;
}

body.sidebar-collapsed .brand-mark__copy,
body.sidebar-collapsed .sidebar__eyebrow,
body.sidebar-collapsed .sidebar__status-copy,
body.sidebar-collapsed .user-chip__copy,
body.sidebar-collapsed .sidebar__link-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar__brand {
  justify-content: center;
}

body.sidebar-collapsed .sidebar__collapse {
  display: none;
}

body.sidebar-collapsed .sidebar__link,
body.sidebar-collapsed .sidebar__status,
body.sidebar-collapsed .user-chip {
  justify-content: center;
}

body.sidebar-collapsed .sidebar__link {
  padding-inline: 0.65rem;
}

body.sidebar-collapsed .sidebar__collapse svg {
  transform: rotate(180deg);
}

.app-shell__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.8rem;
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.topbar__left,
.topbar__actions,
.hero-panel__actions,
.hero-panel__pills,
.page-header__meta,
.form-actions,
.contact-actions,
.table-actions,
.view-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar__menu {
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  color: var(--text);
  border-radius: 18px;
  padding: 0.38rem 0.5rem 0.38rem 0.42rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--shadow-soft);
}

.topbar__menu-label {
  font-weight: 700;
}

.topbar__title-group {
  display: grid;
}

.topbar__title {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
}

.topbar__profile {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.4rem 0.35rem 0.35rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  box-shadow: var(--shadow-soft);
}

.topbar__profile-copy {
  display: grid;
  line-height: 1.2;
}

.topbar__profile-copy strong {
  font-size: 0.95rem;
}

.topbar__profile-copy small {
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.content-area {
  display: grid;
  gap: 1.6rem;
  padding: 1.6rem 1.8rem 2rem;
  flex: 1;
}

.content-area > * {
  min-width: 0;
}

.content-area > .row {
  margin: 0;
  --bs-gutter-x: 1.3rem;
  --bs-gutter-y: 1.3rem;
}

.app-footer {
  width: 100%;
  padding: 0 1.8rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.app-footer p {
  margin: 0;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--surface-border);
}

.app-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hero-panel,
.panel,
.metric-card,
.lead-card,
.user-summary-card,
.action-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.hero-panel {
  padding: 1.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 1.25rem;
  align-items: center;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -2rem -5rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 66%);
  pointer-events: none;
}

.hero-panel__content,
.hero-panel__actions,
.hero-panel__aside {
  position: relative;
  z-index: 1;
}

.hero-panel__pills {
  margin-top: 1rem;
}

.hero-panel__aside {
  display: grid;
  gap: 0.75rem;
  min-width: 180px;
}

.hero-panel__insight {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
}

.hero-panel__insight strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.5rem;
}

.hero-panel__insight small {
  color: var(--text-muted);
  font-weight: 700;
}

.hero-panel h1,
.hero-panel h2,
.page-header h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.7rem, 2vw, 2.25rem);
}

.hero-panel p,
.page-header p,
.metric-card__subtitle,
.action-card p,
.feature-list__item p,
.follow-up-item p,
.timeline__content p,
.empty-state p,
.lead-card__subtitle,
.lead-notes p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.metric-grid,
.card-grid,
.user-card-grid,
.action-card-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.user-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  padding: 1.3rem;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-accent, var(--accent));
}

.metric-card::after {
  content: "";
  position: absolute;
  top: -25%;
  right: -15%;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--metric-accent, var(--accent)) 18%, transparent), transparent 72%);
}

.metric-card__header,
.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card__title {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card__value {
  display: block;
  font-size: 2.1rem;
  margin-bottom: 0.35rem;
}

.metric-card__link {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.panel,
.page-header {
  padding: 1.4rem;
}

.panel__title {
  margin: 0;
  font-size: 1.15rem;
}

.page-header {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.customize-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: min(380px, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateX(calc(100% + 2rem));
  transition: transform 0.24s ease;
  z-index: 50;
}

.customize-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.customize-panel__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.customize-panel__subtitle {
  color: var(--text-muted);
  margin: 0;
}

.customize-panel__body {
  display: grid;
  gap: 1rem;
}

.customize-panel__section {
  display: grid;
  gap: 0.95rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
}

.customize-panel__copy strong {
  display: block;
  margin-bottom: 0.3rem;
}

.customize-panel__copy p {
  margin: 0;
  color: var(--text-muted);
}

.preference-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.preference-toggle__switch {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
}

.preference-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.segmented-control__button {
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.accent-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.accent-swatch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.accent-swatch__preview {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.accent-swatch__preview--cobalt {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.accent-swatch__preview--emerald {
  background: linear-gradient(135deg, #0f766e, #22c55e);
}

.accent-swatch__preview--sunset {
  background: linear-gradient(135deg, #ea580c, #f59e0b);
}

.accent-swatch__preview--slate {
  background: linear-gradient(135deg, #334155, #6366f1);
}

body.customize-open .customize-panel {
  transform: translateX(0);
}

body.customize-open .customize-overlay {
  opacity: 1;
  pointer-events: auto;
}

.segmented-control__button[aria-pressed="true"],
.accent-swatch.is-active,
.preference-toggle.is-active {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--surface-border));
  background: var(--accent-soft);
  color: var(--accent);
}

.preference-toggle.is-active .preference-toggle__switch {
  background: color-mix(in srgb, var(--accent) 24%, white);
}

.preference-toggle.is-active .preference-toggle__switch::after {
  transform: translateX(22px);
}

.chart-stack,
.follow-up-list,
.timeline {
  display: grid;
  gap: 1rem;
}

.bar-item__meta,
.legend-list__item,
.follow-up-item,
.timeline__item,
.access-matrix__row,
.summary-inline,
.lead-card__header,
.lead-card__actions,
.lead-card__meta,
.details-list,
.tag-list,
.info-list {
  display: flex;
  gap: 0.85rem;
}

.bar-item__meta,
.follow-up-item,
.timeline__item,
.access-matrix__row {
  justify-content: space-between;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin: 0.45rem 0 0.35rem;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.donut-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.donut-chart {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--surface-solid);
}

.donut-chart__center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-chart__center strong {
  display: block;
  font-size: 2rem;
}

.legend-list {
  display: grid;
  gap: 0.85rem;
}

.legend-list__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0;
}

.stat-pill,
.reminder-chip,
.assignment-badge,
.tag,
.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-pill {
  background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
  border: 1px solid var(--surface-border);
  color: var(--text);
}

.stat-pill--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.lead-pipeline-auto-assign {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding-inline: 0.9rem;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-panel__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.lead-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--surface-border);
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0 0.75rem;
}

.lead-table thead th {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.75rem 0.2rem;
  border-bottom: 0;
}

.lead-table tbody td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

.lead-table tbody td:first-child {
  border-left: 1px solid var(--surface-border);
  border-radius: 18px 0 0 18px;
}

.lead-table tbody td:last-child {
  border-right: 1px solid var(--surface-border);
  border-radius: 0 18px 18px 0;
}

.table-responsive {
  overflow: visible;
}

.lead-table td small,
.lead-card__subtitle,
.timeline__content small,
.follow-up-item small,
.summary-inline small {
  display: block;
  color: var(--text-muted);
}

.table-actions {
  flex-wrap: nowrap;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-card {
  padding: 1.25rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.lead-card:hover,
.action-card:hover,
.user-summary-card:hover,
.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.lead-card__title {
  margin: 0;
  font-size: 1.08rem;
}

.lead-card__badges {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.lead-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.9rem;
  margin: 1rem 0;
}

.lead-card__meta-stack {
  display: grid;
  gap: 0.7rem;
}

.lead-card__meta dt,
.details-list dt {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.lead-card__meta dd,
.details-list dd {
  margin: 0;
  font-weight: 600;
}

.details-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 1rem;
}

.lead-notes {
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  margin-top: 1rem;
}

.lead-notes h3 {
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
}

.follow-up-item,
.timeline__item,
.access-matrix__row,
.action-card,
.user-summary-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .follow-up-item,
html[data-theme="dark"] .timeline__item,
html[data-theme="dark"] .access-matrix__row,
html[data-theme="dark"] .action-card,
html[data-theme="dark"] .user-summary-card {
  background: rgba(9, 18, 32, 0.6);
}

.follow-up-item:hover,
.timeline__item:hover,
.access-matrix__row:hover,
.action-card:hover,
.user-summary-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 16%, var(--surface-border));
  box-shadow: var(--shadow-soft);
}

.follow-up-item.is-urgent {
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.unassigned-lead-form {
  margin: 0;
}

.unassigned-lead-trigger {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.leave-coverage-form {
  display: grid;
  gap: 0.65rem;
  min-width: min(280px, 100%);
}

.leave-coverage-form .form-select {
  min-height: 42px;
}

.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--surface-border);
}

.timeline__item {
  position: relative;
  padding-left: 3rem;
}

.timeline__badge {
  position: absolute;
  left: 0;
  top: 1rem;
  z-index: 1;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.64rem;
  padding: 0;
}

.timeline-call,
.timeline-meeting,
.timeline-discussion,
.timeline-email,
.timeline-system {
  color: #fff;
}

.timeline-call { background: var(--accent); }
.timeline-meeting { background: var(--success); }
.timeline-discussion { background: var(--warning); }
.timeline-email { background: #8b5cf6; }
.timeline-system { background: var(--status-closed); }

.status-badge,
.priority-badge {
  border: 1px solid transparent;
}

.badge-status-new { color: var(--status-new); background: rgba(37, 99, 235, 0.12); }
.badge-status-interested { color: var(--status-interested); background: rgba(22, 163, 74, 0.14); }
.badge-status-not-interested { color: var(--status-not-interested); background: rgba(220, 38, 38, 0.12); }
.badge-status-follow-up { color: var(--status-follow-up); background: rgba(249, 115, 22, 0.12); }
.badge-status-contacted { color: var(--status-contacted); background: rgba(99, 102, 241, 0.12); }
.badge-status-closed { color: var(--status-closed); background: rgba(71, 85, 105, 0.12); }

.badge-priority-hot { color: var(--priority-hot); background: rgba(220, 38, 38, 0.12); }
.badge-priority-warm { color: var(--priority-warm); background: rgba(245, 158, 11, 0.12); }
.badge-priority-cold { color: var(--priority-cold); background: rgba(14, 165, 233, 0.12); }

.reminder-chip,
.assignment-badge,
.tag {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.assignment-badge {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.16);
  margin-top: 0.4rem;
}

.summary-inline {
  justify-content: space-between;
}

.summary-inline strong {
  display: block;
  font-size: 1.4rem;
}

.access-matrix,
.info-list,
.feature-list {
  display: grid;
  gap: 1rem;
}

.tag-list {
  flex-wrap: wrap;
}

.centered-panel {
  max-width: 640px;
  margin: 3rem auto;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 1rem;
}

.empty-state--compact {
  padding: 0.5rem;
}

.temporary-assignment-summary,
.history-stack {
  display: grid;
  gap: 1rem;
}

.history-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}

html[data-theme="dark"] .history-card {
  background: rgba(15, 23, 42, 0.35);
}

.history-card__header,
.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-meta {
  border-top: 1px solid var(--surface-border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.history-meta small {
  display: block;
  color: var(--text-muted);
}

.metric-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.action-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card,
.user-summary-card {
  height: 100%;
}

.auth-shell {
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-shell,
.auth-shell button,
.auth-shell input,
.auth-shell label {
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.auth-shell__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.auth-shell__body {
  max-width: 1320px;
  margin: 0 auto;
}

.guest-mode .auth-shell__topbar {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .guest-mode .auth-shell__topbar {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(148, 163, 184, 0.18);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.5rem;
  align-items: stretch;
}

.login-panel,
.login-brand-panel {
  min-height: 720px;
  animation: loginFadeIn 0.75s ease both;
}

.login-panel {
  padding: 0;
  overflow: hidden;
}

.login-panel__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100%;
  padding: clamp(2rem, 4vw, 3.2rem);
}

.login-panel__intro {
  display: grid;
  gap: 0.75rem;
}

.login-panel__title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.login-panel__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

html[data-theme="dark"] .login-panel__title {
  color: #f8fbff;
}

.login-form {
  display: grid;
  gap: 1.15rem;
}

.login-field {
  display: grid;
  gap: 0.5rem;
}

.login-input {
  min-height: 56px;
  border-radius: 18px;
  border-color: rgba(37, 99, 235, 0.12);
  padding-inline: 1rem;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.login-input:hover {
  border-color: rgba(37, 99, 235, 0.24);
}

.login-input:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap .login-input {
  padding-right: 5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
}

.password-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
}

.login-submit {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-alert,
.validation-summary-errors {
  margin: 0;
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: 16px;
  background: rgba(254, 226, 226, 0.72);
  color: #991b1b;
  box-shadow: none;
}

.validation-summary-errors ul,
.login-alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

.field-validation-error,
.text-danger.small {
  color: #b91c1c !important;
  font-size: 0.82rem !important;
  font-weight: 600;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(2rem, 4vw, 3rem);
  color: #f8fbff;
  background:
    radial-gradient(circle at 15% 20%, rgba(96, 165, 250, 0.35), transparent 25%),
    radial-gradient(circle at 85% 25%, rgba(45, 212, 191, 0.22), transparent 24%),
    linear-gradient(145deg, #0f172a 0%, #123c7a 42%, #0e7490 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 1.25rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.login-brand-panel__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.45)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 12px, transparent 12px 24px);
}

.login-brand-panel__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  min-height: 100%;
}

.login-brand-panel__eyebrow {
  color: rgba(226, 232, 240, 0.82);
}

.login-brand-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.login-brand-panel p {
  max-width: 56ch;
  margin: 0;
  color: rgba(226, 232, 240, 0.92);
}

.login-brand-panel__cards {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.login-info-card {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.login-info-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.login-info-card p {
  color: rgba(226, 232, 240, 0.84);
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

.hero-panel--auth {
  min-height: 100%;
}

.auth-panel {
  align-self: center;
}

.demo-login-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.demo-login-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .demo-login-card {
  background: rgba(15, 23, 42, 0.4);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  color: var(--text-muted);
}

.theme-toggle input {
  display: none;
}

.theme-toggle__track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
}

.theme-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease;
}

.theme-toggle input:checked + .theme-toggle__track::after {
  transform: translateX(22px);
}

.sidebar-overlay,
.customize-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 25;
}

.app-alert {
  border-radius: 16px;
  border: none;
  box-shadow: var(--shadow-soft);
}

.stat-pill--danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
}

.report-page-actions {
  gap: 0.75rem;
}

.report-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(37, 99, 235, 0.08);
}

.report-highlight strong {
  font-size: 0.92rem;
}

.report-highlight span {
  font-weight: 700;
}

.report-highlight--danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.16);
  color: var(--danger);
}

.employee-leaderboard {
  display: grid;
  gap: 0.9rem;
}

.employee-rank-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
}

.employee-rank-card.is-leading {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: var(--shadow-soft);
}

.employee-rank-card__main {
  display: grid;
  gap: 0.25rem;
}

.employee-rank-card__main strong {
  font-size: 1rem;
}

.employee-rank-card__main small {
  color: var(--text-muted);
}

.employee-rank-card__meter {
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.employee-rank-card__meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, white));
}

.report-subheading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 800;
}

.lead-report-table tr.is-overdue td {
  background: rgba(220, 38, 38, 0.03);
}

.lead-report-table__identifier strong {
  display: block;
  max-width: 190px;
  word-break: break-word;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.lead-report-table--stacked td small {
  display: block;
  margin-top: 0.35rem;
}

.reminder-chip--danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.reminder-chip--neutral {
  background: rgba(71, 85, 105, 0.12);
  color: var(--status-closed);
}

.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.report-pagination__summary {
  color: var(--text-muted);
  font-weight: 700;
}

html[data-theme="dark"] .report-highlight {
  background: rgba(37, 99, 235, 0.14);
}

html[data-theme="dark"] .report-highlight--danger {
  background: rgba(220, 38, 38, 0.14);
}

html[data-theme="dark"] .employee-rank-card.is-leading {
  background: rgba(37, 99, 235, 0.16);
}

html[data-theme="dark"] .lead-report-table tr.is-overdue td {
  background: rgba(220, 38, 38, 0.08);
}

@media (max-width: 1399px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-grid,
  .action-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero-panel__aside {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0.75rem;
    height: calc(100vh - 1.5rem);
    width: min(320px, calc(100vw - 1rem));
    border-radius: 0 28px 28px 0;
    transform: translateX(-115%);
    transition: transform 0.22s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar__collapse {
    display: none;
  }

  body.sidebar-collapsed .sidebar {
    width: min(320px, calc(100vw - 1rem));
    padding: 1.15rem;
  }

  body.sidebar-collapsed .brand-mark__copy,
  body.sidebar-collapsed .sidebar__eyebrow,
  body.sidebar-collapsed .sidebar__status-copy,
  body.sidebar-collapsed .user-chip__copy,
  body.sidebar-collapsed .sidebar__link-label {
    opacity: 1;
    width: auto;
    overflow: visible;
    pointer-events: auto;
  }

  body.sidebar-collapsed .sidebar__brand,
  body.sidebar-collapsed .sidebar__link,
  body.sidebar-collapsed .sidebar__status,
  body.sidebar-collapsed .user-chip {
    justify-content: flex-start;
  }

  .content-area,
  .topbar {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .topbar {
    position: static;
    top: auto;
  }

  .metric-grid,
  .metric-grid--compact,
  .card-grid,
  .user-card-grid,
  .action-card-grid,
  .auth-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .donut-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-panel,
  .topbar {
    width: 100%;
  }

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

  .hero-panel__aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .page-header,
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__actions {
    width: 100%;
  }

  .details-list,
  .lead-card__meta {
    grid-template-columns: 1fr;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .login-panel,
  .login-brand-panel {
    min-height: auto;
  }

  .login-brand-panel {
    order: -1;
    padding: 1.75rem;
  }

  .login-brand-panel h2 {
    max-width: none;
  }

  .customize-panel {
    top: auto;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-height: 70vh;
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  .auth-shell,
  .content-area {
    padding: 1rem;
  }

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

  .guest-mode .auth-shell__topbar {
    padding: 0.9rem 1rem;
    border-radius: 18px;
  }

  .topbar {
    padding-inline: 1rem;
  }

  .topbar__actions,
  .topbar__profile {
    width: 100%;
  }

  .topbar__profile {
    justify-content: flex-start;
  }

  .hero-panel__actions,
  .hero-panel__aside,
  .segmented-control,
  .accent-swatches {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .follow-up-item,
  .demo-login-card,
  .access-matrix__row,
  .summary-inline,
  .history-card__header,
  .history-meta,
  .report-highlight,
  .report-page-actions,
  .report-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-panel__inner,
  .login-brand-panel {
    padding: 1.35rem;
  }

  .login-brand-panel__cards {
    gap: 0.8rem;
  }

  .panel,
  .hero-panel,
  .metric-card,
  .lead-card {
    border-radius: 20px;
  }

  .table-responsive {
    overflow-x: auto;
  }
}

:root {
  --status-closed: #0f766e;
}

.icon-button--link {
  text-decoration: none;
}

.topbar__profile {
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 92%, transparent), color-mix(in srgb, var(--accent) 12%, var(--surface-solid)));
}

.sidebar__link.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, rgba(255, 255, 255, 0.06)), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 30px rgba(2, 6, 23, 0.18);
}

.dashboard-page {
  display: grid;
  gap: 1.5rem;
}

.hero-panel--crm {
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.78fr) minmax(0, 1fr);
  align-items: stretch;
  padding: clamp(1.65rem, 3vw, 2rem);
}

.hero-panel--crm::before {
  width: 20rem;
  height: 20rem;
  right: -5rem;
  bottom: -8rem;
}

.dashboard-hero__content {
  display: grid;
  align-content: center;
}

.dashboard-hero__content h2 {
  max-width: 14ch;
}

.dashboard-hero__actions {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 0.9rem;
  padding: 1.15rem;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--surface-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 88%, transparent), color-mix(in srgb, var(--accent) 6%, var(--surface-solid)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dashboard-hero__aside {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  min-width: 0;
}

.dashboard-mini-stat,
.dashboard-chart-insight,
.dashboard-follow-up-summary__tile {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dashboard-mini-stat strong,
.dashboard-chart-insight strong,
.dashboard-follow-up-summary__tile strong {
  display: block;
  margin: 0.25rem 0 0.2rem;
  font-size: 1.55rem;
}

.dashboard-mini-stat small,
.dashboard-chart-insight small,
.dashboard-follow-up-summary__tile small {
  color: var(--text-muted);
  font-weight: 700;
}

.dashboard-mini-stat span,
.dashboard-chart-insight span {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.metric-grid--dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card--dashboard {
  display: grid;
  gap: 0.8rem;
  min-height: 100%;
}

.metric-card__topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.metric-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--metric-accent, var(--accent));
  background: color-mix(in srgb, var(--metric-accent, var(--accent)) 14%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metric-accent, var(--accent)) 18%, transparent);
}

.metric-card__icon svg {
  width: 22px;
  height: 22px;
}

.metric-card__context {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-card__context::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--metric-accent, var(--accent));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--metric-accent, var(--accent)) 14%, transparent);
}

.dashboard-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-panel--wide {
  grid-row: span 2;
}

.dashboard-chart-shell {
  position: relative;
  min-height: 250px;
}

.dashboard-chart-shell--line {
  min-height: 320px;
}

.dashboard-chart-shell canvas {
  width: 100% !important;
  height: 100% !important;
}

.dashboard-chart-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.dashboard-stat-list {
  display: grid;
  gap: 0.8rem;
}

.dashboard-stat-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
}

.dashboard-stat-list__dot,
.legend-list__dot {
  flex-shrink: 0;
}

.dashboard-stat-list__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
}

.legend-list--dashboard {
  display: grid;
  gap: 0.75rem;
}

.dashboard-operations {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}

.dashboard-panel--table,
.dashboard-panel--side {
  min-width: 0;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(160px, 1fr));
  gap: 0.9rem;
}

.dashboard-field {
  display: grid;
  gap: 0.45rem;
}

.dashboard-field__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-table-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-table-summary__hint {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.dashboard-table-wrap {
  max-height: 560px;
  overflow: auto;
  padding-right: 0.25rem;
}

.lead-table--dashboard {
  border-spacing: 0 0.9rem;
}

.lead-table--dashboard thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  backdrop-filter: blur(16px);
}

.lead-table tbody tr {
  transition: transform 0.18s ease;
}

.lead-table tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-solid) 92%, color-mix(in srgb, var(--accent) 5%, transparent));
}

.dashboard-table__lead-link {
  color: var(--text);
  font-weight: 800;
}

.dashboard-table__lead-link:hover {
  color: var(--accent);
}

.follow-up-list--dashboard {
  max-height: 460px;
  overflow: auto;
  padding-right: 0.2rem;
}

.dashboard-follow-up-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.dashboard-queue-grid .panel {
  height: 100%;
}

.status-badge,
.priority-badge,
.reminder-chip,
.assignment-badge,
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-badge,
.priority-badge,
.reminder-chip,
.assignment-badge {
  padding: 0.36rem 0.72rem;
  font-size: 0.76rem;
}

.table-actions .btn {
  min-width: 64px;
}

@media (max-width: 1399px) {
  .metric-grid--dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel--crm {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .dashboard-hero__actions,
  .dashboard-hero__aside {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1199px) {
  .dashboard-analytics,
  .dashboard-operations {
    grid-template-columns: 1fr;
  }

  .dashboard-panel--wide {
    grid-row: auto;
  }
}

@media (max-width: 991px) {
  .dashboard-chart-insights,
  .dashboard-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-hero__aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .metric-grid--dashboard,
  .dashboard-chart-insights,
  .dashboard-toolbar,
  .dashboard-follow-up-summary,
  .dashboard-hero__aside {
    grid-template-columns: 1fr;
  }

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

  .dashboard-table-wrap,
  .follow-up-list--dashboard {
    max-height: none;
  }

  .dashboard-table-summary {
    align-items: flex-start;
  }
}


/* Missed follow-up styles */
.follow-up-item.is-missed {
  border-color: rgba(220, 53, 69, 0.5);
  box-shadow: inset 0 0 0 1px rgba(220, 53, 69, 0.25);
  background-color: rgba(220, 53, 69, 0.05);
}

.follow-up-item.is-missed:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 53, 69, 0.6);
  box-shadow: var(--shadow-soft);
}

.panel--danger {
  border-color: rgba(220, 53, 69, 0.4);
  background-color: rgba(220, 53, 69, 0.03);
}

.panel--danger .panel__header {
  border-bottom-color: rgba(220, 53, 69, 0.2);
}

/* Automation Rules styles */
.automation-rules-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.automation-rule-card {
  border: 1px solid var(--border-soft, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated, #fff);
  transition: box-shadow 0.15s ease;
}

.automation-rule-card:hover {
  box-shadow: var(--shadow-soft);
}

.automation-rule-card--inactive {
  opacity: 0.6;
}

.automation-rule-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.automation-rule-card__name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
}

.automation-rule-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.automation-rule-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.automation-rule-card__assignee {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
}

.automation-rule-card__assignee svg {
  flex-shrink: 0;
  color: var(--text-muted, #94a3b8);
}

/* Facebook lead import add-on styles */
.facebook-import-card {
  display: grid;
  gap: 1rem;
  margin-top: 0.35rem;
  padding: 1.15rem;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--surface-border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 90%, transparent), color-mix(in srgb, var(--accent) 6%, var(--surface-solid)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.facebook-import-card[hidden] {
  display: none;
}

.facebook-import-card--readonly {
  gap: 0.75rem;
}

.facebook-import-card__controls,
.facebook-import-fields {
  display: grid;
  gap: 1rem;
}

.facebook-import-card__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.facebook-import-status {
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  font-weight: 700;
  border: 1px solid transparent;
}

.facebook-import-status--info {
  color: var(--text);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.14);
}

.facebook-import-status--success {
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.14);
}

.facebook-import-status--error {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.14);
}

.facebook-import-fields {
  padding-top: 0.25rem;
  border-top: 1px solid var(--surface-border);
}

.facebook-import-fields__header p {
  margin: 0;
  color: var(--text-muted);
}

.facebook-dynamic-field {
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
}

.lead-core-field--hidden {
  display: none;
}

@media (max-width: 767px) {
  .facebook-import-card__row {
    grid-template-columns: 1fr;
  }

  .facebook-import-card__row .btn {
    width: 100%;
  }
}

/* ================================================
   DASHBOARD FILTER PANEL
   ================================================ */
.filter-panel {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.filter-form__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-field--search {
  min-width: 0;
}

.filter-field--actions {
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.filter-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-active-indicator {
  margin-top: 0.75rem;
}

/* ================================================
   KPI GRID
   ================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.kpi-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card--primary .kpi-card__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.kpi-card--success .kpi-card__icon {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.kpi-card--warning .kpi-card__icon {
  background: rgba(249, 115, 22, 0.12);
  color: var(--warning);
}

.kpi-card--accent .kpi-card__icon {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-secondary);
}

.kpi-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-card__body small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kpi-card__body span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================================================
   STATUS CARDS GRID
   ================================================ */
.status-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.status-card {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.status-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

.status-card--link {
  cursor: pointer;
}

.status-card__indicator {
  width: 4px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 0 2px 2px 0;
}

.status-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.status-card__count {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.status-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.status-card__arrow {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.status-card:hover .status-card__arrow {
  opacity: 1;
}

/* ================================================
   PERFORMERS GRID
   ================================================ */
.performers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.performer-card {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s ease;
}

.performer-card:hover {
  box-shadow: var(--shadow-soft);
}

.performer-card__rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.performer-card:first-child .performer-card__rank {
  background: rgba(234, 179, 8, 0.15);
  color: #b45309;
}

.performer-card:nth-child(2) .performer-card__rank {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.performer-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.performer-card__body > strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.performer-card__stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.performer-card__stats .divider {
  opacity: 0.4;
}

.performer-card__rate {
  font-weight: 600;
  color: var(--success);
}

.performer-card__revenue {
  margin-top: 0.2rem;
}

.performer-card__revenue small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.performer-card--link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.performer-card--link:hover,
.performer-card--link:focus-visible {
  color: inherit;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--surface-border));
}

.performer-card--link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 3px;
}

.metric-card--link,
.kpi-card--link,
.dashboard-mini-stat--link,
.dashboard-follow-up-summary__tile--link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.metric-grid > .metric-card--link {
  display: block;
}

.metric-card--dashboard.metric-card--link {
  display: grid;
}

.metric-card--link:hover,
.metric-card--link:focus-visible,
.kpi-card--link:hover,
.kpi-card--link:focus-visible,
.dashboard-mini-stat--link:hover,
.dashboard-mini-stat--link:focus-visible,
.dashboard-follow-up-summary__tile--link:hover,
.dashboard-follow-up-summary__tile--link:focus-visible {
  color: inherit;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--surface-border));
  box-shadow: var(--shadow-soft);
}

.metric-card--link:focus-visible,
.kpi-card--link:focus-visible,
.dashboard-mini-stat--link:focus-visible,
.dashboard-follow-up-summary__tile--link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 3px;
}

.lead-card--clickable,
.lead-table tbody tr[data-lead-detail-url] {
  cursor: pointer;
}

.lead-card--clickable:focus-visible,
.lead-table tbody tr[data-lead-detail-url]:focus-visible td {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: -2px;
}

.employee-performance-page {
  display: grid;
  gap: 1rem;
}

.employee-performance-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
  margin-bottom: 1rem;
}

.employee-performance-chart {
  align-items: center;
}

.employee-performance-table-wrap {
  overflow-x: auto;
}

.employee-performance-table tbody tr[data-performer-lead-row] {
  cursor: pointer;
}

.employee-performance-table tbody tr[data-performer-lead-row]:hover {
  transform: translateY(-1px);
}

.employee-performance-table tbody tr[data-performer-lead-row]:focus-visible td {
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: -2px;
}

.lead-drilldown-modal .modal-content {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.lead-drilldown-modal .modal-header {
  border-bottom-color: var(--surface-border);
}

.lead-drilldown-modal .modal-body {
  padding: 1rem;
}

.modal-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.employee-lead-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
}

.employee-lead-modal-panel {
  margin: 0;
}

.employee-lead-modal-panel--wide {
  grid-column: 1 / -1;
}

.details-list--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeline--compact {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ================================================
   CATEGORY BADGE
   ================================================ */
.category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ================================================
   RESPONSIVE ADJUSTMENTS FOR NEW SECTIONS
   ================================================ */
@media (max-width: 1399px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .performers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .filter-form__grid {
    grid-template-columns: 1fr 1fr;
  }

  .employee-lead-modal-grid {
    grid-template-columns: 1fr;
  }

  .filter-field--actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .status-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .filter-form__grid {
    grid-template-columns: 1fr;
  }

  .employee-performance-toolbar,
  .details-list--compact {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .status-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.subscription-page .pricing-grid,
.pricing-grid--app {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pkg-card {
  position: relative;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pkg-card.featured {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--surface-border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 92%, transparent), color-mix(in srgb, var(--accent) 7%, var(--surface-solid)));
}

.pkg-card.package-current {
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-soft);
}

.pkg-badge {
  position: absolute;
  top: -0.75rem;
  left: 1.2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.pkg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pkg-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.pkg-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.pkg-icon.gradient-purple {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
}

.pkg-tagline {
  color: var(--text-muted);
  margin: 0;
}

.pkg-prices {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pkg-price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.price-value {
  font-size: 2.3rem;
  line-height: 1;
  font-weight: 800;
}

.price-unit,
.pkg-yearly {
  color: var(--text-muted);
  font-weight: 600;
}

.pkg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pkg-meta span {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.pkg-divider {
  height: 1px;
  background: var(--surface-border);
}

.pkg-feature-content,
.package-rich-preview {
  color: var(--text);
  line-height: 1.7;
}

.pkg-feature-content ul,
.pkg-feature-content ol,
.package-rich-preview ul,
.package-rich-preview ol {
  margin: 0;
  padding-left: 1.15rem;
  list-style: revert;
}

.pkg-feature-content li + li,
.package-rich-preview li + li {
  margin-top: 0.45rem;
}

.pkg-feature-content mark,
.package-rich-preview mark {
  background: #fef3c7;
  color: #111827;
  border-radius: 4px;
  padding: 0 0.2rem;
}

.pkg-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.pkg-btn {
  width: 100%;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  color: var(--text);
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pkg-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--surface-border));
}

.pkg-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  border-color: transparent;
}

.pkg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.subscription-overview-panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 90%, transparent), color-mix(in srgb, var(--accent) 6%, var(--surface-solid)));
}

/* ================================================
   CRM SMART ASSISTANT
   ================================================ */
.crm-assistant-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1080;
  pointer-events: none;
}

.crm-assistant-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.85rem;
  position: absolute;
  right: 0;
  bottom: 5.25rem;
  width: min(420px, calc(100vw - 2rem));
  height: min(620px, calc(100vh - 7rem));
  padding: 1rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--surface-border) 80%, transparent);
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 88%, transparent), color-mix(in srgb, var(--surface-solid) 78%, var(--accent) 4%));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease;
  pointer-events: none;
}

.crm-assistant-widget.is-open .crm-assistant-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.crm-assistant-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
}

.crm-assistant-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.75rem;
}

.crm-assistant-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

.crm-assistant-avatar,
.crm-assistant-close,
.crm-assistant-toggle,
.crm-assistant-send__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-assistant-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 34%, transparent);
}

.crm-assistant-avatar svg,
.crm-assistant-close svg,
.crm-assistant-toggle svg,
.crm-assistant-send svg {
  width: 1.15rem;
  height: 1.15rem;
}

.crm-assistant-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.crm-assistant-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-solid));
  transform: rotate(6deg) scale(1.04);
}

.crm-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.2rem 0.35rem 0.2rem 0.1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 38%, transparent) transparent;
}

.crm-assistant-messages::-webkit-scrollbar {
  width: 0.45rem;
}

.crm-assistant-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
}

.crm-assistant-message {
  display: flex;
  animation: assistant-message-in 180ms ease both;
}

.crm-assistant-message--user {
  justify-content: flex-end;
}

.crm-assistant-message__bubble {
  width: fit-content;
  max-width: 84%;
  padding: 0.78rem 0.95rem;
  border-radius: 18px 18px 18px 6px;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface-border) 86%, transparent);
  color: var(--text);
  line-height: 1.55;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  word-break: break-word;
}

.crm-assistant-message--user .crm-assistant-message__bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 26%, transparent);
}

.crm-assistant-message--loading .crm-assistant-message__bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.crm-assistant-message--loading .crm-assistant-message__bubble::after {
  content: "";
  width: 1.4rem;
  height: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--text-muted) 25%, transparent 25% 50%, var(--text-muted) 50% 75%, transparent 75%);
  background-size: 0.55rem 0.35rem;
  animation: assistant-typing 0.8s steps(4) infinite;
  opacity: 0.65;
}

.crm-assistant-suggestions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.crm-assistant-suggestions button {
  border: 1px solid color-mix(in srgb, var(--surface-border) 84%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.48rem 0.72rem;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.crm-assistant-suggestions button:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--surface-border));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-solid));
  transform: translateY(-1px);
}

.crm-assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--surface-border) 82%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.crm-assistant-form .form-control {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  padding-left: 0.75rem;
}

.crm-assistant-form .form-control:focus {
  box-shadow: none;
}

.crm-assistant-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  min-width: 88px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.crm-assistant-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 34%, transparent);
}

.crm-assistant-send:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.crm-assistant-toggle {
  position: relative;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  box-shadow: 0 20px 48px color-mix(in srgb, var(--accent) 42%, transparent), 0 8px 22px rgba(15, 23, 42, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  pointer-events: auto;
}

.crm-assistant-toggle:hover {
  transform: translateY(-4px) scale(1.04);
  filter: saturate(1.08);
  box-shadow: 0 26px 58px color-mix(in srgb, var(--accent) 46%, transparent), 0 10px 26px rgba(15, 23, 42, 0.25);
}

.crm-assistant-widget.is-open .crm-assistant-toggle {
  transform: scale(0.96);
}

.crm-assistant-toggle__icon {
  position: relative;
  z-index: 1;
}

.crm-assistant-toggle__icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.crm-assistant-toggle__pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  animation: assistant-pulse 2.4s ease-out infinite;
}

.crm-assistant-form.is-loading {
  opacity: 0.78;
}

@keyframes assistant-typing {
  to {
    background-position-x: 1.1rem;
  }
}

@keyframes assistant-message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes assistant-pulse {
  0% {
    opacity: 0.55;
    transform: scale(0.86);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@media (max-width: 575px) {
  .crm-assistant-widget {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    justify-content: flex-end;
  }

  .crm-assistant-panel {
    position: fixed;
    right: 0.75rem;
    bottom: 5.75rem;
    left: 0.75rem;
    width: auto;
    height: min(620px, calc(100dvh - 7rem));
    max-height: calc(100dvh - 7rem);
    border-radius: 22px;
    transform-origin: bottom center;
  }

  .crm-assistant-message__bubble {
    max-width: 88%;
  }

  .crm-assistant-send {
    width: 46px;
    min-width: 46px;
    padding: 0;
  }

  .crm-assistant-send__label {
    display: none;
  }
}

/* Enterprise CRM shell polish */
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.38rem 0.75rem 0.38rem 0.42rem;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: var(--shadow-soft);
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__brand:hover,
.topbar__brand:focus-visible {
  color: var(--accent);
}

.topbar__brand-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f766e);
  box-shadow: 0 10px 22px var(--accent-shadow);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.topbar__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.topbar__breadcrumb a,
.topbar__breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__quick-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 112px;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f766e);
  box-shadow: 0 14px 28px var(--accent-shadow);
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topbar__quick-add:hover,
.topbar__quick-add:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 18px 34px var(--accent-shadow);
}

.topbar__quick-add svg {
  width: 18px;
  height: 18px;
}

.sidebar__section {
  display: grid;
  gap: 0.42rem;
  padding-bottom: 0.65rem;
}

.sidebar__section + .sidebar__section {
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__badge {
    position: relative;
    z-index: 1;
    display: inline-grid;
    min-width: 26px;
    height: 24px;
    place-items: center;
    margin-left: auto;
    padding-inline: 0.45rem;
    border-radius: 999px;
    color: #dbeafe;
    background: color-mix(in srgb, #001fff 42%, rgb(39 0 255 / 52%));
    font-size: 0.72rem;
    font-weight: 950;
}

body.sidebar-collapsed .sidebar__section {
  padding-bottom: 0.35rem;
}

body.sidebar-collapsed .sidebar__badge {
  position: absolute;
  top: 0.22rem;
  right: 0.2rem;
  min-width: 18px;
  height: 18px;
  padding: 0;
  font-size: 0.62rem;
}

@media (max-width: 1199.98px) {
  .topbar__breadcrumb {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .topbar {
    align-items: stretch;
    padding: 0.85rem;
  }

  .topbar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .topbar__search {
    min-width: 0;
    width: 100%;
  }

  .topbar__quick-add span:last-child,
  .topbar__brand span:last-child,
  .topbar__profile-copy {
    display: none;
  }

  .topbar__quick-add {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }
}
