/* Afram page tokens — shell (--pl-*) comes from theme-palette.css */

[data-theme="dark"] {
  --erp-primary: var(--brand-primary, #2f6fed);
  --erp-primary-hover: color-mix(in srgb, var(--brand-primary, #2f6fed) 80%, #000);
  --erp-primary-soft: color-mix(in srgb, var(--brand-primary, #2f6fed) 16%, transparent);
  --erp-secondary: var(--brand-accent, #0d9f7a);
  --erp-accent: #fbbf24;
  --erp-accent-soft: rgba(251, 191, 36, 0.12);
  --erp-success: #34d399;
  --erp-success-soft: rgba(52, 211, 153, 0.12);
  --erp-danger: #f87171;
  --erp-danger-soft: rgba(248, 113, 113, 0.12);
  --erp-bg: #06080d;
  --erp-surface: rgba(14, 18, 26, 0.92);
  --erp-border: rgba(255, 255, 255, 0.07);
  --erp-border-light: rgba(255, 255, 255, 0.04);
  --erp-text: #eef2f8;
  --erp-text-secondary: #cbd5e1;
  --erp-text-muted: #8b95a8;
  --erp-radius-sm: 8px;
  --erp-radius: 12px;
  --erp-radius-lg: 16px;
  --erp-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --erp-font-fa: iransans, Tahoma, sans-serif;
  --erp-font-en: iransans, Tahoma, sans-serif;

  --tblr-primary: var(--brand-primary, #2f6fed);
  --tblr-primary-rgb: 47, 111, 237;
  --tblr-body-bg: #06080d;
  --tblr-bg-surface: rgba(14, 18, 26, 0.92);
  --tblr-card-bg: rgba(14, 18, 26, 0.92);
  --tblr-border-color: rgba(255, 255, 255, 0.07);
  --tblr-body-color: #eef2f8;
  --tblr-secondary: #8b95a8;
  --tblr-font-sans-serif: iransans, Tahoma, sans-serif;

  --afram-accent: var(--brand-primary, #2f6fed);
  --afram-accent-light: var(--brand-accent, #0d9f7a);
  --afram-accent-soft: color-mix(in srgb, var(--brand-primary, #2f6fed) 14%, transparent);
  --afram-bg: #06080d;
  --afram-surface: rgba(14, 18, 26, 0.92);
  --afram-surface-2: #161c26;
  --afram-border: rgba(255, 255, 255, 0.07);
  --afram-text: #eef2f8;
  --afram-text-muted: #8b95a8;
  --afram-radius: 12px;
  --afram-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --afram-gradient-text: linear-gradient(135deg, var(--brand-primary, #2f6fed), var(--brand-accent, #0d9f7a));
  --afram-staff: var(--brand-primary, #2f6fed);
  --afram-portal: var(--brand-accent, #0d9f7a);

  --bs-body-bg: #06080d;
  --bs-body-color: #eef2f8;
  --bs-primary: var(--brand-primary, #2f6fed);
  --bs-primary-rgb: 47, 111, 237;
  --bs-border-color: rgba(255, 255, 255, 0.07);
  --bs-secondary-color: #8b95a8;
}

[data-theme="light"] {
  --erp-primary: var(--brand-primary, #2f6fed);
  --erp-primary-hover: color-mix(in srgb, var(--brand-primary, #2f6fed) 85%, #000);
  --erp-primary-soft: color-mix(in srgb, var(--brand-primary, #2f6fed) 12%, transparent);
  --erp-secondary: var(--brand-accent, #0d9f7a);
  --erp-accent: #d97706;
  --erp-accent-soft: rgba(217, 119, 6, 0.1);
  --erp-success: #059669;
  --erp-success-soft: rgba(5, 150, 105, 0.1);
  --erp-danger: #dc2626;
  --erp-danger-soft: rgba(220, 38, 38, 0.1);
  --erp-bg: #f3f5f8;
  --erp-surface: #ffffff;
  --erp-border: rgba(15, 23, 42, 0.1);
  --erp-border-light: rgba(15, 23, 42, 0.06);
  --erp-text: #0f172a;
  --erp-text-secondary: #334155;
  --erp-text-muted: #64748b;
  --erp-radius-sm: 8px;
  --erp-radius: 12px;
  --erp-radius-lg: 16px;
  --erp-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --erp-font-fa: iransans, Tahoma, sans-serif;
  --erp-font-en: iransans, Tahoma, sans-serif;

  --tblr-primary: var(--brand-primary, #2f6fed);
  --tblr-primary-rgb: 47, 111, 237;
  --tblr-body-bg: #f3f5f8;
  --tblr-bg-surface: #ffffff;
  --tblr-card-bg: #ffffff;
  --tblr-border-color: rgba(15, 23, 42, 0.1);
  --tblr-body-color: #0f172a;
  --tblr-secondary: #64748b;
  --tblr-font-sans-serif: iransans, Tahoma, sans-serif;

  --afram-accent: var(--brand-primary, #2f6fed);
  --afram-accent-light: var(--brand-accent, #0d9f7a);
  --afram-accent-soft: color-mix(in srgb, var(--brand-primary, #2f6fed) 12%, transparent);
  --afram-bg: #f3f5f8;
  --afram-surface: #ffffff;
  --afram-surface-2: #f8fafc;
  --afram-border: rgba(15, 23, 42, 0.1);
  --afram-text: #0f172a;
  --afram-text-muted: #64748b;
  --afram-radius: 12px;
  --afram-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --afram-gradient-text: linear-gradient(135deg, var(--brand-primary, #2f6fed), var(--brand-accent, #0d9f7a));
  --afram-staff: var(--brand-primary, #2f6fed);
  --afram-portal: var(--brand-accent, #0d9f7a);

  --bs-body-bg: #f3f5f8;
  --bs-body-color: #0f172a;
  --bs-primary: var(--brand-primary, #2f6fed);
  --bs-primary-rgb: 47, 111, 237;
  --bs-border-color: rgba(15, 23, 42, 0.1);
  --bs-secondary-color: #64748b;
}

body.pl-body {
  background: var(--pl-bg, #06080d) !important;
  color: var(--pl-text, #eef2f8) !important;
  font-family: iransans, Tahoma, sans-serif !important;
}

/* Tabler-lite utilities */
.bg-blue-lt, .bg-azure-lt { background: color-mix(in srgb, var(--brand-primary, #2f6fed) 15%, transparent) !important; color: var(--brand-primary, #2f6fed) !important; }
.bg-green-lt, .bg-teal-lt { background: rgba(52, 211, 153, 0.15) !important; color: #34d399 !important; }
.bg-yellow-lt, .bg-orange-lt { background: rgba(251, 191, 36, 0.15) !important; color: #fbbf24 !important; }
.bg-red-lt, .bg-pink-lt { background: rgba(248, 113, 113, 0.15) !important; color: #f87171 !important; }
.bg-purple-lt, .bg-indigo-lt { background: color-mix(in srgb, var(--brand-primary, #2f6fed) 15%, transparent) !important; color: var(--brand-primary, #2f6fed) !important; }
.bg-cyan-lt { background: rgba(34, 211, 238, 0.15) !important; color: #22d3ee !important; }
.bg-gray-lt, .bg-secondary-lt { background: rgba(148, 163, 184, 0.12) !important; color: #94a3b8 !important; }

.text-blue, .text-azure { color: var(--brand-primary, #2f6fed) !important; }
.text-green, .text-teal { color: #34d399 !important; }
.text-yellow, .text-orange { color: #fbbf24 !important; }
.text-red, .text-pink { color: #f87171 !important; }
.text-purple, .text-indigo { color: var(--brand-primary, #2f6fed) !important; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary, #2f6fed) 15%, transparent);
  color: var(--brand-primary, #2f6fed);
  font-weight: 700;
  font-size: 0.85rem;
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.7rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }
.avatar-xl { width: 4rem; height: 4rem; font-size: 1.25rem; }

.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: none;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--erp-border);
}
.card-footer {
  background: transparent;
  border-top: 1px solid var(--erp-border);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--erp-text);
  --bs-table-border-color: var(--erp-border);
  color: var(--erp-text);
}
