:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --sidebar-w: 230px;
  --brand-dark: #191919;   /* matches the wordmark background */
  --gold: #d4a72c;
}
body { background: #f4f6f9; }
.bg-navy { background: var(--brand-dark); border-bottom: 2px solid var(--gold); }

/* Sidebar */
.sidebar { background: #fff; border-right: 1px solid #e3e7ee; }
@media (min-width: 992px) {
  .sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); min-height: calc(100vh - 56px); position: sticky; top: 56px; align-self: flex-start; }
}
.sidebar .nav-link { color: #334155; padding: .55rem 1.25rem; border-left: 3px solid transparent; }
.sidebar .nav-link i { width: 1.4rem; display: inline-block; }
.sidebar .nav-link:hover { background: #f1f5f9; }
.sidebar .nav-link.active { color: var(--brand-dark); font-weight: 600; background: #fbf4e2; border-left-color: var(--gold); }
.sidebar-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; padding: .9rem 1.25rem .3rem; }
.main-content { min-width: 0; }

/* Cards & tiles */
.card { border: 1px solid #e3e7ee; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.stat-tile .value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-tile .label { color: #64748b; font-size: .85rem; }
.stat-tile .sub { color: #94a3b8; font-size: .78rem; }

.page-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; }

.ctr-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .02em; }
.table td, .table th { vertical-align: middle; }
.table thead th { font-size: .8rem; text-transform: uppercase; color: #64748b; font-weight: 600; white-space: nowrap; }

/* Container cards (mobile list) */
.ctr-card { display: block; color: inherit; text-decoration: none; }
.ctr-card:hover { border-color: #94a3b8; }

/* Journey timeline */
.timeline { list-style: none; padding-left: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: #dbe2ea; }
.timeline li { position: relative; padding-left: 2.2rem; padding-bottom: 1.1rem; }
.timeline .dot { position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-2); }
.timeline li.info .dot { border-color: #94a3b8; }
/* "NOW" step at the end of the journey */
.timeline li.now { padding-bottom: 0; }
.timeline li.now .dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 167, 44, .25); }
.timeline .now-box { background: #fbf4e2; border: 1px solid #ecd9a6; border-radius: .5rem; padding: .6rem .8rem; }
.timeline li.now-alert .dot { background: #dc3545; border-color: #dc3545; box-shadow: 0 0 0 4px rgba(220, 53, 69, .2); }
.timeline li.now-alert .now-box { background: #fdf0f1; border-color: #f1b5bb; }

/* Brand buttons */
.btn-gold { background: linear-gradient(180deg, #e3bb4a, var(--gold)); border: 0; color: #191919; }
.btn-gold:hover, .btn-gold:focus { background: linear-gradient(180deg, #ecc75c, #c9981f); color: #000; }

/* Login */
.login-page { background: #0b1f33 url('img/login-bg.jpg') center / cover no-repeat fixed; }
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 6vw; padding: 1.5rem;
  background: linear-gradient(100deg, rgba(5, 18, 33, .82) 0%, rgba(5, 18, 33, .45) 55%, rgba(5, 18, 33, .25) 100%);
}
.login-brand { max-width: 460px; color: #fff; }
.login-brand h2 { font-size: 2.6rem; font-weight: 800; line-height: 1.15; text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.login-brand h2 span { color: var(--gold); font-style: italic; }
.login-brand p { color: rgba(255, 255, 255, .8); font-size: 1.1rem; margin-top: 1rem; }
.login-card {
  width: 100%; max-width: 400px; padding: 2rem 2rem 1.5rem; border-radius: 1.25rem;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); border-top: 4px solid var(--gold);
}
/* logo.png has a transparent background */
.login-logo { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
.login-card .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(212, 167, 44, .25); }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); color: #64748b; z-index: 5; }

/* Top bar brand */
.navbar-brand-img { height: 24px; width: auto; display: block; }
@media (max-width: 400px) { .navbar-brand-img { height: 20px; } }

.is-invalid-ctr { border-color: #dc3545 !important; }

/* Route checklist */
.bg-gold { background-color: var(--gold) !important; }
.progress-thin { height: 6px; background: #e9ecef; }
.checklist-leg { border: 1px solid #e3e7ee; border-radius: .6rem; margin-bottom: .75rem; }
.checklist-leg .leg-head { padding: .5rem .75rem; background: #f8fafc; border-bottom: 1px solid #e3e7ee; border-radius: .6rem .6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.checklist-leg.tba .leg-head { background: #fdf0f1; }
.check-step { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; border-bottom: 1px dashed #edf0f4; }
.check-step:last-child { border-bottom: 0; }
.check-step .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #cbd5e1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.check-step.done .box { background: #198754; border-color: #198754; color: #fff; }
.check-step.done .lbl { color: #475569; }
.check-step.next { background: #fbf4e2; }
.check-step.next .box { border-color: var(--gold); }
.check-step.late .box { border-color: #dc3545; }
.check-step .when { margin-left: auto; text-align: right; font-size: .8rem; color: #64748b; white-space: nowrap; }
.check-step form { display: flex; gap: .35rem; align-items: center; }

/* Highlighted "Current position" box (brand dark + gold) */
.position-card { border: 0; border-left: 5px solid var(--gold); box-shadow: 0 6px 18px rgba(212, 167, 44, .18); overflow: hidden; }
.position-card .card-header { background: var(--brand-dark); color: var(--gold); border-bottom: 0; letter-spacing: .02em; }
.position-card .card-body { background: linear-gradient(180deg, #fffaf0 0%, #fdf3dc 100%); }
.position-card .card-body > .fs-5 { color: var(--brand-dark); }

/* Sub-item in the sidebar (e.g. Voyages under Vessels) */
.sidebar .nav-link.sub { padding-left: 2.6rem; font-size: .92rem; position: relative; }
.sidebar .nav-link.sub::before { content: ""; position: absolute; left: 1.55rem; top: 0; bottom: 50%; width: .6rem; border-left: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1; border-bottom-left-radius: 4px; }

/* Voyages listed under each vessel */
.vessel-voyages { background: #fafbfc; }
.vessel-voyages td { padding-top: .35rem !important; padding-bottom: .6rem !important; border-top: 0; }
.voy-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #e3e7ee; background: #fff; border-radius: 999px; padding: .15rem .6rem; margin: .15rem .25rem .15rem 0; font-size: .82rem; text-decoration: none; color: inherit; }
.voy-chip:hover { border-color: var(--gold); }
.border-gold-left { border-left: 4px solid var(--gold) !important; }
details > summary { cursor: pointer; }
/* Long unbroken text (file names, codes) must wrap instead of widening the page */
.main-content { overflow-wrap: anywhere; }
.main-content .table td, .main-content .table th { overflow-wrap: normal; }
.bulk-bar { border-left: 4px solid var(--gold); }

/* Size summary on the Containers list */
.size-summary { border-left: 4px solid var(--brand-dark); }
.size-chip { display: inline-flex; align-items: baseline; gap: .4rem; padding: .2rem .7rem; border: 1px solid #dfe3ea; border-radius: 999px; text-decoration: none; color: inherit; background: #fff; }
.size-chip span { font-size: 1.05rem; font-weight: 700; }
.size-chip:hover { border-color: var(--gold); }
.size-chip.active { background: #fbf4e2; border-color: var(--gold); }
.size-table { max-width: 560px; }
.size-table thead th { font-size: .75rem; }
.size-table tfoot td { border-top: 2px solid #cbd5e1; }
