/* ============================================================
   Order list — flex row so Details button aligns to the right
   ============================================================ */
.booking_grid .row {
    display:     flex !important;
    align-items: center;
    flex-wrap:   nowrap;
    min-height:  35px;
}
.booking_grid .row .box {
    flex-shrink: 0;
    height:      auto;
    min-height:  35px;
    line-height: normal;
    display:     flex;
    align-items: center;
    justify-content: center;
}
.booking_grid .row .box.name {
    justify-content: flex-start;
    padding-left: 4px;
    text-align: left;
}
.booking_grid .row .marine-details-box {
    margin-left: auto;
    justify-content: center;
}

/* ============================================================
   Order list — status dot counters inside Status column
   ============================================================ */
.marine-status-dot {
    font-size:      11px;
    font-weight:    bold;
    margin-left:    4px;
    white-space:    nowrap;
    vertical-align: middle;
}
.marine-dot-pending   { color: #006fcf; }
.marine-dot-confirmed { color: #71a800; }
.marine-dot-cancelled { color: #bc1f00; }

/* ============================================================
   Order list status badges — kept for backward compat
   ============================================================ */
.marine-status-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 3px;
    white-space: nowrap;
}
.marine-badge-pending   { background-color: #006fcf; color: #ffffff; }
.marine-badge-confirmed { background-color: #71a800; color: #ffffff; }
.marine-badge-cancelled { background-color: #bc1f00; color: #ffffff; }

/* ============================================================
   Marine Booking Detail — hierarchy view (marineBookingDetail.jsp)
   ============================================================ */

/* --- Surface card wrapping the whole hierarchy (Move #2) --- */
.marine-hierarchy-card {
    background: #ffffff;
    border: 1px solid #e1e6ec;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 8px 0;
    margin-top: 4px;
}

/* Empty-state paragraph inside the card */
.marine-empty-state {
    margin: 0;
    padding: 32px 16px;
    text-align: center;
    color: #6b7684;
    font-size: 12px;
}

/* --- Level 1: Customer row — dark navy section strip (Option A) --- */
.marine-customer-row {
    background-color: #0F1C3E;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 16px;
    cursor: pointer;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.marine-customer-row:first-child {
    margin-top: 0;
}

/* --- Level 2: Marker row — distinct grey-blue tier --- */
.marine-marker-row {
    background-color: #c5d1e0;
    color: #0F1C3E;
    font-weight: 600;
    font-size: 12px;
    padding: 7px 16px 7px 32px;
    cursor: pointer;
    border-left: 3px solid #0F1C3E;
    border-top: 1px solid #b5c2d3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* --- Level 3: SubMarker row — clearly lighter than marker, still tinted --- */
.marine-submarker-row {
    background-color: #f1f4f8;
    color: #566b85;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 16px 6px 48px;
    cursor: pointer;
    border-left: 3px solid #b6c2d0;
    border-top: 1px solid #e4e9ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Level 4: Reservation row — clean white, no zebra --- */
.marine-reservation-row {
    background-color: #ffffff;
    color: #2a3442;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 16px 6px 62px;
    border-top: 1px solid #eef1f4;
    display: flex;
    flex-direction: column;
}
.marine-reservation-row:nth-child(even) {
    background-color: #ffffff;
}

/* Reservation header line (service type, status, code, PNR, cost, actions) */
.marine-res-header {
    display: flex;
    align-items: center;
    min-height: 22px;
}

/* --- Flight segments body — per-leg blocks, one compact line per segment --- */
.marine-flight-segments {
    margin-top: 2px;
    padding-left: 2px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    color: #2a3442;
}
.marine-leg-group {
    display: flex;
    align-items: flex-start;
    padding: 1px 0 1px 6px;
    border-left: 1px dashed #c0cdd9;
    margin-left: 2px;
}
.marine-leg-group + .marine-leg-group {
    margin-top: 2px;
}
.marine-leg-tag {
    display: inline-block;
    flex-shrink: 0;
    background: transparent;
    color: #6b7684;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0;
    margin-right: 10px;
    margin-top: 2px;
    line-height: 1.3;
    min-width: 28px;
}
.marine-leg-segments {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.marine-segment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 15px;
    white-space: nowrap;
}
.marine-segment-row + .marine-segment-row {
    border-top: 1px solid #f0f2f5;
    padding-top: 2px;
    margin-top: 2px;
}
.marine-seg-carrier {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: #0F1C3E;
    font-size: 11px;
    min-width: 52px;
}
.marine-seg-route {
    color: #2a3442;
    min-width: 80px;
}
.marine-seg-time {
    color: #6b7684;
}
.marine-seg-cabin {
    color: #6b7684;
    font-size: 10px;
}
.marine-seg-op {
    color: #b7352c;
    font-size: 10px;
}

/* --- Collapse/expand chevron (SVG mask, follows currentColor) (#8) --- */
.marine-collapse-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: -1px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2,4 5,7 8,4'/%3E%3C/svg%3E") no-repeat center / 10px 10px;
    mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2,4 5,7 8,4'/%3E%3C/svg%3E") no-repeat center / 10px 10px;
    opacity: 0.55;
    transition: transform 0.15s;
}
.marine-collapse-icon.is-collapsed {
    transform: rotate(-90deg);
}

/* --- Reservation status chips — tinted, not saturated (Move #4) --- */
.marine-res-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.2px;
    margin-left: 6px;
}
.marine-res-badge-pending   { background-color: #e8f1fb; color: #0a4c8a; }
.marine-res-badge-confirmed { background-color: #e9f5e4; color: #3a6f1f; }
.marine-res-badge-cancelled { background-color: #fbeae7; color: #8a2a22; }

/* --- Row-level buttons: two styles (ghost + danger) with identical shape (Move #3) --- */

/* Ghost — neutral default for view details, seat map, amend */
.marine-btn-ghost {
    background: #ffffff;
    border: 1px solid #d4dae0;
    color: #243b53;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    margin-left: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.marine-btn-ghost:hover {
    background: #f5f7fa;
    border-color: #a9b3c0;
}

/* Danger — every cancel action */
.marine-btn-cancel {
    background: #ffffff;
    border: 1px solid #e5a5a0;
    color: #b7352c;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    margin-left: 4px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.marine-btn-cancel:hover {
    background: #b7352c;
    border-color: #b7352c;
    color: #ffffff;
}

/* Primary — positive action (Confirm booking) — mirror of cancel, green-tinted */
.marine-btn-primary {
    background: #ffffff;
    border: 1px solid #a9c6a3;
    color: #2f6b24;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    margin-left: 4px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.marine-btn-primary:hover {
    background: #2f6b24;
    border-color: #2f6b24;
    color: #ffffff;
}

/* .marine-btn-action kept as a deprecated alias of ghost for any legacy callers */
.marine-btn-action {
    background: #ffffff;
    border: 1px solid #d4dae0;
    color: #243b53;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    margin-left: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.marine-btn-action:hover {
    background: #f5f7fa;
    border-color: #a9b3c0;
}

/* --- Action message banner — slim info strip (#11) --- */
.marine-action-message {
    background: #fff7ed;
    border-left: 3px solid #d97706;
    padding: 8px 14px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0 3px 3px 0;
}
.marine-action-text { flex: 1; }
.marine-action-close {
    background: transparent;
    border: none;
    color: #92400e;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 10px;
    opacity: 0.55;
    transition: opacity 0.15s;
}
.marine-action-close:hover { opacity: 1; }

/* --- Hidden children (collapsed state) --- */
.marine-children-hidden { display: none; }

/* ============================================================
   Hover feedback on interactive (collapse-trigger) rows
   ============================================================ */
.marine-customer-row,
.marine-marker-row,
.marine-submarker-row {
    transition: background-color 0.12s ease;
}
.marine-customer-row:hover   { background-color: #1a2a54; }
.marine-marker-row:hover     { background-color: #bdcadb; }
.marine-submarker-row:hover  { background-color: #e8eef5; }

/* ============================================================
   Staggered page-load reveal — customer groups fade+slide in
   ============================================================ */
@keyframes marine-row-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.marine-customer-group {
    animation: marine-row-in 0.32s ease-out both;
}
.marine-customer-group:nth-of-type(1) { animation-delay: 0.00s; }
.marine-customer-group:nth-of-type(2) { animation-delay: 0.05s; }
.marine-customer-group:nth-of-type(3) { animation-delay: 0.10s; }
.marine-customer-group:nth-of-type(4) { animation-delay: 0.15s; }
.marine-customer-group:nth-of-type(5) { animation-delay: 0.20s; }
.marine-customer-group:nth-of-type(6) { animation-delay: 0.25s; }
.marine-customer-group:nth-of-type(7) { animation-delay: 0.30s; }
.marine-customer-group:nth-of-type(n+8) { animation-delay: 0.32s; }
/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .marine-customer-group { animation: none; }
}

/* --- Breadcrumb row: crumb trail (left) + Back-to-Orders button (right) --- */
.marine-breadcrumb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px 10px 2px;
    gap: 12px;
}

/* --- Breadcrumb (#12) --- */
.marine-breadcrumb {
    font-size: 11px;
    color: #6b7684;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.marine-breadcrumb-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #6b7684;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
}
.marine-breadcrumb-link:hover { color: #0F1C3E; text-decoration: underline; }
.marine-breadcrumb-sep { color: #c0cdd9; font-size: 12px; line-height: 1; }
.marine-breadcrumb-current { color: #2a3442; font-weight: 600; }

/* --- Service-type icon (flight/hotel) — neutral small glyph (#13) --- */
.marine-svc-icon {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    margin-right: 5px;
    color: #6b7684;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Service type label wrapper (replaces inline style min-width/bold) */
.marine-res-type {
    min-width: 72px;
    font-weight: 600;
    color: #0F1C3E;
    display: inline-flex;
    align-items: center;
}

/* ============================================================
   Booking detail — professional two-zone page header
   ============================================================ */
.marine-detail-header-wrap {
    margin-bottom: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Top zone: navy background with subtle depth (#5) */
.marine-header-top {
    background: linear-gradient(180deg, #0b1531 0%, #0F1C3E 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.marine-header-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.marine-header-title .marine-res-badge {
    padding-bottom: 0;
}
.marine-header-order-label {
    color: #7aabdb;
    font-size: 12px;
    font-weight: 500;
}
.marine-header-order-number {
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
/* Shared sizing — cancel + primary share width so the meta-strip row is balanced */
.marine-btn-cancel,
.marine-btn-primary {
    min-width: 90px;
    text-align: center;
}

/* Bottom zone: data (left) + actions (right) (#14 + Alt A) */
.marine-header-meta {
    background-color: #f5f7fa;
    border: 1px solid #e1e6ec;
    border-top: none;
    padding: 7px 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.marine-meta-data {
    display: flex;
    align-items: center;
    gap: 10px;
}
.marine-meta-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.marine-meta-value {
    font-size: 12px;
    font-weight: 500;
    color: #2a3442;
}
.marine-meta-sep {
    color: #a9b3c0;
    font-size: 12px;
    line-height: 1;
}

/* ============================================================
   Booking detail — PNR and Cost inline labels (Move #5 + #6)
   ============================================================ */

/* Monospace code chip — shared by reservation code, PNR, order number */
.marine-code {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f3f5f8;
    color: #243b53;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.marine-row-label {
    font-size:      10px;
    color:          #6b7684;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right:   4px;
}

.marine-cost-value {
    font-weight: 600;
    font-size:   12px;
    color:       #2a3442;
}

/* ============================================================
   Icon-only action buttons (booking detail page)
   Replaces text buttons; CSS-only tooltip via ::after
   ============================================================ */
.marine-icon-cluster {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.marine-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    background: #ffffff;
    border: 1px solid #d4dae0;
    border-radius: 4px;
    color: #243b53;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.marine-icon-btn .fa {
    font-size: 13px;
    line-height: 1;
}
.marine-icon-btn:hover { transform: translateY(-1px); }
.marine-icon-btn:active { transform: translateY(0); }
.marine-icon-btn:focus-visible {
    outline: 2px solid #7aabdb;
    outline-offset: 1px;
}
.marine-icon-btn:disabled,
.marine-icon-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cancel — danger (red) */
.marine-icon-btn--cancel {
    border-color: #e5a5a0;
    color: #b7352c;
}
.marine-icon-btn--cancel:hover {
    background: #b7352c;
    border-color: #b7352c;
    color: #ffffff;
}

/* Confirm — positive (green) */
.marine-icon-btn--confirm {
    border-color: #a9c6a3;
    color: #2f6b24;
}
.marine-icon-btn--confirm:hover {
    background: #2f6b24;
    border-color: #2f6b24;
    color: #ffffff;
}

/* Add — constructive (green, mirrors confirm) */
.marine-icon-btn--add {
    border-color: #a9c6a3;
    color: #2f6b24;
}
.marine-icon-btn--add:hover {
    background: #2f6b24;
    border-color: #2f6b24;
    color: #ffffff;
}

/* View details — informational (teal) */
.marine-icon-btn--view {
    border-color: #b6dad4;
    color: #1f8077;
}
.marine-icon-btn--view:hover {
    background: #1f8077;
    border-color: #1f8077;
    color: #ffffff;
}

/* Seat map / Amend — neutral info (blue) */
.marine-icon-btn--info {
    border-color: #aac7e2;
    color: #1d5a91;
}
.marine-icon-btn--info:hover {
    background: #1d5a91;
    border-color: #1d5a91;
    color: #ffffff;
}

/* On the dark navy page header strip — invert to white-on-transparent */
.marine-header-top .marine-icon-btn,
.marine-customer-row .marine-icon-btn {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}
.marine-header-top .marine-icon-btn:hover,
.marine-customer-row .marine-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

/* --- Tooltip — CSS only via ::after / ::before --- */
.marine-icon-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #0F1C3E;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s, visibility 0.12s;
    z-index: 100;
    line-height: 1.4;
    letter-spacing: 0.1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.marine-icon-btn[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #0F1C3E;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s, visibility 0.12s;
    z-index: 100;
}
.marine-icon-btn[data-tooltip]:hover::after,
.marine-icon-btn[data-tooltip]:hover::before,
.marine-icon-btn[data-tooltip]:focus-visible::after,
.marine-icon-btn[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
}

/* --- Header action buttons (navy top bar, right) --- */
.marine-header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.marine-header-offer-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.marine-header-offer-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
}
