@layer modules {
  .business-shell {
    min-height: 100dvh;
  }

  .business-shell__inner {
    padding-block: clamp(1.5rem, 3vw, 3rem);
  }

  .business-shell__mobile-bar {
    align-items: center;
    display: flex;
    gap: var(--block-space);
    justify-content: space-between;
  }

  .business-shell__brand {
    align-items: center;
    display: flex;
    gap: var(--block-space);
  }

  .business-shell__brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    color: var(--color-emerald-600);
    display: inline-flex;
    justify-content: center;
    min-block-size: 2.5rem;
    min-inline-size: 2.5rem;
  }

  .business-shell__brand-mark--drawer {
    border-color: rgba(255, 255, 255, 0.6);
  }

  .business-shell__brand-mark--drawer .sidebar__logo {
    color: var(--color-white);
  }

  .sidebar__logo {
    block-size: 1.5rem;
    color: var(--color-white);
    inline-size: 1.5rem;
    object-fit: contain;
  }

  .business-shell__grid {
    align-items: start;
    display: grid;
    gap: var(--block-space-double);
    margin-top: var(--block-space-double);
  }

  .business-shell__content {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);
    min-width: 0;
  }

  .sidebar {
    background: var(--color-slate-900);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-2xl);
    color: var(--color-slate-100);
    display: none;
    flex-direction: column;
    align-self: start;
    height: fit-content;
    overflow: hidden;
    position: sticky;
    top: 1.5rem;
  }

  .sidebar__inner {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);
    padding: 1.5rem;
  }

  .sidebar__brand {
    align-items: center;
    display: flex;
    gap: var(--block-space);
  }

  .sidebar__title {
    color: var(--color-white);
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.2;
  }

  .sidebar__label {
    color: var(--color-slate-400);
    font-size: var(--text-2xs);
    letter-spacing: 0.3em;
    text-transform: uppercase;
  }

  .sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .sidebar__link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--color-slate-200);
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
  }

  .sidebar__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-white);
  }

  .sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    color: var(--color-white);
  }

  .sidebar__status {
    color: var(--color-emerald-200);
    font-size: var(--text-2xs);
    letter-spacing: 0.12em;
    margin-left: auto;
    text-transform: uppercase;
  }

  .sidebar__meta {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-slate-100);
    display: flex;
    flex-direction: column;
    gap: var(--block-space-half);
    padding: 1rem;
    font-size: var(--text-sm);
  }

  .sidebar__meta-label {
    color: var(--color-slate-400);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .sidebar__logout {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    color: var(--color-red-400);
    cursor: pointer;
    display: flex;
    font-size: var(--text-sm);
    font-weight: 500;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
    width: 100%;
  }

  .sidebar__logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--color-red-300);
  }

  /* ── Hamburger toggle ── */
  .hamburger {
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    overflow: hidden;
    padding: 0.5rem;
    position: relative;
    z-index: 51;
  }

  .hamburger__line {
    background: var(--color-slate-700);
    border-radius: 2px;
    display: block;
    height: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 20px;
  }

  .hamburger.is-active .hamburger__line {
    background: var(--color-white);
  }

  .hamburger.is-active .hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger.is-active .hamburger__line:nth-child(2) {
    transform: translateX(40px);
  }

  .hamburger.is-active .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .drawer {
    background: rgba(2, 6, 23, 0.95);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    inset: 0;
    position: fixed;
    z-index: 50;
  }

  .drawer__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: clamp(1.5rem, 3vw, 3rem) var(--container-padding);
  }

  .drawer__body {
    display: flex;
    flex-direction: column;
    gap: var(--block-space-double);
    overflow-y: auto;
    padding: 0 var(--container-padding) 2rem;
  }

  .drawer__nav {
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    font-size: var(--text-base);
    font-weight: 600;
  }

  .drawer__link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    color: var(--color-slate-200);
    display: flex;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
  }

  .drawer__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
  }

  .drawer__link.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-sm);
    color: var(--color-white);
  }

  .card.dashboard-wallet {
    background-color: var(--color-slate-950, #020617);
    background-image: linear-gradient(145deg, var(--color-slate-950, #020617) 0%, var(--color-slate-900, #0f172a) 55%, var(--color-emerald-900, #064e3b) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--color-white);
    isolation: isolate;
    overflow: hidden;
    position: relative;
  }

  .dashboard-wallet__glow {
    display: none;
  }

  .dashboard-wallet__content {
    display: flex;
    flex-direction: column;
    gap: var(--block-space);
    position: relative;
    z-index: 1;
  }

  .dashboard-wallet__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--block-space);
    justify-content: space-between;
  }

  .dashboard-wallet__amount {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .dashboard-wallet__note {
    color: rgba(236, 253, 245, 0.9);
    font-size: var(--text-sm);
  }

  .dashboard-alert {
    background: var(--color-amber-50);
    border: 1px solid var(--color-amber-200);
  }

  .dashboard-alert__icon {
    align-items: center;
    background: var(--color-amber-100);
    border-radius: 999px;
    color: var(--color-amber-700);
    display: inline-flex;
    font-size: var(--text-lg);
    inline-size: 2.5rem;
    justify-content: center;
    min-block-size: 2.5rem;
  }

  .dashboard-alert__count {
    color: var(--color-ink);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
  }

  .velocity-chart {
    background: linear-gradient(180deg, var(--color-slate-50), var(--color-white));
    border-radius: var(--radius-lg);
    min-block-size: 12rem;
    overflow: visible;
    padding: var(--block-space);
    padding-block-end: calc(var(--block-space) + 0.75rem);
  }

  .velocity-chart .vega-embed {
    width: 100%;
  }

  .velocity-chart .vega-embed canvas,
  .velocity-chart .vega-embed svg {
    display: block;
  }

  .velocity-chart--pie {
    align-items: center;
    display: none;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    min-block-size: auto;
    padding: var(--block-space);
  }

  .pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-inline-size: 0;
  }

  .pie-legend__item {
    align-items: center;
    display: flex;
    gap: 0.375rem;
  }

  .pie-legend__dot {
    block-size: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    inline-size: 0.5rem;
  }

  .pie-legend__dot--leads {
    background: #334155;
  }

  .pie-legend__dot--converted {
    background: #059669;
  }

  .pie-legend__dot--clicks {
    background: #0369a1;
  }

  .pie-legend__label {
    color: var(--color-ink-subtle);
    font-size: var(--text-xs);
  }

  .pie-legend__value {
    color: var(--color-ink);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-inline-start: 0.25rem;
  }

  @media (max-width: 639px) {
    .velocity-chart--line {
      display: none;
    }

    .velocity-chart--pie {
      display: flex;
    }

    .velocity-badge {
      display: none;
    }
  }

  .dashboard-ticker {
    background: var(--color-slate-50);
    border: 1px solid var(--color-slate-200);
    transition: var(--transition-fast);
  }

  .dashboard-ticker:hover {
    border-color: var(--color-slate-300);
    box-shadow: var(--shadow-md);
  }

  .dashboard-ticker__count {
    color: var(--color-ink);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .dashboard-top-affiliate {
    background: var(--color-slate-50);
    border: 1px solid var(--color-slate-200);
    transition: var(--transition-fast);
  }

  .dashboard-top-affiliate:hover {
    border-color: var(--color-slate-300);
    box-shadow: var(--shadow-md);
  }

  /* New Lead Alert */
  .dashboard-new-lead {
    background: var(--color-emerald-50);
    border: 1px solid var(--color-emerald-200);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .dashboard-new-lead__header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--block-space);
    justify-content: space-between;
  }

  .dashboard-new-lead__info {
    align-items: center;
    display: flex;
    gap: 0.75rem;
  }

  .dashboard-new-lead__badge {
    background: var(--color-emerald-500);
    border-radius: var(--radius-sm);
    color: var(--color-white);
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    text-transform: uppercase;
  }

  .dashboard-new-lead__details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }

  .dashboard-new-lead__title {
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .dashboard-new-lead__time {
    color: var(--color-ink-subtle);
    font-size: var(--text-xs);
  }

  .dashboard-new-lead__actions {
    display: flex;
    gap: 0.5rem;
  }

  .dashboard-new-lead__contact {
    border-top: 1px solid var(--color-emerald-200);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.75rem;
  }

  .dashboard-new-lead__field {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }

  .dashboard-new-lead__label {
    color: var(--color-emerald-700);
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
  }

  .dashboard-new-lead__value {
    color: var(--color-ink);
    font-size: var(--text-sm);
  }

  /* ROI Stats */
  .dashboard-roi {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, 1fr);
  }

  @media (max-width: 639px) {
    .dashboard-roi {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.5rem;
    }

    .dashboard-roi__item {
      padding: 0.75rem 0.5rem;
    }

    .dashboard-roi .dashboard-roi__item--cost {
      display: none;
    }

    .dashboard-roi__value {
      font-size: var(--text-lg);
    }
  }

  .dashboard-roi__item {
    align-items: center;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .dashboard-roi__item--revenue {
    background: var(--color-emerald-50);
    border: 1px solid var(--color-emerald-100);
  }

  .dashboard-roi__item--cost {
    background: var(--color-slate-100);
    border: 1px solid var(--color-slate-200);
  }

  .dashboard-roi__item--profit {
    background: linear-gradient(135deg, var(--color-emerald-100), var(--color-sky-100));
    border: 1px solid var(--color-emerald-200);
  }

  .dashboard-roi__label {
    color: var(--color-ink-muted);
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .dashboard-roi__value {
    color: var(--color-ink);
    font-size: var(--text-2xl);
    font-weight: 700;
  }

  .dashboard-roi__value--highlight {
    background: linear-gradient(120deg, var(--color-emerald-600), var(--color-sky-700));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .dashboard-roi__detail {
    color: var(--color-ink-subtle);
    font-size: var(--text-xs);
  }

  /* Top Performers */
  .dashboard-performers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .dashboard-performer {
    align-items: center;
    background: var(--color-slate-50);
    border-radius: var(--radius-lg);
    color: inherit;
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    transition: var(--transition-fast);
  }

  .dashboard-performer:hover {
    background: var(--color-emerald-50);
    box-shadow: 0 0 0 2px var(--color-emerald-200);
  }

  .dashboard-performer__avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--color-emerald-100), var(--color-sky-100));
    border-radius: var(--radius-pill);
    color: var(--color-emerald-700);
    display: flex;
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: 600;
    block-size: 2rem;
    inline-size: 2rem;
    justify-content: center;
  }

  .dashboard-performer__info {
    flex: 1;
    min-inline-size: 0;
  }

  .dashboard-performer__name {
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .dashboard-performer__stats {
    color: var(--color-ink-subtle);
    display: flex;
    font-size: var(--text-xs);
    gap: 0.75rem;
  }

  .dashboard-performer__earnings {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .dashboard-performer__paid {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
  }

  @media (min-width: 1024px) {
    .business-shell__mobile-bar {
      display: none;
    }

    .business-shell__grid {
      grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
      margin-top: 0;
    }

    .sidebar {
      display: flex;
    }
  }

  @media (max-width: 1023px) {
    .business-shell__brand-mark {
      border-color: var(--color-slate-900);
    }

    .sidebar__logo {
      color: rgb(34, 65, 72);
    }
  }

  /* Business Mobile Cards */
  .business-lead-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1rem;
  }

  .business-lead-card__header {
    align-items: flex-start;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  .business-lead-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
  }

  .business-lead-card__contact {
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .business-lead-card__affiliate {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
  }

  .business-lead-card__body {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .business-lead-card__date {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
  }

  .business-lead-card__actions {
    display: flex;
    gap: 0.5rem;
  }

  /* Business Affiliate Mobile Cards */
  .business-affiliate-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1rem;
  }

  .business-affiliate-card__header {
    align-items: flex-start;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  .business-affiliate-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
  }

  .business-affiliate-card__name {
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .business-affiliate-card__contact {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
  }

  .business-affiliate-card__body {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.5rem;
  }

  .business-affiliate-card__progress {
    color: var(--color-ink);
    font-size: var(--text-sm);
  }

  .business-affiliate-card__progress-caption {
    color: var(--color-ink-muted);
    font-size: var(--text-xs);
  }

  /* Business Lead Stats Header */
  .business-leads-stats {
    display: grid;
    gap: var(--block-space-half);
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  }

  @media (min-width: 640px) {
    .business-leads-stats {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }

  .business-leads-stat {
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    padding: var(--block-space-half) var(--block-space);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .business-leads-stat:hover {
    background: var(--color-slate-50);
    border-color: var(--color-slate-300);
  }

  .business-leads-stat--active {
    background: var(--color-emerald-50);
    border-color: var(--color-emerald-300);
  }

  .business-leads-stat__value {
    color: var(--color-ink);
    font-size: var(--text-lg);
    font-weight: 700;
  }

  .business-leads-stat__label {
    color: var(--color-subtle);
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
}
