/**
 * Stock AI Lab v2.0 - Institutional Order Flow & Delivery Spike Radar CSS
 * Namespace: src/ui/institutional_order_flow.css
 * Theme: Obsidian Dark (#090A0F) with Linear x Koyfin Bento Grid
 * Chief Quantitative Architect Directive: Google Gemini 4 Argon
 */

.iof-card {
  background: var(--bg-surface, #0E1017);
  border: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.07));
  border-radius: var(--r-outer, 16px);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.45), var(--inner-glow, inset 0 1px 0 rgba(255, 255, 255, 0.06));
  margin-bottom: 22px;
}

.iof-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.07));
}

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

.iof-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan, #06B6D4);
  box-shadow: 0 0 8px var(--cyan, #06B6D4);
  animation: iofPulseDot 2s infinite ease-in-out;
}

@keyframes iofPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.iof-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary, #F3F4F6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.iof-badge-z {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #06B6D4;
}

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

/* Linear Segmented Dock Tabs */
.iof-dock {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-canvas, #090A0F);
  border: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.07));
  padding: 3px;
  border-radius: 8px;
}

.iof-dock-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #9CA3AF);
  font-family: var(--font-sans, sans-serif);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.iof-dock-btn:hover {
  color: #fff;
}

.iof-dock-btn.active {
  background: var(--bg-elevated, #131620);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 4-Tile High-Level Telemetry Ribbon */
.iof-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.iof-metric-tile {
  background: var(--bg-elevated, #131620);
  border: 1px solid var(--border-faint, rgba(255, 255, 255, 0.04));
  border-radius: var(--r-inner, 10px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.iof-metric-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.iof-metric-val {
  font-family: var(--font-mono, monospace);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.iof-metric-sub {
  font-size: 10.5px;
  color: var(--text-secondary, #9CA3AF);
}

/* Toolbar & Filters */
.iof-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.iof-search-input {
  flex: 1;
  min-width: 220px;
  background: var(--bg-elevated, #131620);
  border: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  color: #fff;
  padding: 7px 12px;
  font-size: 12px;
  font-family: var(--font-sans, sans-serif);
  outline: none;
  transition: border-color 140ms ease;
}

.iof-search-input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.iof-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.iof-filter-chip {
  background: var(--bg-elevated, #131620);
  border: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.08));
  color: var(--text-secondary, #9CA3AF);
  font-family: var(--font-sans, sans-serif);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 140ms ease;
}

.iof-filter-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.iof-filter-chip.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: #06B6D4;
}

/* Tables */
.iof-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-inner, 10px);
  border: 1px solid var(--border-faint, rgba(255, 255, 255, 0.04));
  background: var(--bg-elevated, #131620);
  margin-bottom: 14px;
}

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

.iof-table th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748B);
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.07));
  white-space: nowrap;
}

.iof-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-faint, rgba(255, 255, 255, 0.03));
  color: var(--text-primary, #F3F4F6);
  white-space: nowrap;
}

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

.iof-table tr:last-child td {
  border-bottom: none;
}

/* Z-Score Badges */
.iof-z-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

.iof-z-tag-elevated {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #06B6D4;
}

.iof-z-tag-high {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10B981;
}

.iof-z-tag-extreme {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #D8B4FE;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.25);
}

/* Action Badges */
.iof-action-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.iof-action-badge.buy {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10B981;
}

.iof-action-badge.sell {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #F43F5E;
}

.iof-regime-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.iof-regime-tag.reg-acc {
  background: rgba(168, 85, 247, 0.10);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #D8B4FE;
}

.iof-regime-tag.reg-elev {
  background: rgba(6, 182, 212, 0.10);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #06B6D4;
}

/* Footer Summary Bar */
.iof-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  background: var(--bg-elevated, #131620);
  border: 1px solid var(--border-hairline, rgba(255, 255, 255, 0.07));
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  .iof-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .iof-header-actions { width: 100%; justify-content: space-between; margin-top: 8px; }
}

@media (max-width: 600px) {
  .iof-metrics-grid { grid-template-columns: 1fr; }
  .iof-toolbar { flex-direction: column; align-items: stretch; }
  .iof-search-input { width: 100%; }
}
