/* ============================================
   MODERN DASHBOARD UI - SIDEBAR LAYOUT
   Inspired by clean HR dashboard design
   ============================================ */

/* Import Material Symbols font */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* === ROOT VARIABLES === */
:root {
    /* Colors - Match Reference Design */
    --primary: #00FF85;        /* Bright Green (Muat/Loading) */
    --primary-light: #33FF9E;
    --primary-dark: #00CC6A;
    --secondary: #00D9FF;      /* Bright Cyan (Bongkar/Discharge) */
    --secondary-light: #33E3FF;
    --secondary-dark: #00B8DB;
    --accent: #00FF85;
    --success: #00FF85;
    --warning: #FFB800;
    --danger: #FF4757;

    /* Backgrounds - DARK like reference */
    --bg-main: #0A0F14;
    --bg-sidebar: rgba(15, 20, 25, 0.95);
    --bg-card: rgba(20, 28, 35, 0.7);
    --bg-card-hover: rgba(25, 33, 40, 0.9);

    /* Glass morphism */
    --glass-bg: rgba(15, 25, 32, 0.5);
    --glass-border: rgba(0, 255, 133, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);

    /* Text colors - LIGHT */
    --text-primary: #FFFFFF;
    --text-secondary: #A0AEC0;
    --text-muted: #718096;

    /* Borders & shadows */
    --border-color: rgba(0, 255, 133, 0.08);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.7);

    /* Spacing */
    --sidebar-width: 64px;     /* Icon-only sidebar */
    --topbar-height: 0px;      /* No topbar */
}

/* === MATERIAL ICONS FONT FIX === */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* === GLOBAL OVERRIDES === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* Remove Dash default margins */
#react-entry-point > div {
    background-color: var(--bg-main);
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
    background: var(--bg-main);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 255, 133, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.sidebar-menu-item:hover {
    background-color: rgba(0, 255, 133, 0.08);
    color: var(--primary);
}

.sidebar-menu-item.active {
    background-color: rgba(0, 255, 133, 0.12);
    color: var(--primary);
}

.sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 25%;
    height: 50%;
    width: 3px;
    background-color: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-menu-item .material-symbols-outlined {
    font-size: 22px;
}

.sidebar-menu-item .nav-label {
    display: none;
}

/* === TOP BAR === */
.topbar {
    position: fixed;
    left: var(--sidebar-width);
    top: 0;
    right: 0;
    height: var(--topbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: left 0.3s ease;
}

.topbar.collapsed {
    left: 0 !important;
}

.topbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.topbar-welcome {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.topbar-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.status-badge.success {
    background-color: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.status-badge.warning {
    background-color: rgba(255, 165, 2, 0.15);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.3);
}

.status-badge.error {
    background-color: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-bell:hover {
    background-color: var(--primary-light);
    color: white;
}

.topbar-bell-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background-color: #FF6B6B;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

/* === MAIN CONTENT AREA === */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    padding: 28px 36px 32px 36px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.collapsed {
    margin-left: 0 !important;
}

/* === CARDS === */
.metric-card {
    background: rgba(15, 22, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    background: rgba(22, 27, 34, 0.5) !important;
}

.metric-card-label {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    word-break: break-word;
}

.metric-card-small {
    font-size: 1.5rem;
}

/* === SECTION HEADERS === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.section-link {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.section-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

/* === CHART CONTAINERS === */
.chart-container {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(91, 124, 255, 0.06);
}

.chart-header {
    margin-bottom: 16px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.chart-subtitle {
    font-size: 0.85rem;
    color: #ffffff;
    margin: 0;
}

/* === FILTERS SECTION === */
.filters-container {
    background: rgba(22, 27, 34, 0.35) !important;  /* Glass effect */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 100;  /* Keep filters above cards below */
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filters-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-reset {
    padding: 6px 14px;
    border-radius: 8px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === DROPDOWNS === */
.Select-control {
    border-radius: 10px !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.Select-control:hover {
    border-color: var(--primary) !important;
}

.is-focused .Select-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(91, 124, 255, 0.1) !important;
}

/* Fix dropdown menu z-index - prevent it from going behind cards */
/* Parent dropdown containers */
.dash-dropdown,
div[class*="dropdown"],
.Select,
div[id*="f-quarter"],
div[id*="f-month"],
div[id*="f-cargo"],
div[id*="f-kapal"] {
    position: relative !important;
    z-index: 1000 !important;
    overflow: visible !important;
}

/* When dropdown is focused/open, increase z-index */
.dash-dropdown.is-focused,
div[class*="dropdown"]:focus-within,
.Select.is-focused,
.Select.is-open {
    z-index: 10000 !important;
    overflow: visible !important;
}

/* Dropdown menu itself */
.Select-menu-outer,
.Select-menu,
.VirtualizedSelectFocusedOption,
div[class*="menu"],
div[class*="MenuList"],
.css-26l3qy-menu,
.css-1n7v3ny-option {
    z-index: 99999 !important;
}

/* Ensure dropdown menu is not blocked by overflow */
.filters-container,
.dbc-container,
.row {
    overflow: visible !important;
}

/* Dash dcc.Dropdown menu portal */
.dash-dropdown .Select-menu-outer {
    z-index: 99999 !important;
}

/* Modern Dash dropdown (dcc v2) */
div[id$="-dropdown"] div[class*="menu"] {
    z-index: 99999 !important;
}

/* === STATUS BANNER === */
.status-banner {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-banner.dropbox {
    background-color: rgba(32, 201, 151, 0.1);
    color: var(--success);
    border: 1px solid rgba(32, 201, 151, 0.2);
}

.status-banner.local {
    background-color: rgba(255, 193, 7, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-banner.error {
    background-color: rgba(255, 107, 107, 0.1);
    color: #EF4444;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .main-content {
        padding: 16px 12px;
        margin-left: 0;
        margin-top: 0;
    }

    .topbar-welcome {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .topbar-subtitle {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    .btn-logout {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .status-badge {
        display: none;
    }

    /* KPI Cards - stack on mobile */
    .metric-card {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .metric-card-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .metric-card-value {
        font-size: 1.1rem;
    }

    /* Charts - full width */
    .chart-container {
        padding: 14px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .chart-title {
        font-size: 0.9rem;
    }

    .chart-subtitle {
        font-size: 0.75rem;
    }

    /* Filters - compact */
    .filters-container {
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    .filters-title {
        font-size: 0.85rem;
    }

    /* Section headers */
    .section-title {
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 12px;
    }

    /* Tables - scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.75rem;
    }

    table th, table td {
        padding: 8px 6px !important;
        white-space: nowrap;
    }

    /* Bootstrap row override for mobile */
    .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .row > [class*="col"] {
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Make KPI rows scroll horizontally on very small screens */
    .g-2, .g-3 {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .g-2 > [class*="col"], .g-3 > [class*="col"] {
        flex: 0 0 auto;
        min-width: 120px;
    }

    /* Sidebar on mobile */
    .sidebar {
        width: 100%;
        max-width: 280px;
    }

    .sidebar-logo-text {
        font-size: 1.1rem;
    }

    .sidebar-menu-item {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .topbar-welcome {
        font-size: 0.9rem;
        max-width: 120px;
    }

    .hamburger-btn {
        font-size: 1.5rem;
        padding: 2px 6px;
    }

    .metric-card-value {
        font-size: 1rem;
    }

    .metric-card-label {
        font-size: 0.65rem;
    }

    .g-2 > [class*="col"], .g-3 > [class*="col"] {
        min-width: 100px;
    }

    .chart-container {
        padding: 10px;
    }

    .btn-logout {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .topbar-bell {
        width: 32px;
        height: 32px;
    }
}

/* === LOGOUT BUTTON === */
.btn-logout {
    padding: 8px 16px;
    border-radius: 10px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #FEE;
    border-color: #EF4444;
    color: #EF4444;
}

/* === TABS NAVIGATION === */
.tabs-container {
    margin-bottom: 24px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.nav-tab {
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-tab:hover {
    color: var(--primary);
    background-color: var(--bg-card-hover);
}

.nav-tab.active {
    color: var(--primary);
    background-color: transparent;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

/* === FLOATING CHAT (preserve from original) === */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(91, 124, 255, 0.3);
}

/* === UTILITY CLASSES === */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* === GLASS MORPHISM EFFECTS === */
.glass-panel {
    background: rgba(15, 25, 32, 0.6);  /* Dark glass like reference */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 255, 133, 0.08);  /* Green tint border */
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

/* For browsers that don't support backdrop-filter, use more opaque background */
@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .glass-panel {
        background: rgba(22, 27, 34, 0.85);
    }
}

/* Glow effects */
.glow-green {
    filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.5));
}

.glow-cyan {
    filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.5));
}

/* Blur orbs for KPI cards */
.blur-orb {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.blur-muat {
    background: rgba(74, 222, 128, 0.15);
}

.blur-bongkar {
    background: rgba(34, 211, 238, 0.15);
}

.border-muat {
    border-left: 4px solid var(--primary) !important;
}

.border-bongkar {
    border-left: 4px solid var(--secondary) !important;
}

/* Background blobs */
.bg-blob {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.bg-blob-green {
    top: -20%;
    left: -10%;
    background: #4ADE80;
}

.bg-blob-cyan {
    bottom: -10%;
    right: -10%;
    background: #22D3EE;
}

.bg-blob-center {
    top: 20%;
    right: 30%;
    opacity: 0.05;
    background: linear-gradient(45deg, #4ADE80, #22D3EE);
}

/* === KPI CARDS GLASS STYLE === */
.kpi-card-glass {
    position: relative;
    overflow: hidden;
    padding: 24px;
    transition: all 0.3s ease;
    background: rgba(22, 27, 34, 0.35) !important;  /* Much more transparent */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.kpi-card-glass:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    background: rgba(22, 27, 34, 0.5) !important;  /* Slightly more opaque on hover */
}

.kpi-content {
    position: relative;
    z-index: 1;
}

.kpi-title {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.kpi-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.kpi-unit {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
}

.kpi-delta {
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4px;
    display: inline-block;
}

/* === SIDEBAR ICON-ONLY MODE === */
.sidebar-container {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    border-right: none !important;  /* Remove any right border */
}

.sidebar-content {
    width: 80px;
    height: 100%;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    border-right: none !important;  /* Remove any right border */
    box-shadow: none !important;  /* Remove shadow */
    /* Make more glassy - match other glass panels */
    background: rgba(22, 27, 34, 0.35) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.sidebar-logo .material-symbols-outlined {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link-custom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link-custom:hover {
    color: var(--primary);
    background-color: rgba(74, 222, 128, 0.1);
}

.nav-link-custom.active {
    color: var(--primary);
    background-color: rgba(74, 222, 128, 0.15);
}

.nav-link-custom.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-link-custom .material-symbols-outlined {
    font-size: 24px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-logout-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
    color: #EF4444;
}

.sidebar-logout-btn .material-symbols-outlined {
    font-size: 20px;
}

/* === TOPBAR GLASS STYLE === */
.topbar {
    position: fixed;
    left: 80px;
    top: 0;
    right: 0;
    height: var(--topbar-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
    transition: left 0.3s ease;
    border: none !important;  /* Remove all borders */
    box-shadow: none !important;  /* Remove shadow */
    /* Make more glassy - match sidebar */
    background: rgba(22, 27, 34, 0.35) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.topbar-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-search {
    width: 280px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.topbar-notification {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-notification:hover {
    background-color: rgba(74, 222, 128, 0.1);
    border-color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: #EF4444;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

.topbar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: 2px solid var(--glass-border);
}

/* === CHART CONTAINERS GLASS === */
.chart-container {
    background: rgba(22, 27, 34, 0.35);  /* More transparent */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 24px;
}

.chart-container-sm {
    padding: 20px;
}

/* Ensure Plotly charts have proper background through container */
.chart-container .js-plotly-plot,
.chart-container .plotly,
.chart-container .plot-container {
    background: transparent !important;
    border-radius: 8px;
}

.chart-container .svg-container {
    background: transparent !important;
}

.chart-container .main-svg {
    background: transparent !important;
}

/* Container itself provides the background */
.chart-container {
    background: rgba(15, 20, 25, 0.6) !important;  /* Darker for contrast */
}

.chart-header {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.chart-title-sm {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #ffffff;
    margin: 0;
}

.chart-subtitle-sm {
    font-size: 0.8rem;
    color: #ffffff;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* === PROGRESS CARDS & TIMELINE === */
.panel-header {
    margin-bottom: 24px;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-card-glass {
    background: rgba(22, 27, 34, 0.35) !important;  /* Match other cards */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.progress-card-glass:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: rgba(22, 27, 34, 0.5) !important;
}

.progress-card-glass.alert-critical {
    border-left: 4px solid #EF4444;
}

.progress-card-glass.alert-warning {
    border-left: 4px solid #F59E0B;
}

.progress-card-glass.alert-ok {
    border-left: 4px solid var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-header-left {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.card-progress {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-left: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-critical {
    background-color: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

.badge-ok {
    background-color: rgba(74, 222, 128, 0.2);
    color: var(--primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: #ffffff;
    margin: 4px 0 12px 0;
}

.card-message {
    font-size: 0.85rem;
    color: #ffffff;
    margin: 12px 0 0 0;
}

/* Progress timeline */
.progress-timeline {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    padding: 0 8px;
}

.timeline-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background-color: var(--primary);
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.3s ease;
}

.timeline-stages {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 2;
}

.stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stage-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.stage-dot.complete {
    background-color: var(--primary);
    color: white;
}

.stage-dot.incomplete {
    background-color: var(--bg-main);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.stage-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.btn-view-all {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-view-all:hover {
    background-color: var(--primary);
    color: white;
}

/* AI Insights section */
.ai-section {
    margin-top: 24px;
}

.ai-insight-card {
    padding: 16px;
    margin-top: 12px;
}

.insight-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.insight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bg-primary {
    background-color: var(--primary) !important;
}

/* === RECENT LOGISTICS PANEL STYLES === */
.recent-logistics-card {
    background: rgba(15, 25, 32, 0.8);
    border: 1px solid rgba(0, 255, 133, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.recent-logistics-card:hover {
    border-color: rgba(0, 255, 133, 0.3);
    transform: translateY(-2px);
}

.logistics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vessel-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-badge {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.alert-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-critical {
    background: rgba(255, 71, 87, 0.15);
    color: #FF4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.badge-warning {
    background: rgba(255, 184, 0, 0.15);
    color: #FFB800;
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.badge-active {
    background: rgba(0, 255, 133, 0.15);
    color: #00FF85;
    border: 1px solid rgba(0, 255, 133, 0.3);
}

.progress-timeline {
    position: relative;
    padding: 20px 0;
    margin: 16px 0;
}

.progress-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
}

.progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: var(--primary);
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(0, 255, 133, 0.6);
    transition: width 0.3s ease;
}

.progress-stages {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    width: 100%;
}

.progress-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stage-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stage-dot.complete {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 255, 133, 0.5);
}

.stage-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.alert-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 8px 0 0 0;
}

.alert-message.critical {
    color: #FF4757;
}

.alert-message.warning {
    color: #FFB800;
}

/* === RESPONSIVE UPDATES === */
@media (max-width: 1024px) {
    .sidebar-content {
        width: 80px;
    }

    .topbar {
        left: 80px;
    }

    /* Sidebar hidden by default on tablet/mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .nav-label {
        display: none;
    }

    .topbar-search {
        display: none;
    }

    .topbar {
        left: 0;
    }

    /* Full width sidebar on mobile when open */
    .sidebar.mobile-open {
        width: 260px;
    }

    .sidebar.mobile-open .nav-label {
        display: inline !important;
    }
}
