/**
 * Incentiwise Minimal Light Theme v5
 * Clean · white · icon-led navigation
 */

:root {
  --radius-sm: 10px;
  --radius: 20px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --iw-accent: #2563eb;
  --iw-accent-hover: #1d4ed8;
  --iw-accent-soft: #e0f2fe;
  --iw-accent-muted: #bae6fd;

  --iw-ink: #0f172a;
  --iw-muted: #64748b;
  --iw-subtle: #94a3b8;
  --iw-border: #e2e8f0;
  --iw-border-light: #f1f5f9;

  --iw-surface: #ffffff;
  --iw-surface-muted: #f4f6fa;
  --iw-bg: #ffffff;

  --sidebar-width: 272px;
  --topbar-height: 56px;

  --shadow-none: none;
  --shadow-xs: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 8px 30px -4px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.04);

  --iw-indigo: var(--iw-accent);
  --iw-indigo-dark: var(--iw-accent-hover);
  --iw-indigo-light: #3b82f6;
  --erp-accent: var(--iw-accent);
  --erp-accent-soft: var(--iw-accent-soft);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* Ensure Font Awesome icons render */
.fa-solid,
.fa-regular,
.fa-brands,
.nav-icon-fa,
[class^="fa-"],
[class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", var(--fa-style-family, "Font Awesome 6 Free");
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  display: inline-block;
}

.fa-solid,
.nav-icon-fa {
  font-weight: 900;
}

/* ── Shell ── */
body.app-body {
  background: var(--iw-bg);
  background-image: none;
  color: var(--iw-ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  background: var(--iw-bg);
}

/* ── Light sidebar ── */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--iw-surface);
  color: var(--iw-ink);
  border-right: 1px solid var(--iw-border);
  box-shadow: none;
  backdrop-filter: none;
}

.sidebar-brand {
  padding: 1.125rem 1rem 0.875rem;
  border-bottom: 1px solid var(--iw-border-light);
  gap: 0.65rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon:hover {
  transform: none;
}

.brand-text strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--iw-ink);
  letter-spacing: -0.02em;
}

.brand-text small,
.sidebar-role {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 0.75rem 0.625rem;
}

.nav-section {
  margin-bottom: 1.25rem;
}

.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding: 0 0.625rem 0.375rem;
}

.nav-item {
  gap: 0.625rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition);
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--iw-ink);
  transform: none;
}

.nav-item.active {
  background: #eff6ff !important;
  color: #2563eb !important;
  box-shadow: none;
  font-weight: 600;
}

.nav-icon-fa {
  width: 18px;
  font-size: 0.95rem;
  color: #94a3b8 !important;
}

.nav-item.active .nav-icon-fa {
  color: #2563eb !important;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 0.75rem 0.625rem;
  border-top: 1px solid var(--iw-border-light);
}

.trial-pill {
  background: #fff7ed !important;
  color: #ea580c !important;
  border: none !important;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  padding: 6px 12px;
  border-radius: 999px !important;
  backdrop-filter: none;
}

.user-chip {
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
}

.user-chip:hover {
  background: var(--iw-surface-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  background: #dbeafe !important;
  color: #1e40af !important;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-detail-grid dt {
  font-size: 0.8125rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.incentive-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--iw-border);
  border-radius: var(--radius-sm);
  background: var(--iw-surface);
  font-size: 0.875rem;
  cursor: pointer;
}

.incentive-type-option input {
  accent-color: var(--iw-accent);
}

.user-meta strong {
  font-size: 0.8125rem;
  color: var(--iw-ink);
}

.user-meta span {
  font-size: 0.6875rem;
  color: var(--iw-muted);
}

.logout-btn {
  color: var(--iw-muted) !important;
  border-radius: var(--radius-sm);
}

.logout-btn:hover {
  color: #dc2626 !important;
  background: #fef2f2 !important;
}

/* Hide theme toggles — light only */
.theme-toggle,
.theme-toggle-sidebar,
.auth-theme-toggle {
  display: none !important;
}

/* ── Main area ── */
.app-main {
  background: var(--iw-surface-muted);
}

.app-topbar {
  height: var(--topbar-height);
  background: var(--iw-surface);
  border-bottom: 1px solid var(--iw-border);
  box-shadow: none;
  backdrop-filter: none;
  padding: 0 1.5rem;
}

.topbar-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--iw-ink);
  letter-spacing: -0.01em;
}

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--iw-border);
  border-radius: var(--radius-sm);
  color: var(--iw-muted);
}

.app-content {
  padding: 1.5rem 1.75rem 2rem;
  animation: none;
  background: var(--iw-surface-muted);
}

/* Role dashboards: content carries the page title */
.layout-role-dashboard .app-topbar {
  display: none;
}

.layout-role-dashboard .app-content {
  padding-top: 1.75rem;
}

.erp-page {
  max-width: 100%;
  width: 100%;
}

/* ── Cards ── */
.iw-card,
.stat-card,
.erp-stat-card,
.se-stat-card,
.de-stat-card {
  background: var(--iw-surface);
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  backdrop-filter: none;
  transition: border-color var(--transition);
}

.iw-card:hover,
.erp-stat-card:hover,
.se-stat-card:hover,
.de-stat-card:hover {
  border-color: #d1d5db;
  box-shadow: var(--shadow-xs);
  transform: none;
}

.iw-card-header {
  background: var(--iw-surface);
  border-bottom: 1px solid var(--iw-border-light);
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.iw-card-body {
  padding: 1.25rem;
}

.erp-card-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.erp-card-title i {
  color: var(--iw-muted);
  font-size: 0.8rem;
}

/* ── Stat cards ── */
.erp-stat-grid,
.se-stat-grid,
.de-stat-grid,
.stat-grid {
  gap: 0.75rem;
}

.erp-stat-icon,
.se-stat-icon,
.de-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1rem;
}

.erp-stat-blue,
.se-stat-icon-purple,
.de-stat-icon-blue { background: #eff6ff; color: #2563eb; }
.erp-stat-green,
.se-stat-icon-green,
.de-stat-icon-green { background: #f0fdf4; color: #16a34a; }
.erp-stat-purple,
.de-stat-icon-purple { background: var(--iw-accent-soft); color: var(--iw-accent); }
.erp-stat-gold,
.se-stat-icon-gold,
.de-stat-icon-gold { background: #fffbeb; color: #d97706; }
.erp-stat-red { background: #fef2f2; color: #dc2626; }
.erp-stat-slate { background: #f3f4f6; color: #6b7280; }

.erp-stat-label,
.se-stat-label,
.de-stat-label,
.stat-card .label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--iw-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.erp-stat-value,
.se-stat-value,
.de-stat-value,
.stat-card .value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--iw-ink);
  letter-spacing: -0.03em;
}

.erp-stat-value.accent,
.stat-card .value.accent {
  color: var(--iw-accent);
}

/* ── Admin dashboard charts ── */
.admin-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.admin-dashboard-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.admin-dashboard-subtitle {
  color: var(--iw-muted);
  margin: 0;
  font-size: 0.92rem;
}

.admin-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  border: 1px solid var(--iw-accent-muted);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.admin-kpi-pill strong {
  font-weight: 700;
}

.admin-stat-grid {
  margin-bottom: 1.25rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

@media (max-width: 768px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-chart-card .iw-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.admin-chart-wrap {
  position: relative;
  width: 100%;
}

.admin-chart-wrap-lg {
  height: 300px;
}

.admin-chart-wrap-donut {
  height: 260px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.admin-chart-wrap-bar {
  height: 280px;
}

.admin-chart-wrap-bar-sm {
  height: 220px;
}

.admin-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--iw-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.admin-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--iw-surface-muted);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--iw-muted);
}

.admin-suggestions .admin-suggestion-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--iw-border-light);
}

.admin-suggestions .admin-suggestion-item:last-child {
  border-bottom: none;
}

.admin-suggestions .admin-suggestion-item p {
  color: var(--iw-muted);
  font-size: 0.86rem;
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* ── Welcome headers ── */
.se-welcome,
.tl-welcome,
.de-welcome {
  margin-bottom: 1.25rem;
}

.se-welcome h1,
.tl-welcome h1,
.de-welcome h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--iw-ink);
}

.se-welcome p,
.tl-welcome p,
.de-welcome p {
  font-size: 0.875rem;
  color: var(--iw-muted);
}

.erp-badge,
.se-badge,
.de-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}

.erp-badge-success,
.se-badge-success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.erp-badge-info,
.de-badge-active {
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  border-color: var(--iw-accent-muted);
}

/* ── Progress bars ── */
.se-progress-track,
.progress-track {
  height: 6px;
  background: var(--iw-border-light);
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.se-progress-fill,
.progress-fill {
  background: var(--iw-accent);
  border-radius: var(--radius-pill);
  box-shadow: none;
  transition: width 0.6s ease;
}

.progress-fill.success,
.se-progress-fill { background: #22c55e; }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger { background: #ef4444; }

.se-progress-pct {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--iw-accent);
}

/* ── Tables ── */
.iw-table th {
  background: var(--iw-surface-muted);
  color: var(--iw-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--iw-border);
}

.iw-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--iw-border-light);
  font-size: 0.875rem;
}

.iw-table tbody tr:hover td {
  background: var(--iw-surface-muted);
}

/* ── Buttons ── */
.btn-iw,
.app-body .btn.btn-iw {
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem !important;
  transition: background var(--transition) !important;
}

.btn-iw:hover,
.app-body .btn.btn-iw:hover {
  background: #1e293b !important;
  color: #ffffff !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-iw-outline,
.app-body .btn.btn-iw-outline {
  background: var(--iw-surface) !important;
  border: 1px solid var(--iw-border) !important;
  color: var(--iw-ink) !important;
  border-radius: var(--radius-pill) !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem !important;
  box-shadow: none !important;
}

.btn-iw-outline:hover {
  background: var(--iw-surface-muted) !important;
  border-color: #94a3b8 !important;
  color: var(--iw-ink) !important;
  transform: none !important;
}

.app-body .btn-primary {
  background: #0f172a !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
}
.app-body .btn-primary:hover {
  background: #1e293b !important;
}

/* ── Forms ── */
.iw-form .form-control,
.iw-form .form-select,
.erp-search .form-control {
  border: 1px solid var(--iw-border);
  border-radius: var(--radius-sm);
  background: var(--iw-surface);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  box-shadow: none;
}

.iw-form .form-control:focus,
.iw-form .form-select:focus {
  border-color: var(--iw-accent);
  box-shadow: 0 0 0 3px var(--iw-accent-soft);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--iw-ink);
  margin-bottom: 0.35rem;
}

/* ── Toolbar & page header ── */
.erp-toolbar {
  background: var(--iw-surface);
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.erp-page-header {
  margin-bottom: 1.25rem;
}

.erp-page-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  font-size: 1rem;
}

.erp-page-meta h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.erp-page-meta p {
  font-size: 0.875rem;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

/* ── Pills & badges ── */
.status-pill,
.role-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}

.se-type-pill,
.rate-pill {
  background: var(--iw-surface-muted);
  color: var(--iw-muted);
  border: 1px solid var(--iw-border);
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
}

.se-incentive {
  color: #16a34a;
  font-weight: 600;
}

/* ── Notices & empty states ── */
.erp-notice,
.se-notice,
.de-notice {
  background: var(--iw-surface-muted);
  border: 1px solid var(--iw-border);
  border-left: 3px solid var(--iw-accent);
  border-radius: var(--radius-sm);
  backdrop-filter: none;
}

.erp-empty-state {
  padding: 2rem 1rem;
}

.erp-empty-icon {
  background: var(--iw-surface-muted);
  color: var(--iw-subtle);
  border-radius: var(--radius);
}

.erp-link {
  color: var(--iw-accent);
  font-size: 0.875rem;
}

/* ── Dropdowns ── */
.iw-custom-dropdown .iw-dropdown-trigger {
  border: 1px solid var(--iw-border);
  border-radius: var(--radius-sm);
  background: var(--iw-surface);
}

.iw-dropdown-panel {
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--iw-surface);
}

/* ── Auth ── */
.auth-body {
  font-family: var(--font-sans, 'Open Sans', system-ui, sans-serif);
}

.auth-hero {
  background: #fafafa;
  color: var(--iw-ink);
}

.auth-hero h1 {
  color: var(--iw-ink);
}

.auth-hero h1 span {
  color: var(--iw-accent);
}

.auth-hero .lead {
  color: var(--iw-muted);
}

.auth-badge {
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  border: 1px solid var(--iw-accent-muted);
}

.auth-features li {
  color: var(--iw-muted);
}

.auth-feature-icon {
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
}

.auth-panel {
  background: var(--iw-surface);
  background-image: none;
}

.auth-form-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: 380px;
}

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

.password-input-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--iw-muted);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.password-toggle-btn:hover {
  color: var(--iw-accent);
  background: var(--iw-accent-soft);
}

.auth-copyright {
  color: var(--iw-subtle);
}

/* ── Signup (2-column + plan panel) ── */
.auth-panel-signup {
  padding: 2rem 2.5rem;
}

.auth-panel-signup .auth-form-wrap.signup-wrap {
  max-width: 920px;
  width: 100%;
}

.signup-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.signup-form-col h2 {
  font-weight: 800;
  font-size: 1.65rem;
  margin-bottom: 0.35rem;
}

.signup-form-col .subtitle {
  color: var(--iw-muted);
  margin-bottom: 1.5rem;
}

.signup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.signup-field {
  margin-bottom: 1rem;
}

.signup-field-full {
  grid-column: 1 / -1;
}

.signup-plan-card {
  background: var(--iw-surface-muted);
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.signup-plan-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--iw-accent);
  background: var(--iw-accent-soft);
  border: 1px solid var(--iw-accent-muted);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.75rem;
}

.signup-plan-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.signup-plan-team {
  color: var(--iw-muted);
  font-size: 0.88rem;
  margin: 0 0 1rem;
}

.signup-plan-pricing {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--iw-border);
}

.signup-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.signup-price-currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--iw-muted);
}

.signup-price-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--iw-ink);
  line-height: 1;
}

.signup-price-period {
  color: var(--iw-muted);
  font-size: 0.9rem;
}

.signup-price-note {
  font-size: 0.8rem;
  color: var(--iw-muted);
  margin: 0 0 0.75rem;
}

.signup-billing-toggle {
  display: inline-flex;
  background: var(--iw-surface);
  border: 1px solid var(--iw-border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.signup-billing-toggle button {
  border: none;
  background: transparent;
  color: var(--iw-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.signup-billing-toggle button.active {
  background: var(--iw-accent);
  color: #fff;
}

.signup-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.signup-plan-features li {
  display: flex;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--iw-ink);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.signup-plan-features .fa-circle-check {
  color: var(--iw-accent);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.signup-trial-note {
  font-size: 0.8rem;
  color: var(--iw-muted);
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--iw-border);
}

.plan-feature-matrix {
  margin-bottom: 1rem;
}

.plan-feature-matrix-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--iw-muted);
  margin-bottom: 0.5rem;
}

.plan-feature-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.plan-feature-matrix-table tr.is-highlight {
  background: #eff6ff;
}

.plan-feature-matrix-label {
  padding: 0.35rem 0.5rem 0.35rem 0;
  color: var(--iw-ink);
  line-height: 1.35;
  vertical-align: middle;
}

.plan-feature-matrix-status {
  width: 2rem;
  text-align: center;
  padding: 0.35rem 0;
  vertical-align: middle;
}

.plan-feature-tick {
  color: #16a34a;
  font-weight: 700;
}

.plan-feature-dash {
  color: #94a3b8;
  font-weight: 600;
}

.plan-feature-lock {
  display: inline-block;
  margin-left: 0.25rem;
  color: #94a3b8;
  font-size: 0.65rem;
  vertical-align: middle;
}

.period-pill-premium {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #fbbf24;
  cursor: pointer;
}

.period-pill-premium:hover {
  background: #fef3c7;
  color: #92400e;
}

.signup-plan-empty {
  padding: 1rem 0;
}

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

  .signup-plan-card {
    position: static;
    order: -1;
  }

  .auth-panel-signup {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .signup-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Form pages ── */
.form-page-back {
  font-size: 0.8125rem;
  color: var(--iw-muted);
  margin-bottom: 0.875rem;
}

.form-page-card {
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
}

/* ── Alerts ── */
.app-alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--iw-border);
  font-size: 0.875rem;
}

/* ── Feature pills (admin dashboard) ── */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.feature-pill.is-active {
  background: var(--iw-accent-soft);
  color: var(--iw-accent);
  border: 1px solid var(--iw-accent-muted);
}

.feature-pill.is-inactive {
  background: var(--iw-surface-muted);
  color: var(--iw-subtle);
  border: 1px solid var(--iw-border);
}

/* ── Billing subscribe / checkout ── */
.billing-flow-page {
  max-width: 100%;
  width: 100%;
}

.billing-flow-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.billing-flow-main .iw-card {
  margin-bottom: 0;
}

.billing-summary-box {
  background: var(--iw-surface-muted);
  border: 1px solid var(--iw-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.billing-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
}

.billing-summary-row + .billing-summary-row {
  border-top: 1px solid var(--iw-border);
  margin-top: 0.35rem;
  padding-top: 0.65rem;
}

.billing-summary-amount {
  color: var(--iw-accent);
  font-size: 1.15rem;
}

.billing-plan-panel {
  position: sticky;
  top: 1rem;
}

.billing-due-today {
  margin-top: 0.5rem;
}

.billing-subscribe-form .billing-form-actions {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.billing-subscribe-form .btn-iw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .billing-flow-layout {
    grid-template-columns: 1fr;
  }

  .billing-plan-panel {
    position: static;
    order: -1;
  }
}

/* ── Mobile ── */
@media (max-width: 991px) {
  .app-content {
    padding: 1rem;
  }
  .app-sidebar.open {
    box-shadow: var(--shadow-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Disable dark mode overrides */
[data-theme="dark"] body.app-body,
[data-theme="dark"] .app-sidebar,
[data-theme="dark"] .iw-card {
  /* forced light — no dark palette */
}

/* ── Custom Premium Admin Dashboard Elements ── */
.iw-dashboard-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px !important;
  background: var(--iw-surface) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: var(--shadow-xs) !important;
}

.iw-stat-card-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.5rem;
  display: block;
}

.iw-stat-card-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.iw-stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.iw-stat-icon-blue {
  background: #eff6ff;
  color: #2563eb;
}

.iw-stat-icon-yellow {
  background: #fffbeb;
  color: #d97706;
}

.iw-stat-icon-purple {
  background: #f5f3ff;
  color: #7c3aed;
}

.iw-stat-icon-green {
  background: #ecfdf5;
  color: #059669;
}

.iw-stat-card-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.admin-stats-grid .iw-stat-card-value {
  font-size: 1.5rem;
}

.iw-stat-card-featured .iw-stat-card-value {
  font-size: 2.125rem;
}

.iw-stat-card-featured .iw-stat-card-icon {
  width: 52px;
  height: 52px;
  font-size: 1.35rem;
}

.iw-stat-card-featured .iw-stat-card-meta {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

@media (min-width: 1200px) {
  .admin-stats-grid .iw-stat-card-value {
    font-size: 1.65rem;
  }

  .iw-stat-card-featured .iw-stat-card-value {
    font-size: 2.375rem;
  }
}

.iw-stat-icon-text {
  font-weight: 600;
  font-size: 1.15rem;
}

.iw-dot-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
}

.iw-breakdown-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.iw-pill-green {
  background: #f0fdf4;
  color: #16a34a;
}

.iw-pill-orange {
  background: #fff7ed;
  color: #ea580c;
}

/* Leaderboard snapshot styling */
.iw-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.iw-avatar-1 { background: #e0e7ff; color: #4338ca; }
.iw-avatar-2 { background: #f3e8ff; color: #7e22ce; }
.iw-avatar-3 { background: #d1fae5; color: #065f46; }
.iw-avatar-default { background: #f1f5f9; color: #475569; }

.iw-leaderboard-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
}

.iw-leaderboard-amount {
  font-weight: 600;
  color: #16a34a;
  font-size: 0.875rem;
}

/* Recovery and general table updates */
.iw-pill-pink {
  background: #fdf2f8;
  color: #db2777;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #fbcfe8;
  display: inline-block;
}

.iw-view-all-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb !important;
  text-decoration: none;
  background: #eff6ff;
  padding: 6px 14px;
  border-radius: 9999px;
  transition: background var(--transition);
}

.iw-view-all-link:hover {
  background: #dbeafe;
}

/* Centered Donut Label text */
.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-percent {
  font-size: 1.625rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.donut-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Suggestions elements */
.iw-suggestion-row {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.iw-suggestion-row:hover {
  border-color: #cbd5e1;
}

.iw-suggestion-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.875rem;
}

.iw-suggestion-text {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.4;
}

.iw-suggestion-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.iw-badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.iw-badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.iw-badge-orange {
  background: #fff7ed;
  color: #ea580c;
}

.iw-badge-green {
  background: #f0fdf4;
  color: #16a34a;
}

/* Refined sidebar active state */
.nav-item.active {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

.nav-item.active .nav-icon-fa {
  color: #2563eb !important;
}

.sidebar-brand .brand-icon {
  background: #2563eb !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25) !important;
}

/* General Layout updates for Clean Tables and Forms */
.app-topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.iw-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 0.725rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 0.75rem 1rem !important;
}

.iw-table td {
  padding: 0.875rem 1rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: #334155 !important;
}

/* Forms styling */
.form-control,
.form-select {
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.875rem !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-control:focus,
.form-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

