/* ─────────────────────────────────────────────────────────────
   Fleet Planner — Styles
   Basis aus der alten Single-File-App, ergänzt um Auth-UI.
   ───────────────────────────────────────────────────────────── */

:root {
  --abyss:#0a1929; --deep:#102a43; --navy:#0a4d8c; --steel:#486581;
  --mist:#d9e2ec; --fog:#f0f4f8; --pearl:#ffffff; --brass:#b8860b;
  --copper:#c44b1c; --sage:#2e8540; --berry:#c2185b;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Source Sans 3', -apple-system, sans-serif; color: var(--deep); background: var(--fog); }
button, select, input { font-family: inherit; }

#map { position: absolute; inset: 0; z-index: 1; }

/* ───────── Login-Overlay ───────── */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--abyss), var(--navy));
  display: none; align-items: center; justify-content: center;
  z-index: 10000;
}
.login-overlay.visible { display: flex; }
.login-card {
  background: white;
  border-radius: 12px;
  padding: 32px 36px;
  box-shadow: var(--shadow-lg);
  min-width: 340px;
  max-width: 90vw;
}
.login-card h1 { font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.login-sub { color: var(--steel); font-size: 13px; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 11px; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.login-card input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--mist); border-radius: 6px;
  font-size: 14px; color: var(--deep);
}
.login-card input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,77,140,0.12); }
.login-error { color: var(--berry); font-size: 12px; min-height: 16px; margin-bottom: 8px; }
.login-btn {
  width: 100%; padding: 11px 16px;
  background: var(--navy); color: white;
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.login-btn:hover { background: var(--deep); }

/* ───────── Brand-Pille ───────── */
.brand {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: var(--abyss); color: var(--pearl);
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
  min-height: 44px;
}
.brand-app {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
}
.brand-icon {
  flex-shrink: 0;
}
.brand-app-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: white;
}
.brand-tagline {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.6px;
  opacity: 0.7;
  text-transform: uppercase;
  margin-top: 1px;
}
.brand-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.25);
}
.brand-tenant {
  display: flex;
  align-items: center;
  padding: 0 4px;
}
.tenant-logo {
  display: block;
}
.brand-spacer {
  width: 8px;
}
.logout-btn {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
}
.logout-btn:hover { background: rgba(255,255,255,0.2); }

/* ───────── Layout-Panels ───────── */
.left-stack {
  position: absolute; top: 60px; left: 16px; bottom: 60px;
  z-index: 500;
  width: 320px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 12px;
}
.selector-panel {
  background: var(--pearl); border-radius: 10px; box-shadow: var(--shadow);
  padding: 12px 14px;
  overflow-y: auto;
  flex: 0 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--mist) transparent;
}
.selector-panel::-webkit-scrollbar { width: 6px; }
.selector-panel::-webkit-scrollbar-thumb { background: var(--mist); border-radius: 3px; }

.selector-panel h2 {
  font-size: 12px; font-weight: 500; color: var(--steel);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px;
}

/* ───────── Fields ───────── */
.field { margin-bottom: 6px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 10px; font-weight: 600; color: var(--steel);
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.8px;
}
.field select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--mist); border-radius: 6px;
  font-size: 13px; background: white; color: var(--deep); cursor: pointer;
}
.field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,77,140,0.12); }

/* ───────── Kalender ───────── */
.calendar {
  background: white; border: 1px solid var(--mist);
  border-radius: 6px; padding: 6px; user-select: none;
}
.calendar.disabled { opacity: 0.5; pointer-events: none; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 4px; }
.cal-nav {
  background: var(--fog); border: none; border-radius: 4px;
  width: 24px; height: 24px; cursor: pointer; font-size: 14px;
  color: var(--steel); display: flex; align-items: center; justify-content: center;
}
.cal-nav:hover:not(:disabled) { background: var(--navy); color: white; }
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-title { font-size: 11px; font-weight: 700; color: var(--deep); flex: 1; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-today {
  background: none; border: 1px solid var(--mist); border-radius: 4px;
  padding: 2px 7px; font-size: 10px; font-weight: 600; color: var(--steel); cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.cal-today:hover { background: var(--fog); color: var(--navy); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.cal-wd { text-align: center; font-size: 9px; font-weight: 700; color: var(--steel); letter-spacing: 0.5px; padding: 1px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  aspect-ratio: 1 / 0.78;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; cursor: default; padding: 2px 0 0;
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; overflow: hidden;
}
.cal-day .cd-num { font-size: 11px; font-weight: 600; color: var(--steel); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cal-day .cd-port {
  font-size: 7px; color: var(--steel); line-height: 1.05; margin-top: 1px;
  text-align: center; padding: 0 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.cal-day.other-month .cd-num { color: var(--mist); }
.cal-day.has-call {
  background: rgba(10, 77, 140, 0.08);
  border-color: rgba(10, 77, 140, 0.15); cursor: pointer;
}
.cal-day.has-call .cd-num { color: var(--navy); font-weight: 700; }
.cal-day.has-call .cd-port { color: var(--navy); font-weight: 600; opacity: 0.85; }
.cal-day.has-call:hover { background: rgba(10, 77, 140, 0.18); border-color: var(--navy); }
.cal-day.today { border-color: var(--brass); }
.cal-day.today .cd-num { color: var(--brass); }
.cal-day.selected { background: var(--navy); border-color: var(--navy); }
.cal-day.selected .cd-num, .cal-day.selected .cd-port { color: white; }

/* ───────── Reference context badge ───────── */
.ref-context {
  margin-top: 10px; padding: 8px 11px;
  background: linear-gradient(135deg, var(--navy), var(--deep));
  color: var(--pearl); border-radius: 6px; font-size: 12px;
  display: none;
}
.ref-context.visible { display: block; }
.ref-context .ref-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ref-context .ref-port { font-size: 14px; font-weight: 500; margin-top: 1px; }
.ref-context .ref-date { font-size: 11px; opacity: 0.85; }
.ref-context .ref-time { font-size: 11px; opacity: 0.75; margin-top: 1px; }
.ref-context .clear-ref {
  background: none; border: 1px solid rgba(255,255,255,0.3);
  color: white; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; cursor: pointer;
}

/* ───────── Port-Agent-Karte ───────── */
.port-agent-card {
  margin-top: 6px; padding: 8px 11px;
  background: var(--fog); border: 1px solid var(--mist);
  border-radius: 6px; font-size: 12px; display: none;
}
.port-agent-card.visible { display: block; }
.port-agent-card .pa-header { display: flex; align-items: center; margin-bottom: 4px; gap: 6px; }
.port-agent-card .pa-title { font-size: 10px; font-weight: 700; color: var(--steel); text-transform: uppercase; letter-spacing: 0.6px; }
.port-agent-card .pa-name { font-size: 12px; font-weight: 600; color: var(--deep); margin-bottom: 4px; white-space: pre-line; line-height: 1.3; }
.port-agent-card .pa-row { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; font-size: 11px; line-height: 1.3; }
.port-agent-card .pa-label { flex-shrink: 0; width: 50px; color: var(--steel); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.port-agent-card .pa-value { flex: 1; color: var(--deep); white-space: pre-line; line-height: 1.35; }
.port-agent-card .pa-value a { color: var(--navy); text-decoration: none; }
.port-agent-card .pa-value a:hover { text-decoration: underline; }
.port-agent-card .pa-empty { font-size: 11px; color: var(--steel); font-style: italic; text-align: center; padding: 6px; }

/* ───────── Results Panel ───────── */
.results-panel {
  position: absolute; top: 60px; right: 16px; bottom: 60px;
  z-index: 500; width: 360px; max-width: calc(100vw - 32px);
  background: var(--pearl); border-radius: 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width 0.3s ease;
}
.results-panel.collapsed { width: 56px; }
.results-panel.collapsed .results-empty,
.results-panel.collapsed .accordion,
.results-panel.collapsed .results-header h2 { display: none; }
.results-panel.collapsed .results-header { justify-content: center; padding: 12px 0; }
.results-panel.collapsed .toggle { transform: rotate(180deg); }

.results-header {
  padding: 12px 16px; border-bottom: 1px solid var(--mist);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.results-header h2 {
  font-size: 13px; font-weight: 500; color: var(--steel);
  letter-spacing: 1px; text-transform: uppercase;
}
.toggle {
  background: var(--fog); border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 16px;
  color: var(--steel); display: flex; align-items: center; justify-content: center;
}
.toggle:hover { background: var(--mist); color: var(--navy); }

.results-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  color: var(--steel); font-size: 13px; line-height: 1.5;
}
.anchor-big { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

.accordion { flex: 1; overflow-y: auto; }
.acc-item { border-bottom: 1px solid var(--fog); }
.acc-header {
  width: 100%; background: transparent; border: none; cursor: pointer;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  text-align: left;
}
.acc-header:hover { background: var(--fog); }
.acc-title { flex: 1; display: flex; gap: 10px; align-items: center; }
.acc-icon { font-size: 18px; }
.acc-label { font-size: 13px; font-weight: 600; color: var(--deep); }
.acc-sub { font-size: 11px; color: var(--steel); margin-top: 1px; }
.acc-count {
  background: var(--navy); color: white;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; min-width: 24px; text-align: center;
}
.acc-count.zero { background: var(--mist); color: var(--steel); }
.acc-chevron { color: var(--steel); font-size: 18px; transition: transform 0.2s; }
.acc-item.open .acc-chevron { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 16px 12px; }
.acc-item.open .acc-body { display: block; }
.acc-empty { color: var(--steel); font-style: italic; font-size: 12px; text-align: center; padding: 12px; }

.hit-list { display: flex; flex-direction: column; gap: 6px; }
.hit { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--mist); border-radius: 6px; cursor: pointer; }
.hit:hover { background: var(--fog); border-color: var(--navy); }
.hit-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.hit-main { flex: 1; min-width: 0; }
.hit-ship { font-size: 13px; font-weight: 600; color: var(--deep); }
.hit-detail { font-size: 11px; color: var(--steel); margin-top: 1px; }
.hit-meta { font-size: 11px; font-weight: 600; color: var(--steel); flex-shrink: 0; }

/* ───────── Map Controls ───────── */
.map-controls {
  position: absolute; bottom: 16px; left: 16px;
  z-index: 500; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.mc-btn {
  background: var(--pearl); border: none; padding: 8px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--deep);
  box-shadow: var(--shadow);
}
.mc-btn:hover { color: var(--navy); }
.status-pill {
  padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 600;
  box-shadow: var(--shadow); letter-spacing: 0.3px;
}
.status-demo { background: #fff8e1; color: #7a5a00; }
.status-live { background: #e6f4ea; color: #1e5e2f; }
.status-error { background: #fcebea; color: #8a1f1a; }

/* ───────── Style-Switcher ───────── */
.style-switcher {
  position: absolute; bottom: 16px; right: 16px; z-index: 500;
  display: flex; gap: 1px; background: var(--mist); border-radius: 6px;
  overflow: hidden; box-shadow: var(--shadow);
}
.style-btn {
  background: var(--pearl); border: none; padding: 7px 11px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--steel); letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}
.style-btn:hover { background: var(--fog); color: var(--navy); }
.style-btn.active { background: var(--navy); color: white; }

/* ───────── Mobile ───────── */
@media (max-width: 900px) {
  .left-stack { top: 60px; left: 8px; right: 8px; width: auto; max-width: none; bottom: auto; max-height: calc(50vh - 60px); }
  .results-panel { top: auto; bottom: 64px; left: 8px; right: 8px; width: auto; max-height: 45vh; }
  .results-panel.collapsed { width: auto; max-height: 48px; }
  .map-controls { bottom: 16px; }
}

/* ───────── Window-Toggle (±7 / ±30) ───────── */
.window-toggle { display: flex; gap: 4px; background: var(--mist); padding: 2px; border-radius: 6px; }
.win-btn {
  flex: 1; background: white; border: none; padding: 5px 10px;
  font-size: 11px; font-weight: 600; color: var(--steel);
  border-radius: 4px; cursor: pointer;
}
.win-btn.active { background: var(--navy); color: white; }

/* ───────── Schiff-Bubble (zentrales Modal) ───────── */
.bubble-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 25, 41, 0.6);
  z-index: 9000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.bubble-backdrop.open { opacity: 1; pointer-events: auto; }

.ship-bubble {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 420px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 9001;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  scrollbar-width: thin;
}
.ship-bubble.open {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.bubble-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--mist);
  border-radius: 50%;
  font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--steel);
  z-index: 10;
}
.bubble-close:hover { background: var(--fog); color: var(--navy); }

.bubble-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px 14px;
  border-bottom: 3px solid var(--navy);
}
.bubble-pikto { width: 48px; height: 48px; flex-shrink: 0; }
.bubble-title h2 { font-size: 18px; font-weight: 600; color: var(--deep); margin: 0; }
.bubble-sub { font-size: 11px; color: var(--steel); margin-top: 2px; letter-spacing: 0.3px; }

.bubble-photo { width: 100%; height: 200px; overflow: hidden; background: var(--fog); }
.bubble-photo img { width: 100%; height: 100%; object-fit: cover; }

.bubble-live {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(90deg, #e6f4ea, #f0f8f2);
  font-size: 12px; font-weight: 600; color: #1e5e2f;
  border-bottom: 1px solid var(--mist);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2e8540;
  box-shadow: 0 0 0 0 rgba(46,133,64,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,133,64,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(46,133,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,133,64,0); }
}

.bubble-section { padding: 14px 20px; border-bottom: 1px solid var(--fog); }
.bubble-section:last-child { border-bottom: none; }
.bubble-section h3 {
  font-size: 11px; font-weight: 700; color: var(--steel);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 0 0 10px;
}

.upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px; background: var(--fog);
  border-radius: 6px; cursor: pointer;
  transition: background 0.15s;
}
.upcoming-row:hover { background: var(--mist); }
.up-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.up-main { flex: 1; min-width: 0; }
.up-port { font-size: 13px; font-weight: 600; color: var(--deep); }
.up-meta { font-size: 11px; color: var(--steel); margin-top: 1px; }
.up-empty { color: var(--steel); font-size: 12px; font-style: italic; text-align: center; padding: 12px; }

.bubble-agent { font-size: 12px; }
.ag-company { font-size: 13px; font-weight: 600; color: var(--deep); margin-bottom: 6px; }
.ag-row { display: flex; gap: 6px; padding: 2px 0; line-height: 1.4; }
.ag-label {
  flex-shrink: 0; width: 48px;
  font-size: 10px; font-weight: 700; color: var(--steel);
  text-transform: uppercase; letter-spacing: 0.5px;
  align-self: center;
}
.ag-row a { color: var(--navy); text-decoration: none; }
.ag-row a:hover { text-decoration: underline; }

.bubble-loading {
  padding: 30px; text-align: center;
  color: var(--steel); font-style: italic;
}

/* Live-AIS-Marker: subtiler grüner Pulsschlag */
.ship-divicon.live-marker {
  /* Subtile Live-Anzeige */
}

/* ───────── Marker-Stile (Live vs. Schedule) ───────── */
.ship-divicon { position: relative; }
.ship-divicon .ship-marker-inner { position: relative; z-index: 2; }

/* Grüner Pulsschlag-Halo für Live-Schiffe */
.ship-divicon.ship-source-live .live-halo {
  position: absolute;
  top: -6px; left: -6px;
  width: calc(100% + 12px); height: calc(100% + 12px);
  border-radius: 50%;
  background: rgba(46, 133, 64, 0.25);
  border: 2px solid rgba(46, 133, 64, 0.7);
  animation: live-pulse 2s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%      { transform: scale(1.15); opacity: 0.4; }
}

/* Schedule-Marker: leicht transparenter */
.ship-divicon.ship-source-schedule .ship-marker-inner {
  /* Klasse hängt bereits opacity 0.9 inline */
}

/* Gelber Halo für "letzte AIS-Position <24h alt" — statisch */
.ship-divicon.ship-source-recent .recent-halo {
  position: absolute;
  top: -4px; left: -4px;
  width: calc(100% + 8px); height: calc(100% + 8px);
  border-radius: 50%;
  background: rgba(184, 134, 11, 0.15);
  border: 2px solid rgba(184, 134, 11, 0.5);
  z-index: 1;
  pointer-events: none;
}

/* Bubble Status-Leisten — eine pro Quelle */
.bubble-recent {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(90deg, #fff8e1, #fdf6e3);
  font-size: 12px; color: #7a5a00;
  border-bottom: 1px solid var(--mist);
}
.recent-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b8860b;
}
.bubble-schedule {
  padding: 8px 20px;
  background: linear-gradient(90deg, #e8f1fa, #f0f4f8);
  font-size: 12px; color: #102a43;
  border-bottom: 1px solid var(--mist);
}
.bubble-stale {
  padding: 8px 20px;
  background: #f5f5f5;
  font-size: 12px; color: #666;
  border-bottom: 1px solid var(--mist);
}

/* ───────── Bubble Tabs ───────── */
.bubble-tabs {
  display: flex;
  border-bottom: 1px solid var(--mist);
  background: var(--fog);
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab-btn:hover {
  background: white;
  color: var(--navy);
}
.tab-btn.active {
  background: white;
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.bubble-tab-content {
  display: none;
  padding: 14px 20px;
}
.bubble-tab-content.active {
  display: block;
}

.tab-hint {
  font-size: 11px;
  color: var(--steel);
  font-style: italic;
  margin-bottom: 8px;
  text-align: center;
}

.agent-port-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Bubble — verfeinertes Design (Override früherer Styles)
   ═══════════════════════════════════════════════════════════════ */

.ship-bubble {
  width: 460px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(10, 25, 41, 0.4), 0 0 0 1px rgba(255,255,255,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

/* Header neu: mit Gradient und besserer Hierarchie */
.bubble-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px 18px;
  background: linear-gradient(135deg, var(--abyss) 0%, var(--navy) 100%);
  border-bottom: none;
  color: white;
  position: relative;
}
.bubble-header.hlc {
  background: linear-gradient(135deg, #2d5f3f 0%, #1a3e29 100%);
}

.bubble-pikto {
  width: 56px; height: 56px;
  background: white;
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.bubble-title h2 {
  font-size: 20px; font-weight: 600; color: white;
  margin: 0; line-height: 1.2;
  letter-spacing: -0.3px;
}
.bubble-sub {
  font-size: 11px; color: rgba(255,255,255,0.75);
  margin-top: 4px; letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
}

.bubble-close {
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 20px; font-weight: 300;
  backdrop-filter: blur(8px);
}
.bubble-close:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

/* Foto kleiner, mehr Atem, weicher Übergang */
.bubble-photo {
  height: 180px;
  overflow: hidden;
  background: #1a2a3a;
  position: relative;
}
.bubble-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.bubble-photo::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  pointer-events: none;
}

/* Statusbalken (Live/Recent/Schedule/Stale) — alle einheitlich */
.bubble-live, .bubble-recent, .bubble-schedule, .bubble-stale {
  padding: 10px 22px;
  font-size: 12.5px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.bubble-live {
  background: linear-gradient(90deg, rgba(46,133,64,0.12), rgba(46,133,64,0.04));
  color: #1e5e2f;
}
.bubble-recent {
  background: linear-gradient(90deg, rgba(184,134,11,0.12), rgba(184,134,11,0.04));
  color: #7a5a00;
}
.bubble-schedule {
  background: linear-gradient(90deg, rgba(10,77,140,0.08), rgba(10,77,140,0.02));
  color: var(--deep);
}
.bubble-stale {
  background: #f5f5f5;
  color: #666;
}
.bubble-live b, .bubble-recent b, .bubble-schedule b, .bubble-stale b {
  font-weight: 600;
}

/* Tab-Bar moderner */
.bubble-tabs {
  background: white;
  border-bottom: 1px solid var(--mist);
  padding: 0;
  flex-shrink: 0;
}
.tab-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 13px 8px;
  letter-spacing: 0.2px;
  color: var(--steel);
  border-bottom: 3px solid transparent;
  position: relative;
  transition: all 0.15s;
}
.tab-btn:hover {
  background: var(--fog);
  color: var(--navy);
}
.tab-btn.active {
  background: white;
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.tab-btn.active::before {
  /* kleiner Akzent oben */
  content: ''; position: absolute; top: 0; left: 50%;
  width: 30px; height: 2px;
  transform: translateX(-50%);
  background: var(--navy);
  border-radius: 0 0 2px 2px;
}

/* Tab-Inhalte */
.bubble-tab-content {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 160px;
  max-height: 320px;
  scrollbar-width: thin;
}
.tab-hint {
  font-size: 11px;
  color: var(--steel);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--fog);
  border-radius: 6px;
  text-align: center;
}

/* Folgehäfen-Liste hübscher */
.upcoming-list { gap: 6px; }
.upcoming-row {
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--mist);
  border-radius: 8px;
  transition: all 0.15s;
}
.upcoming-row:hover {
  border-color: var(--navy);
  background: var(--fog);
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(10,77,140,0.08);
}
.up-num {
  width: 26px; height: 26px;
  font-size: 12px;
  font-weight: 700;
}
.up-port {
  font-size: 14px;
  font-weight: 600;
}
.up-meta {
  font-size: 11px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Hafenagent-Block */
.agent-port-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mist);
}
.bubble-agent {
  font-size: 13px;
}
.ag-company {
  font-size: 15px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}
.ag-row {
  padding: 5px 0;
  border-bottom: 1px dashed var(--mist);
}
.ag-row:last-child { border-bottom: none; }
.ag-label {
  width: 56px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.ag-row a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--navy);
}
.ag-row a:hover {
  color: var(--deep);
  border-bottom-style: solid;
}

/* Hafen-Marker (Anker) */
.port-divicon, .hit-port-divicon {
  background: transparent !important;
  border: none !important;
}
.port-icon, .hit-port-icon {
  font-family: 'Source Sans 3', sans-serif;
  user-select: none;
}
.hit-badge-num {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--brass);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  line-height: 1;
}


/* ═══════════════════════════════════════════════════════════════
   MapLibre-Anpassungen
   ═══════════════════════════════════════════════════════════════ */

/* Container muss explizite Größe haben für MapLibre */
#map {
  width: 100%; height: 100%;
}

/* MapLibre-Popup unscheinbar und passend zu unserem Design */
.maplibregl-popup {
  font-family: 'Source Sans 3', sans-serif !important;
}
.maplibregl-popup-content {
  padding: 8px 10px !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}
.ship-tooltip-popup .maplibregl-popup-tip {
  border-top-color: white !important;
}

/* Live-Halo um Schiff-Marker (animiert) */
.ship-marker .live-halo {
  position: absolute;
  /* Halo zentriert ÜBER der Marker-Box, nimmt aber selbst KEINEN Platz im Layout */
  top: 50%; left: 50%;
  width: 52px; height: 52px;
  margin-top: -26px; margin-left: -26px;
  border-radius: 50%;
  background: rgba(46, 133, 64, 0.25);
  border: 2px solid rgba(46, 133, 64, 0.7);
  animation: live-pulse-ml 2s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
  /* WICHTIG: transform-origin und will-change für GPU-Compositor */
  transform-origin: center center;
  will-change: transform, opacity;
}
@keyframes live-pulse-ml {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%      { transform: scale(1.15); opacity: 0.4; }
}

/* Recent-Halo (statisch gelb) */
.ship-marker .recent-halo {
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  margin-top: -24px; margin-left: -24px;
  border-radius: 50%;
  background: rgba(184, 134, 11, 0.15);
  border: 2px solid rgba(184, 134, 11, 0.5);
  z-index: 1;
  pointer-events: none;
}

/* MapLibre Attribution dezent */
.maplibregl-ctrl-attrib {
  background: rgba(255,255,255,0.7) !important;
  font-size: 10px !important;
}


/* WICHTIG: Marker-Container muss IMMER 40×40 sein, egal was drin passiert */
.ship-marker {
  contain: layout style;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  display: block !important;
  overflow: visible;  /* Halo darf rausragen, aber Container-Größe bleibt */
}


/* ═══════════════════════════════════════════════════════════════
   Bubble v3 — neben dem Marker, abgerundet, smooth slide-in
   ═══════════════════════════════════════════════════════════════ */

/* Backdrop weniger dunkel — wir wollen die Karte noch sehen */
.bubble-backdrop {
  background: rgba(10, 25, 41, 0.25) !important;
}

/* Bubble-Container: nicht mehr zentral, sondern absolut positioniert */
.ship-bubble {
  position: fixed;
  width: 440px;
  max-height: 540px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  box-shadow:
    0 24px 60px rgba(10, 25, 41, 0.30),
    0 2px 10px rgba(10, 25, 41, 0.15),
    0 0 0 1px rgba(255,255,255,0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px) scale(0.96);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.ship-bubble.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

/* Bubble-Pfeil links (zeigt zum Marker) */
.ship-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 16px; height: 16px;
  background: linear-gradient(135deg, #2d5f3f 0%, #1a3e29 100%);
  z-index: -1;
}
.ship-bubble:has(.bubble-header.hlc)::before {
  background: linear-gradient(135deg, #2d5f3f 0%, #1a3e29 100%);
}

/* Header runder anpassen */
.bubble-header {
  border-radius: 18px 18px 0 0;
}

/* Logistik-Block: zwei Spalten nebeneinander */
.bubble-logistics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 12px 18px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f0f4f8 100%);
  border-bottom: 1px solid var(--mist);
}
.log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px;
}
.log-item + .log-item {
  border-left: 1px solid var(--mist);
  margin-left: 4px;
  padding-left: 12px;
}
.log-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.log-text { min-width: 0; }
.log-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.log-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--deep);
  margin-top: 1px;
}

/* Tab-Bar mit Icons + Labels (kleiner Stack) */
.tab-btn {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px !important;
  font-size: 10px !important;
  letter-spacing: 0.1px !important;
}
.tab-btn span:first-child {
  font-size: 17px;
  line-height: 1;
}
.tab-btn span:last-child {
  font-size: 10px;
}

/* Public Health Tab */
.health-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.health-light {
  flex-shrink: 0;
}
.hl-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.2);
}
.health-status { flex: 1; }
.hs-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  opacity: 0.7;
}
.hs-text {
  font-size: 14px;
  font-weight: 600;
  margin-top: 1px;
}

.health-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.ht-item {
  text-align: center;
  padding: 12px;
  background: var(--fog);
  border-radius: 10px;
}
.ht-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--deep);
  line-height: 1;
}
.ht-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.health-disease-list {
  margin-bottom: 12px;
}
.hd-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.health-disease-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--mist);
  border-radius: 8px;
  margin-bottom: 4px;
}
.hd-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
}
.hd-stats {
  display: flex; gap: 8px; align-items: center;
}
.hd-cases {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  background: var(--fog);
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}
.hd-iso {
  font-size: 11px;
  color: #b8860b;
  font-weight: 600;
}

.health-updated {
  font-size: 10px;
  color: var(--steel);
  text-align: right;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════
   Bubble v3.1 — länger, mit Diagramm + Logistik-Header
   ═══════════════════════════════════════════════════════════════ */

/* Bubble länger machen — 720px statt 540px */
.ship-bubble {
  max-height: 720px !important;
  width: 460px !important;
}

/* Tab-Inhalte dürfen jetzt mehr Höhe nutzen */
.bubble-tab-content {
  max-height: 460px !important;
}

/* Logistik-Header */
.bubble-logistics-wrap {
  background: linear-gradient(180deg, #f7f9fc 0%, #f0f4f8 100%);
  border-bottom: 1px solid var(--mist);
  padding: 10px 18px 12px;
}
.logistics-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 8px;
}
.bubble-logistics-wrap .bubble-logistics {
  padding: 0;
  background: transparent;
  border-bottom: none;
}

/* CoMail mit zwei Daten — Sub-Labels */
.log-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 3px;
}
.log-value {
  line-height: 1.5;
}

/* Voyage-Chart */
.voyage-chart {
  margin: 14px 0;
  padding: 12px;
  background: white;
  border: 1px solid var(--mist);
  border-radius: 10px;
  position: relative;
}
.vc-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.vc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.vc-meta {
  font-size: 10px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.vc-yaxis {
  position: absolute;
  left: 4px;
  top: 36px;
  height: 100px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.vc-chart-area {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-left: 18px;            /* Platz für Y-Achse */
  border-bottom: 1.5px solid var(--mist);
}

.vc-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
}
.vc-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  width: 100%;
  justify-content: center;
}
.vc-bar {
  width: 6px;
  min-height: 1px;
  border-radius: 1px 1px 0 0;
  transition: opacity 0.15s;
}
.vc-bar:hover {
  opacity: 0.75;
}
.vc-day-label {
  font-size: 8px;
  color: var(--steel);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  transform: rotate(-45deg);
  transform-origin: top center;
  white-space: nowrap;
}
.vc-day-label.is-turnaround {
  color: var(--brass);
  font-weight: 700;
}

.vc-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;     /* mehr Abstand wegen rotierter Labels */
  font-size: 10px;
}
.vc-legend-item {
  display: flex; align-items: center; gap: 4px;
  color: var(--deep);
  font-weight: 500;
}
.vc-legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
}

.voyage-chart-empty {
  margin: 14px 0;
  padding: 16px;
  background: var(--fog);
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--steel);
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════
   Bubble v3.2 — noch länger, kompakteres Public Health
   ═══════════════════════════════════════════════════════════════ */

.ship-bubble {
  max-height: calc(100vh - 32px) !important;     /* fast volle Bildschirmhöhe */
  height: auto !important;
}

.bubble-tab-content {
  max-height: none !important;     /* Tab-Inhalt: keine Höhenbegrenzung mehr */
  flex: 1;                          /* nutzt verfügbaren Platz */
  overflow-y: auto;
}

/* Public Health — kompakter */
.health-banner {
  padding: 10px 14px !important;
  margin-bottom: 10px !important;
}
.hl-circle {
  width: 28px !important; height: 28px !important;
}
.hs-text {
  font-size: 13px !important;
}

.health-totals {
  margin-bottom: 10px !important;
}
.ht-item {
  padding: 8px !important;
}
.ht-num {
  font-size: 20px !important;
}
.ht-lbl {
  font-size: 9px !important;
}

.health-disease-list {
  margin-bottom: 6px !important;
}
.health-disease-row {
  padding: 6px 12px !important;
  margin-bottom: 3px !important;
}


/* ═══════════════════════════════════════════════════════════════
   USPH-Kategorien (AGE / ARI) — zwei farbige Kacheln
   ═══════════════════════════════════════════════════════════════ */

.health-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.hc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--mist);
  border-radius: 10px;
}
.hc-badge {
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}
.hc-stats { line-height: 1.2; }
.hc-cases {
  font-size: 20px;
  font-weight: 700;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.hc-lbl {
  font-size: 10px;
  color: var(--steel);
  margin-top: 1px;
}

/* Single-Bar-Chart (eine Farbe pro Diagramm) */
.vc-bar-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}
.vc-bar-single {
  width: 70%;
  max-width: 18px;
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.15s;
}
.vc-bar-single:hover {
  opacity: 0.75;
}
.vc-val-label {
  position: absolute;
  top: -12px;
  font-size: 9px;
  font-weight: 600;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}

/* Voyage-Chart kompakter (zwei nebeneinander wirken sonst zu groß) */
.voyage-chart {
  margin: 8px 0 !important;
  padding: 8px 10px !important;
}


/* ═════ Demo-Login-Hinweis ═════ */
.login-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--mist);
  font-size: 12px;
  color: var(--steel);
  text-align: center;
  line-height: 1.6;
}
.login-hint code {
  background: var(--fog);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  color: var(--deep);
}

/* ═══════════════════════════════════════════════════════════════
   Admin-Modal: Nutzerverwaltung
   ═══════════════════════════════════════════════════════════════ */

.header-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.header-btn:hover {
  background: rgba(255,255,255,0.25);
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.5);
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.admin-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 880px;
  max-width: 95vw;
  max-height: 85vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(10, 25, 41, 0.35);
  z-index: 960;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.am-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(180deg, #2d5f3f 0%, #1a3e29 100%);
  color: white;
}
.am-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.am-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.am-close:hover { background: rgba(255,255,255,0.3); }

.am-tabs {
  display: flex;
  border-bottom: 1px solid var(--mist);
  padding: 0 20px;
  background: #fafbfc;
}
.am-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--steel);
  cursor: pointer;
}
.am-tab.active {
  color: #2d5f3f;
  border-bottom-color: #2d5f3f;
}

.am-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.am-loading, .am-error {
  padding: 32px;
  text-align: center;
  color: var(--steel);
}
.am-error { color: #c92a2a; }

.am-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mist);
}
.am-info {
  font-size: 12px;
  color: var(--steel);
}

.am-section {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.am-table-wrap {
  border: 1px solid var(--mist);
  border-radius: 8px;
  overflow: hidden;
}
.am-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.am-table th {
  background: #fafbfc;
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--mist);
}
.am-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--mist);
}
.am-table tr:last-child td { border-bottom: none; }
.am-table tr.inactive { opacity: 0.55; }
.am-table.compact td { padding: 6px 12px; }

.cell-main {
  font-weight: 500;
  color: var(--deep);
}
.cell-sub {
  font-size: 11px;
  color: var(--steel);
  margin-top: 1px;
}
.cell-tag {
  display: inline-block;
  background: #2d5f3f;
  color: white;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: 1px;
}
.cell-time {
  font-size: 12px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}
.cell-actions {
  text-align: right;
  white-space: nowrap;
}
.cell-muted {
  font-size: 11px;
  color: var(--steel);
  font-style: italic;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.role-admin { background: #fdebec; color: #9b1c1c; }
.role-editor { background: #fff8e1; color: #7a5a00; }
.role-viewer { background: #e8f5ea; color: #1e5e2f; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.status-dot.active { background: #2e8540; }
.status-dot.inactive { background: #b4b2a9; }

.btn-sm {
  background: transparent;
  border: 1px solid var(--mist);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
}
.btn-sm:hover {
  background: #f0f4f8;
  border-color: #b4b2a9;
}
.btn-danger {
  border-color: #f5c4c4;
  color: #c92a2a;
}
.btn-danger:hover {
  background: #fdebec;
  border-color: #c92a2a;
}
.btn-link {
  background: #f0f4f8;
  border-color: #d3d1c7;
  color: #2d5f3f;
  font-weight: 500;
}
.btn-link.success {
  background: #2e8540;
  color: white;
  border-color: #2e8540;
}
.btn-primary {
  background: #2d5f3f;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover {
  background: #1a3e29;
}

.invite-create-card {
  background: #fafbfc;
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.invite-create-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
}
.inv-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.inv-form .field { margin: 0; }
.inv-form .field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--steel);
  margin-bottom: 4px;
}
.inv-form .field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--mist);
  border-radius: 5px;
  font-size: 13px;
  box-sizing: border-box;
}
.inv-form .field .opt {
  color: var(--steel);
  font-weight: 400;
}

/* Redeem-Flow */
.redeem-label {
  background: #f0f4f8;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--deep);
  margin: 12px 0;
  text-align: center;
}
.redeem-error {
  background: #fdebec;
  color: #9b1c1c;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 16px 0;
  text-align: center;
}
.redeem-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--mist);
  font-size: 11px;
  color: var(--steel);
  text-align: center;
  line-height: 1.5;
}
.redeem-back {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #2d5f3f;
  text-decoration: none;
}
.redeem-back:hover { text-decoration: underline; }


/* ═══════════════════════════════════════════════════════════════
   Bubble v3.3 — strikte Höhenbegrenzung, kompaktere Diagramme
   ═══════════════════════════════════════════════════════════════ */

.ship-bubble {
  /* Wichtig: NIE höher als Viewport */
  max-height: calc(100vh - 32px) !important;
  height: auto !important;
  width: 440px !important;
  /* Scrollbar IM Bubble, nicht auf Body */
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Tab-Bereich wird scrollbar, Header bleibt fixiert */
.bubble-tab-content {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  max-height: none !important;
  min-height: 0;
}

/* Diagramme kompakter */
.voyage-chart {
  margin: 6px 0 !important;
  padding: 8px 10px !important;
}
.voyage-chart .vc-chart-area {
  height: auto !important;
  min-height: 90px;
  padding-bottom: 24px;     /* Platz für rotierte Tageslabels */
  overflow: visible;
}
.vc-bar-wrap {
  height: 70px !important;
  overflow: visible !important;
}
.vc-val-label {
  top: -10px !important;
  font-size: 8px !important;
}
.vc-bar-single {
  max-width: 14px !important;
}

/* Public Health Banner kompakter */
.health-banner {
  padding: 8px 12px !important;
  margin-bottom: 8px !important;
}
.hl-circle {
  width: 24px !important; height: 24px !important;
}
.hs-text {
  font-size: 12px !important;
}

.health-totals,
.health-categories {
  margin-bottom: 8px !important;
}
.ht-num {
  font-size: 18px !important;
}
.hc-cases {
  font-size: 18px !important;
}


/* ═══════════════════════════════════════════════════════════════
   Offiziere-Tab
   ═══════════════════════════════════════════════════════════════ */
.officer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.officer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--mist);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.officer-card:hover {
  border-color: #b4b2a9;
}
.officer-avatar {
  flex-shrink: 0;
}
.officer-info {
  flex: 1;
  min-width: 0;          /* notwendig für Text-Truncation */
}
.officer-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.officer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
  margin-top: 1px;
}
.officer-email {
  display: block;
  font-size: 11px;
  color: #1e4d7a;
  text-decoration: none;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.officer-email:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════════
   Sprach-Toggle (DE / EN)
   ═══════════════════════════════════════════════════════════════ */
.lang-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 14px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.lang-btn:hover {
  background: rgba(255,255,255,0.15);
}
.lang-btn.active {
  background: rgba(255,255,255,0.35);
  color: white;
}

/* Toggle im Login-Overlay (dunkel auf hellem Hintergrund) */
.login-lang-wrap {
  position: absolute;
  top: 16px;
  right: 16px;
}
.login-card .lang-toggle {
  background: rgba(16, 42, 67, 0.08);
  border-color: rgba(16, 42, 67, 0.15);
}
.login-card .lang-btn {
  color: var(--deep);
}
.login-card .lang-btn:hover {
  background: rgba(16, 42, 67, 0.12);
}
.login-card .lang-btn.active {
  background: var(--deep);
  color: white;
}

/* Header-Wrap als inline-Block, damit Position passt */
.header-lang-wrap {
  display: inline-flex;
  margin-right: 4px;
}

/* Login-Karte braucht position:relative wegen absolutem Toggle */
.login-card {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   Fix: Voyage-Chart - Tagessäulen brauchen explizite Breite
   ═══════════════════════════════════════════════════════════════ */
.vc-chart-area {
  justify-content: space-around !important;
}
.vc-group {
  flex: 1 1 0 !important;        /* gleichmäßig verteilen */
  min-width: 0;
  max-width: 50px;
}

/* Bubble: Telefon-Zeile */
.bubble-phone {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.bubble-phone .bp-icon {
  font-size: 11px;
  opacity: 0.85;
}
.bubble-phone .bp-label {
  font-weight: 500;
  opacity: 0.85;
}
.bubble-phone .bp-num {
  color: #ffd166;
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.bubble-phone .bp-num:hover {
  text-decoration: underline;
}

/* Sea-Days in der Chart leicht ausgegraut */
.vc-group.is-sea-day .vc-day-label {
  opacity: 0.45;
  font-style: italic;
}
.vc-group.is-sea-day .vc-bar-single {
  opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════════════
   Login-Screen: ATLAS-Branding
   ═══════════════════════════════════════════════════════════════ */
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 4px;
}
.login-brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #1e3a5f;
}
.login-card .login-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5a6c80;
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Encounter-Liste: Richtungs-Hinweis (inbound/outbound)
   ═══════════════════════════════════════════════════════════════ */
.hit-direction {
  font-size: 10.5px;
  font-weight: 500;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.1px;
}
.hit-direction.inbound {
  background: rgba(46, 133, 64, 0.12);
  color: #1e5e2f;
}
.hit-direction.outbound {
  background: rgba(184, 134, 11, 0.12);
  color: #7a5a00;
}

/* ═══════════════════════════════════════════════════════════════
   Final-Fix: Chart-Container darf gesamt-Wert-Label oben + 
   rotierte Tages-Label unten nicht abschneiden
   ═══════════════════════════════════════════════════════════════ */
.voyage-chart {
  overflow: visible !important;
}
.voyage-chart .vc-chart-area {
  height: auto !important;
  min-height: 90px;
  padding-top: 14px;        /* Wert-Labels (-10px) brauchen Luft oben */
  padding-bottom: 26px;     /* Rotierte Tages-Labels brauchen Luft unten */
  overflow: visible !important;
  align-items: flex-end !important;
}
.vc-group {
  overflow: visible !important;
}
.vc-bar-wrap {
  overflow: visible !important;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard-View
   ═══════════════════════════════════════════════════════════════ */
.dashboard-view {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  z-index: 100;
  overflow-y: auto;
  padding: 80px 32px 32px 32px;
}
.db-loading {
  text-align: center;
  padding: 80px;
  color: var(--steel);
}
.db-header {
  max-width: 1400px;
  margin: 0 auto 24px;
  text-align: center;
}
.db-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
  color: var(--deep);
  letter-spacing: -0.3px;
}
.db-subtitle {
  font-size: 13px;
  color: var(--steel);
}

/* KPI-Leiste */
.db-kpis {
  max-width: 1400px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.db-kpi {
  background: white;
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 14px 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(10, 25, 41, 0.05);
}
.db-kpi-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--deep);
  line-height: 1.1;
}
.db-kpi-lbl {
  font-size: 10px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-top: 4px;
}
.db-kpi.has-alert .db-kpi-num {
  color: #c92a2a;
}

/* Tile-Grid */
.db-tiles {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.db-tile {
  background: white;
  border: 1px solid var(--mist);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(10, 25, 41, 0.06);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.db-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 25, 41, 0.12);
  border-color: #b4b2a9;
}

.db-tile-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-pikto {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.db-pikto-text {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--deep);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
}
.db-tile-title {
  flex: 1;
  min-width: 0;
}
.db-ship-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--deep);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-ship-ids {
  font-size: 10px;
  color: var(--steel);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* Position-Block */
.db-pos {
  background: #f7f9fc;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-pos-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2e8540;
  box-shadow: 0 0 0 3px rgba(46, 133, 64, 0.2);
  flex-shrink: 0;
  animation: db-pulse 2s ease-in-out infinite;
}
@keyframes db-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.db-pos-stale .db-pos-dot { display: none; }
.db-pos-text {
  flex: 1;
}
.db-pos-coords {
  font-size: 10px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}
.db-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.db-status-pill.in-port {
  background: #e8f5ea;
  color: #1e5e2f;
}
.db-status-pill.at-sea {
  background: #e0ecff;
  color: #1e4d7a;
}
.db-status-pill.unknown {
  background: #f0f0f0;
  color: var(--steel);
}

/* Next Port */
.db-next-port {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}
.db-next-port-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.db-next-port-text { flex: 1; }
.db-next-port-label {
  font-size: 9px;
  color: var(--steel);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.db-next-port-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
  margin-top: 1px;
}
.db-next-port-date {
  color: var(--steel);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* Health */
.db-health {
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-health-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-health-text {
  flex: 1;
  min-width: 0;
}
.db-health-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.7;
}
.db-health-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 1px;
}
.db-health-numbers {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.db-health-numbers b { font-size: 12px; }

/* Supply */
.db-supply {
  display: flex;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--mist);
}
.db-supply-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  flex: 1;
}
.db-supply-icon { font-size: 14px; }
.db-supply-lbl {
  color: var(--steel);
  font-weight: 600;
}
.db-supply-val {
  margin-left: auto;
  font-weight: 600;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-view { padding: 80px 12px 20px; }
  .db-kpis { grid-template-columns: repeat(2, 1fr); }
  .db-tiles { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   Style-Switcher: zusätzliche Overlay-Buttons (Wind, Wave, 3D)
   ═══════════════════════════════════════════════════════════════ */
.style-sep {
  width: 1px;
  height: 18px;
  background: rgba(10, 25, 41, 0.15);
  margin: 0 2px;
  align-self: center;
}
.overlay-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.overlay-btn.active {
  background: var(--deep) !important;
  color: white !important;
}

