/* ═══════════════════════════════════════════════════════════
   GUNARATHNA ERP v5 — Enterprise Design System
   ═══════════════════════════════════════════════════════════ */

/* ── Font Imports ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Light Theme ── */
:root {
  /* Base Colors */
  --bg-page: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5ff;
  --bg-sidebar: #0b1120;
  --bg-sidebar-hover: #162044;
  --bg-input: #ffffff;
  --bg-input-disabled: #f1f5f9;

  /* Text Colors */
  --text-primary: #0b1120;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-muted-2: #94a3b8;
  --text-muted-3: #cbd5e1;
  --text-sidebar: #b8c6e6;
  --text-sidebar-muted: #5a6e9e;
  --text-sidebar-active: #ffffff;
  --text-on-primary: #ffffff;

  /* Accent Colors — VIBRANT */
  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-primary-light: #e0e7ff;
  --accent-primary-bg: rgba(79, 70, 229, 0.12);
  --accent-secondary: #7c3aed;
  --accent-success: #059669;
  --accent-success-light: #d1fae5;
  --accent-success-text: #065f46;
  --accent-danger: #dc2626;
  --accent-danger-light: #fee2e2;
  --accent-danger-text: #991b1b;
  --accent-warning: #d97706;
  --accent-warning-light: #fef3c7;
  --accent-warning-text: #92400e;
  --accent-info: #2563eb;
  --accent-info-light: #dbeafe;
  --accent-info-text: #1e40af;

  /* Border Colors */
  --border-color: #d1d9e6;
  --border-color-light: #e2e8f0;
  --border-color-medium: #b0bccf;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.15);
  --shadow-sidebar: 2px 0 16px rgba(0, 0, 0, 0.08);

  /* Table Colors */
  --table-header-bg: #f8fafc;
  --row-hover: #f1f5f9;
  --row-even: #fafbfc;
  --row-border: #f0f4f8;

  /* Modal */
  --modal-overlay: rgba(15, 23, 42, 0.5);
  --modal-shadow: var(--shadow-xl);

  /* Scrollbar */
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: transparent;

  /* Misc */
  --ghost-hover-bg: #f1f4ff;
  --search-item-hover: #eef2ff;
  --highlight-bg: #fffbeb;
  --chart-grid: #e2e8f0;
  --chart-text: #64748b;
  --skeleton-bg: #e2e8f0;
  --skeleton-shine: #f1f5f9;

  /* Stat Card Gradients — more vibrant */
  --stat-blue-from: #dbeafe;
  --stat-blue-to: #ffffff;
  --stat-green-from: #d1fae5;
  --stat-green-to: #ffffff;
  --stat-orange-from: #fef3c7;
  --stat-orange-to: #ffffff;
  --stat-red-from: #fee2e2;
  --stat-red-to: #ffffff;
  --stat-purple-from: #ede9fe;
  --stat-purple-to: #ffffff;
  --stat-teal-from: #ccfbf1;
  --stat-teal-to: #ffffff;
}

/* ── Dark Theme ── VIBRANT */
[data-theme="dark"] {
  --bg-page: #080e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2338;
  --bg-sidebar: #060a14;
  --bg-sidebar-hover: #0d1528;
  --bg-input: #1a2338;
  --bg-input-disabled: #111827;

  --text-primary: #f0f4ff;
  --text-secondary: #c8d6f0;
  --text-muted: #7a8bb8;
  --text-muted-2: #5a6e9e;
  --text-muted-3: #3d4f7a;
  --text-on-primary: #ffffff;

  --accent-primary: #818cf8;
  --accent-primary-hover: #6b75f0;
  --accent-primary-light: rgba(129, 140, 248, 0.2);
  --accent-primary-bg: rgba(129, 140, 248, 0.18);
  --accent-success: #34d399;
  --accent-success-light: rgba(52, 211, 153, 0.2);
  --accent-success-text: #6ee7b7;
  --accent-danger: #f87171;
  --accent-danger-light: rgba(248, 113, 113, 0.2);
  --accent-danger-text: #fca5a5;
  --accent-warning: #fbbf24;
  --accent-warning-light: rgba(251, 191, 36, 0.2);
  --accent-warning-text: #fcd34d;
  --accent-info: #60a5fa;
  --accent-info-light: rgba(96, 165, 250, 0.2);
  --accent-info-text: #93c5fd;

  --border-color: #1e2a45;
  --border-color-light: #162036;
  --border-color-medium: #2a3a5a;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-sidebar: 2px 0 16px rgba(0, 0, 0, 0.4);

  --table-header-bg: #131a2e;
  --row-hover: #1a2340;
  --row-even: #0f172a;
  --row-border: #1e293b;

  --modal-overlay: rgba(0, 0, 0, 0.7);

  --scrollbar-thumb: #2d3748;

  --ghost-hover-bg: rgba(129, 140, 248, 0.1);
  --search-item-hover: #1a2340;
  --chart-grid: #2d3748;
  --chart-text: #8892b0;
  --skeleton-bg: #1e293b;
  --skeleton-shine: #2d3748;

  --stat-blue-from: rgba(129, 140, 248, 0.12);
  --stat-blue-to: #131a2e;
  --stat-green-from: rgba(52, 211, 153, 0.12);
  --stat-green-to: #131a2e;
  --stat-orange-from: rgba(251, 191, 36, 0.12);
  --stat-orange-to: #131a2e;
  --stat-red-from: rgba(248, 113, 113, 0.12);
  --stat-red-to: #131a2e;
  --stat-purple-from: rgba(167, 139, 250, 0.12);
  --stat-purple-to: #131a2e;
  --stat-teal-from: rgba(52, 211, 153, 0.12);
  --stat-teal-to: #131a2e;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted-3);
}

/* ── Focus Ring ── */
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-primary-bg);
  border-color: var(--accent-primary);
}

/* ── Selection ── */
::selection {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

/* ── Smooth Transitions ── */
a, button, input, select, textarea {
  transition: all 0.2s ease;
}
