/**
 * Litapdimas — Design Tokens & CSS Variables
 * ==========================================
 * Sentralisasi semua nilai desain agar konsisten di seluruh modul.
 */

:root {
    /* 1. Core Brand Colors (UINSI & Kemenag) */
    --uinsi-green: #006837;
    --uinsi-green-dark: #004d29;
    --uinsi-green-soft: rgba(0, 104, 55, 0.08);
    --uinsi-gold: #f9a825;
    --uinsi-gold-soft: rgba(249, 168, 37, 0.1);
    --kemenag-green: #1b5e20;
    
    /* 2. Semantic Colors */
    --primary: var(--uinsi-green);
    --secondary: #64748b;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #0f172a;
    
    /* 3. Neutral Colors (Grays) */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: rgba(148, 163, 184, 0.2);
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    
    /* 4. Elevations (Shadows) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 0.75rem 2rem rgba(15, 23, 42, 0.08);
    
    /* 5. Layout Properties */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-pill: 9999px;
    
    /* 6. Typography */
    --font-main: 'Inter', 'Source Sans 3', sans-serif;
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light / Dark Mode Adjustments (Future proof) */
[data-bs-theme='dark'] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #94a3b8;
    --text-heading: #f1f5f9;
}

/* ============================================================
   Design System v2 — Foundation Tokens (aditif)
   Token baru; tidak menimpa token lama agar halaman lain aman.
   ============================================================ */
:root {
    /* Brand — hijau UINSI */
    --brand-950: #002b16;
    --brand-900: #003d1f;
    --brand-800: #004d29;
    --brand-700: #006837;
    --brand-600: #0b7a44;
    --brand-100: #e6f2ec;
    --brand-50: #f2f9f5;

    /* Netral */
    --ink-950: #0b1220;
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --ink-50: #f8fafc;

    /* Semantik — pasangan tervalidasi */
    --success-800: #065f46;
    --success-700: #047857;
    --success-50: #ecfdf5;
    --info-800: #1e40af;
    --info-700: #1d4ed8;
    --info-50: #eff6ff;
    --warning-800: #92400e;
    --warning-50: #fffbeb;
    --danger-700: #b91c1c;
    --danger-50: #fef2f2;

    /* Permukaan & teks */
    --surface-page: #f4f7f5;
    --surface-card: #ffffff;
    --surface-sunken: #f8fafc;
    --surface-hover: #f1f5f9;
    --text-strong: var(--ink-900);
    --text-primary: var(--ink-700);
    --text-secondary: var(--ink-600);
    --border-subtle: var(--ink-200);
    --border-strong: var(--ink-300);

    /* Sidebar tokens */
    --sidebar-bg: var(--surface-card);
    --sidebar-brand-bg: var(--surface-sunken);
    --sidebar-border: var(--border-subtle);
    --sidebar-item-color: var(--text-secondary);
    --sidebar-item-hover-bg: var(--surface-hover);
    --sidebar-item-hover-color: var(--text-strong);
    --sidebar-item-active-bg: var(--brand-50);
    --sidebar-item-active-color: var(--brand-700);
    --sidebar-item-active-border: var(--brand-100);

    /* Aksi */
    --action-primary-bg: var(--brand-700);
    --action-primary-bg-hover: var(--brand-800);
    --action-primary-text: #ffffff;
    --link-color: var(--brand-700);

    /* Spasi */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radius komponen baru */
    --radius-control: 0.625rem;
    --radius-card: 0.875rem;
}

[data-bs-theme='dark'] {
    --surface-page: #0b1220;
    --surface-card: #111c2e;
    --surface-sunken: #0f172a;
    --surface-hover: #16233a;
    --text-strong: #f1f5f9;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-subtle: rgba(226, 232, 240, 0.14);
    --border-strong: rgba(226, 232, 240, 0.24);

    /* Sidebar dark tokens */
    --sidebar-bg: #111c2e;
    --sidebar-brand-bg: #0d1626;
    --sidebar-border: rgba(226, 232, 240, 0.12);
    --sidebar-item-color: #cbd5e1;
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-item-hover-color: #f8fafc;
    --sidebar-item-active-bg: rgba(125, 211, 168, 0.12);
    --sidebar-item-active-color: #7dd3a8;
    --sidebar-item-active-border: rgba(125, 211, 168, 0.24);

    --brand-700: #7dd3a8;
    --brand-600: #4ade80;
    --brand-800: #a7f3d0;
    --brand-100: rgba(125, 211, 168, 0.12);
    --brand-50: rgba(125, 211, 168, 0.07);

    --success-700: #6ee7b7;
    --success-50: rgba(4, 120, 87, 0.16);
    --info-700: #93c5fd;
    --info-50: rgba(29, 78, 216, 0.20);
    --warning-800: #fcd34d;
    --warning-50: rgba(146, 64, 14, 0.20);
    --danger-700: #fca5a5;
    --danger-50: rgba(185, 28, 28, 0.18);

    --action-primary-bg: #0b7a44;
    --action-primary-bg-hover: #0f8a4f;
    --link-color: #7dd3a8;
}

/* ============================================================
   Design System Admin Console v1.0 — token tambahan (aditif)
   Tidak menimpa token lama. Acuan: docs/05-design-system-admin.md
   ============================================================ */
:root {
    /* Permukaan tambahan */
    --surface-inset: #f1f5f9;

    /* Status domain (fg/bg/border sudah tervalidasi kontras) */
    --status-neutral-fg: var(--ink-700);
    --status-neutral-bg: var(--ink-100);
    --status-neutral-border: var(--ink-200);
    --status-info-fg: var(--info-700);
    --status-info-bg: var(--info-50);
    --status-info-border: #bfdbfe;
    --status-progress-fg: var(--brand-700);
    --status-progress-bg: var(--brand-100);
    --status-progress-border: #a7d7bf;
    --status-success-fg: var(--success-700);
    --status-success-bg: var(--success-50);
    --status-success-border: #a7f3d0;
    --status-warning-fg: var(--warning-800);
    --status-warning-bg: var(--warning-50);
    --status-warning-border: #fde68a;
    --status-danger-fg: var(--danger-700);
    --status-danger-bg: var(--danger-50);
    --status-danger-border: #fecaca;

    /* Skala tipografi admin */
    --text-2xs: 0.6875rem;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.75rem;
    --text-4xl: 2.25rem;

    /* Radius & elevasi */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-modal: var(--radius-xl);
    --elev-0: none;
    --elev-1: 0 1px 2px rgba(15, 23, 42, 0.06);
    --elev-2: 0 8px 24px rgba(15, 23, 42, 0.1);
    --elev-sticky: 0 -8px 24px rgba(15, 23, 42, 0.08);

    /* Motion */
    --motion-fast: 120ms;
    --motion-base: 180ms;
    --motion-slow: 240ms;
    --motion-theme: 280ms;
    --motion-easing: cubic-bezier(0.2, 0, 0, 1);
    --motion-theme-easing: cubic-bezier(0.4, 0, 0.2, 1);

    /* Fokus */
    --focus-ring: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--brand-700);

    /* Layout admin */
    --admin-page-max: 1280px;
    --admin-grid-gap: 1.5rem;
    --admin-sticky-offset: 5.5rem;
}

[data-bs-theme='dark'] {
    --surface-inset: #16233a;

    --status-neutral-fg: #cbd5e1;
    --status-neutral-bg: rgba(148, 163, 184, 0.14);
    --status-neutral-border: rgba(203, 213, 225, 0.24);
    --status-info-fg: #93c5fd;
    --status-info-bg: rgba(29, 78, 216, 0.2);
    --status-info-border: rgba(147, 197, 253, 0.32);
    --status-progress-fg: #7dd3a8;
    --status-progress-bg: rgba(125, 211, 168, 0.12);
    --status-progress-border: rgba(125, 211, 168, 0.28);
    --status-success-fg: #6ee7b7;
    --status-success-bg: rgba(4, 120, 87, 0.16);
    --status-success-border: rgba(110, 231, 183, 0.28);
    --status-warning-fg: #fcd34d;
    --status-warning-bg: rgba(146, 64, 14, 0.2);
    --status-warning-border: rgba(252, 211, 77, 0.3);
    --status-danger-fg: #fca5a5;
    --status-danger-bg: rgba(185, 28, 28, 0.18);
    --status-danger-border: rgba(252, 165, 165, 0.3);

    --elev-1: 0 1px 2px rgba(0, 0, 0, 0.28);
    --elev-2: 0 8px 24px rgba(0, 0, 0, 0.4);
    --elev-sticky: 0 -8px 24px rgba(0, 0, 0, 0.35);
    --focus-ring: 0 0 0 2px var(--surface-card), 0 0 0 4px #7dd3a8;
}
