/* =====================================================================
   CargoRise â€” Arctic Ocean (hand-tuned layer)
   Loaded after the auto-generated colour map. Only active on
   html.theme-arctic, so the dark theme is completely untouched.
   ===================================================================== */
html.theme-arctic {
  --bg: #F4F7FB;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-hover: #F1F5FA;
  --surface-active: #FFFFFF;
  --ink: #0B1F3A;
  --muted: #5B6B82;
  --line: rgba(11, 31, 58, 0.09);
  --line-bright: rgba(14, 116, 144, 0.28);
  --brand-blue: #0369A1;
  --brand-blue-deep: #0E4C75;
  --brand-green: #059669;
  --brand-green-bright: #059669;
  --cyan: #0E7490;
  --cyan-soft: rgba(14, 116, 144, 0.10);
  --amber: #B45309;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --rose: #DC2626;
  --rose-soft: rgba(220, 38, 38, 0.10);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.12);
  --violet: #6D28D9;
  --violet-soft: rgba(109, 40, 217, 0.10);
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.04), 0 10px 28px -10px rgba(11, 31, 58, 0.16);
  --glass-border: 1px solid rgba(11, 31, 58, 0.09);
  --glass-border-focus: 1px solid rgba(14, 116, 144, 0.55);
  color-scheme: light;
  background-color: #F4F7FB !important;
  background-image:
    radial-gradient(1100px 520px at 88% -8%, #D6EEFB 0%, transparent 60%),
    radial-gradient(900px 460px at 0% 0%, #E3F3EF 0%, transparent 55%) !important;
  background-attachment: fixed !important;
}
html.theme-arctic body { color: var(--ink); }

/* Navy sidebar keeps the original (dark) design language */
html.theme-arctic .keep-dark {
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --ink: #E6EEF8;
  --muted: #9FB3CC;
  --line: rgba(255, 255, 255, 0.08);
  --brand-green-bright: #34d399;
  --cyan: #38bdf8;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}
html.theme-arctic .module-sidebar {
  background: linear-gradient(180deg, #0B1F3A 0%, #0A2A4A 100%) !important;
  border-right: 1px solid rgba(11, 31, 58, 0.2) !important;
  box-shadow: 6px 0 30px -12px rgba(11, 31, 58, 0.35) !important;
}

/* Background network canvas: subtle on light */
html.theme-arctic #bgNetworkCanvas { opacity: 0.28; mix-blend-mode: multiply; }

/* Topbar & panels: crisp white cards with soft depth */
html.theme-arctic .topbar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(11, 31, 58, 0.08) !important;
}
html.theme-arctic .panel,
html.theme-arctic .metric-card {
  box-shadow: var(--shadow) !important;
}

/* Primary actions: Arctic ocean gradient */
html.theme-arctic .btn-primary,
html.theme-arctic .access-button,
html.theme-arctic .btn-landing-primary {
  background: linear-gradient(135deg, #0E7490 0%, #0EA5E9 100%) !important;
  color: #FFFFFF !important;
  border: 0 !important;
  box-shadow: 0 8px 20px -8px rgba(14, 116, 144, 0.65) !important;
}
html.theme-arctic .btn-ghost,
html.theme-arctic .btn-landing-login,
html.theme-arctic .btn-secondary {
  background: #FFFFFF !important;
  color: #0B1F3A !important;
  border: 1px solid rgba(11, 31, 58, 0.12) !important;
}

/* Inputs / selects */
html.theme-arctic input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.theme-arctic select,
html.theme-arctic textarea {
  background-color: #F6F9FC !important;
  color: #0B1F3A !important;
  border-color: rgba(11, 31, 58, 0.12) !important;
}
html.theme-arctic .keep-dark input,
html.theme-arctic .keep-dark select { background-color: rgba(255,255,255,0.06) !important; color: #E6EEF8 !important; }
html.theme-arctic option { background: #FFFFFF !important; color: #0B1F3A !important; }
html.theme-arctic ::placeholder { color: #94A3B8 !important; }

/* Login: white card over Arctic glow */
html.theme-arctic .lockscreen {
  background: radial-gradient(circle at center, rgba(244, 247, 251, 0.55), rgba(220, 235, 247, 0.85) 100%) !important;
  backdrop-filter: blur(6px) !important;
}
html.theme-arctic .lock-panel {
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(11, 31, 58, 0.08) !important;
  box-shadow: 0 30px 80px -24px rgba(11, 31, 58, 0.35) !important;
}

/* Landing page */
html.theme-arctic .landing-page {
  background: transparent !important;
}
html.theme-arctic .landing-header {
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(11, 31, 58, 0.07) !important;
}
html.theme-arctic .hero-title span {
  background: linear-gradient(135deg, #0E7490 0%, #0EA5E9 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Leaflet map â€” light ocean canvas */
html.theme-arctic #overviewMap { background: #DCEBF7 !important; }
html.theme-arctic #overviewMap .leaflet-tile-pane { filter: saturate(1.05) contrast(1.02) !important; }
html.theme-arctic .leaflet-container { background: #DCEBF7 !important; }
html.theme-arctic .leaflet-bar a,
html.theme-arctic #overviewMap .leaflet-control-zoom-in,
html.theme-arctic #overviewMap .leaflet-control-zoom-out {
  background: #FFFFFF !important; color: #0B1F3A !important; border-color: rgba(11,31,58,0.1) !important;
}
html.theme-arctic .leaflet-control-attribution { background: rgba(255,255,255,0.8) !important; color: #5B6B82 !important; }
html.theme-arctic #mapVesselHudPanel {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(11, 31, 58, 0.08) !important;
  box-shadow: 0 20px 50px -18px rgba(11, 31, 58, 0.35) !important;
}

/* Tables */
html.theme-arctic table thead th { background: #F1F5FA !important; color: #5B6B82 !important; }

/* Scrollbars */
html.theme-arctic ::-webkit-scrollbar-track { background: #EEF3F9 !important; }
html.theme-arctic ::-webkit-scrollbar-thumb { background: #C3D3E4 !important; border-color: #EEF3F9 !important; }

/* Theme switch button */
.theme-switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: inherit;
  background: rgba(255,255,255,0.06); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.12);
}
html.theme-arctic .theme-switch-btn { background: #FFFFFF; color: #0B1F3A; border: 1px solid rgba(11,31,58,0.12); }

/* =====================================================================
   PREMIUM POLISH â€” smooth motion, depth & refined interactions
   ===================================================================== */
html.theme-arctic { scroll-behavior: smooth; }
html.theme-arctic body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html.theme-arctic ::selection { background: rgba(14, 165, 233, 0.22); color: #0B1F3A; }

/* Silky transitions on interactive surfaces (targeted selectors for optimal rendering performance) */
html.theme-arctic .panel {
  transition: box-shadow .35s cubic-bezier(.22,.61,.36,1),
              border-color .35s cubic-bezier(.22,.61,.36,1) !important;
}

html.theme-arctic .data-table tbody tr {
  transition: background-color .2s ease !important;
}

html.theme-arctic .metric-card,
html.theme-arctic .btn,
html.theme-arctic .module-link,
html.theme-arctic .form-control,
html.theme-arctic .teaser-card,
html.theme-arctic .cost-card,
html.theme-arctic .theme-switch-btn {
  transition: background-color .35s cubic-bezier(.22,.61,.36,1),
              border-color .35s cubic-bezier(.22,.61,.36,1),
              box-shadow .35s cubic-bezier(.22,.61,.36,1),
              color .25s ease,
              transform .35s cubic-bezier(.22,.61,.36,1) !important;
}

/* Panels: crisp white cards with layered soft depth */
html.theme-arctic .panel {
  border-radius: 14px;
  border: 1px solid rgba(11, 31, 58, 0.07) !important;
  box-shadow: 0 1px 2px rgba(11,31,58,.04), 0 12px 32px -14px rgba(11,31,58,.18) !important;
}
html.theme-arctic .panel:hover {
  box-shadow: 0 1px 2px rgba(11,31,58,.05), 0 18px 40px -16px rgba(11,31,58,.24) !important;
}

/* KPI cards: gentle lift + coloured halo on hover */
html.theme-arctic .metric-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFCFE 100%) !important;
  border: 1px solid rgba(11, 31, 58, 0.07) !important;
  box-shadow: 0 1px 2px rgba(11,31,58,.04), 0 10px 26px -14px rgba(11,31,58,.20) !important;
}
html.theme-arctic .metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.35) !important;
  box-shadow: 0 2px 4px rgba(11,31,58,.05), 0 22px 44px -18px rgba(14,116,144,.38) !important;
}
html.theme-arctic .metric-card.warning:hover { border-color: rgba(220,38,38,.32) !important; box-shadow: 0 2px 4px rgba(11,31,58,.05), 0 22px 44px -18px rgba(220,38,38,.30) !important; }
html.theme-arctic .metric-card.amber:hover   { border-color: rgba(217,119,6,.35) !important; box-shadow: 0 2px 4px rgba(11,31,58,.05), 0 22px 44px -18px rgba(217,119,6,.30) !important; }
html.theme-arctic .metric-card.success:hover { border-color: rgba(5,150,105,.35) !important; box-shadow: 0 2px 4px rgba(11,31,58,.05), 0 22px 44px -18px rgba(5,150,105,.30) !important; }
html.theme-arctic .metric-card.violet:hover  { border-color: rgba(109,40,217,.32) !important; box-shadow: 0 2px 4px rgba(11,31,58,.05), 0 22px 44px -18px rgba(109,40,217,.28) !important; }
html.theme-arctic .metric-card::after {
  background: linear-gradient(90deg, transparent, rgba(14,165,233,.10), transparent) !important;
}
html.theme-arctic .metric-card:active { transform: translateY(-1px) scale(.995); }

/* Buttons: tactile lift */
html.theme-arctic .btn-primary:hover,
html.theme-arctic .access-button:hover,
html.theme-arctic .btn-landing-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06) saturate(1.05);
  box-shadow: 0 14px 28px -10px rgba(14, 116, 144, 0.65) !important;
}
html.theme-arctic .btn-ghost:hover,
html.theme-arctic .btn-landing-login:hover,
html.theme-arctic .btn-secondary:hover {
  background: #F4F9FD !important;
  border-color: rgba(14, 116, 144, 0.35) !important;
  color: #0E7490 !important;
}
html.theme-arctic .btn:active { transform: translateY(0) scale(.98); }

/* Inputs: premium focus ring */
html.theme-arctic .form-control:focus,
html.theme-arctic input:focus,
html.theme-arctic select:focus,
html.theme-arctic textarea:focus {
  outline: none !important;
  background-color: #FFFFFF !important;
  border-color: rgba(14, 165, 233, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14) !important;
}

/* Tables: soft teal row hover */
html.theme-arctic .data-table tbody tr:hover td { background: rgba(14, 165, 233, 0.05) !important; }

/* Sidebar: refined active state with glowing rail */
html.theme-arctic .module-link:hover { background: rgba(255,255,255,0.06) !important; color: #FFFFFF !important; }
html.theme-arctic .module-link.active {
  background: linear-gradient(90deg, rgba(14,165,233,.22) 0%, rgba(14,165,233,.04) 100%) !important;
  color: #FFFFFF !important;
  box-shadow: inset 3px 0 0 #38BDF8, 0 0 22px -8px rgba(56,189,248,.55) !important;
}

/* Theme switch button */
html.theme-arctic .theme-switch-btn { box-shadow: 0 1px 2px rgba(11,31,58,.06); }
.theme-switch-btn:hover { transform: rotate(180deg); }
.theme-switch-btn { transition: transform .5s cubic-bezier(.22,.61,.36,1), background-color .3s ease !important; }

/* Smooth page fade when switching theme / first paint */
@keyframes cargoThemeIn { from { opacity: 0; } to { opacity: 1; } }
html.theme-entering body { animation: cargoThemeIn .45s ease-out both; }
html.theme-leaving body { opacity: 0 !important; transition: opacity .28s ease-in !important; }

@media (prefers-reduced-motion: reduce) {
  html.theme-arctic *, html.theme-arctic *::before, html.theme-arctic *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}


/* =====================================================================
   SHIPMENT INSPECTOR SHEET - Crystal Clear, 100% Opaque (No Blur / No Ghosting)
   ===================================================================== */
html.theme-arctic .holo-drawer.open {
  transform-style: flat !important;
  perspective: none !important;
}
html.theme-arctic .shipment-inspector-sheet {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-left: 1px solid rgba(11, 31, 58, 0.12) !important;
  box-shadow: -15px 0 45px rgba(11, 31, 58, 0.18), -2px 0 8px rgba(11, 31, 58, 0.06) !important;
}
html.theme-arctic .inspector-fade-lift {
  animation: none !important;
  filter: none !important;
  will-change: auto !important;
  transform: none !important;
}
html.theme-arctic .inspector-head {
  background: #F8FAFC !important;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08) !important;
}
html.theme-arctic .inspector-head h3 {
  color: #0B1F3A !important;
  font-weight: 800 !important;
}
html.theme-arctic .inspector-head div,
html.theme-arctic .inspector-head span {
  color: #334155 !important;
}
html.theme-arctic .inspector-body {
  background: #FFFFFF !important;
}
html.theme-arctic .inspector-card {
  background: #F8FAFC !important;
  border: 1px solid rgba(11, 31, 58, 0.09) !important;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.03) !important;
}
html.theme-arctic .inspector-card span {
  color: #334155 !important;
  font-weight: 700 !important;
}
html.theme-arctic .inspector-card strong {
  color: #0B1F3A !important;
}
html.theme-arctic .inspector-card b {
  color: #0B1F3A !important;
}
html.theme-arctic .inspector-foot {
  background: #F8FAFC !important;
  border-top: 1px solid rgba(11, 31, 58, 0.08) !important;
}

/* =====================================================================
   ANALYTICS SPOTLIGHT MODAL & PRICE TREND (LIGHT OCEAN / ARCTIC THEME)
   ===================================================================== */
html.theme-arctic .dash1-spotlight-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(11, 31, 58, 0.12) !important;
  box-shadow: 0 25px 70px rgba(11, 31, 58, 0.22), 0 0 30px rgba(14, 116, 144, 0.12) !important;
}
html.theme-arctic .dash1-spotlight-header {
  background: #F8FAFC !important;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08) !important;
}
html.theme-arctic #dash1SpotlightTitle {
  color: #0B1F3A !important;
}
html.theme-arctic #dash1SpotlightGradeSelect {
  background: #F1F5F9 !important;
  color: #0B1F3A !important;
  border: 1.5px solid rgba(14, 116, 144, 0.45) !important;
  box-shadow: 0 0 10px rgba(14, 116, 144, 0.12) !important;
}
html.theme-arctic #dash1SpotlightChartWrap {
  background: #FFFFFF !important;
  border: 1px solid rgba(11, 31, 58, 0.09) !important;
  box-shadow: 0 2px 8px rgba(11, 31, 58, 0.04) !important;
}
html.theme-arctic .dash1-spotlight-table th {
  background: #F1F5FA !important;
  color: #475569 !important;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1) !important;
}
html.theme-arctic .dash1-spotlight-table td {
  border-bottom: 1px solid rgba(11, 31, 58, 0.06) !important;
  color: #334155 !important;
}
html.theme-arctic #dash1PriceTrendSelect {
  background: #EAF8FC !important;
  color: #0B1F3A !important;
  border: 1.5px solid rgba(14, 116, 144, 0.5) !important;
  box-shadow: 0 0 8px rgba(14, 116, 144, 0.15) !important;
}

/* =====================================================================
   CARGOBOT COPILOT - ARCTIC OCEAN (LIGHT THEME)
   ===================================================================== */
html.theme-arctic .copilot-floating-btn {
  background: #FFFFFF !important;
  border: 1.5px solid rgba(14, 116, 144, 0.35) !important;
  box-shadow: 0 12px 30px rgba(11, 31, 58, 0.18), 0 0 20px rgba(14, 116, 144, 0.15) !important;
}
html.theme-arctic .copilot-btn-label {
  color: #0B1F3A !important;
}
html.theme-arctic .copilot-chat-window {
  background: #FFFFFF !important;
  border: 1.5px solid rgba(14, 116, 144, 0.25) !important;
  box-shadow: 0 25px 65px rgba(11, 31, 58, 0.22), 0 0 30px rgba(14, 116, 144, 0.12) !important;
}
html.theme-arctic .copilot-header {
  background: #F8FAFC !important;
  border-bottom: 1px solid rgba(11, 31, 58, 0.08) !important;
}
html.theme-arctic .copilot-title {
  color: #0B1F3A !important;
}
html.theme-arctic .copilot-subtitle {
  color: #64748B !important;
}
html.theme-arctic .copilot-close-btn {
  background: #F1F5FA !important;
  border: 1px solid rgba(11, 31, 58, 0.1) !important;
  color: #475569 !important;
}
html.theme-arctic .copilot-msg-bubble.bot {
  background: #F8FAFC !important;
  border: 1px solid rgba(11, 31, 58, 0.08) !important;
  color: #1E293B !important;
  box-shadow: 0 1px 3px rgba(11, 31, 58, 0.05) !important;
}
html.theme-arctic .copilot-quick-pills {
  background: #F8FAFC !important;
  border-top: 1px solid rgba(11, 31, 58, 0.07) !important;
}
html.theme-arctic .copilot-footer {
  background: #FFFFFF !important;
  border-top: 1px solid rgba(11, 31, 58, 0.08) !important;
}
html.theme-arctic .copilot-input {
  background: #F1F5F9 !important;
  border: 1px solid rgba(11, 31, 58, 0.14) !important;
  color: #0B1F3A !important;
}
html.theme-arctic .copilot-input::placeholder {
  color: #94A3B8 !important;
}

/* D&D Risk Shield & Share Link Modals (Arctic Theme) */
html.theme-arctic #dndRiskModal .dialog-content,
html.theme-arctic #shareLinkModal .dialog-content {
  background: #FFFFFF !important;
  border-color: rgba(11, 31, 58, 0.12) !important;
  color: #0B1F3A !important;
  box-shadow: 0 20px 50px rgba(11, 31, 58, 0.15) !important;
}
html.theme-arctic #publicTrackingPreviewModal .dialog-content {
  background: #F8FAFC !important;
  border-color: rgba(14, 116, 144, 0.25) !important;
  color: #0B1F3A !important;
}
html.theme-arctic #dndRiskModal h2,
html.theme-arctic #shareLinkModal h2,
html.theme-arctic #publicTrackingPreviewModal h2 {
  color: #0B1F3A !important;
}
