/* ============================================================
   Trader Cabinet — Dark Premium Design System
   ============================================================ */

:root {
  color-scheme: dark;

  /* ── Backgrounds ── */
  --bg:    #0a0e1a;
  --bg2:   #0e1420;
  --bg3:   #111827;
  --panel: rgba(255, 255, 255, 0.03);

  /* ── Borders ── */
  --stroke: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.07);

  /* ── Text ── */
  --text:  #e2e8f0;
  --muted: #64748b;

  /* ── Accents ── */
  --blue:   #10b981;   /* emerald — primary action */
  --blue2:  #059669;
  --green:  #10b981;   /* positive */
  --red:    #f43f5e;   /* negative */
  --orange: #f59e0b;
  --purple: #6366f1;   /* indigo — decorative */
  --cyan:   #06b6d4;
  --danger: #f43f5e;

  /* ── Effects ── */
  --shadow:     0 4px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --glow-green: 0 0 20px rgba(16, 185, 129, 0.2);
  --glow-indigo:0 0 20px rgba(99, 102, 241, 0.18);

  /* ── Shape ── */
  --radius: 12px;
}

/* ── Reset ───────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0a0e1a;
  color: var(--text);
  position: relative;
}

/* ── Aurora background ───────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 12% 22%, rgba(99, 102, 241, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 55% 55% at 88% 78%, rgba(16, 185, 129, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 55% 8%,  rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0%   { opacity: 1;    transform: scale(1); }
  100% { opacity: 0.65; transform: scale(1.04); }
}

/* ── Layout ──────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ── Glass panel mixin ───────────────────────────────────── */
.panel,
.metric-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Metric cards ────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex-shrink: 0;
  animation: fadeInUp 0.5s ease both;
}

.metric-card {
  border-radius: 16px;
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
  will-change: transform;
}

/* Glowing top accent bar */
.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 16px 16px 0 0;
}

.metric-card.blue::after  { background: linear-gradient(90deg, #10b981, #06b6d4); }
.metric-card.green::after { background: linear-gradient(90deg, #10b981, #6366f1); }
.metric-card.orange::after{ background: linear-gradient(90deg, #f59e0b, #f43f5e); }
.metric-card.red::after   { background: linear-gradient(90deg, #f43f5e, #f59e0b); }

/* Inner highlight on top edge */
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.metric-card.blue   .metric-value { color: var(--blue); }
.metric-card.green  .metric-value { /* dynamic via JS */ }
.metric-card.orange .metric-value { color: var(--orange); }
.metric-card.red    .metric-value { color: var(--red); }

.metric-icon { font-size: 28px; line-height: 1; opacity: 0.8; }

.metric-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.metric-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.metric-card.blue   .metric-progress-fill { background: linear-gradient(90deg, #10b981, rgba(16,185,129,0.4)); }
.metric-card.green  .metric-progress-fill { background: linear-gradient(90deg, #10b981, rgba(99,102,241,0.5)); }
.metric-card.orange .metric-progress-fill { background: linear-gradient(90deg, #f59e0b, rgba(245,158,11,0.4)); }

/* ── Navigation ──────────────────────────────────────────── */
.logo-block {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  max-width: 100%;
  filter: drop-shadow(0 0 12px rgba(16,185,129,0.2));
  transition: filter 0.3s ease;
}

.logo:hover { filter: drop-shadow(0 0 18px rgba(16,185,129,0.4)); }

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

.nav-btn {
  display: block;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-btn.active {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--blue);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
}

/* ── USD Panel ───────────────────────────────────────────── */
.usd-panel { flex-shrink: 0; }

/* ── Goals Panel ─────────────────────────────────────────── */
.goals-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 200px;
}

.goals-panel #goalsContainer {
  flex: 1;
  overflow-y: auto;
}

/* ── Panel structure ─────────────────────────────────────── */
.panel {
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 0;
}

.left-column .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-column .panel .table-wrap {
  flex: 1;
  overflow: auto;
}

.left-column .panel #dayStatsTable {
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: visible;
}

#dayStatsTable tbody td:first-child,
#dayStatsTable thead th:first-child {
  padding-left: 12px;
  text-align: left;
}

#dayStatsTable thead th.exchange-col,
#dayStatsTable tbody td.exchange-col {
  min-width: 90px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-head .h {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.01em;
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Table ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

thead th {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  min-width: 60px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

thead th.exchange-col,
tbody td.exchange-col {
  min-width: 130px;
  max-width: 220px;
  width: 1%;
  overflow: visible;
}

tbody td {
  padding: 9px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  text-align: center;
}

/* thead th in regular tbody context */
tbody tr th {
  vertical-align: middle;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  min-width: 60px;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr.row-today {
  background: rgba(16, 185, 129, 0.06);
  border-left: 2px solid rgba(16, 185, 129, 0.45);
}

/* ── Buttons ─────────────────────────────────────────────── */
button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

button:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

button:active { transform: translateY(0); }

.btn-primary {
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--green);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: rgba(16, 185, 129, 0.17);
  border-color: rgba(16, 185, 129, 0.6);
  color: var(--green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.18), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: var(--red);
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.16) !important;
  border-color: var(--red) !important;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.2);
}

/* ── Inputs ──────────────────────────────────────────────── */
input {
  width: 100%;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
  font-size: 13px;
  font-weight: 500;
  min-width: 40px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder { color: rgba(100, 116, 139, 0.7); }

input:focus {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ── Tab buttons ─────────────────────────────────────────── */
.tab-btn {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.tab-btn.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--blue);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.12);
}

/* ── Month nav ───────────────────────────────────────────── */
.month-navigation { display: none; }

.month-navigation-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.month-nav-btn-small {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.month-nav-btn-small:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.month-nav-btn-small:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.primary-btn-small {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--green);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.primary-btn-small:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
}

.add-month-btn {
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--purple);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-month-btn:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ── Custom dropdown ─────────────────────────────────────── */
.custom-dropdown {
  position: relative;
  display: inline-block;
}

.month-dropdown-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
}

.month-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.month-dropdown-btn.active {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.07);
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
  opacity: 0.6;
}

.month-dropdown-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(10, 14, 26, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 10000;
  display: none !important;
  padding: 6px;
}

.dropdown-menu.show {
  display: block !important;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dropdown-item:hover {
  background: rgba(16, 185, 129, 0.09);
  color: var(--green);
}

.dropdown-item.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  font-weight: 600;
  border-left: 2px solid rgba(16, 185, 129, 0.6);
  padding-left: 10px;
}

.dropdown-item-text { flex: 1; }

.dropdown-item-badge {
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--muted);
}

.dropdown-item-edit {
  opacity: 0;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.dropdown-item:hover .dropdown-item-edit { opacity: 1; }
.dropdown-item-edit:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

/* ── Subtle add button ───────────────────────────────────── */
.btn-add-subtle {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.btn-add-subtle:hover {
  color: var(--blue);
  background: rgba(16, 185, 129, 0.08);
}

.btn-add-inline {
  background: transparent !important;
  border: none !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: color 0.2s, background 0.2s !important;
  width: auto !important;
  height: auto !important;
}
.btn-add-inline:hover {
  color: var(--blue) !important;
  background: rgba(16, 185, 129, 0.07) !important;
}

/* ── Day Wrapped inline button ───────────────────────────── */
.btn-day-wrapped {
  width: 100%;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

.btn-day-wrapped:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
  transform: translateY(-1px);
}

.btn-day-wrapped-inline {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.07);
  color: var(--purple);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-day-wrapped-inline:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.14);
  transform: translateY(-1px);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
}

.modal.show { display: flex; animation: modalFadeIn 0.25s ease; }

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

.modal-content {
  background: rgba(14, 20, 32, 0.98);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  position: relative;
  animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 28px;
  font-weight: bold;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  max-width: 100%;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Day Wrapped card ────────────────────────────────────── */
.day-wrapped-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2500;
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

.day-wrapped-card {
  position: relative;
  max-width: 420px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(14, 20, 32, 0.99);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.1), 0 40px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 32px 28px 36px;
  animation: dayWrappedCardFly 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dayWrappedCardFly {
  from { opacity: 0; transform: scale(0.82) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.day-wrapped-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.day-wrapped-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.day-wrapped-content { color: #fff; }

.day-wrapped-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 8px;
  background: linear-gradient(90deg, #10b981, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.day-wrapped-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 28px;
}

.day-wrapped-metric {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
}

.day-wrapped-metric-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.day-wrapped-metric-value {
  font-size: 17px;
  font-weight: 700;
}

.day-wrapped-metric-value.positive { color: #10b981; }
.day-wrapped-metric-value.negative { color: #f43f5e; }
.day-wrapped-metric-value.neutral  { color: rgba(255, 255, 255, 0.95); }

.day-wrapped-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Misc helpers ────────────────────────────────────────── */
.hint     { font-size: 12px; color: var(--muted); }
.date-cell { font-size: 13px; font-weight: 500; color: var(--text); }
.amount-cell { font-size: 14px; font-weight: 700; color: var(--text); }

/* Trade photos */
tr.trade-photos-row td { border-top: none; padding-top: 0; padding-bottom: 12px; }
.trade-photos-grid { gap: 8px; max-width: 100%; }
.trade-photos-grid img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.trade-photos-grid img:only-child { max-height: 180px; }

/* ── Screener globals ────────────────────────────────────── */
.screener-quotes-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.screener-quotes-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.screener-quotes-table tbody td { padding: 10px 12px; color: var(--text); }
.screener-quotes-table .col-instrument { font-weight: 600; }
.screener-quotes-table .col-positive { color: var(--green); }
.screener-quotes-table .col-negative { color: var(--red); }

.screener-grid .screener-quotes-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.screener-quotes-panel {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Resize handles */
.screener-resize-edge,
.screener-resize-corner {
  position: absolute;
  z-index: 5;
}
.screener-resize-edge { background: transparent; }
.screener-resize-edge[data-resize="top"]    { top:0;left:0;right:0;height:6px;cursor:n-resize; }
.screener-resize-edge[data-resize="right"]  { top:0;right:0;bottom:0;width:24px;cursor:e-resize; }
.screener-resize-edge[data-resize="bottom"] { bottom:0;left:0;right:0;height:24px;cursor:s-resize; }
.screener-resize-edge[data-resize="left"]   { top:0;left:0;bottom:0;width:6px;cursor:w-resize; }
.screener-resize-corner { width:28px;height:28px;background:transparent;pointer-events:auto; }
.screener-resize-corner[data-resize="tl"] { top:0;left:0;cursor:nwse-resize; }
.screener-resize-corner[data-resize="tr"] { top:0;right:0;cursor:nesw-resize; }
.screener-resize-corner[data-resize="br"] { bottom:0;right:0;cursor:nwse-resize;z-index:1000; }
.screener-resize-corner[data-resize="bl"] { bottom:0;left:0;cursor:nesw-resize; }
.screener-resize-edge:hover,
.screener-resize-corner:hover { background: rgba(16, 185, 129, 0.1); }

.screener-windows-container {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  border-radius: var(--radius);
}

.screener-window {
  position: absolute;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 260px;
  min-height: 180px;
}

.screener-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.screener-window-header:hover { background: rgba(255, 255, 255, 0.04); }

.screener-window-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 12px;
  padding-right: 28px;
  padding-bottom: 28px;
  position: relative;
  z-index: 0;
}

.screener-resize-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 100;
}
.screener-resize-layer .screener-resize-edge,
.screener-resize-layer .screener-resize-corner { pointer-events: auto; }
.screener-window .screener-resize-edge   { z-index: 2; }
.screener-window .screener-resize-corner { z-index: 3; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes modalSlideIn {
  from { opacity: 0; transform: translate(-50%, -56%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.25); }
  50%       { box-shadow: 0 0 30px rgba(16, 185, 129, 0.45); }
}

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

/* ── Table wrap animation ────────────────────────────────── */
.table-wrap { animation: fadeInUp 0.4s ease; }
.metrics    { animation: fadeInUp 0.5s ease both; }

/* ── Goal progress ───────────────────────────────────────── */
.goal-progress-bar { transition: width 0.6s ease; }

/* ── Modal show animations ───────────────────────────────── */
[id$="Modal"][style*="display: block"],
[id$="Modal"][style*="display: flex"] { animation: modalFadeIn 0.25s ease; }

[id$="Modal"][style*="display: block"] > div,
[id$="Modal"][style*="display: flex"]  > div { animation: fadeInUp 0.3s ease; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 1fr 320px; padding: 16px; gap: 16px; }
}

@media (max-width: 1024px) {
  .main-grid { grid-template-columns: 1fr 280px; padding: 12px; gap: 12px; }
  .logo { height: 48px; }
}

@media (max-width: 820px) {
  .main-grid { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .right-column { order: -1; flex-direction: row; flex-wrap: wrap; overflow: visible; gap: 12px; }
  .logo-block { width: 100%; order: 1; }
  .navigation { flex-direction: row; width: 100%; order: 2; }
  .usd-panel { order: 3; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .metrics, .navigation { flex-direction: column; }
  .right-column { flex-direction: column; }
  .usd-panel { min-width: 100%; }
}
