/* ============================================================
   CRYPITO — Dashboard CSS
   Iridescente Cerfámico · Design System v3.0
   Pearl / Violet / Cyan / Mint — glass lux w/ mesh gradients
   ============================================================ */

/* ============================================================
   1. ROOT VARIABLES & RESET
   ============================================================ */

:root {
  /* ---- Deep violet-black canvas ---- */
  --bg-deep: #0a0612;
  --bg-mid: #0e0818;
  --bg-accent: #110a1c;

  /* ---- Surface elevation hierarchy ---- */
  --surface-0: #0e0818;
  --surface-1: #15101f;
  --surface-2: #1c1628;
  --surface-3: #251d34;
  --surface-4: #2e2540;

  /* ---- Pearl / Iridescent palette ---- */
  --pearl-rose: #f4c7ff;
  --pearl-violet: #c7b5ff;
  --pearl-cyan: #9fe8ff;
  --pearl-mint: #b8ffd9;
  --gradient-pearl: linear-gradient(135deg, #f4c7ff 0%, #c7b5ff 35%, #9fe8ff 70%, #b8ffd9 100%);
  --gradient-pearl-soft: linear-gradient(135deg, rgba(244,199,255,0.65), rgba(159,232,255,0.65));
  --gradient-pearl-faint: linear-gradient(135deg, rgba(244,199,255,0.12), rgba(199,181,255,0.10), rgba(159,232,255,0.10), rgba(184,255,217,0.08));

  /* ---- Borders — tinted violet ---- */
  --border-subtle: rgba(199, 181, 255, 0.06);
  --border-default: rgba(199, 181, 255, 0.10);
  --border-strong: rgba(199, 181, 255, 0.18);
  --border-inner: rgba(255, 255, 255, 0.06);

  /* ---- Accent — pearl violet primary ---- */
  --accent: #c7b5ff;
  --accent-muted: rgba(199, 181, 255, 0.12);
  --accent-ring: 0 0 0 3px rgba(199, 181, 255, 0.22);

  /* ---- Semantic — pearl-tinted ---- */
  --positive: #7eecb4;
  --positive-dim: rgba(126, 236, 180, 0.12);
  --negative: #ff8a9b;
  --negative-dim: rgba(255, 138, 155, 0.12);
  --warning: #ffd67a;
  --warning-dim: rgba(255, 214, 122, 0.14);
  --info: #9fe8ff;
  --info-dim: rgba(159, 232, 255, 0.12);

  /* ---- Text hierarchy ---- */
  --text-primary: #f5f0ff;
  --text-secondary: #a89cc0;
  --text-tertiary: #6a5f80;
  --text-disabled: #403847;

  /* ---- Legacy aliases (repointed, zero-break) ---- */
  --glass-bg: rgba(28, 22, 40, 0.68);
  --glass-bg-bright: rgba(37, 29, 52, 0.78);
  --glass-bg-darker: rgba(14, 8, 24, 0.85);
  --glass-border: var(--border-subtle);
  --glass-border-hover: var(--border-default);
  --glass-blur: blur(24px) saturate(1.4);
  --glass-blur-strong: blur(32px) saturate(1.6);
  --cyan: var(--pearl-cyan);
  --cyan-dim: rgba(159, 232, 255, 0.12);
  --cyan-ring: 0 0 0 3px rgba(159, 232, 255, 0.22);
  --green: var(--positive);
  --green-dim: var(--positive-dim);
  --red: var(--negative);
  --red-dim: var(--negative-dim);
  --purple: var(--pearl-violet);
  --purple-dim: rgba(199, 181, 255, 0.14);
  --yellow: var(--warning);
  --yellow-dim: var(--warning-dim);
  --text-muted: var(--text-tertiary);

  /* ---- Fonts ---- */
  --font-headline: 'Geist', system-ui, -apple-system, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, sans-serif;
  --font-data: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;

  /* ---- Spacing ---- */
  --sp-2: 2px;  --sp-4: 4px;  --sp-6: 6px;  --sp-8: 8px;
  --sp-10: 10px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px;
  --sp-24: 24px; --sp-28: 28px; --sp-32: 32px; --sp-40: 40px;
  --sp-48: 48px; --sp-56: 56px; --sp-64: 64px; --sp-80: 80px;

  /* ---- Radii — curved, luxurious ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 9999px;

  /* ---- Layout ---- */
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 76px;
  --header-height: 64px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pearl: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-std: 240ms;
  --t-slow: 480ms;
  --transition: 240ms var(--ease);

  /* ---- Z-Indices ---- */
  --z-sidebar-overlay: 99;
  --z-sidebar: 100;
  --z-header: 50;
  --z-modal: 1000;
  --z-toast: 9999;

  /* ---- Shadows & glows ---- */
  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 40px rgba(10, 6, 18, 0.45);
  --shadow-card-hover: inset 0 1px 0 rgba(255,255,255,0.08), 0 24px 64px rgba(10, 6, 18, 0.6);
  --shadow-pop: 0 24px 72px rgba(10, 6, 18, 0.7), inset 0 1px 0 rgba(255,255,255,0.08);
  --glow-pearl: 0 0 60px rgba(199, 181, 255, 0.18), 0 0 120px rgba(159, 232, 255, 0.08);
  --glow-pearl-soft: 0 0 40px rgba(199, 181, 255, 0.10);
}

/* ============================================================
   1b. LIGHT THEME OVERRIDES (data-theme="light")
   Activated by setting <html data-theme="light">. Preserves
   the pearl iridescent identity but inverts surface/text contrast.
   ============================================================ */

:root[data-theme="light"] {
  /* Surfaces — soft white with violet tint */
  --bg-deep: #f7f3ff;
  --bg-mid: #f0e9ff;
  --bg-accent: #ebe2ff;

  --surface-0: #ffffff;
  --surface-1: #faf6ff;
  --surface-2: #f0e9ff;
  --surface-3: #e6dcff;
  --surface-4: #d9ccff;

  /* Borders — darker for contrast on light */
  --border-subtle: rgba(70, 50, 130, 0.10);
  --border-default: rgba(70, 50, 130, 0.16);
  --border-strong: rgba(70, 50, 130, 0.28);
  --border-inner: rgba(70, 50, 130, 0.06);

  /* Accent stays pearl-violet but darker for AA contrast */
  --accent: #6c4cff;
  --accent-muted: rgba(108, 76, 255, 0.10);
  --accent-ring: 0 0 0 3px rgba(108, 76, 255, 0.22);

  /* Semantic — darker tones for readability on light bg */
  --positive: #1fa971;
  --positive-dim: rgba(31, 169, 113, 0.12);
  --negative: #d04562;
  --negative-dim: rgba(208, 69, 98, 0.12);
  --warning: #c98a14;
  --warning-dim: rgba(201, 138, 20, 0.14);
  --info: #1f93b8;
  --info-dim: rgba(31, 147, 184, 0.12);

  /* Text — dark on light */
  --text-primary: #1a0d2e;
  --text-secondary: #5a4d70;
  --text-tertiary: #8a7d9c;
  --text-disabled: #b8b0c8;

  /* Glass — translucent over white */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-bright: rgba(255, 255, 255, 0.88);
  --glass-bg-darker: rgba(240, 233, 255, 0.85);
  --glass-border: var(--border-subtle);
  --glass-border-hover: var(--border-default);

  --cyan: #1f93b8;
  --cyan-dim: rgba(31, 147, 184, 0.12);
  --green: var(--positive);
  --green-dim: var(--positive-dim);
  --red: var(--negative);
  --red-dim: var(--negative-dim);
  --purple: #6c4cff;
  --purple-dim: rgba(108, 76, 255, 0.10);
  --yellow: var(--warning);
  --yellow-dim: var(--warning-dim);
  --text-muted: var(--text-tertiary);

  /* Shadows — softer, lighter on light theme */
  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.6), 0 8px 24px rgba(70, 50, 130, 0.10);
  --shadow-card-hover: inset 0 1px 0 rgba(255,255,255,0.8), 0 16px 40px rgba(70, 50, 130, 0.16);
  --shadow-pop: 0 24px 60px rgba(70, 50, 130, 0.18), inset 0 1px 0 rgba(255,255,255,0.6);
  --glow-pearl: 0 0 40px rgba(108, 76, 255, 0.15), 0 0 80px rgba(159, 232, 255, 0.10);
  --glow-pearl-soft: 0 0 30px rgba(108, 76, 255, 0.08);
}

:root[data-theme="light"] html,
html[data-theme="light"] {
  color-scheme: light;
}

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

html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "cv11";
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

::selection {
  background: rgba(199, 181, 255, 0.28);
  color: #ffffff;
}

/* --------------------------------------------------
   Override Tailwind Forms plugin light defaults
   -------------------------------------------------- */
[type='text'], [type='email'], [type='url'], [type='password'],
[type='number'], [type='date'], [type='datetime-local'],
[type='month'], [type='search'], [type='tel'], [type='time'],
[type='week'], select, textarea {
  background-color: var(--surface-0) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
}

[type='text']:focus, [type='email']:focus, [type='url']:focus,
[type='password']:focus, [type='number']:focus, [type='date']:focus,
[type='datetime-local']:focus, [type='month']:focus,
[type='search']:focus, [type='tel']:focus, [type='time']:focus,
[type='week']:focus, select:focus, textarea:focus {
  border-color: rgba(199, 181, 255, 0.40) !important;
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.18), 0 0 20px rgba(199, 181, 255, 0.08) !important;
  background-color: var(--surface-2) !important;
  --tw-ring-color: transparent !important;
  --tw-ring-shadow: none !important;
}

[type='text']::placeholder, [type='number']::placeholder,
[type='search']::placeholder, [type='email']::placeholder,
[type='url']::placeholder, textarea::placeholder {
  color: var(--text-disabled) !important;
}

/* ---- Scrollbar — thin pearl ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(199, 181, 255, 0.18);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(199, 181, 255, 0.32);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 181, 255, 0.18) transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}


/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-md { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; }
.text-4xl { font-size: 36px; }

.text-gain {
  color: var(--positive);
}

.text-loss {
  color: var(--negative);
}

.text-neutral {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent);
}

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


/* ============================================================
   3. CARD COMPONENTS — Glassmorphism design system
   ============================================================ */

.glass-card {
  background: linear-gradient(180deg, rgba(28,22,40,0.72) 0%, rgba(21,16,31,0.68) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease), transform var(--t-std) var(--ease);
}

.glass-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover), var(--glow-pearl-soft);
}

.glass-card-bright {
  background: linear-gradient(180deg, rgba(37,29,52,0.80) 0%, rgba(28,22,40,0.72) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}

.glass-card-bright:hover {
  border-color: var(--border-strong);
}

.card-data {
  background: linear-gradient(180deg, rgba(28,22,40,0.60) 0%, rgba(21,16,31,0.55) 100%);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-content {
  background: linear-gradient(180deg, rgba(28,22,40,0.72) 0%, rgba(21,16,31,0.68) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-interactive {
  background: linear-gradient(180deg, rgba(28,22,40,0.55) 0%, rgba(21,16,31,0.50) 100%);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: background var(--t-std) var(--ease), border-color var(--t-std) var(--ease), transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}

.card-interactive:hover {
  background: linear-gradient(180deg, rgba(37,29,52,0.72) 0%, rgba(28,22,40,0.68) 100%);
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), var(--glow-pearl-soft);
}

/* Ambient glow for dashboard cards */
.ambient-glow {
  box-shadow: 0 0 80px rgba(199, 181, 255, 0.06), 0 0 160px rgba(159, 232, 255, 0.03);
}

.pulse-glow {
  animation: none;
}

/* Pearl gradient text-fill utility */
.pearl-text, .text-pearl {
  background: var(--gradient-pearl);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Pearl gradient border utility (double-bg trick) */
.pearl-border {
  position: relative;
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    var(--gradient-pearl) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}


/* ============================================================
   4. APP LAYOUT
   ============================================================ */

#app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar — floating glass panel ---- */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 12px;
  left: 12px;
  height: calc(100vh - 24px);
  background: linear-gradient(180deg, rgba(28,22,40,0.82) 0%, rgba(21,16,31,0.78) 100%);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 48px rgba(10,6,18,0.6);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--t-std) var(--ease), transform var(--t-std) var(--ease);
  overflow: hidden;
}

.sidebar--collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar--collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar--collapsed .sidebar-header-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar--collapsed .sidebar-footer-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar--mobile-open {
  transform: translateX(0) !important;
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-20);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  text-decoration: none;
}

.sidebar-logo-icon {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-pearl);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(199, 181, 255, 0.4));
}

.sidebar-header-title {
  font-family: var(--font-headline);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: opacity var(--transition);
  white-space: nowrap;
}

.sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-12);
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-12);
  padding: 11px var(--sp-16);
  margin: 2px 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(199, 181, 255, 0.06);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(199,181,255,0.12) 0%, rgba(159,232,255,0.06) 100%);
  color: var(--text-primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--gradient-pearl);
  box-shadow: 0 0 12px rgba(199,181,255,0.6);
}

.nav-item.active .nav-icon {
  color: var(--pearl-violet);
}

.nav-item .nav-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.nav-label {
  font-size: 14px;
  transition: opacity var(--transition), width var(--transition);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-8) var(--sp-16);
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: var(--sp-16);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-footer-text {
  font-size: 12px;
  color: var(--text-muted);
  transition: opacity var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-sidebar-overlay);
  display: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ---- Main Area ---- */
.main-area {
  margin-left: calc(var(--sidebar-width) + 24px);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left var(--t-std) var(--ease);
}

.sidebar--collapsed ~ .main-area,
.main-area--sidebar-collapsed {
  margin-left: calc(var(--sidebar-collapsed-width) + 24px);
}

/* ---- Header — glass bar ---- */
#app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-28);
  background: linear-gradient(180deg, rgba(10,6,18,0.72), rgba(10,6,18,0.55));
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  flex-shrink: 0;
}

.header-search {
  background: rgba(21, 16, 31, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 9px var(--sp-16);
  width: 280px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.header-search::placeholder {
  color: var(--text-disabled);
}

.header-search:focus {
  background: rgba(37, 29, 52, 0.92);
  border-color: rgba(199, 181, 255, 0.32);
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.14), 0 0 20px rgba(199, 181, 255, 0.08);
}

.header-search-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
}

.header-search-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-actions {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-12);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--positive);
}

.status-dot.offline {
  background: var(--negative);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-24) var(--sp-28);
  scroll-behavior: smooth;
}


/* ============================================================
   5. DASHBOARD BENTO GRID
   ============================================================ */

.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-24);
}

#hero-greeting {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-cell {
  position: relative;
  background: linear-gradient(180deg, rgba(28,22,40,0.70) 0%, rgba(21,16,31,0.66) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-24);
  min-height: auto;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}

.bento-cell:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), var(--glow-pearl-soft);
}

/* KPI cells — pearl-tinted left bar */
.cell--balance,
.cell--pnl,
.cell--pnl-today,
.cell--winrate {
  grid-column: span 3;
  overflow: hidden;
}

.cell--balance::after,
.cell--pnl::after,
.cell--pnl-today::after,
.cell--winrate::after {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.cell--balance::after  { background: var(--gradient-pearl); box-shadow: 0 0 16px rgba(199,181,255,0.5); }
.cell--pnl::after      { background: linear-gradient(180deg, var(--pearl-mint), var(--positive)); box-shadow: 0 0 16px rgba(126,236,180,0.4); }
.cell--pnl-today::after{ background: linear-gradient(180deg, var(--pearl-rose), var(--pearl-violet)); box-shadow: 0 0 16px rgba(244,199,255,0.4); }
.cell--winrate::after  { background: linear-gradient(180deg, var(--warning), #ffb347); box-shadow: 0 0 16px rgba(255,214,122,0.4); }

/* Spanning cells — asymmetric */
.cell--chart-balance {
  grid-column: span 7;
  min-height: 260px;
}

.cell--chart-donut {
  grid-column: span 5;
  min-height: 260px;
}

.cell--chart-bars {
  grid-column: span 5;
  min-height: 260px;
}

.cell--trades-info {
  grid-column: span 3;
}

.cell--fees {
  grid-column: span 4;
}

.cell--live-prices {
  grid-column: span 5;
}

.cell--feedback {
  grid-column: span 7;
}

/* KPI typography */
.kpi-label {
  font-family: var(--font-data);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-10);
}

.kpi-value {
  font-family: var(--font-data);
  font-size: 34px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  text-shadow: 0 0 40px rgba(199, 181, 255, 0.10);
}

.kpi-positive {
  color: var(--positive);
}

.kpi-negative {
  color: var(--negative);
}


/* ============================================================
   6. DASHBOARD COMPONENTS
   ============================================================ */

.dash-payoff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-12);
}

.dash-payoff-item {
  background: var(--surface-0);
  padding: var(--sp-16);
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.payoff-icon {
  font-size: 24px;
  margin-bottom: var(--sp-4);
}

.payoff-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

.payoff-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-trade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) 0;
}

.dash-trade-label {
  font-size: 12px;
  color: var(--text-muted);
}

.dash-trade-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}


/* ============================================================
   7. FORMS
   ============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-16);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-family: var(--font-data);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.form-input,
.form-select {
  background: rgba(14, 8, 24, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px var(--sp-16);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.form-input::placeholder {
  color: var(--text-disabled);
}

.form-input:focus,
.form-select:focus {
  border-color: rgba(199, 181, 255, 0.40);
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.18), 0 0 20px rgba(199, 181, 255, 0.08);
  background: rgba(28, 22, 40, 0.92);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%238b9cc7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--surface-1);
  color: var(--text-primary);
}

.form-textarea {
  background: rgba(14, 8, 24, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-12) var(--sp-16);
  color: var(--text-primary);
  font-size: 14px;
  min-height: 88px;
  resize: vertical;
  font-family: var(--font-body);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.form-textarea:focus {
  border-color: rgba(199, 181, 255, 0.40);
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.18), 0 0 20px rgba(199, 181, 255, 0.08);
  background: rgba(28, 22, 40, 0.92);
}

/* --------------------------------------------------
   Native browser widget dark overrides
   -------------------------------------------------- */
::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.6;
}

::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px rgba(10, 15, 30, 0.9) inset;
  transition: background-color 5000s ease-in-out 0s;
  border-color: var(--glass-border);
}

input, select, textarea {
  color-scheme: dark;
}

option {
  background: var(--surface-1);
  color: var(--text-primary);
}

.section-header {
  margin-bottom: var(--sp-24);
}

.section-title {
  font-family: var(--font-headline);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text-primary);
}

.trade-preview {
  background: linear-gradient(180deg, rgba(28,22,40,0.60) 0%, rgba(21,16,31,0.55) 100%);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) 0;
}

.preview-row + .preview-row {
  border-top: 1px solid var(--border-subtle);
}


/* ============================================================
   8. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: 10px var(--sp-16);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  border: 1px solid var(--border-default);
  background: rgba(28, 22, 40, 0.6);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn:hover {
  background: rgba(37, 29, 52, 0.8);
  border-color: var(--border-strong);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(199, 181, 255, 0.24), inset 0 1px 0 rgba(255,255,255,0.5);
}

.btn-primary:hover {
  background: var(--gradient-pearl);
  filter: brightness(1.08);
  box-shadow: 0 8px 32px rgba(199, 181, 255, 0.40), inset 0 1px 0 rgba(255,255,255,0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--pearl-mint), var(--positive));
  color: #0a2a1c;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(126, 236, 180, 0.22), inset 0 1px 0 rgba(255,255,255,0.4);
}

.btn-success:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-danger {
  border-color: rgba(255, 138, 155, 0.40);
  color: var(--negative);
  background: rgba(255, 138, 155, 0.08);
}

.btn-danger:hover {
  background: rgba(255, 138, 155, 0.14);
  border-color: var(--negative);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-edit:hover {
  color: var(--text-primary);
}

.btn-delete:hover {
  color: var(--red);
}


/* ============================================================
   9. TABLE STYLES
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  background: linear-gradient(180deg, rgba(28,22,40,0.60) 0%, rgba(21,16,31,0.55) 100%);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.trades-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.trades-table thead th {
  padding: 14px var(--sp-16);
  font-family: var(--font-data);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(14, 8, 24, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast) var(--ease);
}

.trades-table thead th:hover {
  color: var(--pearl-violet);
}

.sort-indicator {
  font-size: 10px;
  opacity: 0.5;
  margin-left: var(--sp-4);
  color: var(--pearl-violet);
}

.trades-table tbody td {
  padding: 14px var(--sp-16);
  border-bottom: 1px solid rgba(199, 181, 255, 0.05);
  font-size: 13px;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-primary);
  transition: background var(--t-fast) var(--ease);
}

.trades-table tbody tr:hover td {
  background: rgba(199, 181, 255, 0.04);
}

.row-gain {
  box-shadow: inset 2px 0 0 var(--positive);
}

.row-loss {
  box-shadow: inset 2px 0 0 var(--negative);
}

.totals-row td {
  background: rgba(14, 8, 24, 0.85) !important;
  font-weight: 600;
  border-top: 1px solid var(--border-default);
}

.empty-state {
  text-align: center;
  padding: var(--sp-40);
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state p {
  margin-top: var(--sp-8);
}

/* Badges — pill glass */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-compra {
  background: rgba(126, 236, 180, 0.10);
  color: var(--positive);
  border-color: rgba(126, 236, 180, 0.22);
}

.badge-venda {
  background: rgba(255, 138, 155, 0.10);
  color: var(--negative);
  border-color: rgba(255, 138, 155, 0.22);
}

.badge-aberto {
  background: rgba(255, 214, 122, 0.10);
  color: var(--warning);
  border-color: rgba(255, 214, 122, 0.22);
}

.badge-fechado {
  background: rgba(199, 181, 255, 0.08);
  color: var(--text-secondary);
  border-color: rgba(199, 181, 255, 0.14);
}

/* Actions */
.actions-cell {
  display: flex;
  gap: var(--sp-4);
}

/* Table controls & pagination */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
  align-items: center;
  margin-bottom: var(--sp-20);
}

.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: rgba(28, 22, 40, 0.5);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-data);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.page-btn:hover {
  background: rgba(199, 181, 255, 0.08);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(199, 181, 255, 0.24);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-dots {
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

#table-page-info {
  font-size: 13px;
  color: var(--text-muted);
}

#table-pagination {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}


/* ============================================================
   10. CHART STYLES
   ============================================================ */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-20);
}

.chart-card {
  background: linear-gradient(180deg, rgba(28,22,40,0.70) 0%, rgba(21,16,31,0.66) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-24);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}

.chart-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover), var(--glow-pearl-soft);
}

.chart-card.full-width {
  grid-column: span 2;
}

.chart-card h3 {
  font-family: var(--font-headline);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--sp-16);
}

.chart-wrapper {
  position: relative;
  min-height: 280px;
}

.chart-controls {
  display: flex;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
  flex-wrap: wrap;
}

.chart-period-btn {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-data);
  letter-spacing: 0.02em;
  border: 1px solid var(--border-default);
  background: rgba(28, 22, 40, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.chart-period-btn:hover {
  color: var(--text-primary);
  background: rgba(199, 181, 255, 0.08);
}

.chart-period-btn.active {
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(199, 181, 255, 0.24);
}


/* ============================================================
   11. REPORT STYLES
   ============================================================ */

.report-controls {
  display: flex;
  gap: var(--sp-12);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--sp-20);
}

.report-period-btn {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-data);
  letter-spacing: 0.02em;
  border: 1px solid var(--border-default);
  background: rgba(28, 22, 40, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.report-period-btn:hover {
  color: var(--text-primary);
  background: rgba(199, 181, 255, 0.08);
}

.report-period-btn.active {
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(199, 181, 255, 0.24);
}

.report-nav-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.report-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

#report-period-title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: var(--sp-12);
}

.report-empty {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-align: center;
  padding: var(--sp-40);
  color: var(--text-muted);
}

.report-section {
  background: linear-gradient(180deg, rgba(28,22,40,0.70) 0%, rgba(21,16,31,0.66) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-28);
  margin-bottom: var(--sp-20);
  box-shadow: var(--shadow-card);
}

.report-section h3 {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--sp-20);
}

.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-12);
}

.report-stat {
  background: var(--surface-0);
  padding: var(--sp-16);
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.report-stat-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}

.report-stat-value {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.report-financial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-12);
}

.report-financial-card {
  background: var(--surface-0);
  padding: var(--sp-16);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.financial-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}

.financial-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.financial-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

.gain-bg {
  border-left: 3px solid var(--green);
}

.loss-bg {
  border-left: 3px solid var(--red);
}

.gain-border {
  border-left: 3px solid var(--green);
}

.loss-border {
  border-left: 3px solid var(--red);
}

/* Report highlights */
.report-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-16);
}

.highlight-box {
  background: var(--surface-0);
  padding: var(--sp-20);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.highlight-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
}

.highlight-pair {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}

.highlight-pnl {
  font-size: 20px;
  font-weight: 700;
}

.highlight-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

/* Score meter */
.score-meter {
  display: flex;
  gap: var(--sp-24);
  align-items: center;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--score-pct, 0) * 1%),
    rgba(255, 255, 255, 0.06) calc(var(--score-pct, 0) * 1%)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--bg-deep);
}

.score-circle span {
  font-family: var(--font-headline);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.score-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.score-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Improvement section */
.improvement-section {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-24);
  margin-bottom: var(--sp-20);
}

.improvement-section h3 {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-16);
}

.improvement-tip {
  display: flex;
  gap: var(--sp-16);
  padding: var(--sp-16);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: var(--sp-12);
  transition: background var(--transition);
}

.improvement-tip:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tip-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tip-content {
  flex: 1;
  min-width: 0;
}

.tip-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.tip-priority {
  font-size: 10px;
  padding: 2px var(--sp-8);
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tip-priority.high {
  background: var(--red-dim);
  color: var(--red);
}

.tip-priority.medium {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.tip-priority.low {
  background: var(--green-dim);
  color: var(--green);
}

.tip-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Report recommendation */
.report-recommendation {
  background: var(--surface-0);
  padding: var(--sp-20);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.rec-positive {
  border-left: 3px solid var(--green);
}

.rec-negative {
  border-left: 3px solid var(--red);
}

.report-recommendation p {
  margin-bottom: var(--sp-8);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.report-recommendation p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------
   Report: Custom Date Range
   -------------------------------------------------- */
.report-custom-range {
  display: flex;
  gap: var(--sp-12);
  align-items: center;
  margin-bottom: var(--sp-16);
  padding: var(--sp-12) var(--sp-16);
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

/* --------------------------------------------------
   Report: Period Comparison
   -------------------------------------------------- */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-12);
}

.comparison-card {
  background: var(--surface-0);
  padding: var(--sp-16);
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comparison-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.comparison-current {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.comparison-prev {
  font-size: 12px;
  color: var(--text-muted);
}

.comparison-delta {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.delta-positive {
  color: var(--green);
}

.delta-negative {
  color: var(--red);
}

.delta-neutral {
  color: var(--text-muted);
}

/* --------------------------------------------------
   Report: Weekday Analysis
   -------------------------------------------------- */
.weekday-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-8);
  margin-top: var(--sp-16);
}

.weekday-stat {
  background: var(--surface-0);
  padding: var(--sp-12);
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition);
}

.weekday-stat.weekday-best {
  border-color: var(--green);
  border-left: 3px solid var(--green);
}

.weekday-stat.weekday-worst {
  border-color: var(--red);
  border-left: 3px solid var(--red);
}

.weekday-stat-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.weekday-stat-pnl {
  font-family: var(--font-headline);
  font-size: 14px;
  font-weight: 700;
}

.weekday-stat-trades {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.weekday-stat-winrate {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}


/* ============================================================
   12. SWAP STYLES
   ============================================================ */

.swap-container {
  max-width: 500px;
  margin: 0 auto;
}

.swap-card {
  background: linear-gradient(180deg, rgba(28,22,40,0.72) 0%, rgba(21,16,31,0.68) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--sp-32);
  box-shadow: var(--shadow-card), var(--glow-pearl-soft);
}

.swap-card h2 {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: var(--sp-24);
}

.swap-field {
  margin-bottom: var(--sp-16);
}

.swap-field label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: var(--sp-6);
}

.swap-input-row {
  display: flex;
  gap: var(--sp-12);
}

.swap-input-row input {
  flex: 1;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--sp-12) var(--sp-16);
  color: var(--text-primary);
  font-size: 14px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.swap-input-row input:focus {
  border-color: rgba(199, 181, 255, 0.40);
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.18);
}

.swap-input-row select {
  width: 140px;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--sp-12) var(--sp-16);
  color: var(--text-primary);
  font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%238b9cc7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.swap-input-row select:focus {
  border-color: rgba(199, 181, 255, 0.40);
  box-shadow: 0 0 0 3px rgba(199, 181, 255, 0.18);
}

.swap-input-row select option {
  background: var(--surface-1);
  color: var(--text-primary);
}

#swap-flip {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  transition:
    transform var(--transition),
    background var(--transition),
    color var(--transition);
}

#swap-flip:hover {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

#swap-calculate {
  width: 100%;
  margin-top: var(--sp-20);
  padding: 14px var(--sp-20);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(199, 181, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: filter var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

#swap-calculate:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#swap-rate {
  background: var(--surface-0);
  padding: var(--sp-16);
  border-radius: 12px;
  margin-top: var(--sp-16);
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.swap-rate-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.swap-rate-prices {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

#swap-price-from,
#swap-price-to {
  font-size: 12px;
  color: var(--text-muted);
}


/* ============================================================
   13. NEWS STYLES
   ============================================================ */

.news-controls {
  display: flex;
  gap: var(--sp-8);
  margin-bottom: var(--sp-20);
  flex-wrap: wrap;
  align-items: center;
}

.news-category-btn {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-data);
  letter-spacing: 0.02em;
  border: 1px solid var(--border-default);
  background: rgba(28, 22, 40, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.news-category-btn:hover {
  color: var(--text-primary);
  background: rgba(199, 181, 255, 0.08);
}

.news-category-btn.active {
  background: var(--gradient-pearl);
  color: #1a0f2e;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(199, 181, 255, 0.24);
}

#news-refresh {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: auto;
  transition: background var(--transition), color var(--transition);
}

#news-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

#news-status {
  font-size: 12px;
  color: var(--text-muted);
}

.news-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-20);
}

.news-card {
  background: linear-gradient(180deg, rgba(28,22,40,0.70) 0%, rgba(21,16,31,0.66) 100%);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
}

.news-card:hover {
  border-color: var(--border-default);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover), var(--glow-pearl-soft);
}

.news-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: rgba(10, 20, 40, 0.6);
}

.news-content {
  padding: var(--sp-20);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
}

.news-source {
  font-weight: 600;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-8);
  line-height: 1.4;
}

.news-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.news-title a:hover {
  color: var(--text-secondary);
}

.news-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-12);
}

.news-tags {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.news-tag {
  font-size: 10px;
  padding: 3px var(--sp-8);
  border-radius: 12px;
  background: var(--accent-muted);
  color: var(--text-primary);
  font-weight: 600;
}

.news-error {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-align: center;
  padding: var(--sp-40);
  color: var(--text-muted);
}

/* Skeleton loading */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

.skeleton-image {
  height: 180px;
  background: rgba(255, 255, 255, 0.04);
}

.skeleton-line {
  height: 12px;
  margin-bottom: var(--sp-8);
  border-radius: var(--sp-4);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

.skeleton-line:last-child {
  width: 60%;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* ============================================================
   14. IMPORT/EXPORT & SETTINGS
   ============================================================ */

#import-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

#import-modal.active {
  display: flex;
}

.import-modal-content {
  background: linear-gradient(180deg, rgba(37,29,52,0.88) 0%, rgba(28,22,40,0.85) 100%);
  backdrop-filter: blur(32px) saturate(1.6);
  -webkit-backdrop-filter: blur(32px) saturate(1.6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-pop), var(--glow-pearl-soft);
  max-width: 600px;
  width: 92%;
  padding: var(--sp-32);
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

#btn-close-import {
  position: absolute;
  top: var(--sp-16);
  right: var(--sp-16);
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

#btn-close-import:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.import-modal-content h2 {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-20);
}

#import-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--sp-40);
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition:
    border-color var(--transition),
    background var(--transition);
}

#import-dropzone:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

#import-dropzone.dragover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.import-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  margin: var(--sp-20) 0;
  color: var(--text-muted);
  font-size: 12px;
}

.import-divider::before,
.import-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

#import-progress-bar {
  display: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--sp-12);
}

#import-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width var(--transition);
  width: 0%;
}

#import-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

#import-preview {
  display: none;
  max-height: 200px;
  overflow-y: auto;
  margin-top: var(--sp-16);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

#import-status {
  font-size: 13px;
  margin-top: var(--sp-12);
  color: var(--text-secondary);
}

#btn-confirm-import {
  display: none;
  margin-top: var(--sp-16);
}

/* Settings */
.settings-grid {
  display: grid;
  gap: var(--sp-20);
}

.settings-card {
  background: linear-gradient(180deg, rgba(28,22,40,0.70) 0%, rgba(21,16,31,0.66) 100%);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-28);
  box-shadow: var(--shadow-card);
}

.settings-card h3 {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--sp-20);
}

#storage-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--sp-12);
}


/* ============================================================
   15. IMPORTED DATA VIEW
   ============================================================ */

#imported-data-empty {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  text-align: center;
  padding: var(--sp-40);
  color: var(--text-muted);
}

#imported-data-container {
  display: none;
}

#imported-data-container.active {
  display: block;
}

.imported-data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-16);
  flex-wrap: wrap;
  gap: var(--sp-12);
}

#imported-data-search {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--sp-8) var(--sp-16);
  color: var(--text-primary);
  font-size: 13px;
  max-width: 300px;
  width: 100%;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

#imported-data-search:focus {
  border-color: var(--border-strong);
  box-shadow: var(--accent-ring);
}

#imported-data-progress {
  display: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--sp-12);
}

#imported-data-progress .progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width var(--transition);
  width: 0%;
}

.imported-data-table-wrapper {
  overflow-x: auto;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

#imported-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#imported-data-table thead th {
  padding: var(--sp-12) var(--sp-16);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-0);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  white-space: nowrap;
}

#imported-data-table tbody td {
  padding: var(--sp-12) var(--sp-16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-primary);
}

#imported-data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

#imported-page-info {
  font-size: 13px;
  color: var(--text-muted);
}

#imported-pagination {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  margin-top: var(--sp-16);
}


/* ============================================================
   16. TOAST NOTIFICATIONS
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: var(--sp-24);
  right: var(--sp-24);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  pointer-events: none;
}

.toast {
  background: linear-gradient(180deg, rgba(37,29,52,0.92) 0%, rgba(28,22,40,0.90) 100%);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px var(--sp-20);
  display: flex;
  gap: var(--sp-10);
  align-items: center;
  transform: translateX(120%);
  transition: transform 0.3s var(--ease);
  pointer-events: all;
  max-width: 400px;
  box-shadow: var(--shadow-pop);
}

.toast-show {
  transform: translateX(0);
}

.toast-success {
  box-shadow: var(--shadow-pop), inset 3px 0 0 var(--positive);
}

.toast-error {
  box-shadow: var(--shadow-pop), inset 3px 0 0 var(--negative);
}

.toast-info {
  box-shadow: var(--shadow-pop), inset 3px 0 0 var(--pearl-violet);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-msg {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}


/* ============================================================
   17. VIEW TRANSITIONS
   ============================================================ */

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: viewFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.6s var(--ease);
}

.scroll-reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.6s var(--ease);
}

.scroll-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s var(--ease);
}

.scroll-reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}


/* ============================================================
   18. RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .bento-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .cell--balance,
  .cell--pnl,
  .cell--pnl-today,
  .cell--winrate {
    grid-column: span 3;
  }

  .cell--chart-balance {
    grid-column: span 4;
  }

  .cell--chart-donut {
    grid-column: span 2;
  }

  .cell--chart-bars {
    grid-column: span 3;
  }

  .cell--trades-info {
    grid-column: span 3;
  }

  .cell--fees {
    grid-column: span 3;
  }

  .cell--live-prices {
    grid-column: span 3;
  }

  .cell--feedback {
    grid-column: span 6;
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-financial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparison-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cell--balance,
  .cell--pnl,
  .cell--pnl-today,
  .cell--winrate {
    grid-column: span 1;
  }

  .cell--chart-balance {
    grid-column: span 2;
  }

  .cell--chart-donut,
  .cell--chart-bars {
    grid-column: span 1;
  }

  .cell--trades-info,
  .cell--fees {
    grid-column: span 1;
  }

  .cell--live-prices {
    grid-column: span 2;
  }

  .cell--feedback {
    grid-column: span 2;
  }

  /* Sidebar becomes overlay */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    border-radius: 0;
    border-right: 1px solid var(--border-default);
    border-top: none;
    border-left: none;
    border-bottom: none;
    transform: translateX(-100%);
    z-index: var(--z-sidebar);
  }

  .sidebar--mobile-open {
    transform: translateX(0);
  }

  .main-area,
  .main-area--sidebar-collapsed {
    margin-left: 0;
  }

  .header-search-toggle {
    display: flex;
  }

  .header-search {
    display: none;
  }

  .header-search.active {
    display: block;
    position: absolute;
    left: var(--sp-16);
    right: var(--sp-16);
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    z-index: 5;
  }

  .report-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card.full-width {
    grid-column: span 1;
  }

  .report-highlights {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparison-grid { grid-template-columns: repeat(2, 1fr); }
  .weekday-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .cell--balance,
  .cell--pnl,
  .cell--pnl-today,
  .cell--winrate,
  .cell--chart-balance,
  .cell--chart-donut,
  .cell--chart-bars,
  .cell--trades-info,
  .cell--fees,
  .cell--live-prices,
  .cell--feedback {
    grid-column: span 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .report-financial-grid {
    grid-template-columns: 1fr;
  }

  .report-stats-grid {
    grid-template-columns: 1fr;
  }

  .report-highlights {
    grid-template-columns: 1fr;
  }

  .swap-container {
    max-width: 100%;
  }

  .swap-card {
    padding: var(--sp-24);
  }

  .news-feed {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: var(--sp-16);
  }

  #hero-greeting {
    font-size: 13px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .score-meter {
    flex-direction: column;
    text-align: center;
  }

  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-payoff-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .import-modal-content {
    padding: var(--sp-20);
    width: 95%;
  }

  .swap-input-row {
    flex-direction: column;
  }

  .swap-input-row select {
    width: 100%;
  }

  .comparison-grid { grid-template-columns: 1fr; }
  .weekday-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .report-custom-range { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .main-content {
    padding: var(--sp-12) var(--sp-12);
  }

  #hero-greeting {
    font-size: 12px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .section-title {
    font-size: 20px;
  }

  .bento-cell {
    padding: var(--sp-16);
  }

  .report-section {
    padding: var(--sp-16);
  }

  .improvement-section {
    padding: var(--sp-16);
  }

  .settings-card {
    padding: var(--sp-16);
  }

  .dashboard-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-12);
  }

  #app-header {
    padding: 0 var(--sp-12);
  }

  .header-actions {
    gap: var(--sp-8);
  }

  .dash-payoff-grid {
    grid-template-columns: 1fr;
  }

  .news-image {
    height: 140px;
  }

  .news-content {
    padding: var(--sp-16);
  }

  #toast-container {
    left: var(--sp-12);
    right: var(--sp-12);
    bottom: var(--sp-12);
  }

  .toast {
    max-width: 100%;
  }

  .weekday-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Reduced motion */
@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;
  }

  .glass-card:hover,
  .glass-card-bright:hover,
  .bento-cell:hover,
  .news-card:hover {
    transform: none;
  }

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
  }

  .view-section.active {
    animation: none;
  }
}


/* ============================================================
   19. MISC UTILITIES
   ============================================================ */

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

/* Prevent no-hover glitches on tables inside glass cards */
.table-wrapper .glass-card:hover,
.imported-data-table-wrapper:hover {
  transform: none;
}

/* Utility: hidden */
.hidden {
  display: none !important;
}

/* Utility: visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Utility: truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Utility: no-scrollbar */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
