:root {
    --color-orange-primary: #F26922;
    --color-orange-secondary: #F59261;
    --color-navy: #233548;
    --color-white: #FFFFFF;
    --color-light-gray: #f8f9fa;
    --color-border: #e0e0e0;
    --color-text-dark: #333333;
    --color-text-muted: #666666;
    --color-text-light: #999999;
    --color-success: #51cf66;
    --color-danger: #ff6b6b;
    --color-warning: #ffeaa7;
    --color-info: #81ecec;
    /* Intermodal phases */
    --color-phase-maritime: #233548;
    --color-phase-maritime-light: #e8eaed;
    --color-phase-intermodal: #F26922;
    --color-phase-intermodal-light: #fef5f1;
    --color-phase-land: #51cf66;
    --color-phase-land-light: #e8f5e9;
}

* {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Make sizing predictable to avoid overflow issues */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ==================== GENERAL STYLES ==================== */

body {
    background-color: var(--color-light-gray);
}

/* Reserve space for scrollbar to avoid content shifting/hiding (modern browsers) */
html {
    /*scrollbar-gutter: stable;*/
}

a {
    text-decoration: none;
}

/* ==================== NAVBAR ==================== */

.navbar-custom {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1040;
    overflow: visible;
    padding-top: 8px;
    padding-bottom: 8px;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--color-white) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-custom .navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-custom .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

.navbar-custom .d-flex {
    flex-wrap: wrap;
}

.navbar-custom .text-white {
    color: var(--color-white) !important;
}

/* ==================== DROPDOWN MENU ==================== */

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.dropdown-menu .dropdown-item {
    padding: 10px 20px;
    color: var(--color-text-dark);
    border-radius: 0;
    transition: all 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f0f0f0;
    color: var(--color-orange-primary);
    padding-left: 25px;
}

.dropdown-menu .dropdown-item i {
    color: var(--color-orange-primary);
}

.dropdown-divider {
    margin: 4px 0 !important;
    border-color: var(--color-border);
}

/* ==================== BUTTONS ==================== */

.btn-primary-custom {
    background: linear-gradient(135deg, var(--color-orange-primary) 0%, var(--color-orange-secondary) 100%);
    border: none;
    color: var(--color-white);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    color: var(--color-white);
    box-shadow: 0 5px 20px rgba(242, 105, 34, 0.4);
}

.btn-secondary-custom {
    background-color: var(--color-navy);
    border: none;
    color: var(--color-white);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary-custom:hover {
    background-color: #1a2534;
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-success-custom {
    background-color: var(--color-success);
    border: none;
    color: var(--color-white);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-success-custom:hover {
    background-color: #40c057;
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-danger-custom {
    background-color: var(--color-danger);
    border: none;
    color: var(--color-white);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-custom:hover {
    background-color: #ff5252;
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-outline-custom {
    border: 2px solid var(--color-white);
    color: var(--color-white);
    background-color: transparent;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-custom:hover {
    background-color: var(--color-white);
    color: var(--color-orange-primary);
}

.btn-info-custom {
    background-color: #17a2b8;
    border: none;
    color: var(--color-white);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-info-custom:hover {
    background-color: #138496;
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-info-secondary {
    background-color: transparent;
    border: 1px solid var(--color-orange-primary);
    color: var(--color-orange-primary);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    /*margin-bottom: 1rem;*/
}

.btn-info-secondary:hover {
    background-color: var(--color-orange-primary);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(242, 105, 34, 0.3);
}

/* Reusable small icon-style action button used across BL cards and tables */
.btn-icon-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
}

.btn-icon-action .bi {
    font-size: 16px;
}

/* Small variant keeps consistent sizing */
.btn-icon-action.btn-sm {
    width: 34px;
    height: 34px;
    padding: 4px;
}

/* Overlay used when showing a child modal above a parent modal */
.modal-sibling-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.28); /* slightly lighter than the main backdrop */
    z-index: 1060; /* sits above default modal (1050) but below the child modal (1065) */
}

/* Utility to bring a modal above the overlay */
.modal-front {
    z-index: 1065 !important;
}

/* ==================== TABLES ==================== */

/* Manage Events Table */
.table-sm-custom {
    font-size: 12px;
    margin-bottom: 0;
}

.table-sm-custom thead th {
    font-size: 12px;
    font-weight: 700;
    padding: 10px 12px;
    background-color: var(--color-light-gray);
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-dark);
}

.table-sm-custom tbody td {
    font-size: 12px;
    font-weight: 400;
    padding: 10px 12px;
    vertical-align: middle;
}

.small-cell {
    font-size: 12px;
    font-weight: 400;
}

/* Table action buttons group: align buttons center vertically and right */
.table-action-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.table-sm-custom td .btn, .table-sm-custom td .btn-sm {
    padding: 4px 8px;
    line-height: 1.1;
}

/* Ensure action buttons share same height and centered icon */
.table-action-group .btn, .table-action-group .btn-sm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 34px; /* fixed height for consistent alignment */
    padding: 4px 8px;
    vertical-align: middle;
}

.table-action-group form { margin: 0; }

/* Reduce gap slightly to keep buttons compact */
.table-action-group { gap: 6px; }

/* ==================== CARDS ==================== */

.card-custom {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: var(--color-white);
}

.card-header-custom {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    color: var(--color-white);
    border-radius: 10px 10px 0 0 !important;
    padding: 20px;
    font-weight: 700;
    border: none;
}

.card-body-custom {
    padding: 30px;
}

/* ==================== FORMS ==================== */

.form-control-custom {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    font-size: 14px;
    background-color: var(--color-white);
}

.form-control-custom:focus {
    border-color: var(--color-orange-primary);
    box-shadow: 0 0 0 0.2rem rgba(242, 105, 34, 0.25);
}

.form-label-custom {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 8px;
}

.input-group-text-custom {
    background-color: var(--color-light-gray);
    border: 1px solid var(--color-border);
    color: var(--color-orange-primary);
}

/* ==================== ALERTS ==================== */

.alert-custom {
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-success-custom {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger-custom {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info-custom {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning-custom {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ==================== LOGIN PAGE ==================== */

.login-body-gradient {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 15px;
}

.login-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    background-color: var(--color-white);
}

.login-header {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    padding: 30px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    color: var(--color-white);
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.login-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.login-header img {
    height: 60px;
    width: auto;
    margin-bottom: 15px;
}

.login-body {
    padding: 30px;
}

.icon-container {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--color-orange-primary);
}

/* ==================== DASHBOARD ==================== */

.search-section {
    background: var(--color-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.search-section h2 {
    color: var(--color-text-dark);
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 24px;
}

.search-section .input-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-section .form-control {
    border: none;
    padding: 12px 15px;
    font-size: 15px;
}

.btn-search {
    background: linear-gradient(135deg, var(--color-orange-primary) 0%, var(--color-orange-secondary) 100%);
    border: none;
    color: var(--color-white);
    padding: 12px 30px;
    font-weight: 600;
}

.btn-search:hover {
    background: linear-gradient(135deg, #e55c1a 0%, #e48050 100%);
    color: var(--color-white);
}

.search-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-top: 0;
    accent-color: var(--color-orange-primary);
}

/* ==================== FREIGHT CARDS ==================== */

.freight-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 20px;
    border-left: 3px solid rgba(242, 105, 34, 0.4);
}

.freight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    margin-top: 10px;
    border-bottom: 2px solid var(--color-light-gray);
}

.freight-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-dark);
}

.freight-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background-color: var(--color-warning);
    color: #d63031;
}

.status-active {
    background-color: var(--color-info);
    color: #00b894;
}

.status-delivered {
    background-color: #55efc4;
    color: #00b894;
}

.freight-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.detail-item {
    padding: 12px;
    background-color: var(--color-light-gray);
    border-radius: 8px;
    border-left: 3px solid var(--color-orange-primary);
}

.detail-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 15px;
    color: var(--color-text-dark);
    font-weight: 500;
}

.comments-section {
    background-color: var(--color-light-gray);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 3px solid var(--color-orange-secondary);
}

.comments-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.comments-preview {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-view-comments {
    background: linear-gradient(135deg, var(--color-orange-primary) 0%, var(--color-orange-secondary) 100%);
    border: none;
    color: var(--color-white);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.btn-view-comments:hover {
    background: linear-gradient(135deg, #e55c1a 0%, #e48050 100%);
    color: var(--color-white);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--color-text-light);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==================== MODALS ==================== */

.modal-header-custom {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    color: var(--color-white);
    border: none;
}

.modal-header-custom h5 {
    color: var(--color-white);
}

.modal-header-confirm {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-orange-primary) 100%);
    border: none;
    border-bottom: 2px solid #ffc107;
}

.modal-header-confirm .modal-title {
    color: var(--color-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-confirm .bi-exclamation-triangle-fill {
    color: #ff6b6b;
    font-size: 24px;
}

/* ==================== ADMIN PANEL ==================== */

.admin-badge {
    display: inline-block;
    background-color: var(--color-danger);
    color: var(--color-white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.users-table {
    background: var(--color-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.users-table table {
    margin: 0;
}

.users-table th {
    background-color: var(--color-light-gray);
    border-top: none;
    font-weight: 700;
    color: var(--color-text-dark);
    padding: 15px;
    border-bottom: 2px solid var(--color-border);
}

.users-table td {
    padding: 15px;
    border-color: var(--color-border);
    vertical-align: middle;
}

/* Responsive: convert users table to stacked cards on tablet/mobile */
@media (max-width: 1080px) {
    .users-table { box-shadow: none; background: transparent; }
    .users-table table { border: none; }
    .users-table thead { display: none; }
    .users-table tbody tr {
        display: block;
        background: var(--color-white);
        margin-bottom: 16px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        padding: 10px 12px;
    }
    .users-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 6px;
        border-bottom: 1px solid transparent;
        word-break: break-word;
    }
    .users-table tbody tr td:last-child {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    /* Add label before each cell using nth-child (keeps HTML unchanged) */
    .users-table tbody tr td:nth-child(1)::before { content: "Username"; font-weight: 700; color: var(--color-text-dark); margin-right: 8px; }
    .users-table tbody tr td:nth-child(2)::before { content: "Email"; font-weight: 700; color: var(--color-text-dark); margin-right: 8px; }
    .users-table tbody tr td:nth-child(3)::before { content: "Type"; font-weight: 700; color: var(--color-text-dark); margin-right: 8px; }
    .users-table tbody tr td:nth-child(4)::before { content: "Action"; font-weight: 700; color: var(--color-text-dark); margin-right: 8px; }

    /* Stack label and value for very narrow screens */
    @media (max-width: 420px) {
        .users-table tbody tr td { flex-direction: column; align-items: flex-start; gap: 6px; }
        .users-table tbody tr td::before { display: block; }
        .users-table tbody tr td:last-child { width: 100%; justify-content: flex-start; }
    }
}

.no-users {
    text-align: center;
    padding: 40px;
    color: var(--color-text-light);
}

/* ==================== UTILITIES ==================== */

.text-orange-primary {
    color: var(--color-orange-primary) !important;
}

.text-navy {
    color: var(--color-navy) !important;
}

.text-muted-custom {
    color: var(--color-text-muted) !important;
}

.border-orange {
    border: 2px solid var(--color-orange-primary) !important;
}

.border-navy {
    border: 2px solid var(--color-navy) !important;
}

.bg-light-orange {
    background-color: #fff8f3 !important;
}

.bg-navy {
    background-color: var(--color-navy) !important;
    color: var(--color-white);
}

.gap-3 {
    gap: 15px !important;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .login-container {
        max-width: 100%;
    }
    
    .freight-details {
        grid-template-columns: 1fr;
    }
    
    .search-options {
        flex-direction: column;
    }
    
    .navbar-custom .navbar-brand img {
        height: 30px;
    }
    
    /* Navbar responsive for mobile */
    .navbar-custom {
        padding: 12px 15px !important;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 16px;
        gap: 8px;
        margin-bottom: 10px;
        width: 100%;
        flex-shrink: 0;
    }
    
    .navbar-custom .d-flex {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px !important;
    }
    
    .navbar-custom .text-white {
        flex-basis: 100%;
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .navbar-custom .dropdown {
        flex: 1;
        min-width: 120px;
    }
    
    .navbar-custom .btn-outline-custom {
        flex: 1;
        min-width: 120px;
        padding: 8px 12px !important;
        font-size: 12px;
    }
    
    .navbar-custom .btn-primary-custom {
        width: 100%;
        padding: 10px 12px !important;
        font-size: 12px;
    }
    
    /* Ensure mobile navbar buttons share same height and center content */
    .navbar-custom .btn, .navbar-custom .btn-primary-custom, .navbar-custom .btn-outline-custom {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 40px !important;
    }
}

/* Action button: compact, consistent across tables */
.btn-action {
    height: 34px;
    padding: 6px 10px !important;
    font-size: 13px !important;
    border-radius: 8px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==================== CONTAINER RESPONSIVE LAYOUT ==================== */

/* Default: desktop width */
.container {
    max-width: 1200px;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

/* Large screens (1400px+): 85% width */
@media (min-width: 1400px) {
    .container {
        width: 85%;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablet and mobile (≤992px): single-column, 85% width, centered */
@media (max-width: 992px) {
    .container {
        width: 85%;
        padding-left: 0;
        padding-right: 0;
    }
    
    .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 25px;
    }
    
    .card-body-custom {
        padding: 20px;
    }
    
    /* Ensure all tables are responsive and centered */
    .table-responsive {
        margin-left: auto;
        margin-right: auto;
    }
    
    .card {
        margin-bottom: 25px;
    }
    
    .freight-card {
        margin-bottom: 25px;
    }
    
    .search-section {
        margin-bottom: 25px;
    }

    /* Adjust table font sizes for smaller screens */
    .table-sm-custom tbody td {
        font-size: 10px;
        font-weight: 400;
        padding: 10px 12px;
        vertical-align: middle;
    }
}

/* Mobile only (≤768px): narrower padding, 100% width with side margins */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }
    
    .table-responsive {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }
    
    /* Dashboard sections responsive */
    .search-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .search-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .search-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .freight-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .freight-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .freight-title {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* ==================== PRINT STYLES FOR MODALS ==================== */

@media print {
    /* Hide everything except the modal content when printing */
    body * {
        visibility: hidden;
    }
    
    /* Show only the active modal */
    .modal.show,
    .modal.show * {
        visibility: visible;
    }
    
    /* Position modal for print */
    .modal.show {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .modal-dialog {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .modal-content {
        border: none;
        box-shadow: none;
    }
    
    /* Hide modal header close button when printing */
    .modal-header .btn-close {
        display: none;
    }
    
    /* Hide modal footer when printing */
    .modal-footer {
        display: none;
    }
    
    /* Style the modal header for print - compact and styled */
    .modal-header {
        background: linear-gradient(135deg, #233548 0%, #F26922 100%) !important;
        color: white !important;
        border-bottom: none !important;
        padding: 12px 20px !important;
        page-break-after: avoid;
        margin: 0 !important;
    }
    
    .modal-title {
        color: white !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        margin: 0 !important;
    }
    
    /* Compact modal body */
    .modal-body {
        padding: 15px 20px !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
    
    /* Compact definition lists - 2 columns layout */
    .modal-body dl.row {
        display: grid !important;
        grid-template-columns: auto 1fr auto 1fr;
        gap: 3px 10px !important;
        margin-bottom: 8px !important;
    }
    
    .modal-body dt {
        font-weight: 600;
        color: #233548;
        page-break-after: avoid;
        margin: 0 !important;
        padding: 3px 0 !important;
        grid-column: auto;
        font-size: 10px !important;
    }
    
    .modal-body dd {
        color: #333;
        page-break-before: avoid;
        margin: 0 !important;
        padding: 3px 0 !important;
        grid-column: auto;
        font-size: 11px !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* Section dividers - compact */
    .modal-body hr {
        border: none;
        border-top: 2px solid #F26922;
        margin: 8px 0 !important;
        opacity: 0.3;
    }
    
    /* Section headers - compact */
    .modal-body h6 {
        color: #233548 !important;
        font-weight: 600 !important;
        font-size: 12px !important;
        margin: 8px 0 5px 0 !important;
        padding-bottom: 3px;
        border-bottom: 1px solid #F26922;
    }
    
    .modal-body h6 i {
        color: #F26922 !important;
    }
    
    /* Page setup - compact margins */
    @page {
        margin: 0.8cm;
        size: A4;
    }
    
    /* Prevent widows and orphans */
    p, h1, h2, h3, h4, h5, h6, dt, dd {
        orphans: 2;
        widows: 2;
    }
    
    /* Remove extra spacing */
    .modal-body > *:first-child {
        margin-top: 0 !important;
    }
    
    .modal-body > *:last-child {
        margin-bottom: 0 !important;
    }
}

/* ==================== INTERMODAL TRANSPORT PHASES ==================== */

/* Phase indicator badges */
.phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.phase-badge.maritime {
    background: var(--color-phase-maritime-light);
    color: var(--color-phase-maritime);
    border-left: 3px solid var(--color-phase-maritime);
}

.phase-badge.intermodal {
    background: var(--color-phase-intermodal-light);
    color: var(--color-phase-intermodal);
    border-left: 3px solid var(--color-phase-intermodal);
}

.phase-badge.land {
    background: var(--color-phase-land-light);
    color: var(--color-phase-land);
    border-left: 3px solid var(--color-phase-land);
}

/* Phase separator in timeline */
.phase-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 10px;
}

.phase-divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--color-phase-maritime) 0%, var(--color-phase-intermodal) 50%, var(--color-phase-land) 100%);
}

.phase-divider-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-phase-intermodal);
    white-space: nowrap;
    padding: 4px 12px;
    background: var(--color-phase-intermodal-light);
    border-radius: 12px;
}

/* Event timeline styling for phases */
.event-row.maritime {
    border-left: 3px solid var(--color-phase-maritime);
    background: linear-gradient(90deg, var(--color-phase-maritime-light) 0%, transparent 20px);
}

.event-row.intermodal {
    border-left: 3px solid var(--color-phase-intermodal);
    background: linear-gradient(90deg, var(--color-phase-intermodal-light) 0%, transparent 20px);
}

.event-row.land {
    border-left: 3px solid var(--color-phase-land);
    background: linear-gradient(90deg, var(--color-phase-land-light) 0%, transparent 20px);
}

/* Second reference badge */
.second-ref-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-phase-intermodal-light);
    border: 1px solid var(--color-phase-intermodal);
    color: var(--color-phase-intermodal);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Dashboard containers - intermodal layout helpers */
.dashboard-containers-table .container-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-containers-table .container-phase-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 576px) {
    .dashboard-containers-table .container-id {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .dashboard-containers-table .second-ref-badge {
        margin-left: 0;
        padding: 2px;
        font-size: 10px;
        border-radius: 4px;
    }

    .dashboard-containers-table .phase-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .dashboard-containers-table .container-phase-info {
        gap: 4px;
    }
}

/* Intermodal indicator dot (subtle) */
.intermodal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-phase-intermodal);
    box-shadow: 0 0 0 2px var(--color-phase-intermodal-light);
    margin-left: 6px;
    vertical-align: middle;
}

