:root {
  --bg-main: #0b0e14;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.3);

  --text-main: #f0f4f8;
  --text-muted: #8a99ad;
  --text-dim: #526075;

  --accent-gold: #ffb703;
  --accent-gold-glow: rgba(255, 183, 3, 0.25);
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);
  --accent-green: #00f59b;
  --accent-green-glow: rgba(0, 245, 155, 0.25);
  --accent-red: #ff3366;
  --accent-red-glow: rgba(255, 51, 102, 0.25);
  --accent-yellow: #ffcc00;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 240, 255, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 183, 3, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-gold { color: var(--accent-gold); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-muted { color: var(--text-muted); }

/* GLASSMORPHISM CARD */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.25s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* APP LAYOUT */
.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* TOP NAVBAR */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

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

.logo-icon {
  font-size: 26px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-glass);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-green {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green);
  animation: pulse-green-anim 2s infinite;
}

.pulse-gray {
  background: var(--text-dim);
}

@keyframes pulse-green-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 155, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(0, 245, 155, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 155, 0); }
}

.mode-badge {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

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

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.btn-primary {
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #050b14;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, #ff3366, #c70039);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-icon-small {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.btn-icon-small:hover {
  color: var(--text-main);
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-card {
  border-color: rgba(255, 183, 3, 0.3);
  box-shadow: 0 8px 32px rgba(255, 183, 3, 0.1);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.06), rgba(18, 24, 38, 0.7));
}

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

.stat-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.badge-green {
  background: rgba(0, 245, 155, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.25);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

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

/* RISK PROFILES SECTION */
.profiles-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.current-profile-pill {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.profile-card {
  background: rgba(14, 19, 31, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.profile-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  background: rgba(0, 240, 255, 0.04);
}

.prof-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}

.tag-gold {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.3);
}

.tag-green {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.3);
}

.tag-red {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

.prof-title {
  font-size: 16px;
  font-weight: 700;
}

.prof-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
}

.prof-metric-item {
  display: flex;
  justify-content: space-between;
}

.m-label { color: var(--text-dim); }
.m-val { font-weight: 600; }

.prof-stat-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  border-left: 3px solid var(--accent-gold);
}

.stat-highlight {
  font-weight: 700;
}

.prof-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  flex-grow: 1;
}

.btn-profile-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.profile-card.active .btn-profile-select {
  background: var(--accent-cyan);
  color: #0b0e14;
  font-weight: 700;
  border-color: var(--accent-cyan);
}

/* TRADING MONITOR SECTION & BLOCKS */
.trading-monitor-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.symbol-monitor-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.symbol-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 4px;
}

.symbol-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.symbol-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  letter-spacing: 0.5px;
}

.badge-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.badge-green {
  background: rgba(0, 245, 155, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.35);
}

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

/* TRADING MONITOR GRID */
.trading-monitor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .trading-monitor-grid {
    grid-template-columns: 1fr;
  }
}

.position-card, .orders-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-indicator {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.side-long {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.3);
}

.pos-symbol {
  font-size: 18px;
  font-weight: 700;
}

.live-price-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.card-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.filter-allowed {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.filter-blocked {
  background: rgba(255, 51, 102, 0.18);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.4);
  animation: pulse-danger 1.5s infinite;
}

.filter-none {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

.prof-filter-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.prof-filter-badge .f-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prof-filter-badge .f-val {
  font-weight: 700;
  font-size: 12px;
}

.pos-status-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pos-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
}

.data-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.d-val {
  font-size: 15px;
  font-weight: 700;
}

/* LIQUIDATION GAUGE */
.liq-gauge-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 51, 102, 0.05);
  border: 1px solid rgba(255, 51, 102, 0.2);
}

.liq-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.gauge-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-yellow), var(--accent-green));
  transition: width 0.3s ease;
}

.pnl-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.pnl-label {
  font-size: 13px;
  color: var(--text-muted);
}

.pnl-value {
  font-size: 18px;
  font-weight: 800;
}

/* ORDERS TABLE */
.table-container {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.orders-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-glass);
}

.orders-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

/* LOGS CONSOLE */
.logs-section {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-console {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 160px;
  overflow-y: auto;
  font-size: 12px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.log-line {
  line-height: 1.4;
  word-break: break-all;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-content {
  width: 90%;
  max-width: 520px;
  padding: 24px;
}

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

.btn-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* MASKED INPUTS WITHOUT BROWSER PASSWORD MANAGER INTERFERENCE */
.input-masked {
  -webkit-text-security: disc !important;
  text-security: disc !important;
}

.input-masked.revealed {
  -webkit-text-security: none !important;
  text-security: none !important;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action .form-control {
  width: 100%;
  padding-right: 42px;
}

.btn-icon-input {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-icon-input:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 20px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* TRADINGVIEW SYMBOL LINKS */
.symbol-link, .symbol-tv-link {
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.symbol-link:hover, .symbol-tv-link:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--accent-cyan);
  text-decoration: underline;
  transform: translateY(-1px);
}

.prof-symbol-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  margin-left: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.prof-symbol-badge:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.prof-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* LIFECYCLE & PROTECTION BADGES */
.badge-cyan {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.lifecycle-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.lifecycle-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.lifecycle-pill.pill-gold {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border-color: rgba(255, 183, 3, 0.35);
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.2);
}

.lifecycle-pill.pill-purple {
  background: rgba(186, 85, 211, 0.18);
  color: #da70d6;
  border-color: rgba(186, 85, 211, 0.4);
  box-shadow: 0 0 10px rgba(186, 85, 211, 0.25);
  animation: pulse-border 1.5s infinite alternate;
}

.lifecycle-pill.pill-blue {
  background: rgba(0, 180, 255, 0.18);
  color: #00d2ff;
  border-color: rgba(0, 180, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.2);
}

.lifecycle-pill.pill-ice {
  background: rgba(72, 209, 204, 0.2);
  color: #48d1cc;
  border-color: rgba(72, 209, 204, 0.5);
  box-shadow: 0 0 10px rgba(72, 209, 204, 0.3);
  font-weight: 800;
}

.d-sub-hint {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

@keyframes pulse-border {
  from { border-color: rgba(186, 85, 211, 0.3); }
  to { border-color: rgba(255, 105, 180, 0.8); }
}

/* SYMBOL TABS ROW */
.symbol-tabs-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.symbol-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.symbol-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.symbol-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 183, 3, 0.2));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}

.badge-gold {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.4);
}

/* ==========================================================================
   SETTINGS PAGE STYLES
   ========================================================================== */
.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 24px;
}

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

.settings-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.settings-form-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
  flex-grow: 1;
}

.field-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action .form-control {
  width: 100%;
  padding-right: 42px;
}

.btn-icon-input {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 6px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-input:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.form-actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

/* STATUS ALERTS */
.form-status-area {
  min-height: 20px;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 0.25s ease-out;
}

.status-success {
  background: rgba(0, 245, 155, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.35);
  box-shadow: 0 0 12px rgba(0, 245, 155, 0.15);
}

.status-error {
  background: rgba(255, 51, 102, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.35);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.15);
}

.status-loading {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

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

.spinner {
  display: inline-block;
  animation: spin 1s infinite linear;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TRADE HISTORY PAGE STYLES
   ========================================================================== */
.history-container {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.history-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.history-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-control {
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
}

.history-table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.history-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.time-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.duration-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.so-level-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-status.badge-success {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 245, 155, 0.35);
}

.badge-status.badge-danger {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.35);
}

.badge-status.badge-warning {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.35);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-main);
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
  max-width: 480px;
  line-height: 1.5;
  color: var(--text-dim);
}

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

/* ==========================================================================
   DASHBOARD FOOTER & LOGS PAGE STYLES
   ========================================================================== */
.dashboard-footer {
  margin-top: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-log-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  transition: all 0.25s ease;
  cursor: pointer;
}

.footer-log-link:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.15);
}

.footer-log-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link-icon {
  font-size: 26px;
  line-height: 1;
}

.footer-link-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-link-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

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

.footer-log-right {
  display: flex;
  align-items: center;
}

.footer-link-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.footer-log-link:hover .footer-link-action {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-cyan);
}

.footer-link-arrow {
  font-size: 16px;
  transition: transform 0.2s;
}

.footer-log-link:hover .footer-link-arrow {
  transform: translateX(4px);
}

/* LOGS FULL PAGE */
.logs-page-container {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.logs-page-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 160px);
}

.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.logs-toolbar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logs-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logs-search-wrapper {
  min-width: 220px;
}

.logs-search-input {
  padding: 6px 12px;
  font-size: 13px;
}

.logs-autoscroll-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.logs-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.logs-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.logs-filter-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.logs-console-window {
  flex-grow: 1;
  background: rgba(5, 8, 14, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 520px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.log-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.log-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.log-time {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}

.log-cat-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.cat-dim { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.cat-green { background: rgba(0, 245, 155, 0.15); color: var(--accent-green); }
.cat-red { background: rgba(255, 51, 102, 0.15); color: var(--accent-red); }
.cat-gold { background: rgba(255, 183, 3, 0.15); color: var(--accent-gold); }
.cat-cyan { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }

.log-msg {
  word-break: break-word;
}

/* ==========================================================================
   CONCEPT LINK & CONCEPT PAGE STYLES
   ========================================================================== */
.footer-concept-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 183, 3, 0.25);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.04), rgba(0, 240, 255, 0.04)), var(--bg-card);
  transition: all 0.25s ease;
  cursor: pointer;
}

.footer-concept-link:hover {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.09), rgba(0, 240, 255, 0.09)), var(--bg-card-hover);
  border-color: rgba(255, 183, 3, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 183, 3, 0.18);
}

.footer-concept-link:hover .footer-link-action {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-gold);
}

.footer-concept-link:hover .footer-link-arrow {
  transform: translateX(4px);
}

/* Concept Page Container */
.concept-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}

/* Hero Section */
.concept-hero {
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(255, 183, 3, 0.06), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(255, 183, 3, 0.3);
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 183, 3, 0.4);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 950px;
  margin-bottom: 24px;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.hero-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.h-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.h-stat-val {
  font-size: 26px;
  font-weight: 800;
}

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

/* Chapters */
.concept-chapter {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chapter-header {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}

.chapter-number {
  font-size: 32px;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-cyan);
  opacity: 0.8;
  line-height: 1;
}

.chapter-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.chapter-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.chapter-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.sub-chapter-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* Comparison Cards */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin: 6px 0;
}

.comparison-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bad-card {
  border-color: rgba(255, 51, 102, 0.35);
  background: linear-gradient(180deg, rgba(255, 51, 102, 0.06) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.good-card {
  border-color: rgba(0, 245, 155, 0.35);
  background: linear-gradient(180deg, rgba(0, 245, 155, 0.06) 0%, rgba(0, 0, 0, 0.25) 100%);
  box-shadow: 0 4px 20px rgba(0, 245, 155, 0.05);
}

.comp-title {
  font-size: 16px;
  font-weight: 700;
}

.comp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.comp-list li {
  position: relative;
  padding-left: 18px;
}

.comp-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

/* Formula Box */
.formula-box {
  background: rgba(5, 8, 14, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.formula-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.formula-line {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 4px 0;
}

.formula-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  line-height: 1.5;
}

/* Concept Tables */
.params-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
}

.concept-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.concept-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.concept-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.concept-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.concept-table tr.highlight-row td {
  background: rgba(255, 183, 3, 0.08);
  border-top: 1px solid rgba(255, 183, 3, 0.3);
  border-bottom: 1px solid rgba(255, 183, 3, 0.3);
}

/* Tech Cards */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.tech-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tech-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.tech-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Notes & Summary */
.note-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-gold);
  background: rgba(255, 183, 3, 0.04);
}

.note-icon {
  font-size: 20px;
  line-height: 1;
}

.note-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.summary-card {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 183, 3, 0.3);
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.06), rgba(0, 0, 0, 0.35));
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.summary-card h3 {
  font-size: 18px;
  font-weight: 700;
}

.summary-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Production Safeguards Cards */
.safeguards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.safeguard-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.safeguard-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
  background: rgba(0, 240, 255, 0.03);
}

.safeguard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.safeguard-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.safeguard-icon {
  font-size: 20px;
  line-height: 1;
}

.safeguard-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.safeguard-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
  white-space: nowrap;
}

.safeguard-badge.badge-gold {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent-gold);
  border-color: rgba(255, 183, 3, 0.4);
}

.safeguard-badge.badge-green {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
  border-color: rgba(0, 245, 155, 0.4);
}

.safeguard-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.safeguard-body strong {
  color: var(--text-main);
}

.safeguard-diff {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #c9d6df;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .concept-hero, .concept-chapter {
    padding: 20px 16px;
  }
  .hero-title {
    font-size: 22px;
  }
  .hero-stats-row {
    grid-template-columns: 1fr 1fr;
  }
}
