/**
 * ERP theme color tokens
 * Colors only: palette + semantic tokens
 */

:root {
    /* Base palette */
    --white: #ffffff;
    --white-rgb: 255, 255, 255;
    --black: #000000;
    --black-rgb: 0, 0, 0;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-450: #7f8c8d;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --gray-300-rgb: 203, 213, 225;
    --gray-200-rgb: 226, 232, 240;
    --gray-400-rgb: 148, 163, 184;
    --gray-500-rgb: 100, 116, 139;
    --gray-900-rgb: 15, 23, 42;

    --blue-900: #1e3a8a;
    --blue-800: #1e40af;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-700-rgb: 29, 78, 216;
    --blue-600-rgb: 37, 99, 235;
    --blue-500-rgb: 59, 130, 246;

    --indigo-700: #4338ca;
    --indigo-600: #4f46e5;

    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-700: #047857;
    --emerald-600-rgb: 5, 150, 105;
    --emerald-700-rgb: 4, 120, 87;

    --red-700: #c0392b;
    --red-600: #dc2626;
    --red-500: #ef4444;
    --red-600-rgb: 220, 38, 38;
    --red-700-rgb: 192, 57, 43;

    --purple-500: #9b59b6;
    --purple-600: #8e44ad;
    --purple-500-rgb: 155, 89, 182;

    --amber-600: #d97706;
    --amber-500: #f59e0b;
    --amber-700: #b45309;
    --amber-600-rgb: 217, 119, 6;
    --amber-700-rgb: 180, 83, 9;

    --yellow-100: #fefce8;
    --yellow-200: #fef08a;
    --yellow-700: #ca8a04;
    --yellow-800: #854d0e;

    --teal-600: #16a085;
    --teal-700: #0f766e;
    --teal-600-rgb: 22, 160, 133;
    --teal-700-rgb: 15, 118, 110;

    /* Standards: Tailwind CSS neutral/blue scales + Material Design tone guidance, WCAG 2.1 AA contrast targets */
    /* Semantic colors */
    --color-bg-primary: #f5f7fb;
    --color-bg-secondary: var(--white);
    --color-bg-tertiary: var(--gray-50);
    --color-bg-muted: var(--gray-100);
    --color-bg-inset: #eef2f7;
    --color-text-primary: var(--gray-900);
    --color-text-secondary: var(--gray-600);
    --color-text-muted: var(--gray-500);
    --color-text-inverse: var(--white);
    --color-border: var(--gray-200);
    --color-border-strong: var(--gray-300);
    --color-surface: var(--color-bg-secondary);
    --color-surface-2: var(--color-bg-tertiary);
    --color-accent: var(--blue-600);
    --color-accent-rgb: var(--blue-600-rgb);
    --color-accent-hover: var(--blue-700);
    --color-accent-hover-rgb: var(--blue-700-rgb);
    --color-accent-soft: rgba(var(--color-accent-rgb), 0.12);
    --color-header-bg: linear-gradient(90deg, var(--gray-900), var(--gray-800));
    --color-header-text: var(--white);
    --color-header-text-rgb: var(--white-rgb);
    --color-sidebar-bg: linear-gradient(180deg, var(--gray-900), var(--gray-800));
    --color-sidebar-text: var(--white);
    --color-sidebar-text-muted: rgba(var(--white-rgb), 0.7);
    --color-sidebar-text-rgb: var(--white-rgb);
    --color-sidebar-hover: rgba(var(--white-rgb), 0.08);
    --color-sidebar-active: rgba(var(--white-rgb), 0.14);
    --color-sidebar-border: rgba(var(--white-rgb), 0.12);

    /* Core brand colors */
    --primary-color: var(--color-accent);
    --primary-color-rgb: var(--color-accent-rgb);
    --secondary-color: var(--blue-700);
    --secondary-color-rgb: var(--blue-700-rgb);
    --accent-color: var(--color-accent);
    --accent-color-rgb: var(--color-accent-rgb);
    --hover-color: var(--color-accent-hover);
    --hover-color-rgb: var(--color-accent-hover-rgb);

    /* Theme override defaults */
    --theme-accent: var(--color-accent);
    --theme-accent-rgb: var(--color-accent-rgb);
    --theme-accent-hover: var(--color-accent-hover);
    --theme-accent-hover-rgb: var(--color-accent-hover-rgb);

    /* Status colors */
    --success-color: #10b981;
    --success-color-rgb: 16, 185, 129;
    --warning-color: #f59e0b;
    --warning-color-rgb: 245, 158, 11;
    --danger-color: #ef4444;
    --danger-color-rgb: 239, 68, 68;
    --info-color: #0ea5e9;
    --info-color-rgb: 14, 165, 233;

    --light-color: var(--color-bg-secondary);
    --dark-color: var(--color-text-primary);
    --dark-color-rgb: 15, 23, 42;

    /* Surfaces */
    --body-bg: var(--color-bg-primary);
    --content-bg: var(--color-bg-secondary);
    --header-bg: var(--color-header-bg);

    /* Text */
    --text-color: var(--color-header-text);
    --text-color-rgb: var(--color-header-text-rgb);
    --text-default: var(--color-text-primary);
    --text-muted: var(--color-text-muted);
    --text-subtle: var(--color-text-secondary);
    --text-inverse: var(--color-text-inverse);

    /* Borders */
    --border-color: var(--color-border);
    --border-color-rgb: var(--gray-200-rgb);
    --border-subtle: var(--color-border);
    --border-strong: var(--color-border-strong);

    /* Inputs */
    --color-input-bg: var(--color-surface);
    --color-input-text: var(--color-text-primary);
    --color-input-placeholder: var(--color-text-muted);
    --color-input-border: var(--color-border);
    --color-input-border-hover: var(--color-border-strong);
    --color-input-border-focus: var(--color-accent);
    --color-input-disabled-bg: var(--color-bg-muted);
    --color-input-disabled-text: var(--color-text-muted);
    --color-input-disabled-border: var(--color-border);
    --color-input-error-bg: rgba(var(--danger-color-rgb), 0.08);
    --color-input-error-text: var(--danger-color);
    --color-input-error-border: var(--danger-color);
    --color-focus-ring: rgba(var(--color-accent-rgb), 0.35);

    /* DataTables */
    --datatable-header-bg: var(--color-bg-tertiary);
    --datatable-header-text: var(--color-text-primary);
    --datatable-border: var(--color-border);
    --datatable-row-hover: rgba(var(--color-accent-rgb), 0.08);
    --datatable-row-striped: var(--color-bg-muted);
    --datatable-pagination-bg: var(--color-bg-secondary);
    --datatable-pagination-hover-bg: var(--color-bg-muted);
    --datatable-pagination-active-bg: var(--color-accent);
    --datatable-pagination-active-text: var(--color-text-inverse);
    --datatable-search-bg: var(--color-bg-secondary);
    --datatable-search-border: var(--color-border);

    /* Chart palette */
    --chart-color-1: var(--color-accent);
    --chart-color-2: var(--success-color);
    --chart-color-3: var(--warning-color);
    --chart-color-4: var(--purple-500);
    --chart-color-5: var(--danger-color);
    --chart-color-6: var(--info-color);
    --chart-color-muted: var(--color-text-muted);

    /* Dental chart colors */
    --dental-chart-caries-color: var(--danger-color);
    --dental-chart-filling-color: var(--success-color);
    --dental-chart-crown-color: var(--info-color);
    --dental-chart-missing-color: var(--color-text-muted);
    --dental-chart-implant-color: var(--color-accent);
    --dental-chart-root-color: var(--warning-color);
    --dental-chart-fracture-color: var(--warning-color);
    --dental-chart-periodontitis-color: var(--purple-500);
    --dental-chart-select-color: var(--color-accent);
    --dental-chart-stroke-color: var(--color-text-inverse);
    --dental-chart-hover-color: var(--color-accent-soft);

    /* Links */
    --link-color: var(--accent-color);

    /* Shadows (colors only) */
    --shadow-color-sm: rgba(var(--black-rgb), 0.05);
    --shadow-color-md: rgba(var(--black-rgb), 0.1);
    --shadow-color-lg: rgba(var(--black-rgb), 0.1);
    --shadow-color-xl: rgba(var(--black-rgb), 0.1);
    --shadow-color-card: rgba(var(--gray-900-rgb), 0.08);
    --shadow-color-card-strong: rgba(var(--gray-900-rgb), 0.12);
    --shadow-color-navbar: rgba(var(--black-rgb), 0.1);
    --shadow-color-toast: rgba(var(--gray-900-rgb), 0.15);
    --color-overlay-bg: rgba(var(--white-rgb), 0.7);

    /* Theme gradients */
    --theme-blue-dark-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --theme-blue-dark-color: #ffffff;
    --theme-blue-dark-border: rgba(255, 255, 255, 0.1);

    --theme-dark-gray-bg: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    --theme-dark-gray-color: #ffffff;
    --theme-dark-gray-border: rgba(255, 255, 255, 0.1);

    --theme-medical-green-bg: linear-gradient(135deg, #065f46 0%, #059669 100%);
    --theme-medical-green-color: #ffffff;
    --theme-medical-green-border: rgba(255, 255, 255, 0.1);

    --theme-navy-blue-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --theme-navy-blue-color: #ffffff;
    --theme-navy-blue-border: rgba(255, 255, 255, 0.08);

    --theme-purple-bg: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
    --theme-purple-color: #ffffff;
    --theme-purple-border: rgba(255, 255, 255, 0.1);

    /* Extended accents */
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --primary-dark-rgb: 29, 78, 216;

    /* Report palette */
    --report-primary-600: var(--indigo-600);
    --report-primary-700: var(--indigo-700);
    --report-accent-600: var(--info-color);
    --report-success-600: var(--emerald-600);
    --report-danger-600: var(--red-600);
    --report-gray-900: var(--gray-900);
    --report-gray-800: var(--gray-800);
    --report-gray-700: var(--gray-700);
    --report-gray-600: var(--gray-600);
    --report-gray-500: var(--gray-500);
    --report-gray-400: var(--gray-400);
    --report-gray-300: var(--gray-300);
    --report-gray-200: var(--gray-200);
    --report-gray-100: var(--gray-100);
    --report-primary-rgb: 79, 70, 229;
    --report-success-rgb: 5, 150, 105;
    --report-danger-rgb: 220, 38, 38;
    --report-gray-700-rgb: 51, 65, 85;
    --report-range-bg: #eef2f7;

    --report-primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
    --report-secondary-gradient: linear-gradient(135deg, #64748b 0%, #334155 100%);
    --report-success-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --report-page-bg: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    --report-card-bg: rgba(var(--white-rgb), 0.98);

    /* Login palette */
    --login-overlay-strong: rgba(var(--primary-color-rgb), 0.65);
    --login-overlay-mid: rgba(var(--secondary-color-rgb), 0.9);
    --login-overlay-soft: rgba(var(--primary-color-rgb), 0.4);
    --login-overlay-accent: rgba(var(--hover-color-rgb), 0.3);
    --login-card-bg: rgba(var(--white-rgb), 0.98);
    --login-card-shadow: rgba(var(--black-rgb), 0.2);
    --login-input-border: #e0e0e0;
    --login-input-border-hover: #b0b0b0;
    --login-input-text: #333333;
    --login-divider: #e0e0e0;
    --login-link-muted: #555555;
    --login-error-bg-rgb: 231, 76, 60;
    --login-error-color: #c0392b;
    --login-success-bg-rgb: 46, 204, 113;
    --login-success-color: #27ae60;
    --login-google-gradient: conic-gradient(from -45deg, #ea4335 110deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg);

    /* Settings palette */
    --settings-page-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --settings-card-shadow: rgba(15, 23, 42, 0.08);
    --settings-stepper-shadow: rgba(59, 130, 246, 0.3);
    --settings-card-border: rgba(226, 232, 240, 0.9);
    --settings-warning-bg: #fefce8;
    --settings-warning-border: #fef08a;
    --settings-warning-icon: #ca8a04;
    --settings-warning-text: #854d0e;
    --settings-dark-page-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

    /* Toast gradients */
    --toast-success-gradient: linear-gradient(135deg, #1cc88a, #17a673);
    --toast-info-gradient: linear-gradient(135deg, #36b9cc, #2c9faf);
    --toast-warning-gradient: linear-gradient(135deg, #f6c23e, #dda20a);
    --toast-danger-gradient: linear-gradient(135deg, #e74a3b, #c0392b);

    --notification-badge-color: #e74c3c;
    --info-700: #0284c7;

    --pharmacy-hero-start: #1b4965;
    --pharmacy-hero-end: #5fa8d3;
    --pharmacy-hero-shadow: rgba(27, 73, 101, 0.2);
    --pharmacy-text-strong: #1b4965;
    --pharmacy-card-header-bg: #f8fbff;
    --pharmacy-pill-bg: rgba(0, 64, 128, 0.85);
    --pharmacy-badge-success: #1e8449;
    --pharmacy-badge-success-rgb: 46, 204, 113;
    --pharmacy-badge-warning: #b9770e;
    --pharmacy-badge-warning-rgb: 243, 156, 18;
    --pharmacy-badge-info: #2471a3;
    --pharmacy-badge-info-rgb: 52, 152, 219;
    /* Auto-generated tokens for legacy colors */
    --color-hex-0077cc: #0077cc;
    --color-hex-ffffff: #ffffff;
    --color-hex-1b6ec2: #1b6ec2;
    --color-hex-1861ac: #1861ac;
    --color-hex-e5e5e5: #e5e5e5;
    --color-hex-3b82f6: #3b82f6;
    --color-hex-8b5cf6: #8b5cf6;
    --color-hex-10b981: #10b981;
    --color-hex-f59e0b: #f59e0b;
    --color-hex-64748b: #64748b;
    --color-hex-0ea5e9: #0ea5e9;
    --color-hex-1e3a8a: #1e3a8a;
    --color-hex-2563eb: #2563eb;
    --color-hex-0284c7: #0284c7;
    --color-hex-475569: #475569;
    --color-hex-7c3aed: #7c3aed;
    --color-hex-0d9488: #0d9488;
    --color-hex-d97706: #d97706;
    --color-hex-dc3545: #dc3545;
    --color-hex-1e293b: #1e293b;
    --color-hex-334155: #334155;
    --color-hex-e2e8f0: #e2e8f0;
    --color-hex-6c757d: #6c757d;
    --color-hex-f7f8fb: #f7f8fb;
    --color-hex-f8f9fa: #f8f9fa;
    --color-hex-e9ecef: #e9ecef;
    --color-hex-cfe2ff: #cfe2ff;
    --color-hex-0d6efd: #0d6efd;
    --color-hex-ffe5d0: #ffe5d0;
    --color-hex-fd7e14: #fd7e14;
    --color-hex-fff3cd: #fff3cd;
    --color-hex-b58105: #b58105;
    --color-hex-d1e7dd: #d1e7dd;
    --color-hex-146c43: #146c43;
    --color-hex-d0ebff: #d0ebff;
    --color-hex-1c7ed6: #1c7ed6;
    --color-hex-198754: #198754;
    --color-hex-f8d7da: #f8d7da;
    --color-hex-842029: #842029;
    --color-hex-495057: #495057;
    --color-hex-ffe3e3: #ffe3e3;
    --color-hex-c92a2a: #c92a2a;
    --color-hex-ffd8a8: #ffd8a8;
    --color-hex-d9480f: #d9480f;
    --color-hex-dee2e6: #dee2e6;
    --color-hex-e7f1ff: #e7f1ff;
    --color-hex-cff4fc: #cff4fc;
    --color-hex-e2e3e5: #e2e3e5;
    --color-hex-0dcaf0: #0dcaf0;
    --color-hex-ffc107: #ffc107;
    --color-hex-6f42c1: #6f42c1;
    --color-hex-ced4da: #ced4da;
    --color-hex-1a365d: #1a365d;
    --color-hex-2d3748: #2d3748;
    --color-hex-ed8936: #ed8936;
    --color-hex-feebc8: #feebc8;
    --color-hex-f7fafc: #f7fafc;
    --color-hex-38a169: #38a169;
    --color-hex-dd6b20: #dd6b20;
    --color-hex-e53e3e: #e53e3e;
    --color-hex-4a5568: #4a5568;
    --color-hex-f1f5f9: #f1f5f9;
    --color-hex-f5f7fa: #f5f7fa;
    --color-hex-2c5282: #2c5282;
    --color-hex-cccccc: #cccccc;
    --color-hex-3182ce: #3182ce;
    --color-hex-c6f6d5: #c6f6d5;
    --color-hex-fed7d7: #fed7d7;
    --color-hex-bee3f8: #bee3f8;
    --color-hex-f9fafc: #f9fafc;
    --color-hex-0f172a: #0f172a;
    --color-hex-f8fafc: #f8fafc;
    --color-hex-1f2937: #1f2937;
    --color-hex-0f766e: #0f766e;
    --color-hex-14b8a6: #14b8a6;
    --color-hex-be123c: #be123c;
    --color-hex-b45309: #b45309;
    --color-hex-15803d: #15803d;
    --color-hex-374151: #374151;
    --color-hex-4b5563: #4b5563;
    --color-hex-94a3b8: #94a3b8;
    --color-hex-e6e6e6: #e6e6e6;
    --color-hex-212529: #212529;
    --color-hex-0f5132: #0f5132;
    --color-hex-1d4ed8: #1d4ed8;
    --color-hex-e0f2fe: #e0f2fe;
    --color-hex-0369a1: #0369a1;
    --color-hex-1b3a57: #1b3a57;
    --color-hex-295a83: #295a83;
    --color-hex-4fd1c5: #4fd1c5;
    --color-hex-f5f7fb: #f5f7fb;
    --color-hex-1f2a3a: #1f2a3a;
    --color-hex-6b7a90: #6b7a90;
    --color-hex-946200: #946200;
    --color-hex-1e7e34: #1e7e34;
    --color-hex-1c5d8b: #1c5d8b;
    --color-hex-b02a37: #b02a37;
    --color-hex-1c3d5a: #1c3d5a;
    --color-hex-2e5b87: #2e5b87;
    --color-hex-7c4dff: #7c4dff;
    --color-hex-f4f6fb: #f4f6fb;
    --color-hex-e3e9f2: #e3e9f2;
    --color-hex-4c2bb1: #4c2bb1;
    --color-hex-3d1f93: #3d1f93;
    --color-hex-cbd5e1: #cbd5e1;
    --color-hex-1e40af: #1e40af;
    --color-hex-f0f9ff: #f0f9ff;
    --color-hex-f0fff4: #f0fff4;
    --color-hex-dcfce7: #dcfce7;
    --color-hex-16a34a: #16a34a;
    --color-hex-f97316: #f97316;
    --color-hex-ef4444: #ef4444;
    --color-hex-14532d: #14532d;
    --color-hex-4c1d95: #4c1d95;
    --color-hex-134e4a: #134e4a;
    --color-hex-9a3412: #9a3412;
    --color-hex-7f1d1d: #7f1d1d;
    --color-hex-0c4a6e: #0c4a6e;
    --color-hex-dbeafe: #dbeafe;
    --color-hex-bfdbfe: #bfdbfe;
    --color-hex-bae6fd: #bae6fd;
    --color-hex-7dd3fc: #7dd3fc;
    --color-hex-f0fdf4: #f0fdf4;
    --color-hex-fef2f2: #fef2f2;
    --color-hex-fee2e2: #fee2e2;
    --color-hex-059669: #059669;
    --color-hex-dddddd: #dddddd;
    --color-hex-000000: #000000;
    --color-hex-166534: #166534;
    --color-hex-edf2f7: #edf2f7;
    --color-hex-047857: #047857;
    --color-hex-fff7ed: #fff7ed;
    --color-hex-fed7aa: #fed7aa;
    --color-hex-333333: #333333;
    --color-hex-555555: #555555;
    --color-hex-666666: #666666;
    --color-hex-f8f8f8: #f8f8f8;
    --color-hex-f0f0f0: #f0f0f0;
    --color-hex-e8e8e8: #e8e8e8;
    --color-hex-006400: #006400;
    --color-hex-8b0000: #8b0000;
    --color-hex-999999: #999999;
    --color-hex-fafafa: #fafafa;
    --color-hex-e0e0e0: #e0e0e0;
    --color-hex-667eea: #667eea;
    --color-hex-764ba2: #764ba2;
    --color-hex-4ade80: #4ade80;
    --color-hex-22c55e: #22c55e;
    --color-hex-6366f1: #6366f1;
    --color-hex-eef2ff: #eef2ff;
    --color-hex-4f46e5: #4f46e5;
    --color-hex-d1fae5: #d1fae5;
    --color-hex-065f46: #065f46;
    --color-hex-a7f3d0: #a7f3d0;
    --color-hex-fecaca: #fecaca;
    --color-hex-cbd5f5: #cbd5f5;
    --color-hex-1a237e: #1a237e;
    --color-hex-283593: #283593;
    --color-hex-3949ab: #3949ab;
    --color-hex-fffbeb: #fffbeb;
    --color-hex-fef3c7: #fef3c7;
    --color-hex-2c3e50: #2c3e50;
    --color-hex-34495e: #34495e;
    --color-hex-eeeeee: #eeeeee;
    --color-hex-3498db: #3498db;
    --color-hex-1abc9c: #1abc9c;
    --color-hex-2980b9: #2980b9;
    --color-hex-e3f2fd: #e3f2fd;
    --color-hex-1976d2: #1976d2;
    --color-hex-fce4ec: #fce4ec;
    --color-hex-c2185b: #c2185b;
    --color-hex-f3e5f5: #f3e5f5;
    --color-hex-7b1fa2: #7b1fa2;
    --color-hex-34d399: #34d399;
    --color-hex-fde68a: #fde68a;
    --color-hex-92400e: #92400e;
    --color-hex-1e3c72: #1e3c72;
    --color-hex-2a5298: #2a5298;
    --color-hex-1a1a1a: #1a1a1a;
    --color-hex-0d47a1: #0d47a1;
    --color-hex-bbdefb: #bbdefb;
    --color-hex-e8f5e9: #e8f5e9;
    --color-hex-c8e6c9: #c8e6c9;
    --color-hex-388e3c: #388e3c;
    --color-hex-fff3e0: #fff3e0;
    --color-hex-ffe0b2: #ffe0b2;
    --color-hex-f57c00: #f57c00;
    --color-hex-616161: #616161;
    --color-hex-9e9e9e: #9e9e9e;
    --color-hex-dc2626: #dc2626;
    --color-hex-d1d5db: #d1d5db;
    --color-hex-1565c0: #1565c0;
    --color-hex-0b3d91: #0b3d91;
    --color-hex-06b6d4: #06b6d4;
    --color-hex-fbbf24: #fbbf24;
    --color-hex-991b1b: #991b1b;
    --color-hex-075985: #075985;
    --color-hex-60a5fa: #60a5fa;
    --color-hex-6d28d9: #6d28d9;
    --color-hex-0891b2: #0891b2;
    --color-hex-0e7490: #0e7490;
    --color-hex-eef1f6: #eef1f6;
    --color-hex-eef2f7: #eef2f7;
    --color-hex-e5e7eb: #e5e7eb;
    --color-hex-6b7280: #6b7280;
    --color-hex-f9fafb: #f9fafb;
    --color-hex-e74c3c: #e74c3c;
    --color-hex-c0392b: #c0392b;
    --color-hex-f39c12: #f39c12;
    --color-hex-d35400: #d35400;
    --color-hex-2ecc71: #2ecc71;
    --color-hex-27ae60: #27ae60;
    --color-hex-f4f6fa: #f4f6fa;
    --color-hex-9ca3af: #9ca3af;
    --color-hex-f3f4f6: #f3f4f6;
    --color-hex-e7e7e7: #e7e7e7;
    --color-hex-ec4899: #ec4899;
    --color-hex-aaaaaa: #aaaaaa;
    --color-hex-444444: #444444;
    --color-hex-888888: #888888;
    --color-hex-e4e4e4: #e4e4e4;
    --color-hex-f1f1f1: #f1f1f1;
    --color-hex-5897fb: #5897fb;
    --color-hex-f7f7f7: #f7f7f7;
    --color-hex-ffffffff: #ffffffff;
    --color-hex-ffeeeeee: #ffeeeeee;
    --color-hex-ffcccccc: #ffcccccc;
    --color-hex-3875d7: #3875d7;
    --color-hex-6610f2: #6610f2;
    --color-hex-d63384: #d63384;
    --color-hex-20c997: #20c997;
    --color-hex-343a40: #343a40;
    --color-hex-adb5bd: #adb5bd;
    --color-hex-052c65: #052c65;
    --color-hex-2b2f32: #2b2f32;
    --color-hex-0a3622: #0a3622;
    --color-hex-055160: #055160;
    --color-hex-664d03: #664d03;
    --color-hex-58151c: #58151c;
    --color-hex-fcfcfd: #fcfcfd;
    --color-hex-9ec5fe: #9ec5fe;
    --color-hex-c4c8cb: #c4c8cb;
    --color-hex-a3cfbb: #a3cfbb;
    --color-hex-9eeaf9: #9eeaf9;
    --color-hex-ffe69c: #ffe69c;
    --color-hex-f1aeb5: #f1aeb5;
    --color-hex-0a58ca: #0a58ca;
    --color-hex-2b3035: #2b3035;
    --color-hex-6ea8fe: #6ea8fe;
    --color-hex-a7acb1: #a7acb1;
    --color-hex-75b798: #75b798;
    --color-hex-6edff6: #6edff6;
    --color-hex-ffda6a: #ffda6a;
    --color-hex-ea868f: #ea868f;
    --color-hex-031633: #031633;
    --color-hex-161719: #161719;
    --color-hex-051b11: #051b11;
    --color-hex-032830: #032830;
    --color-hex-332701: #332701;
    --color-hex-2c0b0e: #2c0b0e;
    --color-hex-1a1d20: #1a1d20;
    --color-hex-084298: #084298;
    --color-hex-41464b: #41464b;
    --color-hex-087990: #087990;
    --color-hex-997404: #997404;
    --color-hex-8bb9fe: #8bb9fe;
    --color-hex-e685b5: #e685b5;
    --color-hex-a6b5cc: #a6b5cc;
    --color-hex-c5d7f2: #c5d7f2;
    --color-hex-bacbe6: #bacbe6;
    --color-hex-bfd1ec: #bfd1ec;
    --color-hex-b5b6b7: #b5b6b7;
    --color-hex-d7d8da: #d7d8da;
    --color-hex-cbccce: #cbccce;
    --color-hex-d1d2d4: #d1d2d4;
    --color-hex-a7b9b1: #a7b9b1;
    --color-hex-c7dbd2: #c7dbd2;
    --color-hex-bcd0c7: #bcd0c7;
    --color-hex-c1d6cc: #c1d6cc;
    --color-hex-a6c3ca: #a6c3ca;
    --color-hex-c5e8ef: #c5e8ef;
    --color-hex-badce3: #badce3;
    --color-hex-bfe2e9: #bfe2e9;
    --color-hex-ccc2a4: #ccc2a4;
    --color-hex-f2e7c3: #f2e7c3;
    --color-hex-e6dbb9: #e6dbb9;
    --color-hex-ece1be: #ece1be;
    --color-hex-c6acae: #c6acae;
    --color-hex-eccccf: #eccccf;
    --color-hex-dfc2c4: #dfc2c4;
    --color-hex-e5c7ca: #e5c7ca;
    --color-hex-c6c7c8: #c6c7c8;
    --color-hex-ecedee: #ecedee;
    --color-hex-dfe0e1: #dfe0e1;
    --color-hex-e5e6e7: #e5e6e7;
    --color-hex-4d5154: #4d5154;
    --color-hex-2c3034: #2c3034;
    --color-hex-373b3e: #373b3e;
    --color-hex-323539: #323539;
    --color-hex-86b7fe: #86b7fe;
    --color-hex-b6d4fe: #b6d4fe;
    --color-hex-0b5ed7: #0b5ed7;
    --color-hex-0a53be: #0a53be;
    --color-hex-5c636a: #5c636a;
    --color-hex-565e64: #565e64;
    --color-hex-51585e: #51585e;
    --color-hex-157347: #157347;
    --color-hex-13653f: #13653f;
    --color-hex-31d2f2: #31d2f2;
    --color-hex-25cff2: #25cff2;
    --color-hex-3dd5f3: #3dd5f3;
    --color-hex-ffca2c: #ffca2c;
    --color-hex-ffc720: #ffc720;
    --color-hex-ffcd39: #ffcd39;
    --color-hex-bb2d3b: #bb2d3b;
    --color-hex-a52834: #a52834;
    --color-hex-d3d4d5: #d3d4d5;
    --color-hex-babbbc: #babbbc;
    --color-hex-424649: #424649;
    --color-hex-569ff7: #569ff7;
    --color-hex-f44336: #f44336;
    --color-hex-efefef: #efefef;
    --color-hex-f5f5f7: #f5f5f7;
    --color-rgb-0-0-0: 0, 0, 0;
    --color-rgb-255-255-255: 255, 255, 255;
    --color-rgb-255-193-7: 255, 193, 7;
    --color-rgb-255-99-0: 255, 99, 0;
    --color-rgb-237-137-54: 237, 137, 54;
    --color-rgb-59-130-246: 59, 130, 246;
    --color-rgb-15-23-42: 15, 23, 42;
    --color-rgb-16-185-129: 16, 185, 129;
    --color-rgb-20-184-166: 20, 184, 166;
    --color-rgb-244-63-94: 244, 63, 94;
    --color-rgb-245-158-11: 245, 158, 11;
    --color-rgb-34-197-94: 34, 197, 94;
    --color-rgb-100-116-139: 100, 116, 139;
    --color-rgb-25-135-84: 25, 135, 84;
    --color-rgb-37-99-235: 37, 99, 235;
    --color-rgb-251-191-36: 251, 191, 36;
    --color-rgb-79-209-197: 79, 209, 197;
    --color-rgb-27-58-87: 27, 58, 87;
    --color-rgb-31-42-58: 31, 42, 58;
    --color-rgb-255-206-86: 255, 206, 86;
    --color-rgb-46-204-113: 46, 204, 113;
    --color-rgb-52-152-219: 52, 152, 219;
    --color-rgb-231-76-60: 231, 76, 60;
    --color-rgb-124-77-255: 124, 77, 255;
    --color-rgb-23-42-70: 23, 42, 70;
    --color-rgb-41-128-185: 41, 128, 185;
    --color-rgb-226-232-240: 226, 232, 240;
    --color-rgb-148-163-184: 148, 163, 184;
    --color-rgb-22-163-74: 22, 163, 74;
    --color-rgb-124-58-237: 124, 58, 237;
    --color-rgb-15-118-110: 15, 118, 110;
    --color-rgb-249-115-22: 249, 115, 22;
    --color-rgb-239-68-68: 239, 68, 68;
    --color-rgb-99-102-241: 99, 102, 241;
    --color-rgb-26-35-126: 26, 35, 126;
    --color-rgb-5-150-105: 5, 150, 105;
    --color-rgb-14-165-233: 14, 165, 233;
    --color-rgb-13-110-253: 13, 110, 253;
    --color-rgb-220-53-69: 220, 53, 69;
    --color-rgb-108-117-125: 108, 117, 125;
    --color-rgb-13-202-240: 13, 202, 240;
    --color-rgb-13-71-161: 13, 71, 161;
    --color-rgb-25-118-210: 25, 118, 210;
    --color-rgb-56-142-60: 56, 142, 60;
    --color-rgb-245-124-0: 245, 124, 0;
    --color-rgb-6-182-212: 6, 182, 212;
    --color-rgb-220-38-38: 220, 38, 38;
    --color-rgb-30-58-138: 30, 58, 138;
    --color-rgb-76-29-149: 76, 29, 149;
    --color-rgb-139-92-246: 139, 92, 246;
    --color-rgb-6-95-70: 6, 95, 70;
    --color-rgb-13-148-136: 13, 148, 136;
    --color-rgb-55-65-81: 55, 65, 81;
    --color-rgb-127-29-29: 127, 29, 29;
    --color-rgb-248-250-252: 248, 250, 252;
    --color-rgb-33-37-41: 33, 37, 41;
    --color-rgb-222-226-230: 222, 226, 230;
    --color-rgb-64-67-70: 64, 67, 70;
    --color-rgb-40-40-40: 40, 40, 40;
    --color-rgb-9-10-11: 9, 10, 11;

}

[data-theme="light"] {
    --color-bg-primary: #f5f7fb;
    --color-bg-secondary: var(--white);
    --color-bg-tertiary: var(--gray-50);
    --color-bg-muted: var(--gray-100);
    --color-bg-inset: #eef2f7;
    --color-text-primary: var(--gray-900);
    --color-text-secondary: var(--gray-600);
    --color-text-muted: var(--gray-500);
    --color-border: var(--gray-200);
    --color-border-strong: var(--gray-300);
    --color-accent: var(--blue-600);
    --color-accent-rgb: var(--blue-600-rgb);
    --color-accent-hover: var(--blue-700);
    --color-accent-hover-rgb: var(--blue-700-rgb);
    --color-accent-soft: rgba(var(--color-accent-rgb), 0.12);
    --color-header-bg: linear-gradient(90deg, #ffffff, #f8fafc);
    --color-header-text: var(--gray-900);
    --color-header-text-rgb: var(--gray-900-rgb);
    --color-sidebar-bg: linear-gradient(180deg, #ffffff, #f8fafc);
    --color-sidebar-text: var(--gray-800);
    --color-sidebar-text-muted: rgba(var(--gray-700-rgb), 0.75);
    --color-sidebar-text-rgb: var(--gray-800-rgb);
    --color-sidebar-hover: rgba(var(--blue-600-rgb), 0.08);
    --color-sidebar-active: rgba(var(--blue-600-rgb), 0.16);
    --color-sidebar-border: rgba(var(--gray-300-rgb), 0.85);
    --color-sidebar-layer-1: rgba(var(--blue-600-rgb), 0.06);
    --color-sidebar-layer-2: rgba(var(--blue-600-rgb), 0.1);
    --color-sidebar-layer-3: rgba(var(--blue-600-rgb), 0.14);
    --color-sidebar-scrollbar-track: rgba(var(--gray-400-rgb), 0.2);
    --color-sidebar-scrollbar-thumb: rgba(var(--gray-600-rgb), 0.35);
    --color-sidebar-scrollbar-thumb-hover: rgba(var(--gray-700-rgb), 0.45);
}

[data-theme="dark"] {
    --color-bg-primary: #0b1120;
    --color-bg-secondary: #111827;
    --color-bg-tertiary: #1f2937;
    --color-bg-muted: #0f172a;
    --color-bg-inset: #111827;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-border: #1f2937;
    --color-border-strong: #334155;
    --color-accent: #60a5fa;
    --color-accent-rgb: 96, 165, 250;
    --color-accent-hover: #3b82f6;
    --color-accent-hover-rgb: var(--blue-500-rgb);
    --color-accent-soft: rgba(var(--color-accent-rgb), 0.2);
    --color-header-bg: linear-gradient(90deg, #0b1120, #111827);
    --color-header-text: #f8fafc;
    --color-header-text-rgb: 248, 250, 252;
    --color-sidebar-bg: linear-gradient(180deg, #0b1120, #111827);
    --color-sidebar-text: #f8fafc;
    --color-sidebar-text-muted: rgba(248, 250, 252, 0.7);
    --color-sidebar-text-rgb: 248, 250, 252;
    --color-sidebar-hover: rgba(248, 250, 252, 0.06);
    --color-sidebar-active: rgba(248, 250, 252, 0.12);
    --color-sidebar-border: rgba(248, 250, 252, 0.12);
    --color-sidebar-layer-1: rgba(var(--black-rgb), 0.2);
    --color-sidebar-layer-2: rgba(var(--black-rgb), 0.25);
    --color-sidebar-layer-3: rgba(var(--black-rgb), 0.3);
    --color-sidebar-scrollbar-track: rgba(var(--black-rgb), 0.15);
    --color-sidebar-scrollbar-thumb: rgba(var(--white-rgb), 0.2);
    --color-sidebar-scrollbar-thumb-hover: rgba(var(--white-rgb), 0.3);
    --color-overlay-bg: rgba(var(--black-rgb), 0.6);
    --color-hex-ffffff: var(--color-bg-secondary);
    --color-hex-f8fafc: var(--color-bg-primary);
    --color-hex-f9fafb: var(--color-bg-tertiary);
    --color-hex-f8f9fa: var(--color-bg-tertiary);
    --color-hex-f5f7fa: var(--color-bg-primary);
    --color-hex-f5f7fb: var(--color-bg-primary);
    --color-hex-f7f8fb: var(--color-bg-primary);
    --color-hex-f7fafc: var(--color-bg-primary);
    --color-hex-f9fafc: var(--color-bg-tertiary);
    --color-hex-f1f5f9: var(--color-bg-muted);
    --color-hex-e2e8f0: var(--color-border);
    --color-hex-e5e7eb: var(--color-border);
    --color-hex-e5e5e5: var(--color-border);
    --color-hex-e9ecef: var(--color-border);
    --color-hex-1a365d: var(--color-text-primary);
    --color-hex-2d3748: var(--color-text-primary);
    --color-hex-4a5568: var(--color-text-secondary);
    --color-hex-1e293b: var(--color-text-primary);
    --color-hex-1f2937: var(--color-text-primary);
    --color-hex-334155: var(--color-text-secondary);
    --color-hex-475569: var(--color-text-secondary);
    --color-hex-64748b: var(--color-text-muted);
    --color-hex-6c757d: var(--color-text-muted);
    --color-hex-495057: var(--color-text-secondary);
    --color-hex-cccccc: var(--color-border-strong);
    --color-hex-2c5282: var(--color-accent);
    --color-hex-3182ce: var(--color-accent);
    --color-hex-f7f8fb: var(--color-bg-primary);
    --color-hex-f8f9fa: var(--color-bg-tertiary);
    --color-hex-f9fafc: var(--color-bg-tertiary);
    --color-hex-c6f6d5: rgba(var(--success-color-rgb), 0.2);
    --color-hex-fed7d7: rgba(var(--danger-color-rgb), 0.2);
    --color-hex-bee3f8: rgba(var(--info-color-rgb), 0.2);
    --color-hex-feebc8: rgba(var(--warning-color-rgb), 0.25);

    --report-primary-600: var(--color-accent);
    --report-primary-700: var(--color-accent-hover);
    --report-accent-600: var(--info-color);
    --report-success-600: var(--success-color);
    --report-danger-600: var(--danger-color);
    --report-gray-900: var(--color-text-primary);
    --report-gray-800: var(--color-text-primary);
    --report-gray-700: var(--color-text-secondary);
    --report-gray-600: var(--color-text-muted);
    --report-gray-500: var(--color-text-muted);
    --report-gray-400: var(--color-text-muted);
    --report-gray-300: var(--color-border-strong);
    --report-gray-200: var(--color-border);
    --report-gray-100: var(--color-bg-tertiary);
    --report-primary-rgb: var(--color-accent-rgb);
    --report-success-rgb: var(--success-color-rgb);
    --report-danger-rgb: var(--danger-color-rgb);
    --report-gray-700-rgb: var(--color-accent-hover-rgb);
    --report-range-bg: var(--color-bg-muted);
    --report-primary-gradient: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
    --report-secondary-gradient: linear-gradient(135deg, var(--color-bg-tertiary), var(--color-bg-secondary));
    --report-success-gradient: linear-gradient(135deg, rgba(var(--success-color-rgb), 0.9), var(--success-color));
    --report-page-bg: linear-gradient(135deg, var(--color-bg-primary), var(--color-bg-secondary));
    --report-card-bg: var(--color-bg-secondary);

    --pharmacy-text-strong: var(--color-text-primary);
    --pharmacy-card-header-bg: var(--color-bg-tertiary);
    --pharmacy-pill-bg: rgba(var(--color-accent-rgb), 0.25);
    --pharmacy-badge-success: var(--success-color);
    --pharmacy-badge-success-rgb: var(--success-color-rgb);
    --pharmacy-badge-warning: var(--warning-color);
    --pharmacy-badge-warning-rgb: var(--warning-color-rgb);
    --pharmacy-badge-info: var(--info-color);
    --pharmacy-badge-info-rgb: var(--info-color-rgb);

    --bs-table-color: var(--color-text-primary);
    --bs-table-bg: var(--color-bg-secondary);
    --bs-table-border-color: var(--color-border);
    --bs-emphasis-color: var(--color-text-primary);
    --bs-secondary-color: var(--color-text-muted);
    --bs-body-color: var(--color-text-primary);
    --bs-body-bg: var(--color-bg-primary);
}

html[data-theme-color="blue"] {
    --theme-accent: var(--blue-600);
    --theme-accent-rgb: var(--blue-600-rgb);
    --theme-accent-hover: var(--blue-700);
    --theme-accent-hover-rgb: var(--blue-700-rgb);
}

html[data-theme-color="green"] {
    --theme-accent: var(--emerald-600);
    --theme-accent-rgb: var(--emerald-600-rgb);
    --theme-accent-hover: var(--emerald-700);
    --theme-accent-hover-rgb: var(--emerald-700-rgb);
}

html[data-theme-color="purple"] {
    --theme-accent: var(--purple-600);
    --theme-accent-rgb: var(--purple-500-rgb);
    --theme-accent-hover: var(--indigo-600);
    --theme-accent-hover-rgb: 79, 70, 229;
}

html[data-theme-color="amber"] {
    --theme-accent: var(--amber-600);
    --theme-accent-rgb: var(--amber-600-rgb);
    --theme-accent-hover: var(--amber-700);
    --theme-accent-hover-rgb: var(--amber-700-rgb);
}

html[data-theme-color="teal"] {
    --theme-accent: var(--teal-600);
    --theme-accent-rgb: var(--teal-600-rgb);
    --theme-accent-hover: var(--teal-700);
    --theme-accent-hover-rgb: var(--teal-700-rgb);
}

html[data-theme-color="red"] {
    --theme-accent: var(--red-600);
    --theme-accent-rgb: var(--red-600-rgb);
    --theme-accent-hover: var(--red-700);
    --theme-accent-hover-rgb: var(--red-700-rgb);
}

html[data-theme-color] {
    --color-accent: var(--theme-accent);
    --color-accent-rgb: var(--theme-accent-rgb);
    --color-accent-hover: var(--theme-accent-hover);
    --color-accent-hover-rgb: var(--theme-accent-hover-rgb);
    --primary-color: var(--theme-accent);
    --primary-color-rgb: var(--theme-accent-rgb);
    --accent-color: var(--theme-accent);
    --accent-color-rgb: var(--theme-accent-rgb);
    --hover-color: var(--theme-accent-hover);
    --hover-color-rgb: var(--theme-accent-hover-rgb);
    --secondary-color: var(--theme-accent-hover);
    --secondary-color-rgb: var(--theme-accent-hover-rgb);
}

[data-theme="medical"] {
    --primary-color: #16a085;
    --secondary-color: #1abc9c;
    --accent-color: #3498db;
    --hover-color: #2ecc71;
}

/* AfCode Global Dialog */
.afcode-dialog .modal-dialog {
    max-width: 440px;
}

.afcode-dialog-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.24);
}

.afcode-dialog-title-wrap {
    display: flex;
    align-items: center;
    gap: .625rem;
}

.afcode-dialog-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--theme-accent-rgb, 37, 99, 235), .12);
    font-size: 1rem;
}

.afcode-dialog-message {
    color: var(--bs-secondary-color, #475569);
    line-height: 1.7;
}

html[dir="rtl"] .afcode-dialog .modal-footer {
    justify-content: flex-start;
}
