@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

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

:root {
  /* Light theme */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --accent-green: #2e7d32;
  --accent-green-light: #e8f5e9;
  --accent-green-mid: #4caf50;
  --accent-green-dim: rgba(46, 125, 50, 0.1);
  --accent-blue: #1976d2;
  --accent-blue-dim: rgba(25, 118, 210, 0.1);
  --accent-red: #c62828;
  --accent-red-light: #fce4e4;
  --accent-red-dim: rgba(198, 40, 40, 0.08);
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-active: #4caf50;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ══ ANIMATIONS ══ */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.anim-slide-up {
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

/* Staggered delay for cards */
.db-stats-grid > *:nth-child(1) { animation-delay: 0.1s; }
.db-stats-grid > *:nth-child(2) { animation-delay: 0.2s; }
.db-stats-grid > *:nth-child(3) { animation-delay: 0.3s; }
.db-stats-grid > *:nth-child(4) { animation-delay: 0.4s; }
.db-stats-grid > *:nth-child(5) { animation-delay: 0.5s; }
.db-stats-grid > *:nth-child(6) { animation-delay: 0.6s; }

/* â•â• TradingView Dark Theme â•â•
   Exact palette from TradingView.com
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
html.dark {
  /* Backgrounds â€” TV charcoal layers */
  --bg-primary:         #131722;   /* main page bg */
  --bg-secondary:       #1e222d;   /* panels, sidebars */
  --bg-card:            #1e222d;   /* cards */
  --bg-card-hover:      #2a2e39;   /* card hover */

  /* TV signature green (teal) */
  --accent-green:       #089981;
  --accent-green-light: rgba(8,153,129,0.12);
  --accent-green-mid:   #0ec9a9;
  --accent-green-dim:   rgba(8,153,129,0.08);

  /* TV blue */
  --accent-blue:        #2962ff;
  --accent-blue-dim:    rgba(41,98,255,0.10);

  /* TV red */
  --accent-red:         #f23645;
  --accent-red-light:   rgba(242,54,69,0.12);
  --accent-red-dim:     rgba(242,54,69,0.07);

  /* TV text */
  --text-primary:       #d1d4dc;   /* main text */
  --text-secondary:     #9598a1;   /* labels */
  --text-muted:         #50535e;   /* subtle hints */

  /* TV borders */
  --border:             #2a2e39;
  --border-active:      #089981;

  /* Shadows */
  --shadow-sm:          0 1px 4px rgba(0,0,0,0.5);
  --shadow-md:          0 4px 20px rgba(0,0,0,0.55);
}

html.dark body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html.dark ::-webkit-scrollbar-track { background: #131722; }
html.dark ::-webkit-scrollbar-thumb { background: #2a2e39; border-radius: 3px; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #363a45; }



html, body, #root {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

button {
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

input {
  font-family: 'Inter', sans-serif;
}
/* â”€â”€ Root â”€â”€ */
.db-root { min-height: 100vh; background: var(--bg-primary); display: flex; flex-direction: column; }

/* â•â• NAVBAR â•â• */
/* ══ NAVBAR ══ */
.db-nav {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.4);
  padding: 0 40px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
html.dark .db-nav {
  background: rgba(19, 23, 34, 0.8) !important;
  border-bottom-color: rgba(42, 46, 57, 0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.db-nav-left  { display: flex; align-items: center; gap: 24px; }
.db-nav-right { display: flex; align-items: center; gap: 10px; position: relative; }

.db-brand      { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.db-brand-logo {
  width: 34px; height: 34px;
  background: var(--accent-green-dim);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(46,125,50,0.2);
}
.db-brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.db-nav-tabs { display: flex; gap: 2px; }
.db-tab {
  background: none; border: none;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-radius: 8px; transition: all 0.2s;
}
.db-tab:hover  { background: #f3f4f6; color: var(--text-primary); }
.db-tab.active { background: var(--accent-green-light); color: var(--accent-green); font-weight: 600; }

.db-dark-toggle {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; cursor: pointer; flex-shrink: 0;
}
.db-dark-toggle:hover { border-color: var(--accent-green); background: var(--accent-green-light); }

.db-live-pill {
  display: flex; align-items: center; gap: 6px;
  background: #f0fdf4; border: 1px solid #c8e6c9;
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 600; color: #2e7d32;
}
.db-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #43a047;
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(67,160,71,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(67,160,71,0); }
  100% { box-shadow: 0 0 0 0 rgba(67,160,71,0); }
}

.db-avatar-wrap {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: #f9fafb;
  transition: all 0.2s; user-select: none;
}
.db-avatar-wrap:hover { background: #f3f4f6; border-color: #9ca3af; }
.db-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.db-avatar.lg { width: 40px; height: 40px; font-size: 17px; }
.db-user-info  { display: flex; flex-direction: column; }
.db-user-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.db-user-email { font-size: 11px; color: var(--text-muted); }
.db-chevron    { font-size: 9px; color: var(--text-muted); }

.db-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; min-width: 220px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden; animation: fadeSlide 0.15s ease; z-index: 200;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.db-dropdown-user  { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #f9fafb; }
.db-dropdown-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.db-dropdown-email { font-size: 11px; color: var(--text-muted); word-break: break-all; }
.db-dropdown-hr    { border: none; border-top: 1px solid var(--border); margin: 0; }
.db-dropdown-item  {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
  text-align: left; transition: background 0.15s;
}
.db-dropdown-item:hover  { background: #f3f4f6; color: var(--text-primary); }
.db-dropdown-item.logout { color: #b71c1c; }
.db-dropdown-item.logout:hover { background: #fff5f5; }

/* â•â• MAIN â•â• */
/* ══ MAIN ══ */
.db-main {
  flex: 1; padding: 40px 32px 60px;
  display: flex; flex-direction: column; gap: 32px;
  max-width: 1440px; width: 100%; margin: 0 auto; box-sizing: border-box;
}

.db-page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.db-page-title  { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; }
.db-page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.db-header-actions { display: flex; align-items: center; gap: 10px; }

.db-export-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  transition: all 0.2s; white-space: nowrap;
}
.db-export-btn:hover { background: var(--accent-green-light); border-color: var(--accent-green-mid); color: var(--accent-green); }

.db-month-badge {
  background: var(--accent-green-light); border: 1px solid rgba(46,125,50,0.25);
  color: #2e7d32; font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700; padding: 8px 18px;
  border-radius: 20px; letter-spacing: -0.02em;
}
.db-month-badge.red { background: #fce4e4; border-color: rgba(198,40,40,0.25); color: #b71c1c; }

/* â•â• STAT CARDS â•â• */
/* ══ STAT CARDS ══ */
.db-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.stat-card:hover { 
  transform: translateY(-4px); 
  box-shadow: var(--shadow-md); 
  border-color: var(--accent-green);
}
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.stat-circle-wrap { display: flex; align-items: center; justify-content: space-between; }
.stat-value { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.stat-value.green { color: #2e7d32; }
.stat-value.blue  { color: #1976d2; }
.stat-value.red   { color: #b71c1c; }

/* â•â• BEST / WORST DAY â•â• */
.db-bw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-bw-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
}
.db-bw-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.db-bw-card.best  { border-left: 4px solid #43a047; }
.db-bw-card.worst { border-left: 4px solid #e53935; }
.db-bw-icon  { font-size: 24px; flex-shrink: 0; }
.db-bw-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.db-bw-day   { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.db-bw-pnl   { margin-left: auto; font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; flex-shrink: 0; }
.db-bw-pnl.green { color: #2e7d32; }
.db-bw-pnl.red   { color: #b71c1c; }

/* â•â• TAG PILLS â•â• */
.tag-pill, .cell-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 10px; text-transform: uppercase;
}
.tag-scalp,   .cell-tag-scalp   { background: #e3f2fd; color: #1565c0; }
.tag-swing,   .cell-tag-swing   { background: #e8f5e9; color: #1b5e20; }
.tag-options, .cell-tag-options { background: #f3e5f5; color: #6a1b9a; }
.tag-news,    .cell-tag-news    { background: #fff8e1; color: #e65100; }
.tag-futures, .cell-tag-futures { background: #fce4e4; color: #b71c1c; }

/* â•â• LOWER SECTION â•â• */
.db-lower       { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.db-calendar-col { display: flex; flex-direction: column; gap: 16px; }
.db-chart-col   { display: flex; flex-direction: column; gap: 16px; }

/* â•â• MONTHLY SUMMARY â•â• */
.db-summary-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.db-summary-title { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.db-summary-rows  { display: flex; flex-direction: column; gap: 10px; }
.db-summary-row   { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-secondary); }
.db-summary-row.bold  { font-weight: 700; color: var(--text-primary); font-size: 14px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 2px; }
.db-summary-row .green { color: #2e7d32; font-weight: 600; }
.db-summary-row .red   { color: #b71c1c; font-weight: 600; }
.db-summary-row .blue  { color: #1976d2; font-weight: 600; }

/* â•â• FOOTER â•â• */
.db-footer     { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding-top: 8px; border-top: 1px solid var(--border); }
.db-footer-dot { width: 7px; height: 7px; border-radius: 50%; background: #43a047; flex-shrink: 0; }

/* â•â• TICKER SECTION â•â• */
.db-ticker-section { margin-bottom: 24px; animation: fadeIn 0.8s ease; }

/* â•â• JOURNAL TABLE â•â• */
.db-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.db-table th {
  background: #f9fafb;
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.db-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover td { background: #f9fafb; }

.td-date { font-weight: 600; }
.td-pnl { font-family: 'Outfit', sans-serif; font-weight: 700; }
.td-pnl.green { color: #2e7d32; }
.td-pnl.red { color: #b71c1c; }
.td-notes {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

/* TV DARK - TABLE */
html.dark .db-table th { background: #1e222d; border-bottom-color: #2a2e39; color: #50535e; }
html.dark .db-table td { border-bottom-color: #2a2e39; color: #d1d4dc; }
html.dark .db-table tr:hover td { background: #1a1e2a; }
html.dark .td-pnl.green { color: #089981; }
html.dark .td-pnl.red { color: #f23645; }

/* â•â• HAMBURGER â•â• */
.db-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; padding: 6px; cursor: pointer;
  border-radius: 6px; transition: background 0.2s; flex-shrink: 0;
}
.db-hamburger:hover { background: #f3f4f6; }
.ham-line { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: all 0.25s ease; transform-origin: center; }
.ham-line.open:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ham-line.open:nth-child(2) { opacity: 0; transform: scaleX(0); }
.ham-line.open:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* â•â• MOBILE DRAWER â•â• */
.db-mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.db-mobile-drawer {
  position: fixed; top: 60px; left: 0; width: 75%; max-width: 280px;
  height: calc(100vh - 60px); background: var(--bg-secondary);
  border-right: 1px solid var(--border); z-index: 300;
  display: flex; flex-direction: column; padding: 16px 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  animation: slideInLeft 0.25s ease; overflow-y: auto;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.db-mobile-user { display: flex; align-items: center; gap: 10px; padding: 8px 18px 14px; }
.db-mobile-tab {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 13px 20px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  text-align: left; transition: background 0.15s;
}
.db-mobile-tab:hover  { background: var(--bg-card-hover); }
.db-mobile-tab.active { background: var(--accent-green-light); color: var(--accent-green); font-weight: 600; }

/* â•â• TRADINGVIEW DARK OVERRIDES â•â• */
html.dark .db-nav {
  background: #1e222d;
  border-bottom-color: #2a2e39;
  box-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
html.dark .db-brand-logo     { background: rgba(8,153,129,0.08); border-color: rgba(8,153,129,0.18); }
html.dark .db-brand-name     { color: #d1d4dc; }
html.dark .db-tab            { color: #9598a1; }
html.dark .db-tab:hover      { background: #2a2e39; color: #d1d4dc; }
html.dark .db-tab.active     { background: rgba(8,153,129,0.12); color: #089981; }
html.dark .db-dark-toggle    { background: #2a2e39; border-color: #363a45; color: #d1d4dc; }
html.dark .db-dark-toggle:hover { background: rgba(8,153,129,0.12); border-color: #089981; color: #089981; }
html.dark .db-live-pill      { background: rgba(8,153,129,0.10); border-color: rgba(8,153,129,0.25); color: #089981; }
html.dark .db-live-dot       { background: #089981; }
html.dark .db-avatar-wrap    { background: #2a2e39; border-color: #363a45; }
html.dark .db-avatar-wrap:hover { background: #363a45; border-color: #50535e; }
html.dark .db-user-name      { color: #d1d4dc; }
html.dark .db-user-email     { color: #9598a1; }
html.dark .db-chevron        { color: #9598a1; }

/* Dropdown */
html.dark .db-dropdown        { background: #1e222d; border-color: #2a2e39; box-shadow: 0 8px 32px rgba(0,0,0,0.65); }
html.dark .db-dropdown-user   { background: #2a2e39; }
html.dark .db-dropdown-name   { color: #d1d4dc; }
html.dark .db-dropdown-email  { color: #9598a1; }
html.dark .db-dropdown-hr     { border-top-color: #2a2e39; }
html.dark .db-dropdown-item   { color: #9598a1; }
html.dark .db-dropdown-item:hover  { background: #2a2e39; color: #d1d4dc; }
html.dark .db-dropdown-item.logout { color: #f23645; }
html.dark .db-dropdown-item.logout:hover { background: rgba(242,54,69,0.08); }

/* Mobile drawer */
html.dark .db-mobile-overlay   { background: rgba(0,0,0,0.7); }
html.dark .db-mobile-drawer    { background: #1e222d; border-right-color: #2a2e39; box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
html.dark .db-mobile-tab       { color: #9598a1; }
html.dark .db-mobile-tab:hover { background: #2a2e39; color: #d1d4dc; }
html.dark .db-mobile-tab.active { background: rgba(8,153,129,0.12); color: #089981; }

/* Page header */
html.dark .db-page-title       { color: #d1d4dc; }
html.dark .db-page-subtitle    { color: #50535e; }
html.dark .db-month-badge      { background: rgba(8,153,129,0.12); border-color: rgba(8,153,129,0.25); color: #089981; }
html.dark .db-month-badge.red  { background: rgba(242,54,69,0.12); border-color: rgba(242,54,69,0.25); color: #f23645; }

/* Stat cards */
html.dark .stat-card           { background: #1e222d; border-color: #2a2e39; }
html.dark .stat-label          { color: #50535e; }
html.dark .stat-value.green    { color: #089981; }
html.dark .stat-value.blue     { color: #2962ff; }
html.dark .stat-value.red      { color: #f23645; }
html.dark circle[stroke="#e5e7eb"] { stroke: #2a2e39; }

/* Best / Worst */
html.dark .db-bw-card          { background: #1e222d; border-color: #2a2e39; }
html.dark .db-bw-card.best     { border-left-color: #089981; }
html.dark .db-bw-card.worst    { border-left-color: #f23645; }
html.dark .db-bw-label         { color: #50535e; }
html.dark .db-bw-day           { color: #d1d4dc; }
html.dark .db-bw-pnl.green     { color: #089981; }
html.dark .db-bw-pnl.red       { color: #f23645; }

/* Monthly summary */
html.dark .db-summary-card     { background: #1e222d; border-color: #2a2e39; }
html.dark .db-summary-title    { color: #d1d4dc; border-bottom-color: #2a2e39; }
html.dark .db-summary-row      { color: #9598a1; }
html.dark .db-summary-row.bold { color: #d1d4dc; border-top-color: #2a2e39; }
html.dark .db-summary-row .green { color: #089981; }
html.dark .db-summary-row .red   { color: #f23645; }
html.dark .db-summary-row .blue  { color: #2962ff; }

/* Footer */
html.dark .db-footer           { border-top-color: #2a2e39; color: #50535e; }
html.dark .db-footer-dot       { background: #089981; }

/* Tag pills (TV-style) */
html.dark .tag-scalp,   html.dark .cell-tag-scalp   { background: rgba(41,98,255,0.12);  color: #2962ff; }
html.dark .tag-swing,   html.dark .cell-tag-swing   { background: rgba(8,153,129,0.12);  color: #089981; }
html.dark .tag-options, html.dark .cell-tag-options { background: rgba(178,96,240,0.12); color: #b260f0; }
html.dark .tag-news,    html.dark .cell-tag-news    { background: rgba(255,167,38,0.12); color: #ffa726; }
html.dark .tag-futures, html.dark .cell-tag-futures { background: rgba(242,54,69,0.12);  color: #f23645; }


/* â•â• RESPONSIVE â•â• */
/* ══ RESPONSIVE ══ */
@media (max-width: 1280px) {
  .db-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .db-lower      { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .db-nav-tabs  { display: none; }
  .db-hamburger { display: flex; }
  .db-lower     { grid-template-columns: 1fr; }
  .db-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .db-main      { padding: 24px 20px 48px; gap: 24px; }
  .db-chart-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 768px) {
  .db-nav        { padding: 0 16px; height: 60px; }
  .db-stats-grid { grid-template-columns: 1fr; }
  .db-user-info  { display: none; }
  .db-page-title { font-size: 22px; }
  .db-main       { padding: 16px 16px 40px; gap: 20px; }
  .db-mobile-drawer { top: 60px; height: calc(100vh - 60px); }
  .db-bw-row     { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .db-stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card      { padding: 12px; }
  .stat-value     { font-size: 16px; }
  .stat-label     { font-size: 9px; }
  .stat-circle-wrap svg { display: none; }
  .db-page-title  { font-size: 18px; }
  .db-page-subtitle { font-size: 12px; }
  .db-month-badge { font-size: 13px; padding: 6px 12px; }
  .db-main        { padding: 12px 12px 28px; gap: 12px; }
  .db-bw-pnl      { font-size: 15px; }
  .db-export-btn  { font-size: 11px; padding: 6px 10px; }
}
@media (max-width: 380px) {
  .db-brand-name { display: none; }
  .db-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-card     { padding: 10px; }
  .db-main       { padding: 10px 10px 24px; gap: 10px; }
}
.forex-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* â”€â”€ Header â”€â”€ */
.forex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.forex-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pulsing live dot */
.forex-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43a047;
  box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.6);
  animation: livePulse 2s infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.6);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(67, 160, 71, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(67, 160, 71, 0);
  }
}

.forex-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.forex-source {
  font-size: 10px;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
}

.forex-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forex-time {
  font-size: 11px;
  color: var(--text-muted);
}

.forex-refresh-btn {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 15px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}

.forex-refresh-btn:hover {
  background: var(--accent-green-light);
  border-color: #c8e6c9;
  color: #2e7d32;
}

.forex-refresh-btn.spinning {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.forex-interval {
  font-size: 10px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}

/* â”€â”€ Error â”€â”€ */
.forex-error {
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #b71c1c;
}

/* â”€â”€ Rates Grid â”€â”€ */
.forex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* â”€â”€ Rate Card â”€â”€ */
.forex-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #f9fafb;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: default;
}

.forex-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.forex-card.up {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.forex-card.down {
  background: #fff5f5;
  border-color: #fecaca;
}

.forex-pair {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.forex-rate {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}

.forex-change {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  flex-wrap: wrap;
}

.forex-change.green {
  color: #2e7d32;
}

.forex-change.red {
  color: #b71c1c;
}

.forex-change.flat {
  color: var(--text-muted);
}

.change-arrow {
  font-size: 9px;
}

.change-pct {
  color: inherit;
  opacity: 0.7;
  font-size: 9px;
}

/* â”€â”€ Skeleton â”€â”€ */
.forex-skeleton {
  pointer-events: none;
}

.skel {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skel-label {
  height: 10px;
  width: 60%;
  margin-bottom: 8px;
}

.skel-rate {
  height: 22px;
  width: 80%;
  margin-bottom: 6px;
}

.skel-change {
  height: 10px;
  width: 70%;
}

/* â”€â”€ Footer â”€â”€ */
.forex-footer {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid #f3f4f6;
}

.forex-footer a {
  color: #1976d2;
  text-decoration: none;
}

.forex-footer a:hover {
  text-decoration: underline;
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 1280px) {
  .forex-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

  .forex-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

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

  .forex-rate {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .forex-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .forex-panel {
    padding: 14px 16px;
  }

  .forex-card {
    padding: 10px 12px;
  }

  .forex-rate {
    font-size: 14px;
  }

  .forex-meta {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* â•â• TV DARK â€” FOREX â•â• */
html.dark .forex-panel       { background: #1e222d; border-color: #2a2e39; }
html.dark .forex-title       { color: #d1d4dc; }
html.dark .forex-source      { background: rgba(8,153,129,0.10); border-color: rgba(8,153,129,0.22); color: #089981; }
html.dark .forex-time        { color: #50535e; }
html.dark .forex-interval    { background: #2a2e39; color: #50535e; }
html.dark .forex-refresh-btn { background: #2a2e39; border-color: #363a45; color: #9598a1; }
html.dark .forex-refresh-btn:hover { background: rgba(8,153,129,0.12); border-color: #089981; color: #089981; }
html.dark .forex-card        { background: #2a2e39; border-color: #363a45; }
html.dark .forex-card.up     { background: rgba(8,153,129,0.07); border-color: rgba(8,153,129,0.20); }
html.dark .forex-card.down   { background: rgba(242,54,69,0.07); border-color: rgba(242,54,69,0.20); }
html.dark .forex-pair        { color: #50535e; }
html.dark .forex-rate        { color: #d1d4dc; }
html.dark .forex-change.green { color: #089981; }
html.dark .forex-change.red   { color: #f23645; }
html.dark .forex-change.flat  { color: #50535e; }
html.dark .forex-error       { background: rgba(242,54,69,0.08); border-color: rgba(242,54,69,0.2); color: #f23645; }
html.dark .forex-footer      { border-top-color: #2a2e39; color: #50535e; }
html.dark .forex-footer a    { color: #2962ff; }
html.dark .skel { background: linear-gradient(90deg, #2a2e39 25%, #363a45 50%, #2a2e39 75%); background-size: 200% 100%; }
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* â”€â”€ Root â”€â”€ */
.lp-root {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0fdf4 0%, #f5f7fa 50%, #e8f5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

/* Decorative background circles */
.lp-bg-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.lp-bg-circle.top {
  width: 500px;
  height: 500px;
  top: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(76,175,80,0.08) 0%, transparent 70%);
}

.lp-bg-circle.bottom {
  width: 400px;
  height: 400px;
  bottom: -150px;
  left: -120px;
  background: radial-gradient(circle, rgba(25,118,210,0.06) 0%, transparent 70%);
}

/* â”€â”€ Card â”€â”€ */
.lp-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 40px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
  z-index: 1;
}

/* â”€â”€ Brand â”€â”€ */
.lp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.lp-brand-logo {
  width: 42px;
  height: 42px;
  background: #e8f5e9;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(46,125,50,0.2);
}

.lp-brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

/* â”€â”€ Header â”€â”€ */
.lp-header {
  margin-bottom: 20px;
}

.lp-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.lp-sub {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* â”€â”€ Stats teaser row â”€â”€ */
.lp-stats-row {
  display: flex;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 28px;
  gap: 0;
}

.lp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.lp-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: -0.02em;
}

.lp-stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4b7c4e;
  font-weight: 600;
}

.lp-stat-div {
  width: 1px;
  height: 28px;
  background: rgba(46,125,50,0.2);
}

/* â”€â”€ Form â”€â”€ */
.lp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lp-forgot {
  font-size: 12px;
  color: #43a047;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}
.lp-forgot:hover { opacity: 0.7; }

.lp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lp-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.lp-input {
  width: 100%;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  color: #111827;
  border-radius: 10px;
  padding: 12px 14px 12px 42px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.lp-input::placeholder { color: #9ca3af; }

.lp-input:focus {
  background: #fff;
  border-color: #43a047;
  box-shadow: 0 0 0 3px rgba(67,160,71,0.12);
}

.lp-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 6px;
  cursor: pointer;
  transition: color 0.2s;
}
.lp-pw-toggle:hover { color: #374151; }

/* Options */
.lp-options {
  display: flex;
  align-items: center;
}

.lp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
}

.lp-check input { accent-color: #43a047; width: 14px; height: 14px; }

/* Error */
.lp-error {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Submit button */
.lp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: 10px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 18px rgba(46,125,50,0.3);
  margin-top: 4px;
}

.lp-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(46,125,50,0.4);
}

.lp-btn:active:not(:disabled) { transform: translateY(0); }
.lp-btn.loading { opacity: 0.8; cursor: not-allowed; }

.lp-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.lp-divider {
  position: relative;
  text-align: center;
}

.lp-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: #e5e7eb;
}

.lp-divider span {
  position: relative;
  background: #fff;
  padding: 0 12px;
  font-size: 12px;
  color: #9ca3af;
}

/* Social buttons */
.lp-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lp-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.lp-social-btn:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  transform: translateY(-1px);
}

/* Signup */
.lp-signup {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.lp-signup a {
  color: #43a047;
  text-decoration: none;
  font-weight: 600;
}

.lp-signup a:hover { text-decoration: underline; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 520px) {
  .lp-card    { padding: 32px 24px; border-radius: 16px; }
  .lp-title   { font-size: 22px; }
}

@media (max-width: 400px) {
  .lp-card         { padding: 28px 18px; }
  .lp-title        { font-size: 20px; }
  .lp-stats-row    { padding: 10px 10px; gap: 0; }
  .lp-stat-val     { font-size: 13px; }
  .lp-stat-lbl     { font-size: 8px; }
  .lp-social       { grid-template-columns: 1fr; }
  .lp-btn          { font-size: 14px; padding: 13px; }
}
.pnl-chart-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.pnl-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pnl-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.pnl-chart-val {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pnl-chart-val.green { color: #2e7d32; }
.pnl-chart-val.red   { color: #b71c1c; }

.pnl-svg {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}

.pnl-chart-empty {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* dark mode */
:root.dark .pnl-chart-wrap {
  background: #1e2536;
  border-color: #2a3347;
}

/* â•â• TV DARK â€” PNL CHART â•â• */
html.dark .pnl-chart-wrap   { background: #1e222d; border-color: #2a2e39; }
html.dark .pnl-chart-title  { color: #d1d4dc; }
html.dark .pnl-chart-val.green { color: #089981; }
html.dark .pnl-chart-val.red   { color: #f23645; }
html.dark .pnl-chart-empty  { color: #50535e; }

/* â”€â”€ Calendar Container â”€â”€ */
.calendar-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 4px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-month-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-nav-btn {
  background: #f3f4f6;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  border-color: var(--accent-green-mid);
  color: var(--accent-green);
  background: var(--accent-green-light);
}

.cal-meta {
  font-size: 12px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* â”€â”€ Grid â”€â”€ */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 580px;
}

.cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 90px;
  gap: 3px;
}

.header-row {
  margin-bottom: 2px;
}

.cal-header-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

.cal-week-col-header {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

/* â”€â”€ Day Cells â”€â”€ */
.cal-cell {
  min-height: 64px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 5px 6px;
  position: relative;
  background: #f9fafb;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.cal-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border-color: #9ca3af;
}

.cal-cell:hover .cell-add-hint {
  opacity: 1;
}

/* Empty grid slots (before month starts / after month ends) */
.cal-cell-empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

/* Success flash after saving */
.cell-flash {
  animation: flashCell 1.2s ease;
}

@keyframes flashCell {
  0%   { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  40%  { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* Green profitable day */
.cell-green {
  background: #e8f5e9;
  border-color: #c8e6c9;
}

/* Red losing day */
.cell-red {
  background: #fce4e4;
  border-color: #ffcdd2;
}

.cell-today {
  border: 2px solid var(--accent-blue);
  background: #e3f2fd;
}

.cell-date {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.cell-add-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #d1d5db;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-weight: 300;
}

.cell-data {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cell-pnl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cell-pnl.green { color: #1b5e20; }
.cell-pnl.red   { color: #b71c1c; }

.cell-trades {
  font-size: 9px;
  color: var(--text-muted);
}

.cell-win {
  font-size: 9px;
  font-weight: 600;
}

.cell-win.green { color: #388e3c; }
.cell-win.red   { color: #c62828; }

.cell-note-icon {
  font-size: 9px;
  line-height: 1;
  display: block;
  margin-top: 1px;
}

/* â”€â”€ Week Summary â”€â”€ */
.cal-week-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-summary {
  background: var(--accent-green-light);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.week-summary.week-loss {
  background: #fce4e4;
  border-color: #ffcdd2;
}

.week-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4b7c4e;
}

.week-summary.week-loss .week-label {
  color: #c62828;
}

.week-pnl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #1b5e20;
  letter-spacing: -0.02em;
}

.week-pnl.red { color: #b71c1c; }

.week-days-label {
  display: block;
  font-size: 9px;
  color: #4b7c4e;
}

.week-summary.week-loss .week-days-label {
  color: #c62828;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MODAL
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

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

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #f3f4f6;
  background: linear-gradient(135deg, #f0fdf4, #fff);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.modal-close {
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #fce4e4;
  color: #b71c1c;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input {
  width: 100%;
  background: #f9fafb;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
  background: #fff;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

.modal-hint {
  font-size: 11px;
  color: #9ca3af;
}

/* Two-column row inside modal */
.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Notes textarea */
.modal-textarea {
  width: 100%;
  background: #f9fafb;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-textarea:focus {
  background: #fff;
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

.modal-textarea::placeholder {
  color: #9ca3af;
}

.modal-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: #b71c1c;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 22px 20px;
  border-top: 1px solid #f3f4f6;
  align-items: center;
}

.modal-btn-delete {
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  margin-right: auto;
}

.modal-btn-delete:hover {
  background: #fce4e4;
  border-color: #ef9a9a;
}

.modal-btn-cancel {
  background: #f3f4f6;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.modal-btn-cancel:hover {
  background: #e5e7eb;
}

.modal-btn-save {
  background: linear-gradient(135deg, #43a047, #2e7d32);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(46,125,50,0.25);
}

.modal-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(46,125,50,0.35);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CALENDAR RESPONSIVE
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Tablet â€” tighter cells */
@media (max-width: 1024px) {
  .calendar-wrap { padding: 12px; }
  .cal-cell      { min-height: 56px; padding: 4px 5px; }
  .cell-pnl      { font-size: 9px; }
  .cell-trades   { display: none; }
}

/* Mobile â€” horizontal scroll is OK, shrink cells */
@media (max-width: 640px) {
  .calendar-wrap { padding: 10px 8px; }
  .calendar-grid { min-width: 440px; }
  .cal-row       { grid-template-columns: repeat(7, 1fr) 70px; }
  .cal-cell      { min-height: 48px; padding: 3px 4px; }
  .cell-date     { font-size: 10px; }
  .cell-pnl      { font-size: 8px; }
  .cell-win      { display: none; }
  .week-pnl      { font-size: 10px; }
  .week-summary  { padding: 4px 6px; }
}

/* Modal â€” full screen on mobile */
@media (max-width: 480px) {
  .modal-overlay {
    align-items: flex-end;
  }
  .modal-box {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    animation: slideUpMobile 0.25s ease;
  }
  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .modal-row {
    grid-template-columns: 1fr;
  }
  .modal-footer {
    flex-wrap: wrap;
  }
  .modal-btn-save,
  .modal-btn-cancel {
    flex: 1;
  }
}

/* â•â• TV DARK â€” CALENDAR â•â• */
html.dark .calendar-wrap    { background: #1e222d; border-color: #2a2e39; }
html.dark .cal-month-label  { color: #d1d4dc; }
html.dark .cal-nav-btn      { background: #2a2e39; border-color: #363a45; color: #9598a1; }
html.dark .cal-nav-btn:hover { background: rgba(8,153,129,0.10); border-color: #089981; color: #089981; }
html.dark .cal-meta         { background: #2a2e39; border-color: #363a45; color: #9598a1; }
html.dark .cal-header-cell,
html.dark .cal-week-col-header { color: #50535e; }

/* Day cells */
html.dark .cal-cell         { background: #2a2e39; border-color: #363a45; }
html.dark .cal-cell:hover   { border-color: #50535e; box-shadow: 0 3px 12px rgba(0,0,0,0.4); }
html.dark .cell-date        { color: #9598a1; }
html.dark .cell-green       { background: rgba(8,153,129,0.08); border-color: rgba(8,153,129,0.22); }
html.dark .cell-red         { background: rgba(242,54,69,0.08); border-color: rgba(242,54,69,0.22); }
html.dark .cell-today       { border-color: #089981; background: rgba(8,153,129,0.08); }
html.dark .cell-pnl.green   { color: #089981; }
html.dark .cell-pnl.red     { color: #f23645; }
html.dark .cell-win.green   { color: #089981; }
html.dark .cell-win.red     { color: #f23645; }
html.dark .cell-trades      { color: #50535e; }
html.dark .cell-add-hint    { color: #2a2e39; }

/* Week summary */
html.dark .week-summary      { background: rgba(8,153,129,0.08); border-color: rgba(8,153,129,0.2); }
html.dark .week-summary.week-loss { background: rgba(242,54,69,0.08); border-color: rgba(242,54,69,0.2); }
html.dark .week-label        { color: #089981; }
html.dark .week-summary.week-loss .week-label { color: #f23645; }
html.dark .week-pnl          { color: #089981; }
html.dark .week-pnl.red      { color: #f23645; }
html.dark .week-days-label   { color: #089981; }
html.dark .week-summary.week-loss .week-days-label { color: #f23645; }

/* Modal */
html.dark .modal-overlay     { background: rgba(0,0,0,0.72); }
html.dark .modal-box         { background: #1e222d; box-shadow: 0 24px 64px rgba(0,0,0,0.7); }
html.dark .modal-header      { background: linear-gradient(135deg, rgba(8,153,129,0.05), transparent); border-bottom-color: #2a2e39; }
html.dark .modal-title       { color: #d1d4dc; }
html.dark .modal-subtitle    { color: #9598a1; }
html.dark .modal-close       { background: #2a2e39; color: #9598a1; }
html.dark .modal-close:hover { background: rgba(242,54,69,0.12); color: #f23645; }
html.dark .modal-label       { color: #9598a1; }
html.dark .modal-input,
html.dark .modal-textarea    { background: #2a2e39; border-color: #363a45; color: #d1d4dc; }
html.dark .modal-input:focus,
html.dark .modal-textarea:focus { background: #1e222d; border-color: #089981; box-shadow: 0 0 0 3px rgba(8,153,129,0.12); }
html.dark .modal-hint        { color: #50535e; }
html.dark .modal-footer      { border-top-color: #2a2e39; }
html.dark .modal-btn-cancel  { background: #2a2e39; border-color: #363a45; color: #9598a1; }
html.dark .modal-btn-cancel:hover { background: #363a45; }
html.dark .modal-btn-delete  { background: rgba(242,54,69,0.08); border-color: rgba(242,54,69,0.2); color: #f23645; }
html.dark .modal-btn-delete:hover { background: rgba(242,54,69,0.16); }
html.dark .modal-error       { background: rgba(242,54,69,0.08); border-color: rgba(242,54,69,0.2); color: #f23645; }
.weekly-chart {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.wc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.wc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.wc-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.wc-bars {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  height: 80px;
}

.wc-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.wc-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #e5e7eb;
  min-height: 60px;
}

.wc-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 4px;
}

.wc-bar.gain {
  background: linear-gradient(180deg, #66bb6a, #43a047);
}

.wc-bar.loss {
  background: linear-gradient(180deg, #ef9a9a, #e53935);
  border-radius: 0 0 4px 4px;
  align-self: flex-start;
}

.wc-bar-val {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wc-bar-val.green { color: #2e7d32; }
.wc-bar-val.red   { color: #b71c1c; }

.wc-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.wc-bar-col:hover .wc-bar {
  filter: brightness(1.1);
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 768px) {
  .wc-bars    { height: 70px; gap: 8px; }
  .wc-bar-val { font-size: 9px; }
}

@media (max-width: 480px) {
  .weekly-chart { padding: 12px 14px; }
  .wc-bars      { height: 60px; gap: 6px; }
  .wc-bar-label { font-size: 9px; }
  .wc-bar-val   { display: none; }
  .wc-title     { font-size: 12px; }
  .wc-subtitle  { display: none; }
}

/* â•â• TV DARK â€” WEEKLY CHART â•â• */
html.dark .weekly-chart     { background: #1e222d; border-color: #2a2e39; }
html.dark .wc-title         { color: #d1d4dc; }
html.dark .wc-subtitle      { color: #50535e; }
html.dark .wc-bar-label     { color: #50535e; }
html.dark .wc-bar-val.green { color: #089981; }
html.dark .wc-bar-val.red   { color: #f23645; }
html.dark .wc-bar.green     { background: linear-gradient(to top, #064e3b, #089981); }
html.dark .wc-bar.red       { background: linear-gradient(to top, #7f1d1d, #f23645); }
html.dark .wc-tooltip       { background: #131722; border-color: #2a2e39; color: #d1d4dc; }