/* UI polish pass: visual refresh only, no behavior changes */

/* Import Material Symbols font (backup) */
@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 {
    --bg-main: #060b12;
    --bg-panel: rgba(10, 20, 31, 0.78);
    --bg-panel-strong: rgba(11, 23, 36, 0.9);
    --line-soft: rgba(120, 220, 255, 0.14);
    --line-strong: rgba(120, 220, 255, 0.24);
    --text-primary: #eaf7ff;
    --text-secondary: #9fb9ca;
    --text-muted: #7692a6;
    --primary: #1de2a4;
    --secondary: #59d8ff;
}

body {
    background:
        radial-gradient(900px 550px at -10% -20%, rgba(30, 196, 255, 0.12), transparent 65%),
        radial-gradient(800px 500px at 110% -10%, rgba(29, 226, 164, 0.1), transparent 70%),
        linear-gradient(160deg, #050a11 0%, #07121d 46%, #04080f 100%) !important;
    color: var(--text-primary) !important;
}

.app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(350px 260px at 14% 8%, rgba(24, 205, 255, 0.07), transparent 75%),
        radial-gradient(320px 260px at 88% 14%, rgba(29, 226, 164, 0.08), transparent 75%);
    z-index: 0;
}

#sidebar,
.sidebar {
    width: 72px !important;
    background: linear-gradient(180deg, #08111d 0%, #0b1624 100%) !important;
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border-right: none !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.28) !important;
}

#sidebar > div {
    background: transparent !important;
}

/* Kill gray rail caused by old generic rule div[class*="-menu"] */
#sidebar .sidebar-menu {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100%;
    padding: 0 4px;
    gap: 10px !important;
}

#sidebar::after {
    display: none !important;
}

.sidebar-menu-item {
    width: 46px !important;
    height: 46px !important;
    border: none !important;
    background: transparent !important;
    color: rgba(220, 241, 252, 0.76) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border-radius: 12px;
}

/* Hide nav text in collapsed sidebar */
.sidebar .nav-text,
#sidebar .nav-text {
    display: none !important;
}

/* Show nav text when sidebar is expanded */
.sidebar.expanded .nav-text,
#sidebar.expanded .nav-text {
    display: inline !important;
}

.sidebar-menu-item:hover {
    background: rgba(89, 216, 255, 0.16) !important;
    box-shadow: none !important;
    color: #dff8ff !important;
}

.sidebar-menu-item.active {
    background: linear-gradient(145deg, rgba(32, 201, 151, 0.42), rgba(89, 216, 255, 0.24)) !important;
    box-shadow: 0 10px 24px rgba(4, 20, 34, 0.36) !important;
    color: #eaffff !important;
}

.main-content {
    margin-left: 72px !important;
    padding: 30px 34px 32px 34px !important;
    position: relative;
    z-index: 1;
}

.main-content.expanded {
    margin-left: 220px !important;
}

.content-hero {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 0;
    box-shadow: none !important;
}

.content-title {
    letter-spacing: 0.01em;
    font-weight: 400 !important;
}

.sidebar-logo-icon {
    width: 50px !important;
    height: 50px !important;
    background: rgba(89, 216, 255, 0.1) !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-company-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    filter: brightness(1.8) contrast(1.4) saturate(1.25) drop-shadow(0 0 8px rgba(95, 227, 255, 0.45));
}

.sidebar-brand-text,
.nav-text {
    display: none;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none !important;
    background: rgba(89, 216, 255, 0.1);
    color: #dff3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 10px;
}

.sidebar-toggle-btn:hover {
    background: rgba(89, 216, 255, 0.2);
}

#sidebar.expanded {
    width: 208px !important;
}

#sidebar.expanded .sidebar-inner {
    align-items: stretch !important;
    padding: 16px 10px !important;
}

#sidebar.expanded .sidebar-logo-icon {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 0;
    height: 72px !important;
}

#sidebar.expanded .sidebar-brand-text {
    display: none !important;
}

#sidebar.expanded .sidebar-company-logo {
    width: 48px;
    height: 48px;
}

#sidebar.expanded .sidebar-menu-item {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 10px 12px;
}

#sidebar.expanded .sidebar-menu-item .nav-text {
    display: inline;
    font-size: 0.85rem;
    font-weight: 520;
    color: #dff3ff;
}

.sidebar-logout-btn {
    background: rgba(89, 216, 255, 0.1) !important;
    border: none !important;
    color: #cde9f7 !important;
}

#sidebar.expanded .sidebar-logout-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    gap: 10px;
}

#sidebar.expanded .sidebar-logout-btn .nav-text {
    display: inline;
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.18) !important;
}

.content-subtitle {
    color: var(--text-secondary) !important;
}

.status-badge {
    border-radius: 999px !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.filters-container,
.metric-card,
.chart-container,
.glass-panel,
.recent-logistics-card,
.progress-card-glass {
    background: linear-gradient(160deg, rgba(10, 20, 33, 0.8), rgba(9, 17, 28, 0.66)) !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28) !important;
}

/* Force filter area to same blue-teal theme (override older gray CSS) */
.filters-container {
    background: linear-gradient(160deg, rgba(9, 21, 34, 0.9), rgba(8, 18, 30, 0.86)) !important;
    border: none !important;
}

.filters-container .filters-title,
.filters-container .text-muted,
.filters-container small {
    color: #a9c5d8 !important;
}

.filters-container .btn-reset {
    background: rgba(89, 216, 255, 0.12) !important;
    border-color: rgba(89, 216, 255, 0.35) !important;
    color: #d8f5ff !important;
}

.filters-container .btn-reset:hover {
    background: rgba(32, 201, 151, 0.22) !important;
    border-color: rgba(32, 201, 151, 0.55) !important;
    color: #eaffff !important;
}

/* Progress tracker specific theme (fix gray controls) */
.progress-tab .progress-filter-card {
    background: linear-gradient(160deg, rgba(9, 21, 34, 0.92), rgba(8, 18, 30, 0.9)) !important;
    border: none !important;
}

.progress-tab .progress-filter-card small,
.progress-tab #progress-status {
    color: #a9c5d8 !important;
}

.progress-tab #progress-search.form-control,
.progress-tab #progress-search {
    background: rgba(7, 18, 30, 0.95) !important;
    border: 1px solid rgba(89, 216, 255, 0.22) !important;
    color: #dff3ff !important;
}

.progress-tab #progress-search::placeholder {
    color: #7999ad !important;
}

.progress-tab #btn-refresh-progress.btn,
.progress-tab #btn-refresh-progress {
    background: rgba(89, 216, 255, 0.12) !important;
    border: 1px solid rgba(89, 216, 255, 0.35) !important;
    color: #d8f5ff !important;
    box-shadow: none !important;
}

.progress-tab #btn-refresh-progress:hover {
    background: rgba(32, 201, 151, 0.22) !important;
    border-color: rgba(32, 201, 151, 0.55) !important;
    color: #eaffff !important;
}

.progress-tab .progress-action-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.progress-tab .progress-action-group .progress-action-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 31px;
    border-radius: 8px !important;
    font-size: 0.78rem;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-tab #btn-reset-progress.btn,
.progress-tab #btn-reset-progress {
    background: rgba(89, 216, 255, 0.12) !important;
    border: 1px solid rgba(89, 216, 255, 0.35) !important;
    color: #d8f5ff !important;
}

.progress-tab #btn-reset-progress:hover {
    background: rgba(32, 201, 151, 0.22) !important;
    border-color: rgba(32, 201, 151, 0.55) !important;
    color: #eaffff !important;
}

.progress-tab #progress-filter .Select-control,
.progress-tab #progress-type-filter .Select-control,
.progress-tab #progress-cargo-filter .Select-control,
.progress-tab #progress-sort .Select-control,
.progress-tab #progress-filter div[class*="-control"],
.progress-tab #progress-type-filter div[class*="-control"],
.progress-tab #progress-cargo-filter div[class*="-control"],
.progress-tab #progress-sort div[class*="-control"] {
    background: rgba(7, 18, 30, 0.95) !important;
    border: 1px solid rgba(89, 216, 255, 0.22) !important;
    color: #dff3ff !important;
}

/* Progress cards (summary + rows) force same panel theme, not gray */
.progress-tab #card-complete,
.progress-tab #card-inprogress,
.progress-tab #card-warnings,
.progress-tab #card-critical {
    background: linear-gradient(160deg, rgba(10, 20, 33, 0.86), rgba(9, 17, 28, 0.78)) !important;
    border: none !important;
}

.progress-tab #progress-list-container > div {
    background: linear-gradient(160deg, rgba(10, 20, 33, 0.88), rgba(9, 17, 28, 0.82)) !important;
    border: none !important;
    border-left: 3px solid rgba(89, 216, 255, 0.24) !important;
}

.metric-card {
    border-radius: 14px !important;
    min-height: 124px;
}

.metric-card-label,
.kpi-title {
    color: var(--text-secondary) !important;
    letter-spacing: 0.08em;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
}

.metric-card-value,
.kpi-value,
.section-title,
.chart-title,
.card-title,
.vessel-name {
    color: var(--text-primary) !important;
}

.metric-card-value,
.kpi-value {
    font-size: 2rem !important;
    font-weight: 600 !important;
}

.metric-card .kpi-unit,
.kpi-unit {
    font-size: 0.88rem !important;
}

.overview-title {
    font-size: 1.7rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
}

.subsection-title {
    font-size: 1.08rem !important;
    font-weight: 500 !important;
    color: #c6d9e8 !important;
}

.chart-subtitle,
.card-subtitle,
.card-message,
.alert-message,
.section-subtitle {
    color: var(--text-secondary) !important;
}

.chart-container {
    border-radius: 16px !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36) !important;
}

/* Prevent qty card from being stretched by inherited flex rules */
.qty-comparison-card {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
}

.qty-comparison-card .chart-header,
.qty-comparison-card #loading-chart-qty,
.qty-comparison-card #chart-qty-legend {
    display: block !important;
}

.Select-control,
div[class*="-control"] {
    min-height: 42px !important;
    background: rgba(7, 18, 30, 0.95) !important;
    border: 1px solid rgba(120, 220, 255, 0.18) !important;
    border-radius: 10px !important;
}

.Select-control:hover,
div[class*="-control"]:hover {
    border-color: rgba(89, 216, 255, 0.38) !important;
}

.is-focused .Select-control,
div[class*="-control"][class*="is-focused"] {
    box-shadow: 0 0 0 3px rgba(89, 216, 255, 0.15) !important;
    border-color: rgba(89, 216, 255, 0.45) !important;
}

/* override old style.css blanket gray dropdown rule */
.dash-dropdown,
.dash-dropdown *,
.Select-control,
.Select-menu-outer,
.Select-menu,
.Select-option,
.Select-value,
.Select-input,
.Select-placeholder,
.Select-noresults {
    background-color: rgba(7, 18, 30, 0.95) !important;
    color: #d9edf8 !important;
    border-color: rgba(89, 216, 255, 0.2) !important;
}

.Select-option:hover,
.Select-option.is-focused,
div[class*="-option"]:hover {
    background-color: rgba(89, 216, 255, 0.16) !important;
    color: #e9fbff !important;
}

.section-title {
    font-size: 1.08rem !important;
    font-weight: 650 !important;
}

#chat-window {
    background: rgba(7, 16, 28, 0.92) !important;
    border: 1px solid var(--line-soft) !important;
}

/* Chat Theme */
#chat-window {
    background: linear-gradient(180deg, rgba(6, 16, 28, 0.96), rgba(7, 20, 33, 0.94)) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden;
}

.chat-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(89, 216, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(89, 216, 255, 0.05);
}

.chat-title {
    font-size: 0.95rem;
    font-weight: 620;
    color: #dff3ff;
}

.chat-expand-btn {
    height: 30px;
    border-radius: 8px;
    border: none;
    background: rgba(89, 216, 255, 0.14);
    color: #cfeeff;
    padding: 0 10px;
    font-size: 0.76rem;
    cursor: pointer;
}

.chat-expand-btn:hover {
    background: rgba(89, 216, 255, 0.24);
    color: #ecf9ff;
}

.chat-messages {
    padding: 10px !important;
    background: transparent;
}

.chat-system-msg {
    font-size: 0.8rem;
    color: #8eb2c9;
    margin: 4px 0 10px 0;
}

.chat-bubble {
    max-width: 84%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-user {
    margin-left: auto;
    text-align: right;
    color: #e7fbff;
    background: linear-gradient(180deg, rgba(30, 199, 134, 0.26), rgba(24, 186, 124, 0.22));
}

.chat-bot {
    margin-right: auto;
    color: #d9edf9;
    background: rgba(89, 216, 255, 0.1);
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(89, 216, 255, 0.14);
    background: rgba(89, 216, 255, 0.04);
}

.chat-input {
    flex: 1;
}

.chat-input.form-control {
    height: 34px !important;
    border-radius: 9px !important;
    border: none !important;
    background: rgba(89, 216, 255, 0.1) !important;
    color: #dff2ff !important;
    font-size: 0.82rem !important;
}

.chat-input.form-control::placeholder {
    color: #8fb2c9 !important;
}

.chat-send-btn {
    height: 34px;
    border-radius: 9px;
    border: none;
    background: linear-gradient(180deg, #1fc786, #18ba7c);
    color: #ffffff;
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.chat-send-btn:hover {
    filter: brightness(1.07);
}

.chat-fab {
    background: linear-gradient(135deg, #18ba7c 0%, #59d8ff 100%) !important;
    color: #f4feff !important;
    border: 1px solid rgba(89, 216, 255, 0.45) !important;
    box-shadow: 0 10px 26px rgba(17, 156, 158, 0.35) !important;
}

.chat-fab i {
    color: #f4feff !important;
}

/* Right panel: divider + neural insight block */
.right-ops-divider {
    width: 100%;
    height: 1px;
    margin: 22px 0 18px 0;
    background: linear-gradient(90deg, rgba(89, 216, 255, 0.0), rgba(89, 216, 255, 0.2), rgba(89, 216, 255, 0.0));
}

.neural-insight-card {
    width: 100%;
    border-radius: 24px;
    padding: 22px 20px;
    background: linear-gradient(145deg, rgba(7, 42, 44, 0.85), rgba(10, 34, 44, 0.82));
    box-shadow: inset 0 0 0 1px rgba(32, 201, 151, 0.18), 0 10px 26px rgba(0, 0, 0, 0.32);
}

.neural-insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.neural-insight-title {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #d8f6eb;
}

.neural-insight-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: #c8deeb;
    white-space: normal;
    word-break: break-word;
}

.bottleneck-card {
    padding: 20px 18px !important;
}

.bottleneck-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bottleneck-summary {
    margin: 0 0 10px 0;
    font-size: 0.78rem;
    color: #c7eaf8;
    line-height: 1.4;
}
.bottleneck-summary.sev-critical { color: #FF4757; }
.bottleneck-summary.sev-warning { color: #FFB800; }
.bottleneck-summary.sev-active { color: #00FF85; }

.bottleneck-caption {
    margin: -4px 0 10px 0;
    font-size: 0.68rem;
    color: #90b9cc;
    letter-spacing: 0.02em;
}

.bottleneck-row {
    display: grid;
    grid-template-columns: 82px 1fr 62px;
    align-items: center;
    gap: 10px;
}
.bottleneck-row.sev-critical .bottleneck-stage-count { color: #FF4757; }
.bottleneck-row.sev-warning .bottleneck-stage-count { color: #FFB800; }
.bottleneck-row.sev-active .bottleneck-stage-count { color: #00FF85; }

.bottleneck-row.is-max .bottleneck-stage-label {
    color: #e7fff7;
}

.bottleneck-row.is-max .bottleneck-bar-track {
    box-shadow: inset 0 0 0 1px rgba(28, 224, 151, 0.35);
}

.bottleneck-row.is-max .bottleneck-stage-count {
    color: #9bffd7;
}

.bottleneck-stage-label {
    font-size: 0.72rem;
    color: #c9e1ef;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.bottleneck-bar-track {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(62, 92, 116, 0.36), rgba(23, 49, 67, 0.34));
    box-shadow: inset 0 0 0 1px rgba(89, 216, 255, 0.12);
    overflow: hidden;
}

.bottleneck-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(32, 201, 151, 0.9), rgba(89, 216, 255, 0.92));
    box-shadow: 0 0 10px rgba(32, 201, 151, 0.35);
}
.bottleneck-bar-fill.sev-critical {
    background: linear-gradient(90deg, rgba(255, 71, 87, 0.95), rgba(255, 130, 142, 0.9));
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
}
.bottleneck-bar-fill.sev-warning {
    background: linear-gradient(90deg, rgba(255, 184, 0, 0.95), rgba(255, 214, 102, 0.9));
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.35);
}
.bottleneck-bar-fill.sev-active {
    background: linear-gradient(90deg, rgba(0, 255, 133, 0.95), rgba(89, 216, 255, 0.92));
    box-shadow: 0 0 10px rgba(0, 255, 133, 0.35);
}

.bottleneck-stage-count {
    text-align: right;
    font-size: 0.7rem;
    color: #effbff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make mini timeline line clearer in Live Operations cards */
.recent-logistics-card .progress-track {
    height: 4px !important;
    background: rgba(120, 153, 180, 0.35) !important;
    box-shadow: inset 0 0 0 1px rgba(105, 140, 166, 0.2);
}

.recent-logistics-card .progress-fill {
    height: 4px !important;
    background: linear-gradient(90deg, rgba(28, 224, 151, 1), rgba(73, 241, 210, 0.95)) !important;
    box-shadow: 0 0 10px rgba(31, 199, 134, 0.35);
}

.recent-logistics-card .stage-dot {
    width: 11px !important;
    height: 11px !important;
    border: 2px solid rgba(123, 151, 176, 0.5) !important;
}

.recent-logistics-card .stage-dot.complete {
    border-color: rgba(28, 224, 151, 0.75) !important;
    box-shadow: 0 0 10px rgba(28, 224, 151, 0.35) !important;
}

/* Make live operation cards a bit taller to fill right-panel gap better */
.recent-logistics-card {
    padding: 20px !important;
    margin-bottom: 14px !important;
    min-height: 200px !important;
}

.recent-logistics-card .progress-timeline {
    margin: 18px 0 !important;
}

/* Header controls (reference-inspired top search/action cluster) */
.content-actions {
    gap: 10px !important;
}

.top-quick-search {
    width: 280px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(89, 216, 255, 0.2) !important;
    background: rgba(9, 24, 39, 0.82) !important;
    color: #d9effb !important;
    padding: 0 14px;
    font-size: 0.82rem;
    outline: none !important;
}

.top-quick-search::placeholder {
    color: #88a9bf !important;
}

.top-quick-search:focus {
    border-color: rgba(89, 216, 255, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(89, 216, 255, 0.12) !important;
}

.top-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(89, 216, 255, 0.14);
    color: #c8e9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.top-icon-btn:hover {
    background: rgba(89, 216, 255, 0.24);
    color: #ebf9ff;
}

.top-avatar-chip {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1fc786, #18ba7c);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(24, 186, 124, 0.25);
}

/* ========================================================================== */
/* Sidebar v2 - match new light reference */
/* ========================================================================== */
#sidebar {
    width: 92px !important;
    background: transparent !important;
    box-shadow: none !important;
}

#sidebar.expanded {
    width: 270px !important;
}

#sidebar::after {
    display: none !important;
}

#sidebar > .sidebar-inner {
    background: transparent !important;
    border: none !important;
    border-radius: 16px !important;
    margin: 12px !important;
    padding: 10px 8px !important;
    box-shadow: none !important;
}

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

.main-content.expanded {
    margin-left: 274px !important;
}

.sidebar-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
    color: #bfe9ff !important;
    margin: 2px auto 8px auto !important;
}

.sidebar-logo-icon {
    width: 62px !important;
    height: 62px !important;
    margin: 0 auto 10px auto !important;
    border-radius: 14px !important;
    background: transparent !important;
    border: none !important;
}

.sidebar-company-logo {
    width: 46px !important;
    height: 46px !important;
    filter: brightness(1.7) contrast(1.35) saturate(1.25) drop-shadow(0 0 8px rgba(95, 227, 255, 0.42)) !important;
}

#sidebar.expanded .sidebar-logo-icon {
    width: 108px !important;
    height: 108px !important;
    margin-bottom: 12px !important;
}

#sidebar.expanded .sidebar-company-logo {
    width: 74px !important;
    height: 74px !important;
}

.sidebar-search-wrap,
.sidebar-section-label,
.nav-text,
.sidebar-profile {
    display: none !important;
}

#sidebar.expanded .sidebar-search-wrap {
    display: flex !important;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none !important;
    border-radius: 10px !important;
    height: 36px;
    padding: 0 10px;
    margin: 0 6px 10px 6px;
    color: #a8d2e8 !important;
}

#sidebar.expanded .sidebar-search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: #d5efff !important;
    font-size: 0.83rem;
}

#sidebar.expanded .sidebar-section-label {
    display: block !important;
    margin: 4px 10px 8px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: #7fa1b8 !important;
    text-transform: uppercase;
    font-weight: 600;
}

.sidebar-menu-item {
    border: none !important;
    background: transparent !important;
    color: #9db6c8 !important;
    border-radius: 10px !important;
}

.sidebar-menu-item:hover {
    background: rgba(89, 216, 255, 0.14) !important;
    color: #dff3ff !important;
}

.sidebar-menu-item.active {
    background: linear-gradient(180deg, #1fc786, #18ba7c) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 16px rgba(24, 186, 124, 0.28) !important;
}

#sidebar.expanded .sidebar-menu-item {
    width: calc(100% - 12px) !important;
    margin: 0 6px !important;
    justify-content: flex-start !important;
    padding: 10px 12px !important;
}

#sidebar.expanded .sidebar-menu-item .nav-text {
    display: inline !important;
    font-size: 0.86rem;
    font-weight: 520;
}

.sidebar-logout-btn {
    width: 46px !important;
    height: 46px !important;
    border: none !important;
    background: transparent !important;
    color: #b9d9ea !important;
}

.sidebar-logout-btn:hover {
    background: rgba(89, 216, 255, 0.2) !important;
    color: #e6f7ff !important;
}

#sidebar.expanded .sidebar-logout-btn {
    width: calc(100% - 12px) !important;
    margin: 0 6px !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 10px 12px !important;
}

#sidebar.expanded .sidebar-logout-btn .nav-text {
    display: inline !important;
    color: #c7e6f8 !important;
}

#sidebar.expanded .sidebar-profile {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 10px 10px 4px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    border: none;
}

.sidebar-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(180deg, #22c98a, #16b87c);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-profile-name {
    font-size: 0.76rem;
    color: #d9f1ff;
    font-weight: 600;
    line-height: 1.1;
}

.sidebar-profile-email {
    font-size: 0.67rem;
    color: #8ab0c8;
    line-height: 1.1;
}

/* ========================================================================== */
/* MOBILE RESPONSIVE STYLES */
/* ========================================================================== */

/* Mobile overlay - covers content when sidebar is open on mobile */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9998;
    cursor: pointer;
}

/* Mobile hamburger menu button - HIDDEN on desktop (>1024px) */
@media (min-width: 1025px) {
    .mobile-menu-btn,
    #mobile-menu-btn {
        display: none !important;
    }
}

.mobile-menu-btn:hover {
    background: rgba(89, 216, 255, 0.25) !important;
    border-color: rgba(89, 216, 255, 0.5) !important;
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
    }

    #sidebar {
        transform: translateX(-100%);
        position: fixed !important;
        z-index: 9999 !important;
        transition: transform 0.3s ease;
        width: 260px !important;
        background: rgba(5, 14, 24, 0.98) !important;
    }

    #sidebar > .sidebar-inner {
        width: 100% !important;
        padding: 16px !important;
    }

    #sidebar .sidebar-menu-item {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 12px 14px !important;
    }

    #sidebar .sidebar-menu-item .nav-text {
        display: inline !important;
        margin-left: 10px;
    }

    #sidebar .sidebar-logout-btn {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 12px 14px !important;
    }

    #sidebar .sidebar-logout-btn .nav-text {
        display: inline !important;
        margin-left: 10px;
    }

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

    /* Show overlay when sidebar is open */
    #sidebar.mobile-open ~ .mobile-overlay {
        display: block;
    }

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

    /* Two column layout - stack on tablet */
    .row > .col-lg-7,
    .row > .col-lg-5,
    .row > .col-xl-7,
    .row > .col-xl-5 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .top-quick-search,
    .top-icon-btn,
    .top-avatar-chip {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 70px 12px 20px 12px !important;  /* Top padding for mobile menu button */
    }

    .content-hero {
        padding: 8px 10px;
        margin-bottom: 10px !important;
    }

    .content-branding {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .content-title {
        font-size: 1.1rem !important;
    }

    /* Year selector compact on mobile */
    #dashboard-year-controls {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #data-year-selector {
        width: 80px !important;
        font-size: 0.8rem !important;
    }

    /* KPI Cards - 2 per row on mobile */
    .metric-card {
        min-height: 80px;
        padding: 14px 12px !important;
    }

    .metric-card-label,
    .kpi-title {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }

    .metric-card-value,
    .kpi-value {
        font-size: 1.3rem !important;
    }

    .kpi-unit {
        font-size: 0.75rem !important;
    }

    /* Section titles */
    .section-title,
    .overview-title {
        font-size: 1.2rem !important;
    }

    .subsection-title {
        font-size: 0.9rem !important;
    }

    /* Charts - full width and shorter */
    .chart-container {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

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

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

    /* Charts responsive sizing on mobile */
    .chart-container {
        overflow: hidden !important;
    }

    .chart-container .js-plotly-plot,
    .chart-container .plotly,
    .chart-container .plot-container,
    .chart-container .svg-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Plotly chart specific mobile fixes */
    .js-plotly-plot .plotly .main-svg {
        width: 100% !important;
    }

    /* Chart heights - smaller on mobile */
    .dash-graph,
    .js-plotly-plot {
        height: 200px !important;
        min-height: 180px !important;
    }

    .chart-container .dash-graph,
    .chart-container .js-plotly-plot {
        width: 100% !important;
        overflow: hidden !important;
    }

    /* Keep Qty Muat vs Bongkar card compact on mobile */
    .qty-comparison-card {
        padding: 10px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: block !important;
    }

    .qty-comparison-card .dash-graph,
    .qty-comparison-card .js-plotly-plot {
        height: 180px !important;
        min-height: 170px !important;
    }

    .qty-comparison-card #chart-qty,
    .qty-comparison-card #chart-qty .js-plotly-plot,
    .qty-comparison-card #chart-qty .plotly,
    .qty-comparison-card #chart-qty .plot-container,
    .qty-comparison-card #chart-qty .svg-container {
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }

    .qty-comparison-card #loading-chart-qty {
        display: block !important;
        height: 180px !important;
        min-height: 180px !important;
        max-height: 180px !important;
    }

    #chart-qty-legend {
        margin-top: 6px !important;
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Force plotly to respect container */
    .plot-container.plotly {
        height: 100% !important;
        width: 100% !important;
    }

    /* Filters - more compact */
    .filters-container {
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
    }

    .filters-container .row {
        flex-direction: column;
    }

    .filters-container .col-3,
    .filters-container [class*="col-"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 8px;
    }

    /* Bootstrap grid - make columns stack */
    .row > .col-6,
    .row > .col-md-6,
    .row > .col-lg-6 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .row > .col-3,
    .row > .col-md-3,
    .row > .col-lg-3 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* KPI rows - 2 columns */
    .g-2, .g-3 {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
    }

    .g-2 > .col-3,
    .g-3 > .col-3 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        min-width: unset !important;
    }

    /* Recent logistics cards */
    .recent-logistics-card {
        padding: 14px !important;
        min-height: 160px !important;
        margin-bottom: 10px !important;
    }

    .vessel-name {
        font-size: 0.85rem !important;
    }

    .progress-badge {
        font-size: 0.9rem !important;
    }

    .stage-label {
        font-size: 0.6rem !important;
    }

    /* Neural insight card */
    .neural-insight-card {
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .neural-insight-text {
        font-size: 0.85rem !important;
    }

    /* Bottleneck card */
    .bottleneck-card {
        padding: 14px !important;
    }

    .bottleneck-row {
        grid-template-columns: 70px 1fr 50px !important;
        gap: 6px !important;
    }

    .bottleneck-stage-label {
        font-size: 0.65rem !important;
    }

    /* Chat window */
    #chat-window {
        width: calc(100% - 20px) !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 70px !important;
        max-height: 60vh !important;
    }

    .chat-fab {
        width: 50px !important;
        height: 50px !important;
        right: 16px !important;
        bottom: 16px !important;
    }

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

    table {
        font-size: 0.7rem !important;
    }

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

    /* Login page */
    .login-container {
        padding: 20px !important;
        max-width: 100% !important;
        margin: 10px !important;
    }

    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 9998;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: rgba(89, 216, 255, 0.15);
        border: none;
        color: #dff3ff;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Overlay for mobile menu */
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }

    .mobile-overlay.active {
        display: block;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .main-content {
        padding: 10px 8px 16px 8px !important;
    }

    .content-title {
        font-size: 1rem !important;
    }

    /* All columns full width */
    .row > .col-6,
    .row > .col-md-6,
    .row > .col-3,
    .row > .col-md-3,
    .g-2 > .col-3,
    .g-3 > .col-3,
    .g-2 > [class*="col"],
    .g-3 > [class*="col"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }

    .metric-card {
        min-height: 70px;
        padding: 12px 10px !important;
    }

    .metric-card-value,
    .kpi-value {
        font-size: 1.2rem !important;
    }

    .section-title,
    .overview-title {
        font-size: 1rem !important;
    }

    .chart-container {
        padding: 10px !important;
    }

    /* Charts even shorter on very small screens */
    .chart-container .js-plotly-plot,
    .chart-container [id*="chart-"] {
        height: 200px !important;
        min-height: 200px !important;
    }

    .qty-comparison-card .dash-graph,
    .qty-comparison-card .js-plotly-plot,
    .qty-comparison-card [id*="chart-"] {
        height: 165px !important;
        min-height: 160px !important;
    }

    .qty-comparison-card #chart-qty,
    .qty-comparison-card #chart-qty .js-plotly-plot,
    .qty-comparison-card #chart-qty .plotly,
    .qty-comparison-card #chart-qty .plot-container,
    .qty-comparison-card #chart-qty .svg-container {
        height: 160px !important;
        min-height: 160px !important;
        max-height: 160px !important;
    }

    .qty-comparison-card #loading-chart-qty {
        display: block !important;
        height: 160px !important;
        min-height: 160px !important;
        max-height: 160px !important;
    }

    .filters-container {
        padding: 8px 10px !important;
    }

    /* Dropdowns */
    .Select-control,
    div[class*="-control"] {
        min-height: 36px !important;
        font-size: 0.8rem !important;
    }

    /* Recent logistics cards */
    .recent-logistics-card {
        padding: 12px !important;
        min-height: 140px !important;
    }

    .progress-timeline {
        margin: 12px 0 !important;
    }

    .stage-dot {
        width: 8px !important;
        height: 8px !important;
    }

    /* Chat */
    #chat-window {
        max-height: 50vh !important;
    }

    .chat-bubble {
        max-width: 90% !important;
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
    }

    .chat-input.form-control {
        font-size: 0.78rem !important;
    }
}

/* ========================================================================== */
/* Sidebar final override: no cards, no gray, bigger logo */
/* ========================================================================== */
#sidebar {
    background: transparent !important;
    border-right: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#sidebar > .sidebar-inner {
    background: rgba(5, 14, 24, 0.96) !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

#sidebar .sidebar-toggle-btn,
#sidebar .sidebar-menu-item,
#sidebar .sidebar-logout-btn,
#sidebar .sidebar-search-wrap,
#sidebar .sidebar-profile {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#sidebar .sidebar-section-label,
#sidebar .sidebar-search-wrap,
#sidebar .sidebar-profile {
    display: none !important;
}

#sidebar .sidebar-menu-item {
    border-radius: 8px !important;
    color: #9dc3d8 !important;
    box-shadow: none !important;
    border-left: 3px solid transparent !important;
    position: relative !important;
}

#sidebar .sidebar-menu-item .material-symbols-outlined {
    color: #9dc3d8 !important;
    font-family: 'Material Symbols Outlined' !important;
    font-size: 24px !important;
    font-weight: normal !important;
    font-style: normal !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased !important;
}

#sidebar .sidebar-menu-item:hover {
    background: rgba(32, 201, 151, 0.12) !important;
    color: #d8f6e9 !important;
}

#sidebar .sidebar-menu-item:hover .material-symbols-outlined {
    color: #d8f6e9 !important;
}

#sidebar .sidebar-menu-item.active {
    background: transparent !important;
    color: #20c997 !important;
    box-shadow: none !important;
    border-left-color: #20c997 !important;
}

#sidebar .sidebar-menu-item.active .material-symbols-outlined {
    color: #20c997 !important;
}

/* Kill legacy active markers that can leave green pixel artifacts */
#sidebar .sidebar-menu-item::before,
#sidebar .sidebar-menu-item::after,
#sidebar .sidebar-menu-item.active::before,
#sidebar .sidebar-menu-item.active::after {
    display: none !important;
    content: none !important;
}

#sidebar .sidebar-logo-icon {
    width: 64px !important;
    height: 64px !important;
    background: transparent !important;
    margin-bottom: 12px !important;
}

#sidebar .sidebar-company-logo {
    width: 52px !important;
    height: 52px !important;
    filter: brightness(2.2) contrast(1.6) saturate(1.35) drop-shadow(0 0 16px rgba(95, 227, 255, 0.65)) !important;
}

#sidebar.expanded .sidebar-logo-icon {
    width: 212px !important;
    height: 212px !important;
    margin-bottom: 20px !important;
}

#sidebar.expanded .sidebar-company-logo {
    width: 176px !important;
    height: 176px !important;
}

/* Remove any legacy vertical indicator/line artifacts */
#sidebar::before,
#sidebar::after,
#sidebar .sidebar-inner::before,
#sidebar .sidebar-inner::after {
    display: none !important;
    content: none !important;
}
