/* ==========================================================================
   RT DIGITAL - DESIGN SYSTEM & 3 TEMA WARNA (TERANG, WARM, GELAP)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --------------------------------------------------------------------------
   1. TEMA DEFAULT: MODE TERANG (CLEAN LIGHT)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-card: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-highlight: #cbd5e1;
  --border-focus: #16a34a;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-inverted: #ffffff;

  /* Natural Clean Accents */
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-light: #dcfce7;
  --primary-border: #86efac;

  --status-income: #16a34a;
  --status-income-bg: #f0fdf4;
  --status-income-border: #bbf7d0;

  --status-expense: #dc2626;
  --status-expense-bg: #fef2f2;
  --status-expense-border: #fecaca;

  --accent-kkw: #2563eb;
  --accent-kkw-bg: #eff6ff;
  --accent-kkw-border: #bfdbfe;

  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.1);
}

/* --------------------------------------------------------------------------
   2. TEMA: MODE WARM / CREAM (SEPIA RAMAH MATA)
   -------------------------------------------------------------------------- */
[data-theme="warm"] {
  --bg-body: #fbf8f1;
  --bg-surface: #f5f0e4;
  --bg-surface-elevated: #eee7d7;
  --bg-card: #ffffff;
  --bg-glass: rgba(251, 248, 241, 0.94);
  --bg-glass-card: #ffffff;

  --border-subtle: #e8dec8;
  --border-highlight: #d8cbb0;
  --border-focus: #2f855a;

  --text-main: #2d261e;
  --text-muted: #574c3e;
  --text-dim: #7c6f5e;
  --text-inverted: #ffffff;

  /* Earthy Natural Accents */
  --primary: #2f855a;
  --primary-hover: #276749;
  --primary-light: #e6f4ea;
  --primary-border: #a7d7b9;

  --status-income: #2f855a;
  --status-income-bg: #f0f8f3;
  --status-income-border: #c3e6cb;

  --status-expense: #c53030;
  --status-expense-bg: #fff5f5;
  --status-expense-border: #feb2b2;

  --accent-kkw: #795548;
  --accent-kkw-bg: #efebe9;
  --accent-kkw-border: #d7ccc8;

  --accent-amber: #b7791f;
  --accent-amber-bg: #fffaf0;
  --accent-amber-border: #feebc8;

  --shadow-sm: 0 1px 4px rgba(78, 59, 39, 0.06);
  --shadow-md: 0 4px 14px rgba(78, 59, 39, 0.08);
  --shadow-lg: 0 10px 24px rgba(78, 59, 39, 0.1);
}

/* --------------------------------------------------------------------------
   3. TEMA: MODE GELAP (MUTED DARK NETRAL)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-body: #18181b;
  --bg-surface: #27272a;
  --bg-surface-elevated: #3f3f46;
  --bg-card: #27272a;
  --bg-glass: rgba(39, 39, 42, 0.92);
  --bg-glass-card: #27272a;

  --border-subtle: #3f3f46;
  --border-highlight: #52525b;
  --border-focus: #22c55e;

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --text-inverted: #18181b;

  /* Calmer Dark Accents */
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-light: rgba(34, 197, 94, 0.15);
  --primary-border: rgba(34, 197, 94, 0.35);

  --status-income: #22c55e;
  --status-income-bg: rgba(34, 197, 94, 0.12);
  --status-income-border: rgba(34, 197, 94, 0.25);

  --status-expense: #f87171;
  --status-expense-bg: rgba(239, 68, 68, 0.12);
  --status-expense-border: rgba(239, 68, 68, 0.25);

  --accent-kkw: #60a5fa;
  --accent-kkw-bg: rgba(59, 130, 246, 0.12);
  --accent-kkw-border: rgba(59, 130, 246, 0.25);

  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.25);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   Typography & Global Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

/* App Wrapper */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 0.9375rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-emerald { color: var(--status-income); }
.text-rose { color: var(--status-expense); }
.text-amber { color: var(--accent-amber); }
.text-sky { color: var(--accent-kkw); }

/* Common Flex Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.relative { position: relative; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease forwards;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: var(--radius-pill);
}
