/* ═══════════════════════════════════════════════════════════════
   COMMAND CENTER — unified dropdown for overlays
   ═══════════════════════════════════════════════════════════════ */

.cmd-center-wrap {
  position: relative;
}

#cmd-center-btn {
  position: relative;
}
#cmd-center-btn svg {
  width: 18px;
  height: 18px;
}

/* Dropdown */
.cmd-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 240px;
  background: var(--bg-card, #111820);
  border: 1px solid var(--border, #1E2A35);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  z-index: 1100;
  padding: 6px 0;
  animation: cmd-drop-in 0.15s ease-out;
}
.cmd-dropdown.open {
  display: block;
}

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

.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-primary, #E8F0F7);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.cmd-item:hover {
  background: var(--bg-secondary, #0D1117);
}
.cmd-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}
.cmd-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.cmd-label {
  flex: 1;
}
.cmd-badge {
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  background: #FF3B5C;
  color: #fff;
  padding: 0 5px;
  display: none;
}
.cmd-badge.has-count {
  display: inline-block;
}

/* ── ANALYSES OVERLAY ──────────────────────────────────────── */

.analyses-overlay {
  position: fixed;
  top: var(--chrome-h, 48px);
  left: var(--sidebar-w, 0); right: 0; bottom: 0;
  z-index: 999;
  background: var(--bg-primary, #080B0F);
  overflow-y: auto;
}
.analyses-overlay.hidden { display: none; }

.analyses-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 60px;
}
.analyses-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary, #080B0F);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #1E2A35);
  margin-bottom: 16px;
}
.analyses-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.analyses-title-row h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 0;
  color: var(--text-primary, #E8F0F7);
}
.analyses-toolbar {
  display: flex;
  gap: 8px;
}

/* Reuse fav-table-full styles for analyses table */
.ana-stat { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.ana-stat-vessels { color: var(--accent-primary, #00D4FF); }
.ana-stat-cargo  { color: var(--accent-energy, #FF6B35); }
.ana-stat-infra  { color: var(--accent-green, #00FF8C); }
.ana-stat-events { color: #FF3B5C; }

/* ── PRICES OVERLAY ─────────────────────────────────────── */
.prices-overlay, .arb-overlay {
  position: fixed; top: var(--chrome-h, 48px); left: var(--sidebar-w, 0); right: 0; bottom: 0;
  z-index: 999; background: var(--bg-primary, #080B0F); overflow-y: auto;
}
.prices-overlay.hidden, .arb-overlay.hidden { display: none; }
.prices-container, .arb-container {
  max-width: 960px; margin: 0 auto; padding: 16px 20px 60px;
}
.prices-header, .arb-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-primary, #080B0F);
  padding-bottom: 14px; border-bottom: 1px solid var(--border, #1E2A35); margin-bottom: 16px;
}
.prices-title-row, .arb-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.prices-title-row h2, .arb-title-row h2 {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; margin: 0;
  color: var(--text-primary, #E8F0F7);
}
.arb-sub {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--text-muted, #3D5A70); margin: 0;
}

/* Price change colors */
.price-up   { color: #00FF8C; }
.price-down { color: #FF3B5C; }
.price-flat { color: var(--text-muted, #3D5A70); }

/* ── ARB CARDS ─────────────────────────────────────────── */
.arb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.arb-card {
  background: var(--bg-card, #111820);
  border: 1px solid var(--border, #1E2A35);
  border-radius: 8px; padding: 18px; transition: border-color 0.15s;
}
.arb-card:hover { border-color: var(--text-muted, #3D5A70); }

.arb-card-name {
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--text-primary, #E8F0F7); margin-bottom: 4px;
}
.arb-card-desc {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  color: var(--text-muted, #3D5A70); margin-bottom: 12px; line-height: 1.4;
}
.arb-card-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 28px; font-weight: 700;
  margin-bottom: 4px;
}
.arb-card-value.profitable { color: #00FF8C; }
.arb-card-value.unprofitable { color: #FF3B5C; }
.arb-card-value.neutral { color: var(--text-primary, #E8F0F7); }

.arb-card-status {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; padding: 3px 8px; border-radius: 4px;
  display: inline-block; margin-bottom: 10px;
}
.arb-status-open     { background: rgba(0,255,140,0.12); color: #00FF8C; }
.arb-status-closed   { background: rgba(255,59,92,0.12); color: #FF3B5C; }
.arb-status-neutral  { background: rgba(0,212,255,0.08); color: #00D4FF; }

.arb-card-components {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
}
.arb-comp-item { display: flex; justify-content: space-between; padding: 3px 0; }
.arb-comp-label { color: var(--text-muted, #3D5A70); }
.arb-comp-val { color: var(--text-primary, #E8F0F7); font-weight: 500; }

.arb-card-note {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  color: var(--text-muted, #3D5A70); margin-top: 8px; font-style: italic;
}

/* Vessel & Fleet table */
.vt-tabs {
  display: flex;
  gap: 2px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.vt-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -1px;
}
.vt-tab:hover { color: var(--text-primary); }
.vt-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}
.vt-tab-hint {
  margin-left: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}
/* ── Schedule-query modal form (matches Route Planner form styling) ── */
.sq-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 440px;
  max-width: 520px;
  padding: 6px 4px 0;
}
.sq-modal-head {
  margin-bottom: 4px;
}
.sq-modal-head h3 {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.sq-modal-head p {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}
.sq-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.sq-field > label {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.sq-field input[type=text],
.sq-field textarea,
.sq-field select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 3px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.sq-field textarea {
  font-family: "Inter", sans-serif;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
}
.sq-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%2378909C' fill='none' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.sq-field input:focus,
.sq-field textarea:focus,
.sq-field select:focus {
  border-color: var(--accent-primary);
  outline: none;
}
.sq-interp {
  display: none;
  padding: 10px 12px;
  background: rgba(0, 212, 255, 0.06);
  border-left: 2px solid var(--accent-primary);
  border-radius: 0 3px 3px 0;
  font-size: 12px;
}
.sq-interp.open { display: block; }
.sq-interp-label {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sq-interp-text { color: var(--text-primary); margin-bottom: 8px; }
.sq-interp-json {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  border-radius: 2px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow-y: auto;
}
.sq-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.sq-modal-actions button {
  padding: 7px 14px;
  font-size: 12px;
  font-family: "Inter", sans-serif;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s;
}
.sq-modal-actions button:hover:not(:disabled) {
  border-color: var(--accent-primary);
}
.sq-modal-actions button.primary {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}
.sq-modal-actions button.primary:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.22);
}
.sq-modal-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.sq-modal-error {
  color: #ff8b97;
  font-size: 11px;
  min-height: 14px;
  margin-top: -2px;
}

/* ── Scheduled Queries modal ── */
.sq-body {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.2fr);
  gap: 14px;
  padding: 12px 16px;
  overflow: hidden;
  flex: 1;
}
.sq-list {
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}
.sq-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.sq-empty .sq-empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }
.sq-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: start;
}
.sq-row:hover { background: rgba(0,212,255,0.05); }
.sq-row.active { background: rgba(0,212,255,0.10); border-left: 2px solid var(--accent-primary); padding-left: 10px; }
.sq-row-name { color: var(--text-primary); font-weight: 600; font-size: 12px; }
.sq-row-nl { color: var(--text-secondary); font-size: 11px; margin-top: 2px; }
.sq-row-meta { color: var(--text-muted); font-size: 10px; margin-top: 3px; letter-spacing: 0.04em; }
.sq-row-status { font-size: 14px; }
.sq-row-count {
  color: var(--accent-primary); font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sq-detail {
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
}
.sq-detail-empty {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-align: center;
  padding: 40px 10px;
}
.sq-detail h3 { font-family: "Inter", sans-serif; font-size: 15px; margin: 0 0 4px; color: var(--text-primary); }
.sq-detail .sq-nl {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 10px 12px;
  background: var(--bg-primary);
  border-left: 2px solid var(--accent-primary);
  border-radius: 0 3px 3px 0;
  margin: 12px 0;
  white-space: pre-wrap;
}
.sq-detail .sq-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0;
}
.sq-detail .sq-stat {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 3px; padding: 8px;
  font-family: "IBM Plex Mono", monospace;
}
.sq-detail .sq-stat-val { font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sq-detail .sq-stat-label { font-size: 9px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }

.sq-detail .sq-section-head {
  font-family: "Inter", sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-primary);
  margin: 18px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.sq-detail .sq-filter-json {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  background: rgba(0,0,0,0.25);
  padding: 8px 10px;
  border-radius: 3px;
  white-space: pre-wrap;
  color: var(--text-secondary);
}
.sq-runs-table {
  width: 100%; border-collapse: collapse;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}
.sq-runs-table th {
  text-align: left; color: var(--text-secondary);
  font-family: "Inter", sans-serif;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px; border-bottom: 1px solid var(--border);
}
.sq-runs-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.sq-runs-table td.count { font-variant-numeric: tabular-nums; font-weight: 600; }
.sq-actions-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.sq-actions-row button { padding: 6px 12px; font-size: 11px; }

/* Route planner */
.rp-engine-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.rp-engine-badge.v2 {
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: #00D4FF;
}
.rp-engine-badge.v1 {
  background: rgba(255, 215, 0, 0.10);
  border: 1px solid rgba(255, 215, 0, 0.35);
  color: #ffd680;
}
.rp-version-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: 400;
}
.rp-help {
  font-size: 11px; color: var(--text-secondary);
  margin: 4px 0 0;
}
.rp-body {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  padding: 12px 16px;
  overflow-y: auto;
}
.rp-form { display: flex; flex-direction: column; gap: 10px; }
.rp-row { position: relative; display: flex; flex-direction: column; gap: 4px; }
.rp-row label {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.rp-row input[type=text] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 3px;
}
.rp-coords {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
}
.rp-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 2px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  z-index: 5;
  max-height: 200px;
  overflow-y: auto;
}
.rp-search-results.open { display: block; }
.rp-search-results .rp-sr-row {
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.rp-search-results .rp-sr-row:hover { background: rgba(0,212,255,0.08); }
.rp-section-head {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rp-gateways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.rp-gw-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}
.rp-gw-check:hover { background: rgba(0, 212, 255, 0.06); }
.rp-gw-check input[type=checkbox] { accent-color: var(--accent-primary); }
.rp-gw-check .rp-gw-name { flex: 1; color: var(--text-primary); }
.rp-gw-check input[type=checkbox]:not(:checked) ~ .rp-gw-name {
  color: var(--text-muted);
  text-decoration: line-through;
}
.rp-right-col { display: flex; flex-direction: column; gap: 8px; }
.rp-mode-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rp-table-view {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}
.rp-table-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.rp-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.rp-empty .rp-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.rp-table th {
  text-align: left;
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.rp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.rp-table tr:last-child td { border-bottom: none; }
.rp-table tr:hover td { background: rgba(0, 212, 255, 0.04); }
.rp-table .rp-row-name { color: var(--text-primary); font-weight: 600; }
.rp-table .rp-row-route { color: var(--text-secondary); font-size: 11px; margin-top: 2px; }
.rp-table .rp-row-stat {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.rp-table .rp-row-meta { color: var(--text-muted); font-size: 10px; margin-top: 2px; }
.rp-table .rp-row-gw {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  margin: 1px 2px 0 0;
  background: rgba(0,212,255,0.10);
  border: 1px solid rgba(0,212,255,0.30);
  border-radius: 2px;
  color: var(--accent-primary);
}
.rp-table .rp-row-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.rp-table .rp-row-actions button {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.rp-table .rp-row-actions button:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.rp-table .rp-row-actions button.primary-btn {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.rp-table .rp-row-actions button.danger:hover { color: #ff6b7a; border-color: #ff6b7a; }

.rp-saved-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.rp-saved-empty {
  padding: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.rp-saved-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}
.rp-saved-item:hover { background: rgba(0, 212, 255, 0.06); }
.rp-saved-item.active { background: rgba(0, 212, 255, 0.10); border-left: 2px solid var(--accent-primary); }
.rp-saved-name { color: var(--text-primary); font-weight: 600; }
.rp-saved-meta { color: var(--text-muted); font-size: 10px; }
.rp-saved-actions { display: flex; gap: 4px; align-items: start; }
.rp-saved-actions button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.rp-saved-actions button:hover { color: var(--text-primary); border-color: var(--accent-primary); }
.rp-saved-actions button.danger:hover { color: #ff6b7a; border-color: #ff6b7a; }
.rp-eca-row { display: flex; gap: 16px; padding: 4px 0; }
.rp-radio { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.rp-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.rp-current-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 3px;
  color: var(--accent-primary);
  margin-left: auto;
}
.rp-current-name:empty { display: none; }
.rp-actions button.danger:not(:disabled):hover { color: #ff6b7a; border-color: #ff6b7a; }
.rp-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.rp-actions button { padding: 8px 16px; font-size: 12px; }
.rp-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  min-height: 200px;
  overflow-y: auto;
}
.rp-result .rp-stat { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border); }
.rp-result .rp-stat-key { color: var(--text-secondary); }
.rp-result .rp-stat-val { color: var(--text-primary); font-weight: 700; }
.rp-result .rp-warn {
  background: rgba(255, 215, 0, 0.08);
  border-left: 2px solid #FFD700;
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 11px;
  color: #ffd680;
}
.rp-result .rp-via-list { margin-top: 6px; }
.rp-result .rp-via-pill {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  margin: 2px 4px 2px 0;
  background: rgba(0,212,255,0.10);
  border: 1px solid rgba(0,212,255,0.30);
  border-radius: 3px;
  color: #00D4FF;
}
.rp-result .rp-via-pill.avoided {
  background: rgba(255,107,122,0.10);
  border-color: rgba(255,107,122,0.30);
  color: #ff8b97;
  text-decoration: line-through;
}

.vt-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  flex-wrap: wrap;
}
.vt-page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 3px;
  cursor: pointer;
  min-width: 28px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}
.vt-page-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.vt-page-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  font-weight: 700;
}
.vt-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.vt-page-info { color: var(--text-muted); margin-left: 8px; }

.vt-my-group-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.vt-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.vt-group-chip small { color: var(--text-muted); }
.vt-chip-del {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 0 0 0 4px;
}
.vt-chip-del:hover { color: #ff6b7a; }
.vt-group-pill {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  color: var(--text-secondary);
}
.vt-category-head {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin: 14px 0 4px;
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.05);
  border-left: 2px solid var(--accent-primary);
}
.vt-name-link {
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}
.vt-name-link:hover { color: var(--accent-primary); }
.vt-action-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 8px;
  margin-right: 4px;
  border-radius: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.vt-action-btn:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

/* Vessel groups */
.vt-group {
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.vt-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
}
.vt-group-name {
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.vt-group-name small { color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.vt-group-empty {
  padding: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* ── STORM TRACKER ─────────────────────────────────────── */
.storm-stats {
  display: flex; gap: 16px; margin: 12px 0;
}
.storm-stat { text-align: center; }
.storm-stat .arb-card-value { font-size: 22px; display: block; }
.storm-stat .dh-card-label { font-size: 9px; }

.storm-impact-title {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--text-muted, #3D5A70); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 10px 0 6px;
  padding-top: 8px; border-top: 1px solid var(--border, #1E2A35);
}
.storm-impact-row {
  display: flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  padding: 4px 0; color: var(--text-secondary, #7A9BB5);
}
.storm-impact-name { flex: 1; }
.storm-impact-dist { color: var(--text-muted, #3D5A70); font-size: 10px; }

/* Light theme */
[data-theme="light"] .analyses-overlay,
[data-theme="light"] .prices-overlay,
[data-theme="light"] .arb-overlay { background: var(--bg-primary, #F4F7FB); }
[data-theme="light"] .analyses-header,
[data-theme="light"] .prices-header,
[data-theme="light"] .arb-header { background: var(--bg-primary, #F4F7FB); }
[data-theme="light"] .cmd-dropdown { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
[data-theme="light"] .arb-card { background: #fff; }

/* ── Analytics hub (📊) ────────────────────────────────────────── */
#analytics-overlay .prices-container { max-width: 1280px; }
.an-picker {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border, #1E2A35);
}
.an-picker-row {
  display: flex; flex-direction: column; gap: 4px; min-width: 220px;
}
.an-picker-lbl {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted, #3D5A70);
}
.an-picker select { min-width: 240px; }
.an-report { margin-top: 14px; }
.an-report-head { margin-bottom: 10px; }
.an-report-head h3 { margin: 0 0 4px; font-size: 18px; }
.an-subtitle { margin: 0; font-size: 12px; color: var(--text-muted, #7A9BB5); }
.an-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.an-search-input {
  flex: 1; min-width: 220px;
  background: var(--bg-card, #111820);
  border: 1px solid var(--border, #1E2A35);
  color: var(--text-primary, #E8F0F7);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  padding: 7px 10px; border-radius: 4px;
}
/* Inner-scroll table area so the table's <thead> can stick to its top
   without hiding behind the overlay-level sticky header. */
#an-body {
  max-height: calc(100vh - var(--chrome-h, 90px) - 260px);
  overflow-y: auto;
  border: 1px solid var(--border, #1E2A35);
  border-radius: 4px;
}
#an-body .fav-table-full thead th {
  position: sticky; top: 0; z-index: 2;
  box-shadow: 0 1px 0 var(--border, #1E2A35);
}
/* Per-row 📍 fly-to button — icon only, no border. */
.an-row-map {
  background: transparent;
  border: 0;
  color: var(--text-primary, #E8F0F7);
  cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  font-size: 14px; line-height: 1;
}
.an-row-map:hover { background: rgba(255, 214, 0, 0.14); }
.an-row-map-disabled {
  color: var(--text-muted, #3D5A70);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.an-asset-link {
  color: var(--text-primary, #E8F0F7);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted, #3D5A70);
}
.an-asset-link:hover {
  color: #FFD600;
  border-bottom-color: #FFD600;
}
.an-upgrade-hint {
  margin: 8px 0 12px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid #FFB74D; background: rgba(255, 183, 77, 0.08);
  color: #FFB74D; font-size: 12px;
}
.an-upgrade-hint a { color: #FFB74D; font-weight: 600; }
[data-theme="light"] #analytics-overlay { background: var(--bg-primary, #F4F7FB); }

/* Floating "clear analytics overlay" pill — shown on the map after Show on Map. */
.an-map-pill {
  position: fixed;
  top: calc(var(--chrome-h, 90px) + 12px);
  right: 12px;
  z-index: 800;            /* above map, below topbar (1000) and overlays (999) */
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: rgba(255, 214, 0, 0.16);
  border: 1px solid #FFD600;
  color: #FFD600;
  font-size: 12px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.an-map-pill.hidden { display: none; }
.an-map-pill button {
  background: transparent; border: 0; cursor: pointer;
  color: #FFD600; font-weight: 700; font-size: 12px;
  padding: 2px 6px; border-radius: 4px;
}
.an-map-pill button:hover { background: rgba(255, 214, 0, 0.25); }
[data-theme="light"] .an-map-pill {
  background: rgba(245, 158, 11, 0.14);
  border-color: #B45309;
  color: #92400E;
}
[data-theme="light"] .an-map-pill button { color: #92400E; }

/* ─── Infrastructure overlay: inline profile + breadcrumb ────────────
 * When a port row is clicked, the overlay swaps from list-mode to
 * profile-mode: the tabs/filters/summary/body/pagination collapse
 * and #it-profile-view takes over. The header h2 turns into a
 * "← Infrastructure / Port Name" breadcrumb so the user can step back
 * without losing their place. */
.it-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 18px;
}
.it-crumb-root {
  cursor: default;
}
#infra-overlay.mode-profile .it-crumb-root {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
#infra-overlay.mode-profile .it-crumb-root::before {
  content: "← ";
  margin-right: 2px;
}
#infra-overlay.mode-profile .it-crumb-root:hover { color: var(--text-primary); }
.it-crumb-sep {
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 2px;
}
.it-crumb-leaf {
  color: var(--text-primary);
  font-weight: 600;
}

/* Visibility swap between list view and profile view */
#infra-overlay.mode-profile .vt-tabs,
#infra-overlay.mode-profile .favorites-toolbar,
#infra-overlay.mode-profile #it-summary,
#infra-overlay.mode-profile #it-body,
#infra-overlay.mode-profile #it-pagination { display: none !important; }

.it-profile-view {
  padding: 16px 20px 32px;
  overflow-y: auto;
}
.it-profile-view.hidden { display: none; }

/* Reuse the same .profile-* component styles by including profile.css
 * styles from a tighter scope. The overlay renders the exact same
 * markup as the standalone profile page so nothing else needs to
 * change to keep the look consistent. */

/* Vessels & Fleet overlay shares the same inline-profile + breadcrumb
 * pattern as the Infrastructure overlay above. */
#vessels-overlay.mode-profile .vt-tabs,
#vessels-overlay.mode-profile .favorites-toolbar,
#vessels-overlay.mode-profile #vt-summary,
#vessels-overlay.mode-profile #vt-body,
#vessels-overlay.mode-profile #vt-pagination { display: none !important; }
#vessels-overlay.mode-profile .it-crumb-root {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
#vessels-overlay.mode-profile .it-crumb-root::before { content: "← "; margin-right: 2px; }
#vessels-overlay.mode-profile .it-crumb-root:hover { color: var(--text-primary); }
