/* style.css - Premium Apple/Stripe-like Light Modern Theme */

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

:root {
  --bg-primary: #f8fafc; /* Slate 50 */
  --bg-gradient: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%), 
                  radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.03) 0px, transparent 50%);
  --panel-bg: #ffffff;
  --panel-border: #e2e8f0; /* Slate 200 */
  --panel-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  --glass-blur: none;
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #94a3b8; /* Slate 400 */
  
  --accent-color: #4f46e5; /* Indigo 600 */
  --accent-glow: rgba(79, 70, 229, 0.08);
  --accent-hover: #4338ca; /* Indigo 700 */
  
  --green: #10b981; /* Emerald 500 */
  --green-bg: #ecfdf5; /* Emerald 50 */
  --green-border: #a7f3d0; /* Emerald 200 */
  --green-glow: rgba(16, 185, 129, 0.1);
  
  --red: #f43f5e; /* Rose 500 */
  --red-bg: #fff1f2; /* Rose 50 */
  --red-border: #fecdd3; /* Rose 200 */
  --red-glow: rgba(244, 63, 94, 0.1);
  
  --warning: #d97706; /* Amber 600 */
  --warning-bg: #fef3c7; /* Amber 50 */
  --warning-border: #fde68a; /* Amber 200 */
  
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--panel-border);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.25rem;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.01);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}

.logo-icon {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: #f1f5f9; /* Slate 100 */
}

.nav-item.active a {
  color: var(--accent-color);
  background: var(--accent-glow);
  font-weight: 600;
  border-left: 3px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  padding-left: 0.85rem;
}

.nav-item a i {
  font-size: 1.15rem;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 3.5rem;
}

/* Header / Statusbar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding-bottom: 1.25rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: relative;
}

.status-badge.online {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: #047857; /* Emerald 700 */
}

.status-badge.online .status-indicator {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-badge.offline {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: #b91c1c; /* Red 700 */
}

.status-badge.offline .status-indicator {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.status-badge.offline span.mode-text {
  color: var(--text-secondary);
}

/* Cards / Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--panel-shadow);
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  padding: 1.5rem;
}

.stat-title {
  font-size: 0.825rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-title i {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0.65rem 0;
  color: #0f172a;
}

.stat-value.profit {
  color: #047857; /* Emerald 700 */
}

.stat-value.loss {
  color: #b91c1c; /* Red 700 */
}

.stat-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Calendar Section */
.calendar-section {
  padding: 1.75rem;
}

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

.calendar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.calendar-nav {
  display: flex;
  gap: 0.35rem;
}

.btn-nav {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nav:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

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

.calendar-day-label {
  text-align: center;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 110px;
}

.calendar-cell.other-month {
  opacity: 0.35;
  background: #f8fafc;
}

.calendar-cell.has-pnl:hover {
  transform: translateY(-2px);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.day-number {
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.day-pnl {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  align-self: center;
  margin-top: auto;
  color: var(--text-secondary);
  line-height: 1.2;
}

.day-pnl-pct {
  font-size: 0.68rem;
  font-weight: 400;
  text-align: center;
  align-self: center;
  margin-bottom: auto;
  color: var(--text-muted);
  line-height: 1.2;
}

.calendar-cell.profit .day-pnl-pct {
  color: #047857;
}

.calendar-cell.loss .day-pnl-pct {
  color: #b91c1c;
}

/* Calendar Daily Colors */
.calendar-cell.profit {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.calendar-cell.profit .day-pnl {
  color: #047857; /* Emerald 700 */
}

.calendar-cell.loss {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.calendar-cell.loss .day-pnl {
  color: #b91c1c; /* Red 700 */
}

/* Tooltip */
.tooltip-content {
  display: none;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  background: #0f172a; /* Apple/Stripe-like dark tooltip */
  color: #ffffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.75rem;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255,255,255,0.05);
}

.calendar-cell:hover .tooltip-content {
  display: block;
}

/* Touch-activated tooltip (for mobile) */
.calendar-cell.tooltip-active .tooltip-content {
  display: block;
  pointer-events: auto;
}

.tooltip-title {
  font-weight: 700;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 4px;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  color: #e2e8f0;
}

.tooltip-row strong {
  color: #ffffff;
}

/* Mobile tooltip backdrop */
.calendar-tooltip-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 99;
}

.calendar-tooltip-backdrop.active {
  display: block;
}

/* On mobile screens: reposition tooltip as centered overlay */
@media (max-width: 992px) {
  .calendar-cell:hover .tooltip-content {
    display: none;
  }

  .calendar-cell.tooltip-active .tooltip-content {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(320px, 90vw);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 200;
    padding: 18px;
    font-size: 0.82rem;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
  }
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 0.75rem 1rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--panel-border);
  background: #f8fafc;
}

.custom-table td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
}

.custom-table tr:hover td {
  background: #f8fafc;
}

.custom-table td strong {
  color: #0f172a;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.long {
  background: #e0f2fe; /* Light Blue 100 */
  color: #0369a1; /* Light Blue 700 */
  border: 1px solid #bae6fd;
}

.badge.short {
  background: #ffedd5; /* Orange 100 */
  color: #c2410c; /* Orange 700 */
  border: 1px solid #fed7aa;
}

.badge.status-pending {
  background: #fef3c7; /* Amber 100 */
  color: #b45309; /* Amber 700 */
  border: 1px solid #fde68a;
}

.badge.status-active {
  background: #e0e7ff; /* Indigo 100 */
  color: #4338ca; /* Indigo 700 */
  border: 1px solid #c7d2fe;
}

.badge.status-tp {
  background: var(--green-bg);
  color: #047857; /* Emerald 700 */
  border: 1px solid var(--green-border);
}

.badge.status-sl {
  background: var(--red-bg);
  color: #b91c1c; /* Red 700 */
  border: 1px solid var(--red-border);
}

.badge.status-expired {
  background: #f1f5f9; /* Slate 100 */
  color: #475569; /* Slate 600 */
  border: 1px solid #cbd5e1;
}

.badge.status-cancelled {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
}

/* Forms & Inputs */
.form-section {
  max-width: 550px;
}

.form-section.terms-page,
.form-section.settings-page,
.form-section.readiness-page {
  max-width: none;
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.masked-credential {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1; /* Slate 300 */
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.btn-primary {
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  color: white;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

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

.btn-close-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: #be123c;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border-radius: 999px;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-close-signal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #fecdd3;
  color: #be123c;
  transition: inherit;
}

.btn-close-signal .material-icons {
  font-size: 0.8rem;
}

.btn-close-signal:hover:not(:disabled) {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

.btn-close-signal:hover:not(:disabled) .btn-close-signal-icon {
  background: #fda4af;
  color: #9f1239;
}

.btn-close-signal:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-close-signal:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #ffffff;
  border: 1px solid var(--green-border);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(150%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.show {
  transform: translateY(0);
}

.toast i {
  color: var(--green);
  font-size: 1.15rem;
}

/* Responsive adjustments */
@media(max-width: 900px) {
  .sidebar {
    width: 64px;
    padding: 2rem 0.25rem;
    align-items: center;
  }
  .logo-text, .logo-container span {
    display: none;
  }
  .nav-item a span {
    display: none;
  }
  .nav-item a {
    justify-content: center;
    padding: 0.75rem;
  }
  .main-wrapper {
    margin-left: 64px;
    padding: 2rem 1.5rem;
  }
}

/* Modern Signals Card Grid */
.signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.signal-card {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.signal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}

.signal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

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

.signal-card-header.header-win {
  margin: -1.25rem -1.25rem 0;
  padding: 0.85rem 1.25rem;
  background: #86efac;
  border-bottom: 2px solid #22c55e;
  border-radius: 11px 11px 0 0;
}

.signal-card-header.header-loss {
  margin: -1.25rem -1.25rem 0;
  padding: 0.85rem 1.25rem;
  background: #fca5a5;
  border-bottom: 2px solid #ef4444;
  border-radius: 11px 11px 0 0;
}

.signal-card-header.header-win .signal-symbol {
  color: #14532d;
}

.signal-card-header.header-loss .signal-symbol {
  color: #7f1d1d;
}

.signal-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.signal-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  line-height: 1.4;
}

.signal-row span.label {
  color: var(--text-secondary);
  font-weight: 500;
}

.signal-row span.value {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  display: block;
}

.signal-card-footer {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.signal-card-footer-meta {
  display: flex;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 0.5rem;
}

/* Interactive Charts Styling */
.signal-chart-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.signal-chart-container {
  width: 100%;
  height: 100%;
}

.chart-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  z-index: 5;
}

/* Logs and Sync Status Page */
.logs-page-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .logs-page-container {
    grid-template-columns: 1fr;
  }
}

.panel-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.panel-title-inline {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-summary-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}

.sync-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--panel-border);
}

.sync-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.symbol-col {
  color: var(--text-primary);
}

.sync-time-col, .candle-time-col {
  color: var(--text-secondary);
  font-family: monospace;
}

.terminal-wrapper {
  background: #0f172a; /* Slate 900 */
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #1e293b;
  height: 520px;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.terminal-content {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.775rem;
  line-height: 1.5;
  color: #38bdf8; /* Sky 400 */
  white-space: pre-wrap;
  word-break: break-all;
}

.console-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box-inline {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inline {
  position: absolute;
  left: 8px;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.search-input-inline {
  padding: 0.4rem 0.5rem 0.4rem 1.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  font-size: 0.8rem;
  width: 150px;
  outline: none;
  background: #ffffff;
}

.search-input-inline:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Terms & ToS ─────────────────────────────────────────────── */

/* Document typography */
.terms-document {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}
.terms-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--panel-border);
}
.terms-doc-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.35rem;
}
.terms-doc-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.terms-doc-product {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.terms-doc-body { display: flex; flex-direction: column; gap: 0.5rem; }
.terms-section {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}
.terms-section:last-child { border-bottom: none; }
.terms-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.terms-section-content p { margin: 0 0 0.55rem; }
.terms-section-content p:last-child { margin-bottom: 0; }
.terms-bullets {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.25rem;
  list-style: none;
}
.terms-bullets li {
  position: relative;
  margin-bottom: 0.35rem;
  padding-left: 0.15rem;
}
.terms-bullets li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color);
  opacity: 0.55;
}
.terms-doc-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--panel-border); }
.terms-doc-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.terms-version-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--accent-glow);
  color: var(--accent-color);
  border: 1px solid rgba(79, 70, 229, 0.15);
}
.terms-version-chip--muted { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.terms-acceptance-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.terms-acceptance-tag .material-icons { font-size: 1rem; }
.terms-acceptance-tag--ok { background: var(--green-bg); color: #065f46; border: 1px solid var(--green-border); }
.terms-acceptance-tag--pending { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }
.terms-acceptance-tag-version { opacity: 0.75; font-weight: 400; }

/* Compact variants */
.terms-document--modal .terms-section { padding: 0.75rem 0; }
.terms-document--modal .terms-section-title { font-size: 0.88rem; }
.terms-document--modal { font-size: 0.84rem; line-height: 1.6; }
.terms-document--setup .terms-section { padding: 0.6rem 0; }
.terms-document--setup .terms-section-title { font-size: 0.82rem; }
.terms-document--setup { font-size: 0.78rem; line-height: 1.55; }

/* Terms page layout */
.terms-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}
.terms-page .terms-document-page {
  width: 100%;
}
.terms-page .terms-doc-body {
  width: 100%;
}
.terms-page-header-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.terms-page-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(139, 92, 246, 0.08));
  color: var(--accent-color);
  flex-shrink: 0;
}
.terms-page-icon .material-icons { font-size: 1.4rem; }
.terms-page-desc { margin: 0.35rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
.terms-page-status { display: flex; flex-direction: column; gap: 0.5rem; min-width: 220px; }
.terms-status-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.terms-status-card .material-icons { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.05rem; }
.terms-status-card strong { display: block; font-size: 0.85rem; margin-bottom: 0.1rem; }
.terms-status-card span { color: inherit; opacity: 0.85; }
.terms-status-card--ok { background: var(--green-bg); color: #065f46; border: 1px solid var(--green-border); }
.terms-status-card--warn { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }

.terms-standalone-page {
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  min-height: 100vh;
  padding: 2rem 1rem;
}
.terms-standalone-wrap {
  width: 100%;
  max-width: min(1400px, calc(100vw - 4rem));
  margin: 0 auto;
}
.terms-standalone-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.terms-standalone-back .material-icons { font-size: 1.1rem; }
.terms-standalone-back:hover { color: var(--accent-hover); }

/* ToS Accept Modal */
.tos-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: tosOverlayIn 0.25s ease;
}
@keyframes tosOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.tos-modal {
  background: #fff;
  border-radius: 20px;
  max-width: min(680px, calc(100vw - 2rem));
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255,255,255,0.05);
  animation: tosModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
@media (min-width: 900px) {
  .tos-modal {
    max-width: min(960px, calc(100vw - 4rem));
  }
  .tos-scroll-container {
    max-height: 52vh;
    padding: 1.5rem 2rem;
  }
  .terms-document--modal {
    font-size: 0.88rem;
  }
  .terms-document--modal .terms-section-title {
    font-size: 0.92rem;
  }
}
@media (min-width: 1200px) {
  .tos-modal {
    max-width: min(1100px, calc(100vw - 5rem));
  }
  .tos-scroll-container {
    max-height: 56vh;
  }
  .terms-page .terms-document {
    font-size: 0.95rem;
  }
  .terms-page .terms-section-title {
    font-size: 1rem;
  }
}
@media (min-width: 1600px) {
  .tos-modal {
    max-width: min(1280px, calc(100vw - 6rem));
  }
}
@keyframes tosModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tos-modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}
.tos-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}
.tos-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.tos-modal-icon .material-icons { font-size: 1.35rem; }
.tos-modal-brand-text h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.tos-modal-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tos-modal-lead {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Progress steps */
.tos-progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0.85rem;
}
.tos-progress-steps--compact { margin-bottom: 0.65rem; }
.tos-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  min-width: 56px;
}
.tos-progress-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  transition: all 0.25s ease;
}
.tos-progress-step-icon .material-icons { font-size: 1rem; }
.tos-progress-step-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  transition: color 0.25s ease;
}
.tos-progress-step[data-state="active"] .tos-progress-step-icon {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.tos-progress-step[data-state="active"] .tos-progress-step-label { color: var(--accent-color); }
.tos-progress-step[data-state="done"] .tos-progress-step-icon {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.tos-progress-step[data-state="done"] .tos-progress-step-label { color: var(--green); }
.tos-progress-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.25rem;
  margin-bottom: 1.1rem;
  border-radius: 1px;
  transition: background 0.3s ease;
}
.tos-progress-step-line[data-state="done"] { background: var(--green); }

.tos-scroll-progress-track {
  height: 3px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}
.tos-scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.tos-scroll-container {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
  min-height: 180px;
  max-height: 48vh;
  scroll-behavior: smooth;
}
.tos-scroll-container--setup {
  max-height: 240px;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 0.65rem;
}

.tos-modal-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #fafbfc;
}

.tos-status-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
}
.tos-status-banner--compact { font-size: 0.78rem; padding: 0.55rem 0.75rem; }
.tos-status-banner .tos-status-icon { font-size: 1.1rem; flex-shrink: 0; opacity: 0.7; }
.tos-status-banner[data-state="scroll"] { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tos-status-banner[data-state="scroll"] .tos-status-icon { color: #3b82f6; opacity: 1; }
.tos-status-banner[data-state="wait"] { background: var(--warning-bg); color: #92400e; border-color: var(--warning-border); }
.tos-status-banner[data-state="wait"] .tos-status-icon { color: var(--warning); opacity: 1; }
.tos-status-banner[data-state="ready"] { background: var(--green-bg); color: #065f46; border-color: var(--green-border); }
.tos-status-banner[data-state="ready"] .tos-status-icon { color: var(--green); opacity: 1; }

.tos-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tos-consent-row:hover { border-color: #c7d2fe; }
.tos-consent-row:has(input:checked) {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  color: var(--text-primary);
}
.tos-consent-row input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-color);
}

.tos-accept-btn {
  max-width: none !important;
  width: 100%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  transition: transform 0.15s ease, opacity 0.2s ease !important;
}
.tos-accept-btn:not(:disabled):hover { transform: translateY(-1px); }
.tos-accept-btn .material-icons { font-size: 1.15rem; }

/* Setup ToS panel */
.tos-setup-panel {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbff 0%, #f8fafc 100%);
}
.tos-setup-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.tos-setup-panel-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
}
.tos-setup-panel-title .material-icons { font-size: 1.1rem; color: var(--accent-color); }
.tos-setup-panel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

/* Legacy aliases */
.terms-document-page .terms-section { padding: 1rem 0; border-bottom: 1px solid rgba(226,232,240,0.7); }

/* Settings page — full width + responsive grid */
.settings-page-header,
.readiness-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--panel-border);
}
.settings-page-header-main,
.readiness-page-header-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.settings-page-icon,
.readiness-page-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(139, 92, 246, 0.08));
  color: var(--accent-color);
  flex-shrink: 0;
}
.settings-page-icon .material-icons,
.readiness-page-icon .material-icons { font-size: 1.4rem; }
.settings-page-desc,
.readiness-page-desc {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 720px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1024px) {
  .settings-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.75rem;
  }
}
@media (min-width: 1400px) {
  .settings-form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.settings-panel {
  padding: 1.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.85);
}
.settings-panel h3 {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.settings-panel h3 .material-icons { color: var(--accent-color); }
.settings-panel--span {
  grid-column: 1 / -1;
}
.settings-panel--dark {
  border-color: #374151;
  background: rgba(30, 30, 30, 0.92);
}
.settings-panel--dark h3 { color: #f9fafb; }
.settings-panel--dark p { color: #9ca3af; }
.settings-panel--danger {
  border-color: #fecaca;
  background: rgba(254, 242, 242, 0.85);
}
.settings-panel--danger h3 { color: #dc2626; }
.settings-panel--danger p { color: #64748b; }
.settings-panel .form-group:last-child { margin-bottom: 0; }
.settings-form-actions {
  grid-column: 1 / -1;
  padding-top: 0.25rem;
}
.settings-form-actions .btn-primary {
  max-width: max-content;
  min-width: 220px;
}

.settings-trading-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}
.settings-trading-day-row.is-blocked { opacity: 0.6; }
.settings-trading-days { display: flex; flex-direction: column; gap: 0.65rem; }

.uniform-sizing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .uniform-sizing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#tfa-modal.settings-panel--span {
  margin-bottom: 0;
}

/* Readiness page */
.readiness-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid;
}
.readiness-banner.ready { background: var(--green-bg); border-color: var(--green-border); color: #065f46; }
.readiness-banner.pending { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }
.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (min-width: 1200px) {
  .readiness-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.readiness-card {
  padding: 1.15rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(248, 250, 252, 0.9);
}
.readiness-card.ok { border-color: var(--green-border); }
.readiness-card.warn { border-color: var(--warning-border); }
.readiness-card.fail { border-color: var(--red-border); }
.readiness-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.readiness-value { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.readiness-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0.35rem 0 0; }
.readiness-progress-panel {
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(248, 250, 252, 0.95);
  margin-bottom: 0.5rem;
}
.readiness-progress-panel h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.readiness-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.readiness-actions .btn-primary { max-width: max-content; text-decoration: none; text-align: center; }
.readiness-symbol-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.readiness-symbol-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.readiness-symbol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.readiness-symbol-table th,
.readiness-symbol-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Bot activation consent (settings) */
.bot-activation-consent-block {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.08);
}
.bot-activation-consent-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #334155;
}
.bot-activation-consent-label input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-color);
}
.bot-activation-consent-label a { color: var(--accent-color); }

.bot-activation-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  max-height: 55vh;
}
.bot-activation-modal-body p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 0.65rem;
}
.bot-activation-modal-body .terms-bullets {
  margin: 0.2rem 0 0.85rem 1.2rem;
  font-size: 0.88rem;
  color: #475569;
}
.bot-activation-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
}
.bot-activation-modal-actions .btn-primary {
  flex: 1 1 180px;
  max-width: none;
}
.bot-activation-btn-secondary {
  background-color: #64748b !important;
}
.bot-activation-btn-secondary:hover {
  background-color: #475569 !important;
}


/* =========================================================================
   📱 MOBILE RESPONSIVENESS & OVERRIDES
   ========================================================================= */

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--panel-shadow);
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Table Wrappers for Responsive Scrolling */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* Base button touch improvements */
.btn-primary, .btn-secondary, button {
  min-height: 44px; /* Minimum Apple Touch Target Size */
}

/* Mobile Breakpoint */
@media (max-width: 992px) {
  body {
    flex-direction: column;
  }
  
  /* Show Mobile Header */
  .mobile-header {
    display: flex;
  }
  
  /* Main Wrapper fixes — prevent horizontal overflow */
  .main-wrapper {
    margin-left: 0;
    padding: 1.25rem 1rem;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
  
  /* Sidebar Offcanvas Logic */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  /* Logout — icon only on mobile */
  .sidebar .logout-link .logout-text {
    display: none;
  }
  
  /* Grids */
  .dashboard-grid, .settings-grid {
    grid-template-columns: 1fr;
  }
  
  /* Stats grid: 2 columns on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
    min-height: 90px;
  }
  
  .stat-value {
    font-size: 1.3rem;
  }
  
  .stat-title {
    font-size: 0.72rem;
  }
  
  /* Glass panels — prevent overflow */
  .glass-panel {
    overflow-x: auto;
    padding: 1rem;
  }
  
  /* Calendar — horizontally scrollable on mobile */
  .calendar-section {
    padding: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
  }
  
  .calendar-grid {
    gap: 4px;
    min-width: 700px; /* Force minimum width to prevent crushed text */
  }
  
  .calendar-day-label {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    letter-spacing: 0;
  }
  
  .calendar-cell {
    aspect-ratio: auto;
    min-height: 110px;
    padding: 4px 6px;
    border-radius: 6px;
  }
  
  .day-number {
    font-size: 0.65rem;
  }
  
  .day-pnl {
    font-size: 0.65rem;
  }
  
  .day-pnl-pct {
    font-size: 0.55rem;
  }
  
  .calendar-title {
    font-size: 1rem;
  }
  
  /* Adjust charts width */
  #equity-chart, #drawdown-chart, #winrate-chart {
    height: 250px !important;
  }
}
