/* ============================================================
   THEME.CSS — แก้ไขที่นี่เพื่อเปลี่ยนสี / ขนาดตัวอักษร / ฟอนต์
   ============================================================ */

/* ── Light Theme (default) ────────────────────────────────── */
:root {
  /* Brand */
  --color-primary:        #1d4ed8;
  --color-primary-light:  #dbeafe;
  --color-primary-dark:   #1e3a8a;

  /* Background */
  --color-bg:             #f1f5f9;
  --color-surface:        #ffffff;
  --color-surface-2:      #f8fafc;

  /* Text */
  --color-text:           #0f172a;
  --color-text-2:         #475569;
  --color-text-3:         #94a3b8;

  /* Border */
  --color-border:         #e2e8f0;
  --color-border-2:       #cbd5e1;

  /* Status */
  --color-complete:       #16a34a;
  --color-complete-bg:    #dcfce7;
  --color-inprogress:     #2563eb;
  --color-inprogress-bg:  #dbeafe;
  --color-blocked:        #dc2626;
  --color-blocked-bg:     #fee2e2;
  --color-pending:        #94a3b8;
  --color-pending-bg:     #f1f5f9;

  /* KPI accent colors */
  --color-kpi-green:      #15803d;
  --color-kpi-green-bg:   #f0fdf4;
  --color-kpi-blue:       #1d4ed8;
  --color-kpi-blue-bg:    #eff6ff;
  --color-kpi-red:        #b91c1c;
  --color-kpi-red-bg:     #fff1f2;
  --color-kpi-gray:       #475569;
  --color-kpi-gray-bg:    #f8fafc;

  /* Shadow */
  --shadow-sm:            0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:            0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:            0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.05);

  /* Typography */
  --font-family:          'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-xs:         0.75rem;
  --font-size-sm:         0.875rem;
  --font-size-md:         1rem;
  --font-size-lg:         1.125rem;
  --font-size-xl:         1.5rem;
  --font-size-2xl:        2rem;

  /* Spacing */
  --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;

  /* Radius */
  --radius-sm:  0.375rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-xl:  1rem;
  --radius-full: 9999px;

  /* Header height */
  --header-height: 64px;

  /* Sidebar */
  --sidebar-width:           240px;
  --sidebar-collapsed-width: 64px;
}

/* ── Mobile font scale ────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --font-size-2xl: 1.6rem;
    --font-size-xl:  1.25rem;
    --header-height: auto;
  }
}

/* ── Dark Theme ───────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:             #0f172a;
  --color-surface:        #1e293b;
  --color-surface-2:      #172033;

  --color-text:           #f1f5f9;
  --color-text-2:         #94a3b8;
  --color-text-3:         #64748b;

  --color-border:         #334155;
  --color-border-2:       #475569;

  --color-primary-light:  #1e3a8a;

  --color-complete-bg:    #14532d;
  --color-inprogress-bg:  #1e3a8a;
  --color-blocked-bg:     #7f1d1d;
  --color-pending-bg:     #1e293b;

  --color-kpi-green-bg:   #14532d;
  --color-kpi-blue-bg:    #1e3a8a;
  --color-kpi-red-bg:     #7f1d1d;
  --color-kpi-gray-bg:    #1e293b;

  --shadow-sm:            0 1px 3px rgba(0,0,0,.3);
  --shadow-md:            0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-lg:            0 10px 15px -3px rgba(0,0,0,.5);
}
