/* HAK NAV V45.23 — Bütünleşik HAK FLEET & Haritalı Navlun / Gemi Pazaryeri
   Orijinal HAK NAV koyu denizcilik (ECDIS / Köprüüstü) temasıyla %100 uyumlu tasarım */
:root {
  --navy-deep: #061624;
  --navy: #0b2439;
  --navy-panel: #0e2d46;
  --navy-card: #123854;
  --navy-hover: #18496b;
  --border: #285470;
  --border-bright: #48bbc9;
  --cyan: #38bdf8;
  --mint: #b9ffe8;
  --gold: #e1bc77;
  --gold-soft: #f6dda7;
  --teal: #16a68d;
  --red: #e36c55;
  --blue: #3b82f6;
  --purple: #a855f7;
  --text: #e8f5fa;
  --muted: #9ec0d1;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--navy-deep);
}

button, select, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  min-height: calc(100vh - 47px);
  display: flex;
  flex-direction: column;
}

/* HAK NAV MODULE HEADER BAR (Sits cleanly right under shared.js .hnav-mini bar) */
.topbar {
  background: linear-gradient(180deg, #092135 0%, #071a2b 100%);
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  z-index: 1050;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.brand-symbol {
  font-size: 28px;
  color: var(--border-bright);
  line-height: 1;
}

.brand-word {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

.brand-word strong {
  font-size: 18px;
  letter-spacing: .4px;
  color: #fff;
}

.brand-word strong span {
  color: var(--border-bright);
  margin-left: 4px;
}

.brand-word small {
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: var(--muted);
}

.header-separator {
  height: 28px;
  width: 1px;
  background: var(--border);
}

.topnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.topnav button {
  border: 1px solid var(--border);
  background: #10334a;
  color: #d6eef8;
  padding: 8px 13px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .14s ease;
}

.topnav button:hover {
  background: #194c6e;
  border-color: var(--border-bright);
  color: #fff;
}

.topnav button.topnav-active {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  border-color: var(--mint);
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .14s ease;
}

.btn-outline {
  background: #10334a;
  color: var(--mint);
  border-color: #366982;
}

.btn-outline:hover {
  background: #194d6e;
}

.btn-primary {
  background: linear-gradient(135deg, #d9a441, #e1bc77);
  color: #071928;
  border-color: #f6dda7;
  font-weight: 850;
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-teal {
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  border-color: #5eead4;
}

.btn-secondary {
  background: #133954;
  color: #e0f2fe;
  border: 1px solid #31607d;
}

.btn-secondary:hover {
  background: #1b4d70;
}

/* SPLIT WORKSPACE: Left Marine Sidebar + Right Interactive Map */
.workspace {
  height: calc(100vh - 110px);
  min-height: 580px;
  display: grid;
  grid-template-columns: minmax(365px, 415px) minmax(0, 1fr);
  background: var(--navy-deep);
}

.workspace.full-pane-mode {
  grid-template-columns: 1fr;
}

.sidebar {
  background: #081e30;
  position: relative;
  z-index: 950;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-scroll {
  overflow-y: auto;
  height: 100%;
  padding: 0 16px 28px;
  scrollbar-width: thin;
  scrollbar-color: #285470 transparent;
}

.side-title {
  padding: 14px 4px 10px;
}

.eyebrow {
  letter-spacing: 1.3px;
  color: var(--border-bright);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
}

.side-title h1 {
  font-size: 18px;
  line-height: 1.28;
  margin: 5px 0;
  color: #fff;
}

.side-title p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.48;
  margin: 0;
}

.search-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px;
  background: #0c2940;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 6px;
  color: #bae6fd;
}

.search-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #31607d;
  border-radius: 8px;
  background: #071a2b;
  padding: 0 10px;
}

.search-wrap span {
  font-size: 17px;
  color: var(--border-bright);
}

.search-wrap input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 9px 8px;
  font-size: 12px;
  color: #fff;
}

.location-row {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.location-row select, .subfilter-row select {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #071a2b;
  border: 1px solid #31607d;
  color: #e8f5fa;
  font-size: 11.5px;
  font-weight: 650;
}

.location-row button {
  width: 38px;
  flex-shrink: 0;
  border: 1px solid #31607d;
  border-radius: 8px;
  background: #10334a;
  font-size: 17px;
  color: var(--mint);
}

.subfilter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px 7px;
  font-size: 12px;
  font-weight: 760;
  color: #d9f1fa;
}

.text-action {
  border: 0;
  color: var(--border-bright);
  background: none;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
}

.small-muted {
  font-size: 10px;
  color: var(--muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.filter {
  min-width: 0;
  background: #0c2940;
  border: 1px solid #264f69;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #d2eaf5;
  text-align: left;
  transition: all .14s;
}

.filter:first-child {
  grid-column: 1 / -1;
}

.filter strong {
  margin-left: auto;
  color: #fff;
  font-size: 10.5px;
  background: #164463;
  padding: 2px 6px;
  border-radius: 99px;
}

.filter:hover, .filter.selected {
  background: #144466;
  border-color: var(--border-bright);
  color: #fff;
  box-shadow: 0 0 12px rgba(72, 187, 201, 0.25);
}

.filter-dot {
  font-size: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: white;
  flex-shrink: 0;
}

.filter-dot.all { background: #0284c7; }
.filter-dot.cargo { background: #e36c55; }
.filter-dot.vessel { background: #16a68d; }
.filter-dot.charterer { background: #9333ea; }
.filter-dot.firm { background: #2563eb; }

.area-tools {
  margin-top: 8px;
  background: #0c2940;
  border: 1px solid #264f69;
  border-radius: 10px;
  padding: 9px 10px;
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.tool-btn {
  padding: 8px 4px;
  font-size: 10.5px;
  font-weight: 750;
  border-radius: 7px;
  background: #123956;
  border: 1px solid #316485;
  color: #d9f1fa;
  white-space: nowrap;
  text-align: center;
}

.tool-btn.active {
  background: var(--gold);
  color: #071928;
  border-color: #fff;
  font-weight: 850;
}

.tool-btn.light {
  background: #092133;
  color: var(--muted);
}

.range-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px 0;
  font-size: 11px;
  color: #d9f1fa;
}

.range-line input {
  flex: 1;
  min-width: 40px;
  accent-color: var(--border-bright);
}

.range-line strong {
  white-space: nowrap;
  color: var(--mint);
}

.microcopy {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  margin: 6px 2px 2px;
}

.listing-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 13px;
  padding: 12px 2px 9px;
  gap: 6px;
}

.listing-header h2 {
  margin: 3px 0 0;
  font-size: 15.5px;
  color: #fff;
}

.listing-header select {
  border: 1px solid #31607d;
  background: #071a2b;
  color: #d9f1fa;
  border-radius: 7px;
  padding: 6px;
  font-size: 11px;
}

.result-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-card {
  display: flex;
  gap: 10px;
  border: 1px solid #234b66;
  border-radius: 10px;
  background: #0d2a40;
  padding: 11px;
  cursor: pointer;
  transition: all .14s;
  text-align: left;
  position: relative;
  width: 100%;
  color: var(--text);
}

.result-card:hover, .result-card.active {
  border-color: var(--border-bright);
  background: #133b59;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.list-emblem {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  flex-shrink: 0;
  font-size: 20px;
}

.list-emblem.cargo { background: rgba(227, 108, 85, 0.2); color: #fda4af; border: 1px solid #e36c55; }
.list-emblem.vessel { background: rgba(22, 166, 141, 0.22); color: #6ee7b7; border: 1px solid #16a68d; }
.list-emblem.charterer { background: rgba(168, 85, 247, 0.22); color: #d8b4fe; border: 1px solid #a855f7; }
.list-emblem.firm { background: rgba(59, 130, 246, 0.22); color: #93c5fd; border: 1px solid #3b82f6; }

.card-text {
  min-width: 0;
  flex: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}

.card-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.card-tag.cargo { color: #fca5a5; }
.card-tag.vessel { color: #6ee7b7; }
.card-tag.charterer { color: #d8b4fe; }
.card-tag.firm { color: #93c5fd; }

.card-distance {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.card-name {
  display: block;
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.35;
  margin: 3px 0;
  color: #fff;
}

.card-detail {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.metric-chip {
  font-size: 10px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 5px;
  background: #081c2c;
  color: #cbd5e1;
  border: 1px solid #264f69;
}

.metric-chip.price {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.metric-chip.tce {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
}

.status-pill {
  padding: 2px 7px;
  background: #081c2c;
  color: var(--muted);
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
}

.card-arrow {
  color: var(--border-bright);
  font-size: 10.5px;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed #2e5d7b;
  border-radius: 10px;
  text-align: center;
  padding: 24px 12px;
  font-size: 12px;
  color: var(--muted);
}

.bottom-note {
  padding: 16px 4px 8px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* MAP AREA (Right Pane) */
.map-area {
  position: relative;
  overflow: hidden;
  background: #071b2c;
}

.map-area #map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #092236;
}

.map-top {
  position: absolute;
  z-index: 450;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map-title {
  background: rgba(8, 30, 48, 0.94);
  border: 1px solid var(--border-bright);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 9px 14px;
  pointer-events: auto;
  color: #fff;
}

.map-title-strong {
  font-size: 13.5px;
  font-weight: 820;
  color: var(--mint);
}

.map-title > span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.map-top-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
  flex-wrap: wrap;
}

.map-chip {
  pointer-events: auto;
  border: 1px solid var(--border);
  background: rgba(8, 30, 48, 0.94);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 750;
  color: #e2f2f8;
  font-size: 11.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.map-chip:hover, .map-chip.active {
  background: #15496b;
  color: var(--mint);
  border-color: var(--border-bright);
}

.map-controls {
  position: absolute;
  z-index: 450;
  right: 14px;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.map-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: rgba(8, 30, 48, 0.94);
  border-radius: 8px;
  font-size: 19px;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.map-controls button:hover {
  background: #174c70;
  border-color: var(--border-bright);
}

.map-legend {
  position: absolute;
  z-index: 450;
  right: 14px;
  top: 210px;
  background: rgba(8, 30, 48, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  color: #e2f2f8;
}

.map-legend[hidden] {
  display: none;
}

.map-legend div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-pin {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-pin.cargo { background: #e36c55; }
.legend-pin.vessel { background: #16a68d; }
.legend-pin.charterer { background: #a855f7; }
.legend-pin.firm { background: #3b82f6; }

.map-bottom-info {
  position: absolute;
  z-index: 450;
  left: 14px;
  bottom: 14px;
  border: 1px solid var(--border);
  background: rgba(8, 30, 48, 0.95);
  border-radius: 9px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  font-size: 11.5px;
  color: #e2f2f8;
}

.map-dot {
  height: 9px;
  width: 9px;
  border-radius: 50%;
  background: #10b981;
}

.map-sub {
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 9px;
}

/* SINGLE-CLICK PREVIEW CARD (Bottom-Left of Map) */
.preview-card {
  position: absolute;
  z-index: 500;
  left: 14px;
  bottom: 62px;
  width: min(410px, calc(100% - 28px));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-bright);
  background: #0a2236;
  color: var(--text);
  border-radius: 13px;
  overflow: hidden;
}

.preview-card[hidden] {
  display: none;
}

.preview-cover {
  min-height: 54px;
  background: linear-gradient(105deg, #102a45, #1e4b6e);
  color: var(--gold-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
}

.preview-cover.cargo { background: linear-gradient(105deg, #4c1d24, #b94a38); }
.preview-cover.vessel { background: linear-gradient(105deg, #0a3a36, #138c75); }
.preview-cover.charterer { background: linear-gradient(105deg, #3b1d54, #7e3af2); }
.preview-cover.firm { background: linear-gradient(105deg, #152c54, #2563eb); }

.preview-cover strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.preview-cover span {
  font-size: 24px;
}

.preview-body {
  padding: 13px 15px;
}

.preview-body h3 {
  font-size: 15px;
  margin: 0 0 5px;
  color: #fff;
}

.preview-body p {
  margin: 4px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.preview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
  background: #071928;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #234b66;
  font-size: 10.5px;
  color: var(--muted);
}

.preview-metrics-grid div b {
  display: block;
  color: var(--mint);
  font-size: 11.5px;
  margin-top: 2px;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.preview-actions button {
  flex: 1;
  padding: 8px 10px;
  font-size: 11.5px;
}

/* NON-OVERLAPPING CUSTOM MAP PINS */
.custom-pin {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 8px;
  background: #102a42;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 800;
  font-size: 10.5px;
  white-space: nowrap;
  line-height: 1.22;
  transition: transform .12s ease;
  pointer-events: auto;
}

.custom-pin:hover {
  transform: scale(1.08);
  z-index: 999 !important;
}

.custom-pin:after {
  position: absolute;
  content: '';
  width: 8px;
  height: 8px;
  background: inherit;
  transform: rotate(45deg);
  bottom: -5px;
  z-index: -1;
  left: calc(50% - 4px);
}

.custom-pin.cargo { background: #c84b31; border-color: #fde68a; }
.custom-pin.vessel { background: #0f8a73; border-color: #a7f3d0; }
.custom-pin.charterer { background: #7e22ce; border-color: #e9d5ff; }
.custom-pin.firm { background: #1d4ed8; border-color: #bfdbfe; }

.custom-pin.cluster {
  background: #081e30;
  border: 2px solid var(--gold);
  color: var(--gold-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}

.custom-pin.selected {
  outline: 3px solid var(--gold);
  transform: scale(1.1);
  z-index: 1000 !important;
}

.custom-pin .pin-sub {
  font-size: 9px;
  font-weight: 700;
  color: #fef08a;
  margin-top: 1px;
}

.leaflet-div-icon {
  background: transparent !important;
  border: 0 !important;
}

/* EMBEDDED CALCULATOR PANES (TCE & ETA inside HAK FLEET) */
.embedded-pane {
  padding: 22px 26px;
  overflow-y: auto;
  height: 100%;
  background: var(--navy-deep);
}

.calc-card {
  max-width: 1080px;
  margin: 0 auto;
  background: #0b2439;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.calc-card h2 {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 20px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.calc-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #bae6fd;
}

.calc-grid input, .calc-grid select {
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid #356785;
  background: #071928;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* MODAL LAYER */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 22, 0.82);
  backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  background: #0b2439;
  color: var(--text);
  border: 1px solid var(--border-bright);
  width: min(1080px, 98vw);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 22px 13px;
  border-bottom: 1px solid var(--border);
  background: #081c2e;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 19px;
  color: #fff;
}

.close-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #123854;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.modal-content {
  padding: 18px 22px 24px;
  font-size: 13px;
  line-height: 1.55;
}

.modal-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.modal-tabs button {
  border: 1px solid var(--border);
  background: #0e2d46;
  color: #cbe7f5;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.modal-tabs button.on {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #fff;
  border-color: var(--mint);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

@media (max-width: 820px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-item {
  border: 1px solid #244f6c;
  padding: 10px 12px;
  border-radius: 9px;
  background: #081d2e;
}

.detail-item small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.detail-item strong {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: #fff;
}

.detail-description {
  background: #081d2e;
  border: 1px solid #244f6c;
  padding: 12px 14px;
  border-radius: 9px;
  margin: 12px 0;
  color: #d6eef8;
}

.callout {
  background: rgba(225, 188, 119, 0.14);
  border: 1px solid var(--gold);
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--gold-soft);
  font-size: 12px;
  margin: 10px 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 11px;
  color: #bae6fd;
  font-weight: 750;
}

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #31607d;
  border-radius: 8px;
  font-size: 12.5px;
  background: #071928;
  color: #fff;
}

.holds-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.hold-box {
  background: #071928;
  border: 1px solid #285470;
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.hold-meter {
  height: 60px;
  background: #0f293d;
  border-radius: 5px;
  margin: 6px 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hold-fill {
  width: 100%;
  background: linear-gradient(180deg, #16a68d, #0284c7);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bol-paper {
  background: #fffef8;
  border: 2px solid #0f172a;
  border-radius: 10px;
  padding: 16px;
  font-family: Georgia, serif;
  color: #0f172a;
}

.bol-paper input, .bol-paper textarea {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #64748b !important;
}

.toast {
  position: fixed;
  z-index: 2500;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #081e30;
  color: var(--mint);
  border: 1px solid var(--border-bright);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 330px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .mobile-only {
    display: inline-block;
  }
  .workspace {
    display: block;
    position: relative;
  }
  .sidebar {
    display: none;
    position: absolute;
    inset: 0 auto 0 0;
    width: min(360px, 92vw);
  }
  .sidebar-open .sidebar {
    display: block;
  }
  .map-area {
    height: 100%;
  }
}


.custom-pin {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.custom-pin > div {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}


/* V45.24: Dark Bridge ECDIS Tile Filter (Zero API Key Required), Mobile Touch & A4 Bill of Lading Print Engine */
#map, .leaflet-container {
  touch-action: none !important;
  background: #081e30 !important;
}
.hak-dark-bridge-tiles {
  filter: invert(0.92) hue-rotate(188deg) brightness(0.86) contrast(1.14) saturate(0.72) !important;
}
.preset-Autofill-bar {
  background: linear-gradient(135deg, #0b2840 0%, #113a58 100%);
  border: 1px solid #3c8dad;
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 12px;
  color: #e8f7ff;
}
.preset-Autofill-bar .preset-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #e1bc77;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.preset-Autofill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}
.preset-Autofill-grid label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #9bdaf2;
  margin-bottom: 4px;
}
.preset-Autofill-grid select,
.preset-Autofill-grid input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid #4589a6;
  background: #061826;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}
.kind-badge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}
.kind-badge-banner.cargo { background: rgba(227, 108, 85, 0.16); border: 1px solid #e36c55; color: #ffcabf; }
.kind-badge-banner.vessel { background: rgba(31, 181, 138, 0.16); border: 1px solid #1fb58a; color: #b9ffe8; }
.kind-badge-banner.charterer { background: rgba(139, 92, 246, 0.18); border: 1px solid #a78bfa; color: #ddd6fe; }
.kind-badge-banner.firm { background: rgba(56, 189, 248, 0.16); border: 1px solid #38bdf8; color: #bae6fd; }

.bol-print-only {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body > *:not(#bolPrintContainer) {
    display: none !important;
  }
  #bolPrintContainer.bol-print-only {
    display: block !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
