/* =========================================
   TRADSAVI TRADING JOURNAL
   PROFESSIONAL DARK UI
========================================= */

:root {
  --bg: #05070d;
  --bg-soft: #0a0f1c;

  --panel: #0e1524;
  --panel-2: #121b2e;
  --panel-hover: #172239;

  --border: #1e2a40;
  --border-light: #2b3953;

  --text: #f5f7fb;
  --text-soft: #c3cad7;
  --text-muted: #7f8ba1;

  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-light: #8688f6;

  --green: #22c55e;
  --green-dark: #16a34a;

  --red: #ef4444;
  --red-dark: #dc2626;

  --yellow: #f59e0b;
  --blue: #38bdf8;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow: 0 25px 60px rgba(0, 0, 0, 0.35);

  --transition: 0.2s ease;
}


/* =========================================
   RESET
========================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.10), transparent 35%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.05), transparent 40%),
    var(--bg);

  color: var(--text);

  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}


/* =========================================
   SCROLLBAR
========================================= */

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* =========================================
   AUTH
========================================= */

.auth-screen {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.09), transparent 30%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 460px;

  padding: 38px;

  background: rgba(14, 21, 36, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}

.auth-brand {
  margin-bottom: 35px;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h2 {
  font-size: 28px;
  margin-bottom: 7px;
}

.auth-heading p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);

  padding: 11px;
  border-radius: 6px;

  font-weight: 600;
  transition: var(--transition);
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  background: var(--panel-2);
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer {
  margin-top: 25px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}


/* =========================================
   BRAND
========================================= */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
  overflow: hidden;

  border-radius: 12px;

  background: linear-gradient(135deg, var(--primary), var(--primary-dark));

  color: white;
  font-size: 14px;
  font-weight: 800;

  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.28);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.brand h1 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}


/* =========================================
   APPLICATION
========================================= */

.app {
  width: 100%;
  min-height: 100vh;
  display: none;
  padding-bottom: 40px;
}


/* =========================================
   HEADER
========================================= */

.topbar {
  width: 100%;

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

  gap: 20px;

  padding: 18px 5%;

  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(15px);

  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* =========================================
   NAVIGATION
========================================= */

.tabs {
  width: 90%;
  max-width: 1400px;

  margin: 22px auto 0;

  display: flex;
  gap: 6px;

  padding: 5px;
  overflow-x: auto;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tab {
  flex: 1;
  min-width: 130px;

  border: 0;
  background: transparent;
  color: var(--text-muted);

  padding: 12px 16px;
  border-radius: 8px;

  font-size: 13px;
  font-weight: 600;

  transition: var(--transition);
}

.tab:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.25);
}


/* =========================================
   TAB PANELS
========================================= */

.tab-panel {
  width: 90%;
  max-width: 1400px;

  margin: 28px auto 0;

  display: none;
}

.tab-panel.active {
  display: block;
}


/* =========================================
   PAGE HEADING
========================================= */

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;
  margin-bottom: 25px;
}

.eyebrow {
  display: block;

  color: var(--primary-light);

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;

  margin-bottom: 7px;
}

.page-heading h2 {
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.03em;
  margin-bottom: 5px;
}

.page-heading p {
  color: var(--text-muted);
  font-size: 14px;
}


/* =========================================
   BUTTONS
========================================= */

.btn {
  min-height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;
  padding: 0 16px;

  border: 1px solid transparent;
  border-radius: 9px;

  font-size: 13px;
  font-weight: 700;

  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.25);
}

.btn.secondary {
  background: var(--panel);
  color: var(--text-soft);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.btn.danger-outline {
  background: transparent;
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn.danger-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn.large {
  min-height: 46px;
  padding: 0 22px;
}

.full-width {
  width: 100%;
}


/* =========================================
   CARDS
========================================= */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

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

  gap: 20px;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 16px;
  margin-bottom: 3px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 12px;
}


/* =========================================
   STATISTICS
========================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 18px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  min-width: 0;
}

.stat-label {
  color: var(--text-muted);

  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  margin-bottom: 8px;
}

.stat-value {
  color: var(--text);

  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;

  word-break: break-word;
}

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

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

.stat-value.warning {
  color: var(--yellow);
}


/* =========================================
   DASHBOARD
========================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-weekly-card {
  margin-bottom: 20px;
}

.performance-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.performance-item {
  padding: 13px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.performance-item span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.performance-item strong {
  font-size: 15px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: #fff;
}


/* =========================================
   RECENT TRADES
========================================= */

.recent-trades,
.trades-list,
.selected-day-trades,
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

  gap: 15px;
  padding: 13px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;

  transition: var(--transition);
}

.trade-row:hover {
  border-color: var(--border-light);
  background: var(--panel-hover);
}

.trade-main {
  min-width: 0;
}

.trade-symbol {
  font-weight: 800;
  font-size: 13px;
}

.trade-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 3px;
}

.trade-result {
  text-align: right;
  white-space: nowrap;
}

.trade-pnl {
  font-weight: 800;
  font-size: 13px;
}

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

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

.trade-badge {
  display: inline-flex;
  align-items: center;

  padding: 3px 7px;
  border-radius: 5px;

  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;

  margin-top: 4px;
}

.trade-card-top .trade-badge {
  margin-top: 0;
  padding: 5px 10px;
  font-size: 10px;
}

.trade-badge.win {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
}

.trade-badge.loss {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.trade-badge.be {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

.trade-badge.partial {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
}


/* =========================================
   WEEKLY SUMMARY
========================================= */

.weekly-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.weekly-summary-item {
  padding: 15px;

  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.weekly-summary-item span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.weekly-summary-item strong {
  font-size: 18px;
}


/* =========================================
   FORM
========================================= */

.form-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.form-section:first-child {
  padding-top: 0;
}

.form-section:last-of-type {
  border-bottom: 0;
}

.section-title {
  margin-bottom: 18px;
}

.section-title h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 70ch;
}

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

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

.field.span-2 {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

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

.field small a {
  color: var(--primary-light);
  font-weight: 700;
}

.field small a:hover {
  color: #fff;
}

.field input,
.field select,
.field textarea {
  width: 100%;

  color: var(--text);
  background: var(--bg-soft);

  border: 1px solid var(--border);
  border-radius: 9px;

  outline: none;

  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.field input,
.field select {
  height: 44px;
  padding: 0 13px;
}

.field textarea {
  padding: 12px 13px;
  resize: vertical;
  min-height: 100px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #58657b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: #0d1526;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.field select {
  appearance: none;
  cursor: pointer;
}

.field input[readonly] {
  color: var(--text-muted);
  background: var(--panel-2);
  cursor: not-allowed;
}

.field input[readonly]:focus {
  box-shadow: none;
}


/* =========================================
   DIRECTION
========================================= */

.direction-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.direction-btn {
  height: 52px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--bg-soft);
  color: var(--text-muted);

  font-weight: 800;
  transition: var(--transition);
}

.direction-btn.long:hover,
.direction-btn.long.active {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.5);
  color: var(--green);
}

.direction-btn.short:hover,
.direction-btn.short.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--red);
}


/* =========================================
   CALCULATED FIELD
========================================= */

.calculated-field {
  justify-content: flex-end;
}

.calculated-value {
  min-height: 44px;

  display: flex;
  align-items: center;

  padding: 0 13px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;

  font-size: 16px;
  font-weight: 800;
}

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

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

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


/* =========================================
   P&L BREAKDOWN (partials / breakeven)
========================================= */

.pnl-breakdown {
  margin-top: 16px;
  padding: 14px 16px;

  display: flex;
  flex-direction: column;
  gap: 9px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pnl-breakdown:empty {
  display: none;
}

.pnl-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  color: var(--text-soft);
  font-size: 12px;
}

.pnl-breakdown-row strong {
  font-weight: 800;
  white-space: nowrap;
}

.pnl-breakdown-row strong.positive {
  color: var(--green);
}

.pnl-breakdown-row strong.negative {
  color: var(--red);
}

.pnl-breakdown-row strong em {
  margin-left: 6px;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 600;
}

.pnl-breakdown-row.total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.pnl-breakdown-note {
  color: var(--yellow);
  font-size: 11px;
}


/* =========================================
   UPLOAD
========================================= */

.upload-box {
  position: relative;

  min-height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 14px;

  border: 1px dashed var(--border-light);
  border-radius: 10px;

  background: var(--bg-soft);
  color: var(--text-muted);

  cursor: pointer;
  overflow: hidden;
}

.upload-box span {
  min-width: 0;
  max-width: 100%;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 13px;
  font-weight: 400;
}

.upload-box:hover {
  border-color: var(--primary);
  color: var(--text);
}

.upload-box input {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  opacity: 0;
  cursor: pointer;
}


/* Upload box once a file is chosen */

.upload-box.has-file {
  border-style: solid;
  border-color: var(--primary);

  color: var(--text-soft);
}


/* =========================================
   FORM ACTIONS
========================================= */

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 22px;
}


/* =========================================
   STATUS
========================================= */

.status {
  min-height: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.status.success {
  color: var(--green);
}

.status.error {
  color: var(--red);
}

.status.warning {
  color: var(--yellow);
}


/* =========================================
   HISTORY
========================================= */

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.trades-list {
  margin-top: 18px;
}

.trade-card {
  padding: 18px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  transition: var(--transition);
}

.trade-card:hover {
  border-color: var(--border-light);
}

.trade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
  margin-bottom: 15px;
}

.trade-card-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-card-symbol strong {
  font-size: 16px;
}

.trade-card-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.detail-item {
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 8px;
}

.detail-item span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.detail-item strong {
  font-size: 12px;
}

.trade-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
  padding-top: 14px;

  border-top: 1px solid var(--border);
}

.trade-notes {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 70%;
  margin-top: 10px;
}

.trade-screenshot {
  margin-top: 10px;
  font-size: 12px;
}

.trade-screenshot a {
  color: var(--primary-light);
  font-weight: 700;
}

.trade-screenshot a:hover {
  color: #fff;
}

.trade-actions {
  display: flex;
  gap: 7px;
}

.small-btn {
  height: 34px;
  padding: 0 11px;

  border-radius: 7px;
  border: 1px solid var(--border);

  background: var(--bg-soft);
  color: var(--text-soft);

  font-size: 11px;
  font-weight: 700;
}

.small-btn:hover {
  background: var(--panel-hover);
  color: #fff;
}

.small-btn.delete {
  color: #f87171;
}

.small-btn.delete:hover {
  background: rgba(239, 68, 68, 0.08);
}


/* =========================================
   CALENDAR
========================================= */

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 20px;
}

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

.calendar-header h3 {
  font-size: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;

  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);

  border-radius: 8px;
  transition: var(--transition);
}

.icon-button:hover {
  background: var(--panel-hover);
  color: #fff;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 74px;
  padding: 8px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;

  cursor: pointer;
  transition: var(--transition);
}

.calendar-day:hover {
  border-color: var(--primary);
  background: var(--panel-hover);
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
}

.calendar-number {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
}

.calendar-pnl {
  margin-top: 15px;
  font-size: 10px;
  font-weight: 800;
}

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

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

.calendar-trades {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

/*
   Win / loss days - tinted to sit on top of the dark theme
   instead of the old light pastel backgrounds.
*/

.calendar-day.day-win {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.calendar-day.day-win:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.55);
}

.calendar-day.day-win .calendar-number,
.calendar-day.day-win .calendar-trades {
  color: #86efac;
}

.calendar-day.day-win .calendar-pnl {
  color: var(--green);
}

.calendar-day.day-loss {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.calendar-day.day-loss:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.55);
}

.calendar-day.day-loss .calendar-number,
.calendar-day.day-loss .calendar-trades {
  color: #fca5a5;
}

.calendar-day.day-loss .calendar-pnl {
  color: var(--red);
}

/*
   TODAY - a soft glowing "fade shadow" ring around the
   current date, plus a small halo behind the day number
   so today always stands out, whatever else the day shows.
*/

.calendar-day.today {
  position: relative;
  border-color: var(--primary-light);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.55),
    0 0 0 5px rgba(99, 102, 241, 0.12),
    0 0 24px rgba(99, 102, 241, 0.35);
  animation: today-glow 2.8s ease-in-out infinite;
}

.calendar-day.today:hover {
  border-color: var(--primary-light);
}

.calendar-day.today .calendar-number {
  color: #fff;
  font-weight: 800;
}

.calendar-day.today .calendar-number::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -6px;
  width: 26px;
  height: 26px;

  background: radial-gradient(circle, rgba(134, 136, 246, 0.55), transparent 70%);
  filter: blur(3px);

  border-radius: 50%;
  z-index: -1;
}

@keyframes today-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(99, 102, 241, 0.45),
      0 0 0 5px rgba(99, 102, 241, 0.08),
      0 0 14px rgba(99, 102, 241, 0.25);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(99, 102, 241, 0.75),
      0 0 0 6px rgba(99, 102, 241, 0.16),
      0 0 28px rgba(99, 102, 241, 0.5);
  }
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.calendar-summary-item {
  padding: 12px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calendar-summary-item span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  margin-bottom: 4px;
}

.calendar-summary-item strong {
  font-size: 14px;
}

.selected-day-total {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 20px;
}

.selected-day-total.positive {
  color: var(--green);
}

.selected-day-total.negative {
  color: var(--red);
}


/* =========================================
   WEEKLY REPORT
========================================= */

.weekly-chart {
  min-height: 280px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow-x: auto;
  padding: 15px;
}

.weekly-chart svg {
  width: 100%;
  min-width: 700px;
  height: 320px;
}

.weekly-reports {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.weekly-report {
  padding: 20px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.weekly-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.weekly-report-header h3 {
  font-size: 15px;
}

.weekly-report-header .positive {
  color: var(--green);
  font-weight: 800;
}

.weekly-report-header .negative {
  color: var(--red);
  font-weight: 800;
}

.weekly-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.weekly-report-item {
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
}

.weekly-report-item span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.weekly-report-item strong {
  font-size: 14px;
}


/* =========================================
   WEEKLY REPORT - EXTRA VISUALS
   (bar chart, donut, breakdown table, top pairs)
========================================= */

.weekly-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.weekly-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.weekly-insights-grid .card {
  display: flex;
  flex-direction: column;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;

  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.red {
  background: var(--red);
}

/* ---------- DONUT ---------- */

.donut-flex {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.donut-chart {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.donut-center {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.donut-center span {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  min-width: 130px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--text-soft);
  font-size: 12px;
}

.donut-legend-item .legend-dot {
  width: 9px;
  height: 9px;
}

.donut-legend-label {
  flex: 1;
}

.donut-legend-count {
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
}

.donut-legend-pct {
  color: var(--text-muted);
  font-size: 11px;
  min-width: 42px;
  text-align: right;
}

/* ---------- WEEKLY BREAKDOWN TABLE ---------- */

.breakdown-table-wrap {
  overflow-x: auto;
  flex: 1;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.breakdown-table th {
  text-align: left;

  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;

  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.breakdown-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  white-space: nowrap;
}

.breakdown-table td.positive {
  color: var(--green);
  font-weight: 800;
}

.breakdown-table td.negative {
  color: var(--red);
  font-weight: 800;
}

.breakdown-total-row td {
  font-weight: 800;
  color: var(--text);

  border-top: 1px solid var(--border-light);
  border-bottom: none;

  background: var(--bg-soft);
}

.breakdown-total-row td:first-child {
  border-radius: 8px 0 0 8px;
}

.breakdown-total-row td:last-child {
  border-radius: 0 8px 8px 0;
}

/* ---------- TOP PERFORMING PAIRS ---------- */

.top-pairs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.top-pair-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
  padding: 11px 13px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;

  transition: var(--transition);
}

.top-pair-row:hover {
  border-color: var(--border-light);
  background: var(--panel-hover);
}

.top-pair-symbol {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.top-pair-symbol strong {
  font-size: 13px;
}

.pair-avatar {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);

  font-size: 10px;
  font-weight: 800;
  color: var(--primary-light);

  flex-shrink: 0;
}

.top-pair-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
}

.top-pair-pnl {
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.top-pair-pnl.positive {
  color: var(--green);
}

.top-pair-pnl.negative {
  color: var(--red);
}


/* =========================================
   JOURNAL
========================================= */

.journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.journal-entry {
  padding: 16px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.journal-entry-date {
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.journal-entry-text {
  color: var(--text-soft);
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.7;
  margin-bottom: 10px;
}


/* =========================================
   EMPTY STATES
========================================= */

.empty-state {
  padding: 45px 20px;

  text-align: center;

  border: 1px dashed var(--border);
  border-radius: 12px;

  color: var(--text-muted);
}

.empty-state strong {
  display: block;
  color: var(--text-soft);
  margin-bottom: 5px;
}

.empty-state span {
  font-size: 12px;
}


/* =========================================
   FOOTER
========================================= */

.footer {
  width: 90%;
  max-width: 1400px;

  margin: 45px auto 0;
  padding-top: 22px;

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

  gap: 20px;

  border-top: 1px solid var(--border);

  color: var(--text-muted);
  font-size: 11px;
}

.footer div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer strong {
  color: var(--text-soft);
  font-size: 12px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1150px) {

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

  .trade-card-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weekly-insights-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .weekly-insights-grid .card:nth-child(3) {
    grid-column: 1 / -1;
  }

}


@media (max-width: 900px) {

  .dashboard-grid,
  .journal-layout,
  .calendar-layout,
  .weekly-charts-grid,
  .weekly-insights-grid {
    grid-template-columns: 1fr;
  }

  .weekly-insights-grid .card:nth-child(3) {
    grid-column: auto;
  }

  .weekly-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}


@media (max-width: 700px) {

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions .btn,
  .import-label {
    flex: 1;
  }

  .tabs {
    width: 94%;
  }

  .tab-panel {
    width: 94%;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .trade-card-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .trade-card-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .trade-notes {
    max-width: 100%;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .donut-flex {
    justify-content: center;
  }

}


@media (max-width: 480px) {

  .auth-screen {
    padding: 15px;
  }

  .auth-card {
    padding: 25px 18px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 19px;
  }

  .weekly-summary {
    grid-template-columns: 1fr;
  }

  .direction-buttons {
    grid-template-columns: 1fr;
  }

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

  .calendar-day {
    min-height: 60px;
    padding: 5px;
  }

  .calendar-pnl {
    margin-top: 10px;
    font-size: 8px;
  }

  .calendar-trades {
    font-size: 7px;
  }

  .pnl-breakdown-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

}


/* =========================================================
   CURRENCY SELECTOR (topbar)
========================================================= */

.currency-field {
  min-width: 118px;
}

.currency-select {
  height: 42px;
  width: 100%;
  padding: 0 10px;

  border-radius: 9px;
  border: 1px solid var(--border);

  background: var(--panel);
  color: var(--text);

  font-size: 13px;
  font-weight: 700;

  appearance: none;
  cursor: pointer;
}

.currency-select:hover {
  border-color: var(--border-light);
}

.currency-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}


/* =========================================================
   LOT SIZE CALCULATOR
========================================================= */

.lotcalc-result {
  margin-top: 22px;
}

.lotcalc-result:empty {
  display: none;
}

.lotcalc-highlight {
  padding: 20px;
  margin-bottom: 16px;

  border-radius: 12px;

  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.lotcalc-highlight span {
  display: block;

  color: var(--primary-light);

  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  margin-bottom: 8px;
}

.lotcalc-highlight strong {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.lotcalc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;

  margin-bottom: 14px;
}

.lotcalc-item {
  padding: 14px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;

  min-width: 0;
}

.lotcalc-item span {
  display: block;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;

  margin-bottom: 6px;
}

.lotcalc-item strong {
  font-size: 16px;
  word-break: break-word;
}

.lotcalc-note {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}


@media (max-width: 900px) {

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

}

@media (max-width: 480px) {

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

  .lotcalc-highlight strong {
    font-size: 22px;
  }

}


/* ======================================================
   TAB PANEL FIX
====================================================== */

.tab-panel {
  display: none !important;
}

.tab-panel.active {
  display: block !important;
}


/* =========================================================
   PROFESSIONAL POLISH PASS
   (same dark palette, refined depth / accents / hover states)
========================================================= */

/* Cards get a subtle top hairline accent and a touch more
   lift on hover so the dashboard feels tactile, not flat. */

.card {
  position: relative;
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(134, 136, 246, 0.45), transparent);
  pointer-events: none;
}

.card-header h3 {
  letter-spacing: -0.01em;
}

/* Stat cards: a thin colored accent bar tied to what the
   metric means, plus a soft lift on hover. */

.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border-light);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.stat-card:nth-child(2)::before { background: var(--primary-light); }
.stat-card:nth-child(3)::before { background: var(--green); }
.stat-card:nth-child(4)::before { background: var(--blue); }
.stat-card:nth-child(5)::before { background: var(--yellow); }
.stat-card:nth-child(6)::before { background: var(--primary); }

/* Buttons: slightly richer gradients + easing so the primary
   action always reads as the premium option on the page. */

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #7274f2, var(--primary-dark));
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.32);
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* Trade / result badges: slightly stronger borders so they
   read clearly against the dark cards at a glance. */

.trade-badge {
  border: 1px solid transparent;
  letter-spacing: 0.03em;
}

.trade-badge.win { border-color: rgba(34, 197, 94, 0.35); }
.trade-badge.loss { border-color: rgba(239, 68, 68, 0.35); }
.trade-badge.be { border-color: rgba(245, 158, 11, 0.35); }
.trade-badge.partial { border-color: rgba(56, 189, 248, 0.35); }

/* Trade / weekly report cards: gentle lift on hover to match
   the stat cards, keeping the whole app consistent. */

.trade-card:hover,
.weekly-report:hover,
.top-pair-row:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

/* Topbar: a soft gradient hairline instead of a flat border,
   matching the card accent above. */

.topbar {
  border-bottom: 1px solid transparent;
  background-image:
    linear-gradient(rgba(5, 7, 13, 0.85), rgba(5, 7, 13, 0.85)),
    linear-gradient(90deg, transparent, rgba(134, 136, 246, 0.5), transparent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
/* =========================================================
   AUTH SCREEN ADDITIONS
   (Google button, divider, forgot password, rules, links)
========================================================= */

/* make sure the "hidden" attribute always wins inside the card */
.auth-card [hidden] {
  display: none !important;
}

.google-btn {
  gap: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;

  color: var(--text-muted);
  font-size: 12px;
}

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

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.auth-link {
  border: 0;
  background: transparent;
  padding: 0;

  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-link:hover {
  color: #fff;
}

.auth-switch {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-switch .auth-link {
  font-size: 13px;
}

.auth-legal {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-legal a {
  color: var(--primary-light);
  font-weight: 600;
}

.auth-legal a:hover {
  color: #fff;
}

/* password rules checklist */

.pw-rules {
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 6px;

  padding: 12px 14px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pw-rules li {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--text-muted);
  font-size: 12px;

  transition: color var(--transition);
}

.pw-rules li::before {
  content: "";

  width: 14px;
  height: 14px;
  flex-shrink: 0;

  border-radius: 50%;
  border: 1.5px solid var(--border-light);

  transition: background var(--transition), border-color var(--transition);
}

.pw-rules li.met {
  color: var(--green);
}

.pw-rules li.met::before {
  background: var(--green)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23051' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 100% no-repeat;
  border-color: var(--green);
}


/* tagline under the logo */

.auth-brand {
  margin-bottom: 10px;
}

.auth-tagline {
  width: 100%;
  text-align: center;
  margin-bottom: 28px;

  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
/* =========================================================
   DASHBOARD GOALS
========================================================= */

.tl-goals-card {
  margin-bottom: 20px;
}

.tl-goals-grid,
.tl-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tl-goal {
  padding: 16px;

  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tl-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tl-goal-top strong {
  font-size: 13px;
}

.tl-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-light);
}

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

.tl-bar {
  height: 10px;
  overflow: hidden;

  background: var(--panel-2);
  border-radius: 999px;
}

.tl-bar i {
  display: block;
  height: 100%;

  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;

  transition: width 0.6s ease;
}

.tl-goal-meta {
  margin-top: 10px;

  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.tl-goal-meta em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 500;
}

.tl-goal-note {
  margin-top: 4px;

  color: var(--text-muted);
  font-size: 11px;
}

.tl-goal.hit .tl-bar i {
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}

.tl-goal.hit .tl-pct {
  color: var(--green);
}

.tl-goal.neg .tl-pct {
  color: var(--red);
}

.tl-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
}

@media (max-width: 700px) {

  .tl-goals-grid,
  .tl-edit-grid {
    grid-template-columns: 1fr;
  }

}
