/* global.css - Consolidated admin + worker layout styles
   Generated from partials/admin_styles.php and partials/worker_styles.php
*/

/* ── DataTable row selection ── */
table.dataTable tbody tr {
    cursor: pointer;
    transition: background 0.12s;
}
table.dataTable tbody tr.dt-row-selected td {
    background: #dbeafe !important;
    color: #1e3a8a !important;
    box-shadow: inset 3px 0 0 #3b82f6;
}
table.dataTable tbody tr.dt-row-selected:hover td {
    background: #bfdbfe !important;
}
.dt-select-info {
    display: inline-block;
    padding: 4px 10px;
    background: #3b82f6;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    transition: opacity 0.2s;
}
.dt-select-info.hidden { display: none; }

/* --- Admin Layout --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
}

/* Admin Sidebar */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: #111827;
    color: #ecf0f1;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.admin-sidebar .logo-area {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .logo-area img {
    width: auto;
    height: 60px;
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.admin-sidebar .user-info {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #3498db;
}

.admin-sidebar .user-info h6 { margin: 0; font-size: 14px; font-weight: 600; }
.admin-sidebar .user-info .status { font-size: 12px; color: #2ecc71; margin-top: 5px; }
.admin-sidebar .user-info .status i { font-size: 8px; margin-right: 5px; }

/* admin-sidebar nav rules are defined in admin_sidebar.php inline styles */
/* global.css only defines layout-level rules */
.admin-sidebar .badge { font-size: 11px; padding: 3px 7px; border-radius: 10px; }

/* Admin Top Bar */
.admin-topbar { position: fixed; top: 0; left: 225px; right: 0; height: 70px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; z-index: 999; }
.admin-topbar h4 { margin: 0; font-size: 18px; color: #2c3e50; font-weight: 600; }
.admin-topbar .top-actions { display: flex; align-items: center; gap: 15px; }
.admin-topbar .btn-icon { width: 40px; height: 40px; border: none; background: #f4f6f9; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #2c3e50; transition: all 0.3s; position: relative; }
.admin-topbar .btn-icon:hover { background: #3498db; color: #fff; }
.admin-topbar .badge-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: #e74c3c; border-radius: 50%; border: 2px solid #fff; }
.admin-topbar .user-profile { width: 40px; height: 40px; border-radius: 50%; overflow: visible; cursor: pointer; border: 2px solid #3498db; }
.admin-topbar .user-profile img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Notification bell dropdown styling */
.badge-sm { padding: 0.25em 0.5em; font-size: 0.75rem; }
.dropdown-item { transition: background-color 0.15s ease-in-out; }
.dropdown-item:hover { background-color: #f8f9fa; }
.d-flex.gap-2 { gap: 0.5rem; }

.admin-main-content { margin-left: 240px; margin-top: 70px; padding: 0px; min-height: auto; margin-right: 10px;}
.admin-footer {
    position: relative;
    margin-left: 240px; /* align with content */
    height: 60px;
    background: #ddd;
    color: #333;
    padding: 16px 30px;
    display: flex;
    justify-content: center; /* center copyright */
    align-items: center;
    font-size: 14px;
    z-index: 995;
    box-shadow: none;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.admin-footer .footer-copy { margin: 0; text-align: center; width: 100%; } 
.admin-footer p { margin: 0; }
.admin-footer .footer-links { display: flex; gap: 20px; }
.admin-footer .footer-links a { color: #ecf0f1; text-decoration: none; transition: color 0.3s; }
.admin-footer .footer-links a:hover { color: #3498db; }

.page-header { margin-bottom: 30px; }
.page-header h5 { margin: 0; font-size: 24px; color: #2c3e50; font-weight: 600; }
.page-header p { margin: 5px 0 0 0; color: #7f8c8d; font-size: 14px; }

/* Dashboard Cards */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px; padding: 25px; color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.stat-card.orange { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.green { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-card.purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card.red { background: linear-gradient(135deg, #ff416c 0%, #c0392b 100%); }
.stat-card .card-icon { font-size: 40px; opacity: 0.3; float: right; }
.stat-card h6 { font-size: 14px; font-weight: 500; margin: 0 0 10px 0; opacity: 0.9; }
.stat-card .stat-number { font-size: 36px; font-weight: 700; margin: 10px 0; }
.stat-card .stat-label { font-size: 12px; opacity: 0.8; }

/* Sidebar toggle — collapsed state */
body.sidebar-collapsed .admin-sidebar { transform: translateX(-240px); }
body.sidebar-collapsed .admin-topbar  { left: 0; }
body.sidebar-collapsed .admin-main-content,
body.sidebar-collapsed .admin-footer  { margin-left: 10px; }

/* Smooth transition for sidebar open/close */
.admin-sidebar { transition: transform 0.25s ease; }
.admin-topbar   { transition: left 0.25s ease; }
.admin-main-content,
.admin-footer   { transition: margin-left 0.25s ease; }

/* Sidebar toggle button in topbar */
#sidebarToggleBtn { margin-right: 8px; }

/* Mobile handled by PWA — admin sidebar is desktop-only, no responsive collapse */
@media (max-width: 768px) {
    .admin-topbar { left: 225px; }
    .admin-main-content, .admin-footer { margin-left: 225px; }
}

/* ═══════════════════════════════════════════════
   DARK THEME — body.theme-dark
   ═══════════════════════════════════════════════ */
body.theme-dark,
html.theme-dark-pre body {
    background: #0f1923 !important;
    /* color: #f0f2f5 !important; */
}
html.theme-dark-pre {
    background: #0f1923 !important;
}
/* Topbar */
body.theme-dark .admin-topbar {
    background: #1a2535 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.4) !important;
}
body.theme-dark .admin-topbar h4 { color: #ffffff !important; }
body.theme-dark .admin-topbar .btn-icon { background: #243044 !important; color: #d0dae6 !important; }
body.theme-dark .admin-topbar .btn-icon:hover { background: #3498db !important; color: #fff !important; }
/* Worker layout dark mode */
body.theme-dark .worker-topbar { background: #1a2535 !important; box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; }
body.theme-dark .worker-topbar h4 { color: #ffffff !important; }
body.theme-dark .worker-topbar .btn-icon { background: #243044 !important; color: #d0dae6 !important; }
body.theme-dark .worker-topbar .btn-icon:hover { background: #3498db !important; color: #fff !important; }
body.theme-dark .worker-sidebar { background: #131f2e !important; }
body.theme-dark .worker-sidebar .nav-link { color: #d0dae6 !important; }
body.theme-dark .worker-sidebar .nav-link:hover,
body.theme-dark .worker-sidebar .nav-link.active { background: rgba(52,152,219,.2) !important; color: #fff !important; }
body.theme-dark .worker-main-content { background: #0f1923 !important; }
body.theme-dark .worker-footer { background: #1a2535 !important; color: #8899aa !important; border-top-color: #243044 !important; }
/* Sidebar */
body.theme-dark .admin-sidebar { background: #131f2e !important; }
body.theme-dark .admin-sidebar .nav-link { color: #d0dae6 !important; }
body.theme-dark .admin-sidebar .nav-link:hover,
body.theme-dark .admin-sidebar .nav-link:focus { background: rgba(52,152,219,.2) !important; color:#fff !important; }
/* Footer */
body.theme-dark .admin-footer { background: #1a2535 !important; color: #8899aa !important; border-top-color: #243044 !important; }
/* Main content & body background */
body.theme-dark .admin-main-content { background: #0f1923 !important; }
body.theme-dark { background: #0f1923 !important; }

/* ── Cards ─────────────────────────────────────────────────────── */
body.theme-dark .card,
body.theme-dark .settings-card,
body.theme-dark .filter-card,
body.theme-dark .log-card { background: #1a2535 !important; border-color: #243044 !important; color: #f0f2f5 !important; }
body.theme-dark .card-header { background: #1f2f42 !important; border-bottom-color: #243044 !important; color: #ffffff !important; }
body.theme-dark .card-body { background: #1a2535 !important; color: #f0f2f5 !important; }
body.theme-dark .card-footer { background: #1a2535 !important; border-top-color: #243044 !important; }
/* Inline-styled td inside cards (e.g. ticket detail uses bare tables with style="color:#212529") */
body.theme-dark .card-body td { color: #f0f2f5 !important; }
body.theme-dark .card-body h6 { color: #d0dae6 !important; border-color: #2e4060 !important; }
/* inline white bg on card-body (e.g. style="background: white") */
body.theme-dark .card-body[style*="background: white"],
body.theme-dark .card-body[style*="background:white"] { background: #1a2535 !important; }
/* Tracking history items (tickets/view.php vessel movement) */
body.theme-dark .tracking-history-item { background: #1f2f42 !important; border-left-color: #3498db !important; color: #f0f2f5 !important; }
body.theme-dark .tracking-history-item:hover { background: #243e5a !important; }
body.theme-dark .tracking-history-item .text-muted { color: #7a95aa !important; }

/* ── Modals ─────────────────────────────────────────────────────── */
body.theme-dark .modal-content { background: #1a2535 !important; border-color: #243044 !important; }
body.theme-dark .modal-header { border-bottom-color: #243044 !important; background: #1f2f42 !important; }
body.theme-dark .modal-footer { border-top-color: #243044 !important; background: #1a2535 !important; }
body.theme-dark .modal-title { color: #ffffff !important; }

/* ── Tables ─────────────────────────────────────────────────────── */
body.theme-dark .table { color: #f0f2f5 !important; background: transparent !important; }
body.theme-dark .table thead th,
body.theme-dark .table .thead-dark th { background: #1f2f42 !important; border-color: #2c3e55 !important; color: #d0dae6 !important; }
body.theme-dark .table td,
body.theme-dark .table th { border-color: #243044 !important; background: transparent; }
body.theme-dark .table tbody tr { background: #1a2535 !important; }
body.theme-dark .table-striped tbody tr:nth-of-type(odd) { background: #1f2f42 !important; }
body.theme-dark .table-hover tbody tr:hover { background: #243e5a !important; color: #fff !important; }
body.theme-dark .table-responsive { border-color: #243044 !important; }
/* Alarm severity rows — higher specificity to beat inline !important */
body.theme-dark table tr.severity-CRITICAL,
body.theme-dark table tr.severity-CRITICAL td { background-color: #3d1515 !important; color: #f5b8b8 !important; }
body.theme-dark table tr.severity-HIGH,
body.theme-dark table tr.severity-HIGH td    { background-color: #2e2200 !important; color: #f5d78a !important; }
body.theme-dark table tr.severity-MEDIUM,
body.theme-dark table tr.severity-MEDIUM td  { background-color: #0d2535 !important; color: #80c9e8 !important; }
/* Failed rows in activity log */
body.theme-dark tr.row-failed > td { background: rgba(220,53,69,.12) !important; }

/* ── Inputs & forms ─────────────────────────────────────────────── */
body.theme-dark .form-control,
body.theme-dark .custom-select,
body.theme-dark .input-group-text {
    background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important;
}
body.theme-dark .form-control:focus { border-color: #3498db !important; box-shadow: 0 0 0 .15rem rgba(52,152,219,.3) !important; background: #1f2f42 !important; }
body.theme-dark .form-control::placeholder { color: #7a95aa !important; }
body.theme-dark .input-group-text { color: #d0dae6 !important; }
body.theme-dark label { color: #d0dae6 !important; }
body.theme-dark .form-text { color: #7a95aa !important; }

/* ── Buttons ─────────────────────────────────────────────────────── */
body.theme-dark .btn-secondary  { background: #2c3e55 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .btn-light      { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .btn-outline-secondary { border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .btn-outline-secondary:hover { background: #243044 !important; color: #fff !important; }

/* ── Nav tabs ────────────────────────────────────────────────────── */
body.theme-dark .nav-tabs { border-bottom-color: #243044 !important; }
body.theme-dark .nav-tabs .nav-link { color: #d0dae6 !important; border-color: transparent !important; }
body.theme-dark .nav-tabs .nav-link:hover { border-color: #243044 !important; color: #fff !important; }
body.theme-dark .nav-tabs .nav-link.active { background: #1a2535 !important; border-color: #243044 #243044 #1a2535 !important; color: #ffffff !important; }
body.theme-dark .tab-content { background: #1a2535 !important; }
body.theme-dark .nav-pills .nav-link { color: #d0dae6 !important; }
body.theme-dark .nav-pills .nav-link.active { background: #3498db !important; color: #fff !important; }

/* ── Dropdowns ───────────────────────────────────────────────────── */
body.theme-dark .dropdown-menu { background: #1a2535 !important; border-color: #243044 !important; }
body.theme-dark .dropdown-item { color: #f0f2f5 !important; }
body.theme-dark .dropdown-item:hover { background: #243044 !important; color:#fff !important; }
body.theme-dark .dropdown-divider { border-top-color: #243044 !important; }

/* ── Alerts ──────────────────────────────────────────────────────── */
body.theme-dark .alert-success { background: #0d2e1a !important; border-color: #1a6335 !important; color: #6fcf97 !important; }
body.theme-dark .alert-danger  { background: #2e0d0d !important; border-color: #7a1e1e !important; color: #f28b8b !important; }
body.theme-dark .alert-warning { background: #2e2000 !important; border-color: #7a5500 !important; color: #f0c04a !important; }
body.theme-dark .alert-info    { background: #0d2035 !important; border-color: #1a4a7a !important; color: #6ab8e8 !important; }

/* ── Badges (soft) ───────────────────────────────────────────────── */
body.theme-dark .badge-success-soft  { background: #0d2e1a !important; color: #6fcf97 !important; }
body.theme-dark .badge-danger-soft   { background: #2e0d0d !important; color: #f28b8b !important; }
body.theme-dark .badge-warning-soft  { background: #2e2000 !important; color: #f0c04a !important; }
body.theme-dark .badge-info-soft     { background: #0d2035 !important; color: #6ab8e8 !important; }
body.theme-dark .badge-secondary-soft{ background: #243044 !important; color: #d0dae6 !important; }

/* ── Text utilities ──────────────────────────────────────────────── */
body.theme-dark .text-muted  { color: #7a95aa !important; }
body.theme-dark .text-dark   { color: #d0dae6 !important; }
body.theme-dark h1,body.theme-dark h2,body.theme-dark h3,
body.theme-dark h4,body.theme-dark h5,body.theme-dark h6 { color: #ffffff !important; }
body.theme-dark p { color: #f0f2f5 !important; }
body.theme-dark small { color: #fff !important; }
body.theme-dark code { background: #243044 !important; color: #e2c97e !important; }

/* ── Borders & dividers ──────────────────────────────────────────── */
body.theme-dark hr { border-top-color: #243044 !important; }
body.theme-dark .border,
body.theme-dark .border-bottom,
body.theme-dark .border-top { border-color: #243044 !important; }
body.theme-dark .bg-white,
body.theme-dark .bg-light { background: #1a2535 !important; }

/* ── Pagination ──────────────────────────────────────────────────── */
body.theme-dark .page-item .page-link { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .page-item.active .page-link { background: #3498db !important; border-color: #3498db !important; color:#fff !important; }
body.theme-dark .page-item.disabled .page-link { background: #1a2535 !important; color: #3a5570 !important; }

/* ── DataTables ──────────────────────────────────────────────────── */
body.theme-dark .dataTables_wrapper .dataTables_filter input,
body.theme-dark .dataTables_wrapper .dataTables_length select { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .dataTables_wrapper .dataTables_info,
body.theme-dark .dataTables_wrapper .dataTables_filter label,
body.theme-dark .dataTables_wrapper .dataTables_length label { color: #7a95aa !important; }

/* ── Ticket timeline ─────────────────────────────────────────────── */
body.theme-dark .tl-wrap { background: #1a2535 !important; }
body.theme-dark .tl-icon { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .tl-step.done .tl-icon { background: #28a745 !important; border-color: #28a745 !important; color: #fff !important; }
body.theme-dark .tl-step.active .tl-icon { background: #28a745 !important; border-color: #28a745 !important; color: #fff !important; }
body.theme-dark .tl-label { color: #d0dae6 !important; }
body.theme-dark .tl-step.done .tl-label,
body.theme-dark .tl-step.active .tl-label { color: #6fcf97 !important; }
body.theme-dark .tl-actor { color: #7a95aa !important; }
body.theme-dark .tl-step:not(:last-child)::after { background: #243044 !important; }
body.theme-dark .tl-step.done:not(:last-child)::after { background: #28a745 !important; }

/* ── Activity log specifics ──────────────────────────────────────── */
body.theme-dark .stat-chip { background: #1f2f42 !important; border-color: #243044 !important; color: #d0dae6 !important; }
body.theme-dark .stat-chip strong { color: #ffffff !important; }
body.theme-dark #logTable th { background: #1f2f42 !important; color: #d0dae6 !important; }

/* ── Settings page ───────────────────────────────────────────────── */
body.theme-dark .settings-card { background: #1a2535 !important; border-color: #243044 !important; }
body.theme-dark .settings-card h6 { color: #7a95aa !important; border-bottom-color: #243044 !important; }
body.theme-dark .setting-row { border-bottom-color: #1f2f42 !important; }
body.theme-dark .setting-label strong { color: #ffffff !important; }
body.theme-dark .setting-label small { color: #7a95aa !important; }
body.theme-dark .info-box { background: #0d2035 !important; border-color: #1a4a7a !important; color: #6ab8e8 !important; }
body.theme-dark .warn-box { background: #2e2000 !important; border-color: #7a5500 !important; color: #f0c04a !important; }
body.theme-dark .settings-nav { background: #1a2535 !important; border-color: #243044 !important; }
body.theme-dark .settings-nav a { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .settings-nav a:hover { background: #3498db !important; border-color: #3498db !important; color:#fff !important; }
body.theme-dark .source-pill { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .esc-sub-section { background: #1f2f42 !important; border-color: #243044 !important; }
body.theme-dark .esc-level-table .table th { background: #1f2f42 !important; }

/* ── User dropdown ───────────────────────────────────────────────── */
body.theme-dark .user-dropdown-menu { background: #1a2535 !important; border-color: #243044 !important; }
body.theme-dark .user-dropdown-menu a { color: #f0f2f5 !important; }
body.theme-dark .user-dropdown-menu div[style*="border-bottom"] { border-bottom-color: #243044 !important; }
body.theme-dark .user-dropdown-menu div[style*="border-top"] { border-top-color: #243044 !important; }

/* ── Select2 ─────────────────────────────────────────────────────── */
body.theme-dark .select2-container--default .select2-selection--single,
body.theme-dark .select2-container--default .select2-selection--multiple { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .select2-selection__rendered { color: #f0f2f5 !important; }
body.theme-dark .select2-dropdown { background: #1a2535 !important; border-color: #2e4060 !important; }
body.theme-dark .select2-container--default .select2-results__option { color: #f0f2f5 !important; background: #1a2535 !important; }
body.theme-dark .select2-container--default .select2-results__option--highlighted { background: #3498db !important; color: #fff !important; }
body.theme-dark .select2-search__field { background: #243044 !important; color: #f0f2f5 !important; border-color: #2e4060 !important; }

/* ── Misc list-group, breadcrumb ─────────────────────────────────── */
body.theme-dark .list-group-item { background: #1a2535 !important; border-color: #243044 !important; color: #f0f2f5 !important; }
body.theme-dark .list-group-item.active { background: #3498db !important; border-color: #3498db !important; }
body.theme-dark .breadcrumb { background: #1f2f42 !important; }
body.theme-dark .breadcrumb-item, body.theme-dark .breadcrumb-item a { color: #d0dae6 !important; }
body.theme-dark .breadcrumb-item.active { color: #7a95aa !important; }

/* ── Scroll to top button ────────────────────────────────────────── */
body.theme-dark .scroll-to-top { background: #3498db !important; }

/* ── Vessel Tracking Page ─────────────────────────────────────────── */
body.theme-dark .vessel-tracking-layout { background: #0f1923 !important; }

/* Panels */
body.theme-dark .vt-panel { background: #1a2535 !important; color: #f0f2f5 !important; }
body.theme-dark .vt-panel-header { background: #1f2f42 !important; border-bottom-color: #2a4a8a !important; }
body.theme-dark .vt-panel-header span { color: #6ab8e8 !important; }
body.theme-dark .vt-panel-body::-webkit-scrollbar-track { background: #1a2535 !important; }
body.theme-dark .vt-panel-body::-webkit-scrollbar-thumb { background: #2e4060 !important; }
body.theme-dark .vt-panel.is-collapsed { background: #1f2f42 !important; }
body.theme-dark .vt-panel.is-collapsed .vt-panel-header { border-right-color: #2a4a8a !important; }

/* Collapse button */
body.theme-dark .collapse-btn { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .collapse-btn:hover { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }

/* Left filter panel */
body.theme-dark .filter-sidebar { border-right-color: #243044 !important; }
body.theme-dark .filter-sidebar label { color: #7a95aa !important; }
body.theme-dark .filter-sidebar input,
body.theme-dark .filter-sidebar select { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .filter-sidebar input::placeholder { color: #6a8099 !important; }
body.theme-dark .filter-sidebar input:focus,
body.theme-dark .filter-sidebar select:focus { border-color: #4169E1 !important; box-shadow: 0 0 0 3px rgba(65,105,225,.2) !important; }
body.theme-dark .filter-sidebar .btn-secondary { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .filter-sidebar .btn-secondary:hover { background: #2e4060 !important; color: #fff !important; }
body.theme-dark .date-presets .btn-preset { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .date-presets .btn-preset:hover { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark #trackingStatsPanel { background: #0d2e1a !important; border-color: #1a6335 !important; color: #6fcf97 !important; }

/* Suggestion dropdown */
body.theme-dark #suggestionList { background: #1a2535 !important; border-color: #2e4060 !important; }
body.theme-dark .suggestion-item { color: #f0f2f5 !important; }
body.theme-dark .suggestion-item:hover { background: #4169E1 !important; color: #fff !important; }
body.theme-dark .suggestion-item:hover div { color: #fff !important; }

/* Right legend panel */
body.theme-dark .legend-sidebar { border-left-color: #243044 !important; }
body.theme-dark .legend-sidebar h6 { color: #6ab8e8 !important; border-bottom-color: #243044 !important; }
body.theme-dark .legend-sidebar .btn-sm,
body.theme-dark .legend-sidebar .btn-outline-primary,
body.theme-dark .legend-sidebar .btn-outline-secondary { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .legend-sidebar .btn-sm:hover,
body.theme-dark .legend-sidebar .btn-outline-primary:hover,
body.theme-dark .legend-sidebar .btn-outline-secondary:hover { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark .legend-section-header { }
body.theme-dark .legend-section-header:hover { background: #1f2f42 !important; }
body.theme-dark .legend-section-header h6 { color: #d0dae6 !important; }
body.theme-dark .legend-section-header .section-toggle-btn { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .cable-item:hover { background: #1f2f42 !important; }
body.theme-dark .cable-info strong { color: #f0f2f5 !important; }
body.theme-dark .cable-info small { color: #7a95aa !important; }
body.theme-dark .legend-item { color: #d0dae6 !important; }
body.theme-dark #zoneTemplateToggles { color: #d0dae6 !important; }
body.theme-dark #zoneTemplateToggles label:hover { background: #1f2f42 !important; }

/* Vessel table */
body.theme-dark .vessel-table-container { background: #1a2535 !important; border-top-color: #2a4a8a !important; }
body.theme-dark .table-header-bar { background: #1f2f42 !important; border-bottom-color: #243044 !important; }
body.theme-dark .table-header-bar input { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .table-header-bar input::placeholder { color: #6a8099 !important; }
body.theme-dark .table-header-bar input:focus { border-color: #4169E1 !important; }
body.theme-dark .vessel-table th { background: #1f2f42 !important; color: #6ab8e8 !important; border-bottom-color: #2e4060 !important; }
body.theme-dark .vessel-table td { color: #f0f2f5 !important; border-bottom-color: #1f2f42 !important; }
body.theme-dark .vessel-table tbody tr:nth-child(even) { background: #1d2d3f !important; }
body.theme-dark .vessel-table tbody tr:hover { background: #243e5a !important; cursor: pointer; }
body.theme-dark .vessel-table tbody tr.active-position { background: #0d2e1a !important; border-left-color: #28a745 !important; }
body.theme-dark .vessel-table-scroll::-webkit-scrollbar-thumb { background: #2e4060 !important; }
body.theme-dark .pagination-controls { background: #1f2f42 !important; border-top-color: #243044 !important; color: #7a95aa !important; }
body.theme-dark .pagination-controls select { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .pagination-controls button { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .pagination-controls button:hover { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark .count-badge { background: #0d2e1a !important; border-color: #1a6335 !important; color: #6fcf97 !important; }

/* Map overlays (over the map, need semi-opaque dark bg) */
body.theme-dark .vessel-info-box { background: rgba(26,37,53,.97) !important; border-color: #2e4060 !important; border-top-color: #4169E1 !important; color: #f0f2f5 !important; }
body.theme-dark .vessel-info-box h6 { color: #ffffff !important; }
body.theme-dark .vi-row { border-bottom-color: #243044 !important; }
body.theme-dark .vi-label { color: #7a95aa !important; }
body.theme-dark .vi-val { color: #f0f2f5 !important; }
body.theme-dark .playback-controls { background: rgba(26,37,53,.97) !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .sat-ter-display { background: rgba(26,37,53,.93) !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .filter-controls { background: rgba(26,37,53,.93) !important; border-color: #2e4060 !important; }
body.theme-dark .filter-controls label { color: #d0dae6 !important; }
body.theme-dark .filter-controls .btn { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .filter-controls .btn:hover { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark .map-type-btn { background: rgba(26,37,53,.93) !important; border-color: #2e4060 !important; color: #d0dae6 !important; }

/* Flatpickr dark override */
body.theme-dark .flatpickr-input { background: #243044 !important; color: #f0f2f5 !important; border-color: #2e4060 !important; }
body.theme-dark .flatpickr-calendar { background: #1a2535 !important; border-color: #2e4060 !important; box-shadow: 0 4px 20px rgba(0,0,0,.5) !important; }
body.theme-dark .flatpickr-months,
body.theme-dark .flatpickr-month { background: #1f2f42 !important; color: #ffffff !important; fill: #ffffff !important; }
body.theme-dark .flatpickr-weekdays,
body.theme-dark .flatpickr-weekday { background: #1f2f42 !important; color: #7a95aa !important; }
body.theme-dark .flatpickr-day { color: #f0f2f5 !important; }
body.theme-dark .flatpickr-day:hover { background: #243e5a !important; border-color: #243e5a !important; }
body.theme-dark .flatpickr-day.selected,
body.theme-dark .flatpickr-day.startRange,
body.theme-dark .flatpickr-day.endRange { background: #4169E1 !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark .flatpickr-day.inRange { background: #1f3a6a !important; border-color: #1f3a6a !important; }
body.theme-dark .flatpickr-day.today { border-color: #4169E1 !important; }
body.theme-dark .numInputWrapper input,
body.theme-dark .flatpickr-time input { background: #243044 !important; color: #f0f2f5 !important; border-color: #2e4060 !important; }

/* ── Reports / Aging & Jarak Vessel-Cable page ─────────────── */
body.theme-dark #agingTable thead th,
body.theme-dark #jarakTable thead th,
body.theme-dark #distTable thead th { background: #1f2f42 !important; color: #d0dae6 !important; border-bottom-color: #2e4060 !important; }
body.theme-dark #agingTable tbody td,
body.theme-dark #jarakTable tbody td,
body.theme-dark #distTable tbody td { border-top-color: #243044 !important; color: #f0f2f5 !important; }
body.theme-dark #agingTable tbody tr:hover td,
body.theme-dark #jarakTable tbody tr:hover td,
body.theme-dark #distTable tbody tr:hover td { background: #243e5a !important; }
body.theme-dark #agingTable tbody tr:nth-child(even) td,
body.theme-dark #jarakTable tbody tr:nth-child(even) td,
body.theme-dark #distTable tbody tr:nth-child(even) td { background: #1d2d3f !important; }
body.theme-dark #agingTable tbody tr:nth-child(even):hover td,
body.theme-dark #jarakTable tbody tr:nth-child(even):hover td,
body.theme-dark #distTable tbody tr:nth-child(even):hover td { background: #243e5a !important; }
/* DataTables toolbar rows (Show entries / Search) */
body.theme-dark #agingTable_wrapper > .row:first-child,
body.theme-dark #agingTable_wrapper > .row:last-child,
body.theme-dark #jarakTable_wrapper > .row:first-child,
body.theme-dark #jarakTable_wrapper > .row:last-child,
body.theme-dark #distTable_wrapper > .row:first-child,
body.theme-dark #distTable_wrapper > .row:last-child { background: #1f2f42 !important; border-color: #243044 !important; }
body.theme-dark .dataTables_wrapper .dataTables_filter label,
body.theme-dark .dataTables_wrapper .dataTables_length label { color: #d0dae6 !important; }
body.theme-dark .dataTables_wrapper .dataTables_filter input,
body.theme-dark .dataTables_wrapper .dataTables_length select { background: #243044 !important; border-color: #2e4060 !important; color: #f0f2f5 !important; }
body.theme-dark .dataTables_wrapper .dataTables_info { color: #7a95aa !important; }
body.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.disabled) { background: #243044 !important; border-color: #2e4060 !important; color: #d0dae6 !important; }
body.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) { background: #1f3a6a !important; border-color: #4169E1 !important; color: #fff !important; }
body.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: #3a5070 !important; }
/* Summary cards on aging page */
body.theme-dark .summary-label { color: #7a95aa !important; }

/* ── Google Maps InfoWindow (vessel popup) ─────────────────────────── */
body.theme-dark .gm-style .gm-style-iw-c { background: #1a2535 !important; box-shadow: 0 4px 20px rgba(0,0,0,.6) !important; }
body.theme-dark .gm-style .gm-style-iw-d { background: #1a2535 !important; overflow: auto !important; }
body.theme-dark .gm-style .gm-style-iw-d * { color: #f0f2f5 !important; }
body.theme-dark .gm-style .gm-style-iw-d strong { color: #ffffff !important; }
body.theme-dark .gm-style .gm-style-iw-d h6 { color: #ffffff !important; }
body.theme-dark .gm-style .gm-style-iw-d div[style*="background:#e0e0e0"],
body.theme-dark .gm-style .gm-style-iw-d div[style*="background: #e0e0e0"] { background: #2e4060 !important; }
body.theme-dark .gm-style .gm-style-iw-tc::after { background: #1a2535 !important; }
body.theme-dark .gm-style button.gm-ui-hover-effect { filter: invert(1) !important; }
body.theme-dark .gm-style .gm-style-iw { background: #1a2535 !important; }

/* ═══════════════════════════════════════════════ */

/* --- Worker Layout Styles --- */
html, body { overflow-y: auto !important; height: auto !important; min-height: 100vh; background: #f4f6f9; }

/* Sidebar Navigation */
.worker-sidebar { position: fixed; left: 0; top: 0; width: 240px; height: 100vh; background: #2c3e50; color: white; overflow-y: auto; z-index: 1000; box-shadow: 2px 0 5px rgba(0,0,0,0.1); }
.worker-sidebar .logo-area { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.worker-sidebar .logo-area img { width: auto; height: 100%; max-width: 100%; margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; }
.worker-sidebar .logo-area h5 { font-size: 16px; font-weight: 700; margin: 0; color: white; letter-spacing: 1px; }
.worker-sidebar .user-info { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.worker-sidebar .user-info img { width: 60px; height: 60px; border-radius: 50%; border: 3px solid white; margin-bottom: 10px; }
.worker-sidebar .user-info h6 { font-size: 14px; font-weight: 600; margin: 8px 0 4px 0; color: white; }
.worker-sidebar .user-info .status { font-size: 12px; color: #2ecc71; }
.worker-sidebar .status i { font-size: 8px; margin-right: 4px; }
.worker-sidebar .nav-menu { padding: 20px 0; list-style: none; margin: 0; }
.worker-sidebar .nav-item { list-style: none; }
.worker-sidebar .nav-link { position: relative; display: block; padding: 12px 25px; color: rgba(255,255,255,0.8); text-decoration: none; transition: all 0.2s; font-size: 14px; }
.worker-sidebar .nav-link:hover, .worker-sidebar .nav-link.active { background: rgba(255,255,255,0.1); color: white; border-left: 4px solid #3498db; padding-left: 21px; }
.worker-sidebar .nav-link i { width: 20px; margin-right: 12px; font-size: 16px; }
.worker-sidebar .nav-link .badge { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); background: #e74c3c; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* Top Bar */
.worker-topbar { position: fixed; left: 240px; right: 0; top: 0; height: 70px; background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; z-index: 999; }
.worker-topbar h4 { margin: 0; font-size: 20px; font-weight: 600; color: #2c3e50; }
.worker-topbar .top-actions { display: flex; align-items: center; gap: 15px; }
.worker-topbar .top-actions .btn-icon { width: 40px; height: 40px; border-radius: 50%; background: #f8f9fa; border: none; display: flex; align-items: center; justify-content: center; color: #6c757d; transition: all 0.2s; position: relative; cursor: pointer; }
.worker-topbar .top-actions .btn-icon:hover { background: #e9ecef; color: #2c3e50; }
.worker-topbar .top-actions .btn-icon .badge-dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; background: #e74c3c; border-radius: 50%; border: 2px solid white; }
.worker-topbar .user-profile img { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: all 0.2s; }
.worker-topbar .user-profile img:hover { box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3); }

.worker-main-content { margin-left: 240px; margin-top: 35px; padding: 30px 15px 80px 15px; min-height: calc(100vh - 70px); }

/* Footer */
.worker-footer { height: 60px; background: white; border-top: 1px solid #e9ecef; display: flex; align-items: center; padding: 0 30px; font-size: 13px; color: #6c757d; }
.worker-footer a { color: #3498db; text-decoration: none; }
.worker-footer a:hover { color: #2980b9; }

.worker-footer .user-profile img {
    width: 40px; height: 40px;
}

@media (max-width: 768px) {
    .worker-sidebar { width: 70px; }
    .worker-sidebar .logo-area h5, .worker-sidebar .user-info h6, .worker-sidebar .user-info .status, .worker-sidebar .nav-link span { display: none; }
    .worker-sidebar .nav-link { justify-content: center; padding: 15px; }
    .worker-sidebar .nav-link i { margin-right: 0; }
    .worker-topbar { left: 70px; }
    .worker-main-content, .admin-main-content { margin-left: 70px; }
    .worker-footer, .admin-footer { left: 70px; margin-left: 70px; }
}

/* --- Vessel Tracking page tweaks --- */
.admin-main-content .vessel-layout,
.worker-main-content .vessel-layout {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Focused, non-global layout for Vessel Tracking */
.vessel-layout .row.vessel-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin: 0;
}

/* Support both custom col classes and Bootstrap cols inside vessel layout */
.vessel-layout .col-left, .vessel-layout .col-right,
.vessel-layout .row.vessel-row > .col-md-3:first-child,
.vessel-layout .row.vessel-row > .col-md-3:last-child {
    flex: 0 0 260px;
    max-width: 260px;
    padding: 0;
}
.vessel-layout .col-center,
.vessel-layout .row.vessel-row > .col-md-6 {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding: 0 10px;
}

/* map container and panels */
.map-container {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 420px; /* reasonable default */
    max-height: calc(100vh - 220px); /* keep inside viewport */
    box-shadow: 0 8px 24px rgba(12,20,30,0.08);
    border: 1px solid rgba(15,20,30,0.06);
    margin-top: 0;
}

/* NOC (fullscreen) overrides: ensure map occupies full viewport and side panels are hidden */
.noc-main-content {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}
.noc-main-content .admin-topbar,
.noc-main-content .admin-sidebar,
.noc-main-content .worker-sidebar,
.noc-main-content .right-menu,
.noc-main-content .page-header { display: none !important; }
.noc-main-content .vessel-layout { max-width: 100% !important; padding: 0 !important; margin: 0 !important; height: 100vh !important; }
.noc-main-content .vessel-row { margin: 0 !important; height: 100vh !important; }
.noc-main-content .vessel-row > .col-md-3,
.noc-main-content .vessel-row > .col-left,
.noc-main-content .vessel-row > .col-right { display: none !important; width: 0 !important; flex: 0 0 0 !important; max-width: 0 !important; padding: 0 !important; }
.noc-main-content .vessel-row > .col-12 { flex: 1 1 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; height: 100vh !important; }
.noc-main-content .map-container { border-radius: 0 !important; box-shadow: none !important; border: none !important; min-height: 100vh !important; max-height: 100vh !important; height: 100vh !important; width: 100vw !important; margin: 0 !important; padding: 0 !important; display: block !important; position: fixed !important; top: 0 !important; left: 0 !important; }
.noc-main-content #map { height: 100vh !important; width: 100vw !important; border-radius: 0 !important; min-width: 100vw !important; min-height: 100vh !important; display: block !important; }
.noc-main-content .map-controls { top: 10px !important; left: 10px !important; z-index: 1050 !important; }
.noc-main-content #nocVesselPanel { max-height: 36vh; width: 360px; right: 12px; left: auto; margin-left: 0; bottom: 12px; position: fixed !important; z-index: 1100 !important; }

/* Also apply same rules when body is explicitly set to noc-mode (ensures immediate layout before JS runs) */
body.noc-mode { margin: 0 !important; padding: 0 !important; overflow: hidden !important; }
body.noc-mode .admin-sidebar,
body.noc-mode .admin-topbar,
body.noc-mode .worker-sidebar,
body.noc-mode .worker-topbar,
body.noc-mode .right-menu,
body.noc-mode .admin-footer,
body.noc-mode .page-header { display: none !important; }
body.noc-mode .admin-main-content,
body.noc-mode .noc-main-content,
body.noc-mode .worker-main-content { margin: 0 !important; padding: 0 !important; width: 100vw !important; height: 100vh !important; overflow: hidden !important; }
body.noc-mode .vessel-layout { max-width: 100% !important; padding: 0 !important; margin: 0 !important; width: 100vw !important; height: 100vh !important; }
body.noc-mode .vessel-row { margin: 0 !important; height: 100vh !important; gap: 0 !important; }
body.noc-mode .vessel-row > .col-md-3,
body.noc-mode .vessel-row > .col-left,
body.noc-mode .vessel-row > .col-right { display: none !important; width: 0 !important; flex: 0 0 0 !important; max-width: 0 !important; padding: 0 !important; }
body.noc-mode .vessel-row > .col-12 { flex: 1 1 100% !important; max-width: 100% !important; width: 100vw !important; padding: 0 !important; margin: 0 !important; height: 100vh !important; }
body.noc-mode .map-container { border-radius: 0 !important; box-shadow: none !important; border: none !important; min-height: 100vh !important; max-height: 100vh !important; height: 100vh !important; width: 100vw !important; margin: 0 !important; padding: 0 !important; display: block !important; position: fixed !important; top: 0 !important; left: 0 !important; }
body.noc-mode #map { height: 100vh !important; width: 100vw !important; border-radius: 0 !important; min-width: 100vw !important; min-height: 100vh !important; display: block !important; }
body.noc-mode .tracking-tabs { display: none !important; }
body.noc-mode .map-controls { top: 10px !important; left: 10px !important; z-index: 1050 !important; }
body.noc-mode #nocVesselPanel { max-height: 36vh; width: 360px; right: 12px; left: auto; margin-left: 0; bottom: 12px; position: fixed !important; z-index: 1100 !important; }

/* Map overlay controls */
.map-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 999;
}
.map-controls label { margin: 0; font-size: 13px; color: #2c3e50; }
.map-controls .btn-light { border: 1px solid #e9ecef; }
#map {
    flex: 1 1 auto;
    min-height: 360px;
    width: 100%;
    border-radius: 10px;
}

.tracking-panel,
.cable-panel {
    padding: 20px;
    height: auto;
    max-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(12,20,30,0.08);
    border: 1px solid rgba(12,20,30,0.06);
    overflow: auto;
}

.tracking-panel h6, .cable-panel h6 {
    margin: 0 0 6px 0;
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}
.tracking-panel h6 i, .cable-panel h6 i { color: #3498db; font-size: 16px; }

.tracking-panel hr, .cable-panel hr { display: none; } /* hide duplicate hrs */

.tracking-panel .form-group { margin-bottom: 14px; }
.tracking-panel label { font-size: 13px; font-weight: 600; color: #495057; margin-bottom: 6px; }
.tracking-panel .form-control { font-size: 14px; border-radius: 6px; border: 1px solid #dee2e6; }
.tracking-panel .form-control:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52,152,219,0.2);
    border-radius: 8px;
    transition: all .2s ease;
    padding: 10px 16px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52,152,219,0.3);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    padding: 10px 16px;
    transition: all .2s ease;
}
.btn-secondary:hover { background: #5a6268; transform: translateY(-1px); }

.btn-success { border-radius: 6px; font-weight: 600; }
.btn-block { margin-bottom: 10px; }

.cable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 8px;
    transition: all .15s ease;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
}
.cable-item:hover { background: rgba(52,152,219,0.04); border-bottom-color: transparent; }
.cable-item label { margin: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; }

.cable-color { width: 32px; height: 5px; border-radius: 3px; display: inline-block; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.cable-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -8px;
}

/* custom scrollbar for cable list */
.cable-list::-webkit-scrollbar { width: 8px; }
.cable-list::-webkit-scrollbar-track { background: #f8f9fa; border-radius: 10px; }
.cable-list::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
.cable-list::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* Vessel info box overlay */
.vessel-info-box {
    position: absolute;
    top: 12px;
    right: 12px;
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    display: none;
    min-width: 220px;
    border: 1px solid rgba(0,0,0,0.05);
}
.vessel-info-box.active { display: block; }
.vessel-info-box h6 { margin: 0 0 10px 0; font-weight: 700; color: #2c3e50; }

/* Playback controls */
.playback-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    display: none;
    width: calc(100% - 80px);
    max-width: 900px;
    border: 1px solid rgba(0,0,0,0.05);
}
.playback-controls.active { display: block; }
.speed-control { display: inline-block; margin: 0 10px; }
.timeline { width: 100%; margin-top: 10px; }
.position-marker { opacity: 0.6; }

.page-header { margin-bottom: 20px; padding-top: 0; }
.page-header h5 { font-size: 24px; font-weight: 700; color: #2c3e50; margin-bottom: 4px; }
.page-header p { color: #7f8c8d; margin: 0; font-size: 14px; }

@media (max-width: 992px) {
    .vessel-layout .row.vessel-row { flex-direction: column; gap: 16px; }
    .vessel-layout .col-left, .vessel-layout .col-right,
    .vessel-layout .row.vessel-row > .col-md-3 { flex: 0 0 100%; max-width: 100%; }
    .vessel-layout .col-center,
    .vessel-layout .row.vessel-row > .col-md-6 { padding: 0; }
    .map-container { height: 500px; }
    .tracking-panel, .cable-panel { height: auto; max-height: 400px; }
    .playback-controls { width: calc(100% - 40px); }
}

@media (max-width: 768px) {
    #map { min-height: 350px; }
    .map-container { height: 400px; }
    .page-header h5 { font-size: 20px; }
    .tracking-panel, .cable-panel { padding: 16px; height: auto; }
    .playback-controls { width: calc(100% - 30px); padding: 12px; }
    .btn-primary, .btn-secondary { font-size: 14px; padding: 8px 12px; }
}

/* Use CSS Grid for desktop to avoid wrapping and ensure consistent 3-column layout */
@media (min-width: 992px) {
    .vessel-layout .row.vessel-row {
        display: grid;
        grid-template-columns: 260px 1fr 260px;
        gap: 24px;
        align-items: start;
        width: 100%;
    }

    /* ensure Bootstrap column padding doesn't add extra gutters */
    .vessel-layout .row.vessel-row > [class*='col-'] { padding-left: 0; padding-right: 0; }

    .vessel-layout .map-container { min-height: 520px; max-height: calc(100vh - 240px); }
    .vessel-layout .tracking-panel, .vessel-layout .cable-panel { max-height: calc(100vh - 240px); }
}

/* Fallback: keep flex for smaller screens */
@media (max-width: 991px) {
    .vessel-layout .row.vessel-row { display: flex !important; align-items: flex-start; flex-direction: column; gap: 16px; }
    .vessel-layout .row.vessel-row > [class*='col-'] { display: block; }
}

/* --- Bumper Zones Table Interaction --- */
.cable-row {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cable-row:hover {
    background-color: rgba(52, 152, 219, 0.08) !important;
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.2);
}

.cable-row.table-active {
    background-color: rgba(52, 152, 219, 0.15) !important;
    box-shadow: inset 0 0 0 2px #3498db;
}

.cable-row .cable-code-cell {
    font-weight: 600;
    color: #2c3e50;
}

.cable-row:hover .cable-code-cell {
    color: #3498db;
}

/* Button group spacing for Bumper Zones actions */
.bumper-actions { display:flex; align-items:center; gap:12px; }
.bumper-actions .btn { margin-right: 0 !important; }
.bumper-actions .ml-auto { margin-left: auto !important; }

/* select checkbox column */
#bumperTable td.text-center input.select-cable { transform: scale(1.05); }
#bumperTable th.text-center { padding: 6px 8px; }


/* Preview modal legend and debug panel */
.map-legend {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 8px 10px;
    border-radius: 6px;
    z-index: 9999;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.map-legend .legend-item { margin-top:6px; display:flex; align-items:center; }
.map-legend .legend-swatch { width:16px; height:10px; display:inline-block; margin-right:8px; border-radius:2px; }
.map-legend .legend-swatch.blue { background: rgba(52,152,219,0.6); border:1px solid #3498db; }
.map-legend .legend-swatch.red { background: rgba(231,76,60,0.45); border:1px solid #e74c3c; }
.map-legend .legend-swatch.line { background: linear-gradient(90deg, #fff 0%, #ff6b35 50%); height:5px; width:28px; border-radius:2px; border:1px solid rgba(0,0,0,0.06); }

/* legend toggle (small ×) and peek button (mobile/compact) - used by multiple map views */
.map-legend .legend-toggle { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; border-radius: 3px; background: #fff; border: 1px solid #ddd; display:flex; align-items:center; justify-content:center; cursor:pointer; font-weight:600; font-size:11px; opacity:0.8; }
.map-legend .legend-toggle:hover { opacity:1; background:#f8f8f8; }
.map-legend-show { background: #28a745; border: none; color: #fff; border-radius: 50%; width: 40px; height: 40px; padding: 0; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.18); font-size:14px; display: none; align-items:center; justify-content:center; }
.map-legend-show:hover { background: #218838; transform: translateY(-1px); }
.map-legend-show.visible { display:flex; }
