/* Event Ledger — integrity timeline & fraud alerts */
.el-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.el-page-head h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
}

.el-page-head p {
  margin: 0;
  color: var(--tblr-secondary, #64748b);
  font-size: 0.9rem;
}

.el-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.el-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.el-kpi {
  background: var(--tblr-card-bg, #fff);
  border: 1px solid var(--tblr-border-color, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--tblr-box-shadow-sm);
}

.el-kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tblr-secondary, #64748b);
  margin-bottom: 6px;
}

.el-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tblr-body-color, #1e293b);
}

.el-kpi-value.ok { color: #16a34a; }
.el-kpi-value.warn { color: #ea580c; }
.el-kpi-value.bad { color: #dc2626; }

.el-kpi-sub {
  font-size: 0.72rem;
  color: var(--tblr-secondary);
  margin-top: 4px;
}

.el-integrity-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid var(--tblr-border-color);
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.el-integrity-banner.valid {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.el-integrity-banner.pending {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.5), rgba(255, 255, 255, 0.9));
}

.el-integrity-banner.invalid {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}

.el-integrity-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.el-integrity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.el-integrity-dot.ok { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2); }
.el-integrity-dot.warn { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2); }
.el-integrity-dot.bad { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }

.el-integrity-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.el-integrity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  flex: 1;
  font-size: 0.82rem;
  color: #475569;
}

.el-integrity-meta span strong {
  color: #1e293b;
  font-weight: 600;
}

.el-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .el-layout { grid-template-columns: 1fr; }
}

.el-panel {
  background: var(--tblr-card-bg, #fff);
  border: 1px solid var(--tblr-border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: var(--tblr-box-shadow-sm);
  overflow: hidden;
}

.el-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tblr-border-color);
  background: #f8fafc;
}

.el-panel-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.el-panel-body {
  padding: 12px 16px 16px;
  max-height: 620px;
  overflow-y: auto;
}

.el-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.el-toolbar .input,
.el-toolbar select {
  font-size: 0.8rem;
  padding: 5px 10px;
  min-width: 0;
}

.el-toolbar .input { flex: 1; min-width: 120px; }

.el-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.el-type-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.el-type-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

.el-type-bar-wrap {
  grid-column: 1 / -1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.el-type-bar {
  height: 100%;
  background: var(--tblr-primary, #0054a6);
  border-radius: 2px;
}

/* Vertical timeline */
.el-timeline {
  position: relative;
  padding-left: 4px;
}

.el-timeline-item {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 2px solid #e2e8f0;
  margin-left: 6px;
}

.el-timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.el-timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tblr-primary, #0054a6);
  z-index: 1;
}

.el-timeline-item.sev-critical::before { border-color: #dc2626; background: #fef2f2; }
.el-timeline-item.sev-alert::before { border-color: #ea580c; background: #fff7ed; }
.el-timeline-item.sev-win::before { border-color: #16a34a; background: #f0fdf4; }

.el-timeline-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.el-timeline-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.el-timeline-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 6px;
}

.el-event-id {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.el-event-time {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-left: auto;
}

.el-event-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
}

.el-event-badge.critical { background: #fee2e2; color: #b91c1c; }
.el-event-badge.alert { background: #ffedd5; color: #c2410c; }
.el-event-badge.win { background: #dcfce7; color: #15803d; }
.el-event-badge.neutral { background: #f1f5f9; color: #475569; }

.el-timeline-entity {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 4px;
}

.el-timeline-summary {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
}

.el-timeline-hash {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 6px;
  word-break: break-all;
}

.el-timeline-details {
  margin-top: 8px;
}

.el-timeline-details summary {
  font-size: 0.72rem;
  color: var(--tblr-primary);
  cursor: pointer;
  font-weight: 600;
}

.el-timeline-payload {
  margin-top: 6px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: #000;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow: auto;
}

/* Alert queue */
.el-alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.el-alert-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.el-alert-item.unresolved {
  border-left: 3px solid var(--tblr-primary, #0054a6);
}

.el-alert-item.sev-critical { border-left-color: #dc2626; }
.el-alert-item.sev-high { border-left-color: #ea580c; }

.el-alert-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.el-alert-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
}

.el-sev-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

.el-sev-pill.critical { background: #dc2626; }
.el-sev-pill.high { background: #ea580c; }
.el-sev-pill.medium { background: #d97706; }
.el-sev-pill.low, .el-sev-pill.info { background: #64748b; }

.el-alert-msg {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.el-alert-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.el-empty {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.el-empty i {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
  opacity: 0.5;
}

.el-footer-note {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 10px;
  text-align: center;
}

/* Manual wallet adjustment detail modal — black text on light panel */
#wallet-adjustment-modal .modal-content,
#wallet-adjustment-modal .modal-header,
#wallet-adjustment-modal .modal-body {
  background: #ffffff !important;
  color: #000000 !important;
}

#wallet-adjustment-modal h2,
#wallet-adjustment-modal #wa-modal-subtitle,
#wallet-adjustment-modal .modal-close,
#wallet-adjustment-modal .wa-detail,
#wallet-adjustment-modal .wa-detail-summary,
#wallet-adjustment-modal .wa-detail-summary__amount,
#wallet-adjustment-modal .wa-detail-summary__meta,
#wallet-adjustment-modal .wa-detail-section,
#wallet-adjustment-modal .wa-detail-section__title,
#wallet-adjustment-modal .wa-detail-narrative,
#wallet-adjustment-modal .wa-detail-label,
#wallet-adjustment-modal .wa-detail-value,
#wallet-adjustment-modal .wa-detail-note,
#wallet-adjustment-modal .wa-detail-list,
#wallet-adjustment-modal .wa-detail-list li,
#wallet-adjustment-modal .help-text,
#wallet-adjustment-modal strong,
#wallet-adjustment-modal .crm-badge,
#wallet-adjustment-modal .crm-badge-success,
#wallet-adjustment-modal .crm-badge-warn {
  color: #000000 !important;
}

#wallet-adjustment-modal .modal-close {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.wa-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: #000000;
}

.wa-detail-summary {
  padding: 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #000000;
}

.wa-detail-summary__amount {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 8px;
  color: #000000;
}

.wa-detail-summary__meta {
  font-size: 0.85rem;
  color: #000000;
  margin-top: 4px;
}

.wa-detail-section {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #000000;
}

.wa-detail-section--highlight {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.wa-detail-section--muted {
  font-size: 13px;
  color: #000000;
}

.wa-detail-section__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000000;
}

.wa-detail-narrative {
  margin: 0;
  line-height: 1.55;
  color: #000000;
}

.wa-detail-row {
  display: grid;
  grid-template-columns: minmax(140px, 38%) 1fr;
  gap: 8px 12px;
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
}

.wa-detail-row:last-child {
  border-bottom: none;
}

.wa-detail-label {
  color: #000000;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wa-detail-value {
  color: #000000;
  word-break: break-word;
}

.wa-detail-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #000000;
  font-style: italic;
}

.wa-detail-list {
  margin: 0;
  padding-left: 18px;
  color: #000000;
}

#wallet-adjustment-modal .crm-badge,
#wallet-adjustment-modal .crm-badge-success,
#wallet-adjustment-modal .crm-badge-warn {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1;
}

.user-alert-types-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.user-alert-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
}
