/* ETRM Dashboard Styles */

.etrm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.etrm-header h2 {
  margin: 0;
  font-size: 1.5rem;
}
.etrm-actions {
  display: flex;
  gap: 0.5rem;
}

/* KPI Cards */
.etrm-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}
.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
}
.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
}

/* Tabs */
.etrm-tabs {
  display: flex;
  gap: 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  padding: 0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.etrm-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
}
.etrm-tabs .tab.active {
  background: transparent;
  color: var(--primary-green, #00d4aa);
  border-bottom-color: var(--primary-green, #00d4aa);
  font-weight: 600;
  box-shadow: none;
}
.etrm-tabs .tab:not(.active):hover {
  background: transparent;
  color: var(--text, #1e293b);
}

/* Table */
.etrm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.etrm-table th {
  background: var(--table-header-bg, #f8fafc);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.etrm-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.etrm-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Colors */
.positive {
  color: #16a34a;
}
.negative {
  color: #dc2626;
}
.warning {
  color: #d97706;
}

/* VaR Section */
.var-grid,
.greeks-grid,
.hedge-grid,
.netting-grid,
.margin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.var-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.var-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.var-value {
  font-size: 1.2rem;
  font-weight: 700;
}
.var-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.5rem;
}

/* Greeks */
.greeks-portfolio {
  margin-bottom: 1rem;
}
.greeks-portfolio h4 {
  margin-bottom: 0.5rem;
}
.gl {
  font-weight: bold;
  margin-right: 0.25rem;
}

/* Bid Execution */
.bid-form-card {
  background: var(--card-bg, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.bid-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
.bid-form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  gap: 0.3rem;
}
.bid-form-grid input,
.bid-form-grid select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg, #fff);
  color: var(--text, #1e293b);
  transition: border-color 0.2s;
}
.bid-form-grid input:focus:not(:focus-visible),
.bid-form-grid select:focus:not(:focus-visible) {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.bid-result-success {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #166534;
  font-size: 0.85rem;
}
.bid-result-error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #991b1b;
  font-size: 0.85rem;
}

/* TurbineIQ Bid Intelligence Panel */
.bid-reco-panel {
  background: var(--card-bg, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-left: 4px solid #7c3aed;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.bid-reco-loading {
  padding: 1rem;
  color: var(--text-muted, #64748b);
  font-size: 0.85rem;
}
.bid-risk-grid {
  margin: 0.75rem 0;
}
.bid-reco-table {
  font-size: 0.8rem;
}
.btn-reco-apply {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #7c3aed;
  background: transparent;
  color: #7c3aed;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
}
.btn-reco-apply:hover {
  background: #7c3aed;
  color: #fff;
}

/* Bid Alerts */
.bid-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.bid-alert {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}
.bid-alert-critical {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.bid-alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}
.bid-alert-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* Execution History Status Badges */
.bid-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bid-status-submitted {
  background: #dbeafe;
  color: #1e40af;
}
.bid-status-accepted {
  background: #dcfce7;
  color: #166534;
}
.bid-status-rejected {
  background: #fef2f2;
  color: #991b1b;
}
.bid-status-pending {
  background: #fffbeb;
  color: #92400e;
}

/* Summaries */
.pnl-summary,
.netting-summary,
.margin-summary,
.hedge-summary {
  background: var(--card-bg, #f8fafc);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
