/**
 * OST Logistics Portal — brand tokens (tune hex values to match ostnexus.png)
 */
:root {
  --ost-navy-950: #060d18;
  --ost-navy-900: #0a1628;
  --ost-navy-800: #0f2140;
  --ost-navy-700: #163057;
  --ost-navy-600: #1e4976;
  --ost-gold: #c9a227;
  --ost-gold-light: #e8d08b;
  --ost-gold-dark: #9a7b1c;
  --ost-surface: #eef2f7;
  --ost-card: #ffffff;
  --ost-border: rgba(15, 33, 64, 0.08);
  --ost-shadow: 0 4px 24px rgba(10, 22, 40, 0.08), 0 1px 3px rgba(10, 22, 40, 0.06);
  --ost-shadow-lg: 0 24px 48px rgba(10, 22, 40, 0.12);
  --ost-radius: 14px;
  --ost-sidebar-width: 292px;
  /* Portal entry photo: focal point so container lettering stays visible (tune % if your asset differs) */
  --ost-guest-login-bg-pos: 58% 46%;
}

html {
  scroll-behavior: smooth;
}

body.ost-guest {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ost-surface);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  /* hidden = widest support; clip is stricter in supporting engines only */
  overflow-x: hidden;
}

@supports (overflow: clip) {
  body.ost-guest {
    overflow-x: clip;
  }
}

body.ost-app {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--ost-surface);
}

/* Guest shell — optional full-viewport background photo (see header.php .ost-split-screen__photo) */
.ost-split-screen {
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
}

body.ost-guest .ost-split-screen__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ost-guest-login-bg-pos);
  z-index: 0;
  pointer-events: none;
}

/* Content column above the photo */
.ost-split-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 2rem 1.5rem 3rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  /* Avoid overflow:hidden on this flex column — some Chromium builds clip main content oddly */
  overflow-x: hidden;
  overflow-y: visible;
  background: linear-gradient(180deg, #fafbfd 0%, var(--ost-surface) 100%);
}

body.ost-guest .ost-split-main--has-bg {
  background: transparent !important;
}

@media (min-width: 992px) {
  .ost-split-main {
    padding: 3rem 4rem 4rem;
    padding-left: max(4rem, env(safe-area-inset-left));
    padding-right: max(4rem, env(safe-area-inset-right));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
    justify-content: center;
  }
}

.ost-auth-panel {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.ost-auth-panel--wide {
  max-width: 480px;
}

.ost-auth-panel--landing {
  max-width: 920px;
  width: 100%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

/* Bootstrap .row negative margins + min-content cols → occasional horizontal shift; stabilize across engines */
body.ost-guest .ost-auth-panel--landing .row {
  max-width: 100%;
}

body.ost-guest .ost-auth-panel--landing .row > [class*="col-"] {
  min-width: 0;
}

.ost-card-elevated {
  background: var(--ost-card);
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow-lg);
}

.ost-card-elevated .card-body {
  padding: 2rem 2rem 1.75rem;
}

@media (max-width: 575.98px) {
  .ost-card-elevated .card-body {
    padding: 1.5rem 1.25rem;
  }
}

.ost-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ost-navy-900);
}

.ost-label-muted {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ost-navy-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-ost-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ost-navy-700);
  --bs-btn-border-color: var(--ost-navy-700);
  --bs-btn-hover-bg: var(--ost-navy-600);
  --bs-btn-hover-border-color: var(--ost-navy-600);
  --bs-btn-active-bg: var(--ost-navy-800);
  --bs-btn-active-border-color: var(--ost-navy-800);
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
}

.btn-ost-gold {
  --bs-btn-color: var(--ost-navy-950);
  --bs-btn-bg: var(--ost-gold);
  --bs-btn-border-color: var(--ost-gold);
  --bs-btn-hover-bg: var(--ost-gold-dark);
  --bs-btn-hover-border-color: var(--ost-gold-dark);
  --bs-btn-hover-color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
}

.btn-ost-outline {
  border-radius: 10px;
  font-weight: 600;
  border-color: rgba(22, 48, 87, 0.25);
  color: var(--ost-navy-700);
}

.btn-ost-outline:hover {
  background: rgba(22, 48, 87, 0.06);
  border-color: var(--ost-navy-600);
  color: var(--ost-navy-900);
}

/* Landing cards */
.ost-portal-card {
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

/* Portal entry (index): glass cards — Bootstrap .card bg overridden explicitly */
body.ost-guest .ost-auth-panel--landing .card.ost-portal-card {
  --bs-card-bg: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(10, 22, 40, 0.04);
}

/* Customer column often sits over hero lettering — extra transparency */
body.ost-guest .ost-auth-panel--landing .row > .col-md-6:last-child .card.ost-portal-card {
  --bs-card-bg: rgba(255, 255, 255, 0.05);
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

body.ost-guest .ost-auth-panel--landing .card.ost-portal-card:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

body.ost-guest .ost-auth-panel--landing .row > .col-md-6:last-child .card.ost-portal-card:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
}

/* When hero photo is on: readable labels + secondary actions (no muddy grays on dark areas) */
body.ost-guest .ost-split-main--has-bg .ost-auth-panel--landing .ost-label-muted {
  color: var(--ost-navy-800);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

body.ost-guest .ost-split-main--has-bg .ost-auth-panel--landing .card.ost-portal-card h2 {
  color: var(--ost-navy-950);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.ost-guest .ost-split-main--has-bg .ost-auth-panel--landing .text-muted.small {
  color: rgba(15, 33, 64, 0.82) !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.75);
}

body.ost-guest .ost-split-main--has-bg .ost-auth-panel--landing .btn-ost-outline {
  background-color: rgba(255, 255, 255, 0.94);
  border-color: rgba(22, 48, 87, 0.35);
  color: var(--ost-navy-800);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.ost-guest .ost-split-main--has-bg .ost-auth-panel--landing .btn-ost-outline:hover {
  background-color: #fff;
  border-color: var(--ost-navy-600);
  color: var(--ost-navy-950);
}

.ost-portal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ost-shadow-lg);
}

.ost-portal-card .card-body {
  padding: 1.75rem 1.5rem;
}

.ost-portal-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ost-navy-900);
}

/* Admin home: pending-related shortcut cards (stronger red when attention needed) */
.ost-portal-card.ost-portal-card--pending-home {
  background: linear-gradient(
    165deg,
    rgba(220, 53, 69, 0.16) 0%,
    rgba(220, 53, 69, 0.08) 45%,
    rgba(255, 235, 238, 0.98) 100%
  );
  border: 1px solid rgba(220, 53,  69, 0.35);
  box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.06);
}

.ost-portal-card.ost-portal-card--pending-home:hover {
  border-color: rgba(220, 53, 69, 0.48);
  box-shadow: 0 4px 18px rgba(220, 53, 69, 0.12);
}

/* Logged-in sidebar */
.ost-sidebar {
  width: var(--ost-sidebar-width);
  min-width: var(--ost-sidebar-width);
  background: linear-gradient(180deg, var(--ost-navy-800) 0%, var(--ost-navy-950) 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.ost-sidebar-nav .nav-link {
  color: rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.ost-sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.ost-sidebar-nav .nav-link.active {
  color: var(--ost-navy-950);
  background: linear-gradient(90deg, var(--ost-gold), var(--ost-gold-light));
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.ost-sidebar-nav .nav-link .ost-sidebar-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25em 0.55em;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.ost-sidebar-nav .nav-link.active .ost-sidebar-badge {
  background: var(--ost-navy-700);
  color: var(--ost-gold-light);
}

.ost-main-area {
  min-width: 0;
  min-height: 0;
  background: var(--ost-surface);
}

/* Logged-in shell: ensure main column wins remaining width (flex min-size quirk in some Opera/Chrome builds) */
body.ost-app .container-fluid > .row.align-items-stretch,
body.ost-app .container-fluid > .row.flex-nowrap {
  align-items: stretch;
}

body.ost-app .ost-main-area.col {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ost-navy-600);
  box-shadow: 0 0 0 0.2rem rgba(22, 48, 87, 0.15);
}

/* ——— App shell (logged-in) ——— */
.ost-main-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2.5rem;
}

.ost-app-topbar {
  min-height: 2.5rem;
}

/* Admin top bar: Back + New shipment — same footprint (gold had extra padding from .btn-ost-gold). */
.ost-app-topbar .ost-topbar-pair-btn.btn-sm {
  min-height: 2.375rem;
  padding: 0.4375rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

.ost-user-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(15, 33, 64, 0.12);
  background: #fff;
  color: var(--ost-navy-700);
  box-shadow: 0 1px 3px rgba(10, 22, 40, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ost-user-menu-btn:hover {
  background: rgba(22, 48, 87, 0.06);
  border-color: rgba(15, 33, 64, 0.18);
  color: var(--ost-navy-900);
}

.ost-user-menu-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 48, 87, 0.2);
}

.ost-user-avatar svg {
  display: block;
}

.ost-user-dropdown-menu {
  min-width: 15rem;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  border-radius: 12px !important;
}

.ost-user-dropdown-menu .dropdown-item {
  font-weight: 500;
  padding: 0.45rem 1rem;
}

.ost-user-dropdown-menu .dropdown-item:active {
  background: rgba(22, 48, 87, 0.08);
  color: var(--ost-navy-900);
}

.ost-sidebar-brand-logo {
  display: block;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

/* Page chrome */
.ost-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ost-navy-600);
  margin-bottom: 0.35rem;
}

.ost-display-title {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ost-navy-900);
  line-height: 1.2;
}

/* Long API / sync messages must not stretch the main column horizontally */
.ost-main-inner .ost-alert-long {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Technical sync errors: scroll instead of blowing page layout */
.ost-sync-debug-panel .ost-sync-debug-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 14rem;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 33, 64, 0.06);
  border-radius: 0.35rem;
}

.ost-empty-hint {
  max-width: 42rem;
}

.ost-page-head {
  margin-bottom: 1.75rem;
}

.ost-breadcrumb {
  font-size: 0.875rem;
}

.ost-breadcrumb a {
  color: var(--ost-navy-600);
  text-decoration: none;
}

.ost-breadcrumb a:hover {
  color: var(--ost-gold-dark);
}

/* Panels & tables */
.ost-panel {
  background: var(--ost-card);
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow);
  overflow: hidden;
}

.ost-panel--toolbar {
  padding: 1rem 1.25rem;
}

@media (min-width: 768px) {
  .ost-panel--toolbar {
    padding: 1.25rem 1.5rem;
  }
}

/* Dashboard filters: same height/weight for primary + outline */
.ost-toolbar-action {
  min-width: 7.75rem;
  min-height: 2.625rem;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991.98px) {
  .ost-toolbar-action {
    min-width: 6.25rem;
    font-size: 0.875rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.ost-panel--toolbar .row.align-items-end > [class*="col-"] {
  min-width: 0;
}

/* Directory / admin tables: keep action buttons on one baseline */
.table.ost-table td.ost-td-actions-cell {
  white-space: nowrap;
  vertical-align: middle;
  text-align: right;
}

.table.ost-table td.ost-td-actions-cell .ost-actions-inner {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.table.ost-table th.ost-th-narrow {
  width: 1%;
  white-space: nowrap;
}

.ost-table-meta {
  font-size: 0.8125rem;
  color: var(--ost-navy-600);
  background: linear-gradient(180deg, rgba(238, 242, 247, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.ost-panel--data {
  box-shadow: 0 10px 40px rgba(10, 22, 40, 0.07), 0 2px 6px rgba(10, 22, 40, 0.04);
}

.ost-panel--data .ost-table-meta {
  background: linear-gradient(180deg, #f3f6fb 0%, #fafcfe 100%);
  border-bottom: 1px solid rgba(15, 33, 64, 0.08);
}

.ost-table-responsive {
  border-top: none;
}

.table.ost-table {
  --bs-table-bg: transparent;
  font-size: 0.9rem;
  vertical-align: middle;
}

.table.ost-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, var(--ost-navy-700) 0%, var(--ost-navy-800) 100%);
  border-bottom: none;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  white-space: nowrap;
}

.table.ost-table thead th a {
  color: inherit;
  text-decoration: none;
}

.table.ost-table thead th a:hover {
  color: var(--ost-gold-light);
}

.table.ost-table tbody tr {
  border-color: rgba(15, 33, 64, 0.06);
}

.table.ost-table tbody tr:hover {
  background: rgba(22, 48, 87, 0.04);
}

.table.ost-table td {
  padding: 0.75rem 0.85rem;
}

.table.ost-table--modern thead th {
  padding: 0.95rem 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.table.ost-table--modern tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(15, 33, 64, 0.06);
  color: var(--ost-navy-800);
  font-size: 0.9rem;
}

.table.ost-table--modern tbody tr {
  transition: background-color 0.16s ease;
}

.table.ost-table--modern tbody tr:hover {
  background: linear-gradient(90deg, rgba(22, 48, 87, 0.06) 0%, rgba(22, 48, 87, 0.02) 55%, #fff 100%);
}

.table.ost-table--modern tbody tr:last-child td {
  border-bottom: none;
}

.ost-row-action {
  font-weight: 600;
  border-radius: 10px !important;
}

/* ——— Shipments dashboard: summary strip in same card style as filters ——— */
.ost-shipments-summary-bar {
  padding: 0.85rem 1.25rem;
}

@media (min-width: 768px) {
  .ost-shipments-summary-bar {
    padding: 1rem 1.5rem;
  }
}

/* ——— Shipments dashboard: one white card, table flush — no gray “tab” layer ——— */

.ost-shipments-board {
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  background: #fff;
  box-shadow: var(--ost-shadow-lg);
  overflow: hidden;
}

.ost-table-meta__stat {
  font-size: 0.875rem;
  color: var(--ost-navy-600);
}

.ost-table-meta__num {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ost-navy-900);
  margin-right: 0.2rem;
}

.ost-table-meta__page {
  font-size: 0.8125rem;
  color: var(--ost-navy-600);
}

.table-responsive--shipments {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table.ost-table--shipments {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}

.table.ost-table--shipments thead th {
  padding: 0.65rem 0.45rem 0.7rem;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #1a3a66 0%, #0f2140 100%);
  border-bottom: 3px solid var(--ost-gold);
  box-shadow: none;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

.table.ost-table--shipments thead th.ost-th-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.table.ost-table--shipments thead th.ost-th-customer {
  max-width: 9.5rem;
  white-space: normal;
  line-height: 1.25;
}

.table.ost-table--shipments thead th a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(232, 208, 139, 0.5);
}

.table.ost-table--shipments tbody td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(15, 33, 64, 0.08);
  background-color: #fff;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 400;
}

.table.ost-table--shipments tbody td.ost-td-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.table.ost-table--shipments tbody td.ost-td-action > .d-inline-flex {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* View / Edit / Remove — single horizontal row, compact (admin + customer). */
.table.ost-table--shipments tbody td.ost-td-action .ost-ship-actions-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  vertical-align: middle;
}

.table.ost-table--shipments tbody td.ost-td-action .ost-ship-actions-row .ost-ship-action-form {
  display: inline-flex;
  margin: 0;
  align-items: center;
}

.table.ost-table--shipments tbody td.ost-td-action .ost-ship-actions-row .btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.table.ost-table--shipments tbody td.ost-td-customer {
  max-width: 9.5rem;
  white-space: normal;
  line-height: 1.3;
  word-break: break-word;
}

.table.ost-table--shipments tbody tr.ost-ship-row td {
  transition: background-color 0.15s ease;
}

.table.ost-table--shipments tbody tr.ost-ship-row:hover td {
  background: rgba(22, 48, 87, 0.035);
}

.table.ost-table--shipments.table.ost-table--modern tbody tr.ost-ship-row:hover {
  background: transparent;
}

.table.ost-table--shipments tbody tr:last-child td {
  border-bottom: none;
}

.ost-td-muted {
  color: var(--ost-navy-700);
}

.ost-td-polpod {
  color: var(--ost-navy-700);
  max-width: 5.25rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-td-vessel {
  color: var(--ost-navy-800);
  max-width: 7rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-td-voyage {
  color: var(--ost-navy-700);
  max-width: 5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-td-date {
  color: var(--ost-navy-700);
}

.ost-td-tags {
  white-space: nowrap;
}

.ost-badge--status {
  white-space: nowrap;
  max-width: none;
}

.table.ost-table--shipments .ost-td-action .btn {
  font-weight: 400;
}

.ost-btn-view {
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.45rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(22, 48, 87, 0.18);
  color: var(--ost-navy-800);
  background: #fff;
  box-shadow: 0 2px 6px rgba(10, 22, 40, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.ost-btn-view:hover {
  background: linear-gradient(135deg, var(--ost-navy-700), var(--ost-navy-800));
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 48, 87, 0.2);
}

.ost-btn-edit {
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(22, 48, 87, 0.28);
  color: var(--ost-navy-700);
  background: rgba(22, 48, 87, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ost-btn-edit:hover {
  background: rgba(22, 48, 87, 0.11);
  border-color: var(--ost-navy-600);
  color: var(--ost-navy-950);
}

.ost-ship-empty {
  background: #fff !important;
  border-radius: 12px;
}

@media (max-width: 1199.98px) {
  .table.ost-table--shipments thead th,
  .table.ost-table--shipments tbody td {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

.table.ost-table:not(.ost-table--shipments) .ost-mono {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

.table.ost-table--shipments .ost-mono {
  font-variant-numeric: tabular-nums;
}

/* Badges */
.ost-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ost-badge--success {
  background: rgba(25, 135, 84, 0.14);
  color: #146c43;
}

.ost-badge--danger {
  background: rgba(220, 53, 69, 0.14);
  color: #b02a37;
}

.ost-badge--warn {
  background: rgba(201, 162, 39, 0.2);
  color: var(--ost-gold-dark);
}

.ost-badge--info {
  background: rgba(13, 110, 253, 0.12);
  color: #084298;
}

.ost-badge--muted {
  background: rgba(22, 48, 87, 0.08);
  color: var(--ost-navy-700);
}

.ost-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ost-navy-800);
  background: rgba(22, 48, 87, 0.06);
  border: 1px solid rgba(22, 48, 87, 0.1);
}

.ost-pill svg {
  opacity: 0.65;
}

/* Pagination */
.pagination.ost-pagination .page-link {
  border-radius: 10px !important;
  margin: 0 0.15rem;
  border-color: rgba(22, 48, 87, 0.15);
  color: var(--ost-navy-700);
  font-weight: 600;
  font-size: 0.875rem;
}

.pagination.ost-pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--ost-navy-700), var(--ost-navy-600));
  border-color: transparent;
  color: #fff;
}

.pagination.ost-pagination .page-link:hover {
  background: rgba(22, 48, 87, 0.06);
  color: var(--ost-navy-900);
}

/* Shipment detail */
.ost-detail-hero {
  border-radius: calc(var(--ost-radius) + 2px);
  background: linear-gradient(135deg, #ffffff 0%, #f4f7fb 55%, rgba(201, 162, 39, 0.08) 100%);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow-lg);
}

.ost-detail-hero .ost-display-title {
  font-size: clamp(1.65rem, 3vw, 2rem);
}

.ost-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

@media (min-width: 576px) {
  .ost-stat-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem;
  }
}

/* Shipment overview strip: one row; narrow content areas scroll horizontally */
.ost-stat-strip {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

/*
 * One horizontal row: flex beats CSS grid minmax() here — a high minimum column width
 * wraps the last tile (e.g. ETA) to a second row on typical laptop widths.
 */
.ost-stat-grid--shipment-hero {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}

.ost-stat-grid--shipment-hero .ost-stat-tile {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.ost-stat-grid--shipment-hero .ost-stat-tile__label {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.28rem;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-stat-grid--shipment-hero .ost-stat-tile__value {
  font-size: clamp(0.72rem, 0.85vw + 0.55rem, 0.875rem);
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-stat-grid--shipment-hero .ost-stat-tile__value.ost-mono {
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ost-stat-grid--shipment-hero .ost-stat-tile__value--nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Long vessel names: up to 2 lines instead of a harsh ellipsis */
.ost-stat-grid--shipment-hero .ost-stat-tile__value--multiline {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.3;
}

/* ETD / ETA tiles — stand out on shipment overview strip */
.ost-stat-grid--shipment-hero .ost-stat-tile--schedule-highlight {
  border: 2px solid var(--ost-gold);
  background: linear-gradient(
    165deg,
    rgba(201, 162, 39, 0.14) 0%,
    #ffffff 52%,
    rgba(255, 255, 255, 1) 100%
  );
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.12),
    0 4px 14px rgba(201, 162, 39, 0.15),
    0 1px 2px rgba(10, 22, 40, 0.05);
}

.ost-stat-grid--shipment-hero .ost-stat-tile--schedule-highlight .ost-stat-tile__label {
  color: var(--ost-gold-dark);
}

.ost-stat-tile {
  background: #fff;
  border: 1px solid var(--ost-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(10, 22, 40, 0.04);
}

.ost-stat-tile__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ost-navy-600);
  margin-bottom: 0.35rem;
}

.ost-stat-tile__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ost-navy-900);
  line-height: 1.35;
  word-break: break-word;
}

.ost-stat-tile__value--nowrap {
  white-space: nowrap;
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: normal;
  max-width: 100%;
}

.ost-section-card {
  background: var(--ost-card);
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow);
  height: 100%;
}

.ost-section-card--spaced {
  box-shadow: 0 8px 32px rgba(10, 22, 40, 0.08), 0 1px 3px rgba(10, 22, 40, 0.04);
}

.ost-shipment-detail-columns {
  --bs-gutter-x: 1.75rem;
  --bs-gutter-y: 1.75rem;
}

/* Shipment overview: two columns match height (flex stretch) */
.ost-overview-two-col > [class*="col-"] {
  min-width: 0;
}

.ost-overview-charges-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ost-overview-charges-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(22, 48, 87, 0.1);
  font-size: 0.875rem;
  line-height: 1.4;
}

.ost-overview-charges-line:first-child {
  padding-top: 0;
}

.ost-overview-charges-line:last-child {
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.ost-overview-charges-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(22, 48, 87, 0.16);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ost-navy-900);
}

.ost-overview-charges-total .ost-mono {
  font-size: 0.95rem;
}

.findteu-overview-block .ost-findteu-dl {
  margin-bottom: 0;
}

.findteu-overview-block details summary {
  cursor: pointer;
}

.ost-stat-grid--findteu {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.ost-stat-grid--findteu .ost-stat-tile__value {
  font-size: 0.85rem;
}

.ost-findteu-timeline {
  position: relative;
  padding-left: 0;
}

.ost-findteu-timeline__item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1rem;
}

.ost-findteu-timeline__item:last-child {
  padding-bottom: 0;
}

.ost-findteu-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.31rem;
  top: 0.65rem;
  bottom: -0.25rem;
  width: 2px;
  background: rgba(var(--bs-secondary-rgb), 0.35);
}

.ost-findteu-timeline__item .ost-findteu-timeline__dot {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--bs-secondary);
  box-shadow: 0 0 0 3px rgba(var(--bs-secondary-rgb), 0.2);
}

.ost-findteu-timeline__item--occurred .ost-findteu-timeline__dot {
  background: var(--bs-success);
  box-shadow: 0 0 0 3px rgba(var(--bs-success-rgb), 0.25);
}

.ost-findteu-timeline__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}

.ost-findteu-timeline__loc {
  margin-top: 0.15rem;
}

.ost-findteu-timeline__when {
  margin-top: 0.25rem;
}

.ost-findteu-last-event {
  background: rgba(var(--bs-secondary-rgb), 0.06);
}

.ost-section-card__body {
  padding: 1.35rem 1.5rem 1.5rem;
}

/* Admin shipment form */
.ost-form-stack {
  max-width: 920px;
}

.ost-form-card {
  background: var(--ost-card);
  border-radius: var(--ost-radius);
  border: 1px solid var(--ost-border);
  box-shadow: var(--ost-shadow);
  overflow: hidden;
  margin-bottom: 1.35rem;
}

.ost-form-card__head {
  padding: 0.75rem 1.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ost-navy-600);
  background: linear-gradient(180deg, #eef2f8 0%, #fafcfe 100%);
  border-bottom: 1px solid var(--ost-border);
}

.ost-form-card__body {
  padding: 1.35rem 1.35rem 1.5rem;
}

.ost-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ost-navy-700);
  margin-bottom: 0.4rem;
}

.form-control-ost,
.form-select-ost {
  border-color: rgba(15, 33, 64, 0.14);
  padding: 0.55rem 0.9rem;
  font-size: 0.9375rem;
}

.form-control-ost:focus,
.form-select-ost:focus {
  border-color: var(--ost-navy-600);
  box-shadow: 0 0 0 0.2rem rgba(22, 48, 87, 0.12);
}

.form-control-ost::placeholder {
  color: rgba(22, 48, 87, 0.36);
}

.ost-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ost-navy-600);
  margin-bottom: 1.1rem;
}

.ost-section-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ost-gold), var(--ost-gold-light));
}

.ost-dl {
  margin: 0;
}

.ost-dl__row {
  display: grid;
  grid-template-columns: minmax(8rem, 42%) 1fr;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(15, 33, 64, 0.06);
  font-size: 0.9rem;
}

.ost-dl__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ost-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--ost-navy-600);
  font-size: 0.8rem;
}

.ost-dl dd {
  margin: 0;
  color: var(--ost-navy-900);
  text-align: right;
}

.ost-dl__dd-nowrap {
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 575.98px) {
  .ost-dl__row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .ost-dl dd {
    text-align: left;
    font-weight: 500;
  }
}

/* Tab navigation (shipment) */
.ost-tab-nav {
  gap: 0.35rem;
  flex-wrap: wrap;
  border-bottom: none;
}

.ost-tab-nav .nav-link {
  color: var(--ost-navy-600);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
}

.ost-tab-nav .nav-link:hover {
  background: rgba(22, 48, 87, 0.06);
  color: var(--ost-navy-900);
}

.ost-tab-nav .nav-link.active {
  color: var(--ost-navy-950);
  background: linear-gradient(135deg, var(--ost-gold), var(--ost-gold-light));
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.28);
}

/* Landing / auth polish */
.ost-landing-hero-logo {
  display: block;
  margin: 0 auto 1.25rem;
  max-width: 100%;
  max-height: 148px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(22, 48, 87, 0.15));
}

.ost-auth-logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-height: 118px;
  width: auto;
  object-fit: contain;
}

/* Shipment → Documents: symmetric upload row */
.ost-doc-upload-form .form-label {
  display: block;
  margin-bottom: 0.5rem;
}

@media (min-width: 992px) {
  .ost-doc-upload-form .form-select,
  .ost-doc-upload-form .form-control[type="file"] {
    min-height: calc(2.75rem + 2px);
  }
}

/* Inline preview modal */
.ost-doc-preview-body {
  max-height: min(78vh, 720px);
  overflow: auto;
}

.ost-doc-preview-iframe {
  display: block;
  width: 100%;
  min-height: min(68vh, 620px);
  background: #3d4556;
}

.ost-doc-preview-img {
  max-height: min(72vh, 640px);
  width: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 0.75rem;
  object-fit: contain;
}

.ost-doc-csv-preview {
  font-size: 0.8125rem;
}

.ost-doc-csv-preview th {
  white-space: nowrap;
}

/* Delivered shipments: green row on the Shipments table. */
.ost-ship-row.ost-row-delivered > td {
  background-color: #d1e7dd !important;
}
.ost-ship-row.ost-row-delivered:hover > td {
  background-color: #bcdccb !important;
}
