/* ============================================
   DE VALIS — Design Tokens
   Single source of truth. Sua file nay = re-skin toan app.
   ============================================ */

:root {
  /* === Brand === */
  --color-gold: #C6A664;
  --color-gold-dark: #A8894F;
  --color-gold-soft: #E8D7A8;
  --color-gold-tint: #F4ECD8;
  --color-cream: #FFF9F0;
  --color-cream-warm: #FAF1DD;
  --color-dark: #1A1A1A;
  --color-dark-soft: #2E2E2E;

  /* === Neutral === */
  --color-bg: #FAFAF7;
  --color-surface: #FFFFFF;
  --color-surface-2: #F7F4ED;
  --color-border: #E8E4DA;
  --color-border-soft: #F0EDE5;
  --color-text: #1A1A1A;
  --color-text-muted: #6B6B6B;
  --color-text-soft: #9A9A9A;

  /* === Semantic states (KHONG dung gold) === */
  --color-success: #2E7D5C;
  --color-success-bg: #E6F4ED;
  --color-success-border: #B8DFCC;
  --color-warning: #C77E0A;
  --color-warning-bg: #FBF1DC;
  --color-warning-border: #ECCB89;
  --color-danger: #B43A3A;
  --color-danger-bg: #FBE9E9;
  --color-danger-border: #E6B4B4;
  --color-info: #3A6FB4;
  --color-info-bg: #E8EFF9;
  --color-info-border: #B4CAEB;

  /* === Typography === */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --fs-xs: 0.75rem;       /* 12 */
  --fs-sm: 0.8125rem;     /* 13 */
  --fs-base: 0.875rem;    /* 14 */
  --fs-md: 0.9375rem;     /* 15 */
  --fs-lg: 1.0625rem;     /* 17 */
  --fs-xl: 1.25rem;       /* 20 */
  --fs-2xl: 1.5rem;       /* 24 */
  --fs-3xl: 1.875rem;     /* 30 */
  --fs-4xl: 2.5rem;       /* 40 */

  /* === Spacing 4-pt === */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 40px;
  --space-9: 56px; --space-10: 80px;

  /* === Radius === */
  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 10px;
  --radius-lg: 16px; --radius-xl: 24px; --radius-full: 9999px;

  /* === Shadow === */
  --shadow-xs: 0 1px 2px rgba(26,26,26,.04);
  --shadow-sm: 0 1px 3px rgba(26,26,26,.06), 0 1px 2px rgba(26,26,26,.04);
  --shadow-md: 0 4px 12px rgba(26,26,26,.06), 0 2px 4px rgba(26,26,26,.04);
  --shadow-lg: 0 12px 32px rgba(26,26,26,.08), 0 4px 8px rgba(26,26,26,.04);
  --shadow-xl: 0 24px 56px rgba(26,26,26,.12);
  --shadow-focus: 0 0 0 3px rgba(198,166,100,.25);

  /* === Motion === */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --transition: var(--duration-base) var(--ease-out);

  /* === Layout === */
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --bottom-nav-h: 64px;
  --content-max: 1440px;
  --drawer-w: 560px;

  /* === Z-index scale === */
  --z-topbar: 30;
  --z-sidebar: 40;
  --z-drawer-backdrop: 60;
  --z-drawer: 61;
  --z-modal-backdrop: 70;
  --z-modal: 71;
  --z-toast: 90;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-dark);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0; }
a { color: var(--color-gold-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-gold); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); border: 2px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-soft); }

/* === Utility === */
.text-muted { color: var(--color-text-muted); }
.text-soft  { color: var(--color-text-soft); }
.text-gold  { color: var(--color-gold-dark); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-right { text-align: right; }
.text-num { font-variant-numeric: tabular-nums; }
.font-heading { font-family: var(--font-heading); }
.divider { height: 1px; background: var(--color-border); margin: var(--space-5) 0; }
.hide-mobile { display: revert; }
.show-mobile { display: none !important; }

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: revert !important; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}
