/* ==============================================================================
   SEAWATCH OCEANIC™ — MARITIME DOMAIN AWARENESS & VTS COMMAND CENTER
   Enterprise Slicing for Commercial Vessel Traffic Monitoring (Southeast Asia)
   Zero AI Templates • True Naval ECDIS Cockpit Styling & Hydrodynamic Animations
   ============================================================================== */

:root {
  --bg-deep: #070a12;
  --bg-header: #0c121e;
  --bg-sidebar: #0e1524;
  --bg-surface: #121c30;
  --bg-surface-hover: #18253f;
  --bg-surface-active: #1d2e4e;
  --bg-input: #0a0f1a;
  --bg-modal: #0f1728;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-accent: #0284c7;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --color-green: #10b981;
  --color-red: #ef4444;
  --color-amber: #f59e0b;
  --color-cyan: #06b6d4;
  --color-sky: #38bdf8;
  --color-indigo: #6366f1;
  --color-emerald: #059669;

  --header-height: 48px;
  --bottom-bar-height: 30px;
  --sidebar-width: 340px;
  --inspector-width: 390px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  user-select: none;
  font-size: 13px;
  line-height: 1.4;
}

/* Tabular Numerals for Nautical / Telemetry Data */
.tabular-nums {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.text-green { color: var(--color-green) !important; }
.text-red { color: var(--color-red) !important; }
.text-amber { color: var(--color-amber) !important; }
.text-cyan { color: var(--color-cyan) !important; }
.text-sky { color: var(--color-sky) !important; }

/* Custom Enterprise Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Main C2 Application Grid */
#c2-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ==============================================================================
   1. TOP MARITIME COMMAND BAR (Integrated Cockpit Header)
   ============================================================================== */
#c2-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.c2-brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.c2-brand-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c2-radar-svg {
  width: 26px;
  height: 26px;
  animation: radarRotate 6s linear infinite;
}

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

.c2-brand-text {
  display: flex;
  flex-direction: column;
}

.c2-brand-company {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.2;
}

.c2-brand-subtitle {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.c2-stream-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-left: 6px;
}

.c2-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 6px var(--color-green);
  animation: pulseDot 2s infinite ease-in-out;
}

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

.c2-stream-text {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-green);
}

/* Center Metrics Ribbon */
.c2-metrics-ribbon {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 15, 26, 0.7);
  padding: 3px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.c2-metric-chip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c2-chip-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.c2-chip-val {
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.c2-metric-divider {
  width: 1px;
  height: 14px;
  background: var(--border-subtle);
}

/* Header Right Actions */
.c2-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.c2-coords-display {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 15, 26, 0.6);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
}

.c2-coord-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.c2-coord-val {
  color: var(--color-sky);
  font-weight: 600;
}

.c2-clock-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 1px 6px;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

.c2-clock-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.c2-clock-tag {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  width: 18px;
}

.c2-clock-time {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
}

.c2-nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  height: 30px;
  padding: 0 10px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.c2-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
}

.c2-nav-btn:hover {
  background: var(--bg-surface-hover);
  color: #ffffff;
  border-color: var(--border-medium);
}

.c2-nav-btn:hover svg {
  stroke: #ffffff;
}

.c2-alerts-btn {
  position: relative;
}

.c2-alert-count-pill {
  background: var(--color-red);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 2px;
}

.c2-operator-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 6px;
  border-left: 1px solid var(--border-subtle);
}

.c2-operator-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--color-sky);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c2-operator-info {
  display: flex;
  flex-direction: column;
}

.c2-operator-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.1;
}

.c2-operator-role {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==============================================================================
   2. MAIN OPERATIONS STAGE (Sidebar + Center Map + Inspector)
   ============================================================================== */
#c2-stage {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--header-height) - var(--bottom-bar-height));
}

/* LEFT SIDEBAR */
#c2-fleet-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: transform 0.25s ease, margin-left 0.25s ease;
}

#c2-fleet-sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
}

.c2-sidebar-header {
  padding: 10px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c2-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c2-sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.c2-sidebar-title svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-sky);
}

.c2-toggle-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
}

.c2-toggle-sidebar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.c2-toggle-sidebar-btn svg {
  width: 14px;
  height: 14px;
}

/* Search Box */
.c2-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.c2-search-box svg {
  position: absolute;
  left: 8px;
  width: 13px;
  height: 13px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.c2-search-box input {
  width: 100%;
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0 26px 0 28px;
  color: #ffffff;
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s ease;
}

.c2-search-box input:focus {
  border-color: var(--color-sky);
}

.c2-search-clear {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

/* Company Select */
.c2-company-filter-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.c2-sub-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.c2-company-select {
  width: 100%;
  height: 26px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: #e2e8f0;
  font-size: 11px;
  padding: 0 6px;
  outline: none;
  cursor: pointer;
}

.c2-company-select:focus {
  border-color: var(--color-sky);
}

/* Filter Tabs */
.c2-filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--bg-input);
  padding: 2px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.c2-tab-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.c2-tab-pill:hover {
  color: #ffffff;
}

.c2-tab-pill.active {
  background: #1e293b;
  color: #ffffff;
  font-weight: 700;
}

/* Fleet List Scroll Area */
.c2-fleet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Vessel Card in Sidebar */
.c2-vessel-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: all 0.12s ease;
}

.c2-vessel-row:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.c2-vessel-row.active {
  background: var(--bg-surface-active);
  border-color: var(--color-sky);
  box-shadow: inset 3px 0 0 var(--color-sky);
}

.c2-vessel-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c2-vessel-name-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c2-vessel-type-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.c2-vessel-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.c2-vessel-sog-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-green);
}

.c2-vessel-row-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.c2-vessel-route {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.c2-vessel-cog {
  font-weight: 600;
  color: var(--text-secondary);
}

.c2-vessel-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.c2-vessel-hw-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.c2-vessel-hw-status {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}

.hw-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-green);
}

.hw-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-red);
}

.c2-vessel-mmsi {
  color: var(--text-muted);
}

/* Sidebar Footer */
.c2-sidebar-footer {
  padding: 8px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.c2-add-ship-btn {
  width: 100%;
  height: 28px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.c2-add-ship-btn svg {
  width: 13px;
  height: 13px;
  stroke: var(--color-sky);
}

.c2-add-ship-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* CENTER MAP VIEWPORT */
#c2-map-wrapper {
  flex: 1;
  position: relative;
  background: #070a12;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: #070a12;
}

/* Sidebar Re-open Pill */
#c2-sidebar-reopen-btn {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  align-items: center;
  gap: 5px;
}

#c2-sidebar-reopen-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-sky);
}

#c2-sidebar-reopen-btn:hover {
  background: var(--bg-surface-hover);
}

/* FLOATING WEATHER & OCEAN BAROMETER HUD */
.c2-weather-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 550;
  background: rgba(12, 18, 30, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 7px 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.c2-weather-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.c2-weather-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 5px var(--color-cyan);
}

.c2-weather-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 12px;
}

.c2-w-item {
  display: flex;
  flex-direction: column;
}

.c2-w-lbl {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.c2-w-val {
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

.c2-w-sub {
  font-size: 8.5px;
  color: var(--text-dim);
}

/* MAP HUD TOP-RIGHT */
.c2-map-hud-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 260px;
}

.c2-hud-card {
  background: rgba(14, 21, 36, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.c2-hud-card-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.c2-basemap-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.c2-hud-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}

.c2-hud-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.c2-hud-btn.active {
  background: var(--color-sky);
  color: #090e17;
  border-color: var(--color-sky);
  font-weight: 700;
}

/* Overlay Toggles */
.c2-overlay-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.c2-toggle-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
}

.c2-toggle-item input {
  display: none;
}

.c2-toggle-custom {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.c2-toggle-item input:checked + .c2-toggle-custom {
  background: var(--color-sky);
  border-color: var(--color-sky);
}

.c2-toggle-item input:checked + .c2-toggle-custom::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 3px;
  height: 6px;
  border: solid #090e17;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.c2-toggle-text {
  user-select: none;
}

.c2-reset-view-btn {
  background: rgba(14, 21, 36, 0.92);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.c2-reset-view-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-sky);
}

.c2-reset-view-btn:hover {
  background: #1e293b;
  border-color: var(--color-sky);
}

/* ==============================================================================
   RIGHT TACTICAL VESSEL INSPECTOR (ECDIS Console)
   ============================================================================== */
.c2-inspector-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: var(--inspector-width);
  max-height: calc(100% - 24px);
  background: rgba(12, 18, 30, 0.97);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  z-index: 700;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.c2-inspector-panel.open {
  display: flex;
}

.c2-inspector-header {
  padding: 10px 14px;
  background: #121c2e;
  border-bottom: 1px solid var(--border-subtle);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c2-inspector-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.c2-ship-type-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-green);
  text-transform: uppercase;
}

.c2-ship-name-header {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.c2-inspector-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
}

.c2-inspector-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.c2-inspector-close svg {
  width: 14px;
  height: 14px;
}

.c2-inspector-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Vessel Silhouette Elevation View */
.insp-silhouette-banner {
  background: #090e17;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insp-silhouette-svg {
  width: 100%;
  max-height: 48px;
}

.insp-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insp-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px;
}

/* Gauges Dual Row */
.insp-gauges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.insp-gauge-box {
  background: #090e17;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.insp-gauge-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-green);
  line-height: 1.1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.insp-gauge-unit {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.insp-compass-rose {
  width: 52px;
  height: 52px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.insp-compass-circle {
  width: 100%;
  height: 100%;
}

.insp-compass-needle {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Speed Sparkline Live Chart */
.insp-sparkline-box {
  margin-top: 8px;
  background: #090e17;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insp-sparkline-canvas {
  width: 100%;
  height: 28px;
}

/* Coordinates Dual Box */
.insp-coords-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.insp-coord-item {
  background: #090e17;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 6px 8px;
}

.insp-coord-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.insp-coord-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-sky);
  margin-top: 1px;
}

/* Voyage Progress */
.insp-voyage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.insp-port-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
}

.insp-port-name {
  font-size: 11px;
  color: #ffffff;
  font-weight: 700;
}

.insp-progress-bar-container {
  width: 100%;
  height: 5px;
  background: #070d18;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.insp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-green));
  border-radius: 3px;
}

/* Hardware Box */
.insp-hw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.insp-hw-table td {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.insp-hw-table td:first-child {
  color: var(--text-muted);
  width: 44%;
}

.insp-hw-table td:last-child {
  color: #e2e8f0;
  font-weight: 600;
  text-align: right;
}

.insp-router-toggle-btn {
  width: 100%;
  padding: 7px;
  margin-top: 8px;
  border-radius: 3px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.router-btn-up {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--color-green);
}

.router-btn-up:hover {
  background: rgba(16, 185, 129, 0.22);
}

.router-btn-down {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--color-red);
}

.router-btn-down:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* Action Buttons in Inspector */
.insp-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.insp-btn {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.12s ease;
}

.insp-btn:hover {
  background: #334155;
  color: #ffffff;
}

.insp-btn svg {
  width: 13px;
  height: 13px;
  stroke: var(--color-sky);
}

/* ==============================================================================
   3. BOTTOM LIVE NMEA 0183 & TELEMETRY STREAM RIBBON
   ============================================================================== */
#c2-bottom-terminal {
  background: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 800;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.4);
}

.c2-terminal-bar {
  height: var(--bottom-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.c2-terminal-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.c2-term-badge {
  background: #1e293b;
  color: var(--color-sky);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.c2-term-desc {
  font-size: 10px;
  color: var(--text-muted);
}

.c2-terminal-latest {
  flex: 1;
  max-width: 650px;
  margin: 0 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c2-ticker-time {
  color: var(--color-cyan);
}

.c2-terminal-controls {
  display: flex;
  align-items: center;
}

.c2-term-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.c2-term-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.c2-term-toggle-btn svg {
  width: 12px;
  height: 12px;
}

/* Expanded Terminal Console Drawer */
.c2-terminal-content {
  height: 130px;
  background: #05080e;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.c2-terminal-header-tools {
  padding: 4px 12px;
  background: #0d1422;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.c2-term-btn {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  cursor: pointer;
  margin-left: 4px;
}

.c2-term-btn:hover {
  color: #ffffff;
}

.c2-terminal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
  display: flex;
  flex-direction: column-reverse;
}

.c2-term-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.c2-term-line .time { color: var(--color-sky); }
.c2-term-line .vessel { color: #ffffff; font-weight: 700; }
.c2-term-line .nmea { color: var(--color-green); }
.c2-term-line .device { color: var(--color-amber); }

/* ==============================================================================
   4. MODALS & FORMS
   ============================================================================== */
.c2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.c2-modal-backdrop.open {
  display: flex;
}

.c2-modal-window {
  background: var(--bg-modal);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.c2-modal-wide {
  max-width: 1080px;
}

.c2-modal-head {
  padding: 12px 16px;
  background: #121b2c;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c2-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.c2-modal-title svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-sky);
}

.c2-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.c2-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.c2-modal-close:hover {
  color: #ffffff;
}

.c2-modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* Tabs Bar inside Modals */
.c2-tabs-bar {
  display: flex;
  background: #090e17;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
}

.c2-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
}

.c2-tab-btn:hover {
  color: #ffffff;
}

.c2-tab-btn.active {
  color: var(--color-sky);
  border-bottom-color: var(--color-sky);
  font-weight: 700;
}

/* Enterprise Tables */
.c2-table-wrapper {
  overflow-x: auto;
}

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

.c2-table thead {
  background: #0b121f;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.c2-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
}

.c2-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

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

/* Forms */
.c2-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.c2-form-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.c2-form-input {
  width: 100%;
  height: 30px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: #ffffff;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
}

.c2-form-input:focus {
  border-color: var(--color-sky);
}

.c2-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.c2-btn-primary {
  background: #0284c7;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.c2-btn-primary:hover {
  background: #0369a1;
}

.c2-btn-secondary {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
}

.c2-btn-secondary:hover {
  background: #334155;
  color: #ffffff;
}

.c2-alert-banner {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.c2-alert-banner code {
  color: var(--color-sky);
  font-weight: 700;
}

/* Toast Box */
#toast-alert-box {
  position: fixed;
  bottom: 45px;
  right: 20px;
  background: #1e293b;
  border: 1px solid var(--border-medium);
  border-left: 3px solid var(--color-sky);
  color: #ffffff;
  padding: 9px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 3000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: none;
  max-width: 380px;
}

/* ==============================================================================
   5. LEAFLET MAP & MARITIME VESSEL MARKERS & ANIMATED WAKES
   ============================================================================== */
.leaflet-container {
  background-color: #070a12 !important;
  font-family: inherit !important;
}

.leaflet-bar {
  border: 1px solid var(--border-medium) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  border-radius: 4px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: rgba(14, 21, 36, 0.95) !important;
  color: #cbd5e1 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
}

.leaflet-bar a:hover {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

.leaflet-control-attribution {
  background: rgba(7, 10, 18, 0.8) !important;
  color: #475569 !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: #64748b !important;
}

/* Directional AIS Vessel Marker with Hydrodynamic Wake */
.c2-vessel-marker-wrapper {
  position: relative;
  width: 140px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: auto;
  cursor: pointer;
}

.c2-vessel-hull-box {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.c2-vessel-hull-svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
  transition: transform 0.4s ease-out;
}

/* Animated Bow Wake Ripple behind Vessel */
.c2-bow-wake {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  pointer-events: none;
  transform-origin: center center;
  z-index: -1;
}

.c2-wake-wave {
  position: absolute;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  animation: bowWakeRipple 2.2s infinite ease-out;
}

.c2-wake-wave:nth-child(2) {
  animation-delay: 1.1s;
}

@keyframes bowWakeRipple {
  0% {
    width: 6px;
    height: 6px;
    top: 11px;
    left: 11px;
    opacity: 0.9;
    border-color: rgba(56, 189, 248, 0.8);
  }
  100% {
    width: 28px;
    height: 28px;
    top: 0;
    left: 0;
    opacity: 0;
    border-color: rgba(56, 189, 248, 0);
  }
}

/* Velocity Vector Line (ECDIS 6-min standard) */
.c2-vessel-vector-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5px;
  transform-origin: top center;
  pointer-events: none;
}

/* Tactical Range Ring Sonar Sweep */
.c2-vessel-reticle {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 1.5px dashed var(--color-sky);
  border-radius: 50%;
  animation: sonarSweepRing 6s linear infinite;
  pointer-events: none;
  top: -9px;
  left: 48px;
}

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

/* Crisp Vessel Name Label */
.c2-vessel-nameplate {
  margin-top: 2px;
  background: rgba(7, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: all 0.15s ease;
  line-height: 15px;
}

.c2-vessel-marker-wrapper:hover {
  z-index: 10000 !important;
}

.c2-vessel-marker-wrapper:hover .c2-vessel-nameplate {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.05);
}

.c2-vessel-marker-wrapper.selected {
  z-index: 9999 !important;
}

.c2-vessel-marker-wrapper.selected .c2-vessel-nameplate {
  background: #0284c7;
  border-color: #38bdf8;
}

/* Flashing Lighthouse Beacon Marker */
.c2-lighthouse-icon {
  width: 20px;
  height: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
}

.c2-lighthouse-pulse {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.6);
  animation: beaconFlash 2.5s infinite ease-in-out;
}

@keyframes beaconFlash {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.6); box-shadow: 0 0 10px #facc15; }
}
