/* ==========================================================================
   DESIGN TOKENS - OI PHÁI SINH DASHBOARD
   Hệ nhận diện thống nhất với phaisinh.online
   ========================================================================== */

/* Đồng bộ hệ nhận diện với phaisinh.online (P0).
   Tên biến giữ nguyên để không phải sửa components.css; chỉ đổi giá trị.
   Quy tắc: đỏ thương hiệu (--brand-*) chỉ dùng cho logo, nút chính, mục đang chọn.
   Số liệu tăng/giảm dùng --pos / --neg (lấy từ --up / --down của phaisinh.online). */
:root {
  /* Thương hiệu phaisinh.online */
  --red-600: #d23922;
  --red-700: #b02c18;
  --red-800: #8e1f12;
  --red-50: #fff4f1;
  --red-25: #fffaf8;

  --brand-primary: #d23922;
  --brand-hover: #b02c18;
  --brand-strong: #8e1f12;
  --brand-soft: #fff4f1;
  --brand-gradient: linear-gradient(135deg, #d23922 0%, #8e1f12 100%);

  /* Tăng / Long / Mua ròng / Lãi */
  --pos: #0b7d44;
  --pos-hover: #086637;
  --pos-bg: #e8f6ee;
  --pos-border: rgba(11, 125, 68, 0.24);

  /* Giảm / Short / Bán ròng / Lỗ */
  /* Đỏ giảm dùng chính đỏ thương hiệu phaisinh.online */
  --neg: #d23922;
  --neg-hover: #b02c18;
  --neg-bg: #fdeeea;
  --neg-border: rgba(210, 57, 34, 0.24);

  --neutral: #6c6d6d;
  --neutral-bg: rgba(108, 109, 109, 0.08);
  --neutral-border: rgba(108, 109, 109, 0.2);

  /* Cảnh báo / dữ liệu trễ (màu tham chiếu của phaisinh.online) */
  --warn: #946300;
  --warn-bg: #fdf6e6;
  --warn-border: rgba(148, 99, 0, 0.28);

  /* Màu nhóm nhà đầu tư: tránh tím-trần / vàng-tham chiếu của bảng giá VN.
     NĐT khác là nhóm suy ra nên dùng xám ấm. */
  --s-nn: #1e4d8c;
  --s-td: #6a4aa0;
  --s-nk: #8b8580;
  --metric-oi: #0e7490;
  --chart-price: #1b1b1b;
  --chart-vol: #d9d6d4;

  /* Nền & bề mặt (tông ấm của phaisinh.online) */
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-2: #f6f4f3;
  --bg-surface-3: #eeeae8;
  --bg-soft: #fffaf8;

  /* Mực */
  --ink-primary: #111111;
  --ink-secondary: #444444;
  --ink-muted: #6c6d6d;
  --ink-faint: #9d9fa3;
  --ink-inverse: #ffffff;

  /* Đường kẻ */
  --line-subtle: #f6f4f3;
  --line-normal: #eeeae8;
  --line-strong: #d9d6d4;

  /* Bóng đổ ấm */
  --shadow-xs: 0 1px 2px #1111110d;
  --shadow-sm: 0 1px 2px #1111110d;
  --shadow-md: 0 4px 14px #8e1f120f;
  --shadow-lg: 0 8px 28px #8e1f1214;
  --shadow-xl: 0 16px 40px #8e1f121a;

  /* Bo góc theo phaisinh.online (12 / 16 / 24 / pill) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Chữ: Be Vietnam Pro toàn trang, JetBrains Mono cho mã/số kỹ thuật */
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --num-features: "tnum" 1;

  --max-content-width: 1200px;
  --header-height: 68px;
  --touch-target-min: 44px;

  color-scheme: light;
}

/* Giao diện tối: tông ấm, không dùng navy lạnh */
:root[data-theme="dark"] {
  --red-600: #f0634a;
  --red-700: #ff7a63;
  --red-800: #ffb3a5;
  --red-50: #2a1612;
  --red-25: #1d1311;

  --brand-primary: #f0634a;
  --brand-hover: #ff7a63;
  --brand-strong: #c2412b;
  --brand-soft: #2a1612;

  --bg-page: #141110;
  --bg-surface: #1b1716;
  --bg-surface-2: #221e1c;
  --bg-surface-3: #2f2a28;
  --bg-soft: #1d1311;

  --ink-primary: #f3efed;
  --ink-secondary: #cfc9c6;
  --ink-muted: #9a9491;
  --ink-faint: #7a7471;
  --ink-inverse: #141110;

  --line-subtle: #221e1c;
  --line-normal: #2f2a28;
  --line-strong: #4a4442;

  --pos: #2fbf6f;
  --pos-hover: #4fd389;
  --pos-bg: #10261a;
  --pos-border: rgba(63, 191, 122, 0.3);

  --neg: #ff6b52;
  --neg-hover: #ff8a75;
  --neg-bg: #2c1511;
  --neg-border: rgba(255, 122, 99, 0.3);

  --neutral: #9a9491;
  --neutral-bg: rgba(154, 148, 145, 0.12);
  --neutral-border: rgba(154, 148, 145, 0.24);

  --warn: #e0b04a;
  --warn-bg: #2a2210;
  --warn-border: rgba(224, 176, 74, 0.3);

  --s-nn: #6fa3ea;
  --s-td: #ad92e6;
  --s-nk: #a39d98;
  --metric-oi: #22b8cf;
  --chart-price: #f3efed;
  --chart-vol: #4a4442;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
