/* ============================================================
   MicroCredit — Design Tokens
   Shared by all pages. Imported before app.css.
   ============================================================ */

:root {
    /* Brand — primary (indigo) */
    --color-primary-50:  #eef2ff;
    --color-primary-100: #e0e7ff;
    --color-primary-200: #c7d2fe;
    --color-primary-300: #a5b4fc;
    --color-primary-400: #818cf8;
    --color-primary-500: #6366f1;
    --color-primary-600: #4f46e5;
    --color-primary-700: #4338ca;
    --color-primary-800: #3730a3;
    --color-primary-900: #312e81;

    /* Semantic accents */
    --color-success-50:  #ecfdf5;
    --color-success-100: #d1fae5;
    --color-success-600: #059669;
    --color-success-700: #047857;

    --color-warning-50:  #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-600: #d97706;
    --color-warning-700: #b45309;

    --color-danger-50:   #fef2f2;
    --color-danger-100:  #fee2e2;
    --color-danger-600:  #dc2626;
    --color-danger-700:  #b91c1c;

    /* Neutrals (slate) */
    --color-slate-50:  #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    /* Surface / chrome */
    --surface-page:    var(--color-slate-50);
    --surface-card:    #ffffff;
    --surface-sidebar: #ffffff;
    --surface-topbar:  rgba(255, 255, 255, 0.80);
    --border-default:  var(--color-slate-200);

    /* Typography */
    --text-strong:     var(--color-slate-800);
    --text-base:       var(--color-slate-700);
    --text-muted:      var(--color-slate-500);
    --text-subtle:     var(--color-slate-400);

    /* Radii / shadows */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Dark mode overrides applied via `[data-theme="dark"]` below */
}

/* ============================================================
   Dark mode tokens
   ============================================================ */
[data-theme="dark"] {
    --surface-page:    #0b1220;         /* very dark slate */
    --surface-card:    #111827;
    --surface-sidebar: #0f172a;
    --surface-topbar:  rgba(15, 23, 42, 0.80);
    --border-default:  #1f2937;

    --text-strong:  #f1f5f9;
    --text-base:    #cbd5e1;
    --text-muted:   #94a3b8;
    --text-subtle:  #64748b;

    /* Slight desaturation of the brand for readability */
    --color-primary-50:  #1e1b4b;
    --color-primary-100: #312e81;
    --color-primary-500: #818cf8;
    --color-primary-600: #6366f1;
    --color-primary-700: #4f46e5;
}

/* Smooth theme transition */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html, body { transition: background-color 0.2s ease, color 0.2s ease; }