
        :root {
            --rosa-primary: #6366f1;
            --danger: #ef4444;
            --warning: #f59e0b;
            --success: #10b981;
            --rosa-dark: #4338ca;
        }
        /* Initial paint: show only the refinery background first. */
        body { visibility: visible; opacity: 1; background-color: #1a253d; }

        /* Hold every foreground login element until the synchronized reveal. */
        html.is-logged-out #authSection {
            opacity: 0 !important; visibility: hidden !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.75s !important;
        }

        /* ROSA BOT stays hidden with the login foreground and reveals together after the same 1.4s delay. */
        html.is-logged-out .rosa-bot-container {
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.75s !important;
        }
        html.is-logged-out.page-ready .rosa-bot-container {
            opacity: 1 !important;
            visibility: visible !important;
            pointer-events: auto !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s !important;
        }

        /* Danantara + Patra Niaga stay hidden with the login panel and reveal together. */
        html.is-logged-out .top-left-logo,
        html.is-logged-out .top-right-logo {
            opacity: 0 !important;
            visibility: hidden !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.75s !important;
        }
        html.is-logged-out.page-ready .top-left-logo,
        html.is-logged-out.page-ready .top-right-logo {
            opacity: 1 !important;
            visibility: visible !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s !important;
        }
        html.is-logged-out.page-ready #authSection {
            opacity: 1 !important; visibility: visible !important;
            transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s !important;
        }
        html.is-logged-out #authSection.window-fade { animation: none !important; transform: none !important; }
        html.is-logged-out:not(.page-ready) #authSection * { opacity: 0 !important; visibility: hidden !important; }
        html.is-logged-out.page-ready #authSection * { opacity: 1 !important; visibility: visible !important; }
        html.is-logged-out #authSection *, html.is-logged-out #authSection img, html.is-logged-out #authSection input, html.is-logged-out #authSection button, html.is-logged-out #authSection i, html.is-logged-out #authSection svg { animation-delay: 0s !important; }

        html.is-logged-in #authSection { display: none !important; }
        html.is-logged-in #mainSection { display: block !important; }
        html.is-logged-out #authSection { display: flex !important; }
        html.is-logged-out #mainSection { display: none !important; }

        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.98) translateY(10px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        @keyframes slideInLeft {
            from { opacity: 0; transform: translateX(-30px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes slideInRight {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

#toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 9999; }
        .toast {
            background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(8px);
            color: white; padding: 12px 25px; border-radius: 10px;
            border-left: 4px solid var(--rosa-primary); box-shadow: 0 4px 15px rgba(0,0,0,0.3);
animation: slideInLeft 0.3s ease-out forwards;
            display: flex; align-items: center; gap: 10px;
        }

        .loader-overlay {
            position: fixed; inset: 0; width: 100%; height: 100%;
            background: rgba(15, 23, 42, 0.72); backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 11000; display: flex; justify-content: center; align-items: center;
        }

        .loading-card {
            width: min(340px, calc(100vw - 40px));
            padding: 30px 28px 26px;
            text-align: center;
            border: 1px solid rgba(255,255,255,0.10);
            border-radius: 18px;
            background: rgba(15, 23, 42, 0.78);
            box-shadow: 0 20px 60px rgba(0,0,0,0.30);
        }

        .loading-spinner {
            width: 34px; height: 34px; margin: 0 auto 18px;
            border: 3px solid rgba(255,255,255,0.14);
            border-top-color: var(--rosa-primary);
            border-radius: 50%;
            animation: loadingSpin 0.85s linear infinite;
        }

        @keyframes loadingSpin { to { transform: rotate(360deg); } }

        .loading-brand {
            font-size: 12px; font-weight: 700; letter-spacing: 2.5px;
            color: rgba(255,255,255,0.92); margin-bottom: 10px;
        }

        .loading-msg {
            font-size: 10px; font-weight: 600; letter-spacing: 2px;
            color: rgba(255,255,255,0.72);
        }

        .loading-status {
            margin-top: 8px; font-size: 11px; color: rgba(255,255,255,0.42);
        }

        .confirm-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 10000; display: flex; justify-content: center; align-items: center; }
        .confirm-box { padding: 30px; text-align: center; max-width: 350px; width: 90%; border: 1px solid rgba(255,255,255,0.1); }

        .doc-name-container { max-width: 250px; white-space: normal; word-wrap: break-word; text-align: left; line-height: 1.4; padding: 5px 0; }
        .desc-text { font-size: 12px; opacity: 0.7; font-style: italic; display: block; margin-top: 4px; }

        .action-icons { display: flex; gap: 12px; font-size: 1.1rem; justify-content: center; align-items: center; min-height: 40px; }

        footer { text-align: center; padding: 20px 0; margin-top: 50px; width: 100%; background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(5px); border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; color: rgba(255, 255, 255, 0.5); letter-spacing: 1px; }

        @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes fadeOut { to { opacity: 0; transform: translateY(20px); } }

        .window-fade { animation: fadeInScale 0.5s ease-out forwards; }

        body, html { 
            margin: 0; padding: 0; width: 100%; min-height: 100vh;
            font-family: 'Segoe UI', sans-serif;
            background-image: linear-gradient(rgba(34, 46, 74, 0.85), rgba(33, 48, 82, 0.85)), 
                             url('assets/refinery-background.jpeg');
            background-size: cover; background-position: center; background-attachment: fixed;
            color: white; overflow-x: hidden; display: flex; flex-direction: column;
        }

        .page-content { flex: 1; }
        .top-left-logo { position: absolute; top: 15px; left: 15px; width: 100px; z-index: 100; filter: drop-shadow(0 2px 4px rgba(21,13,13,0.5)); }
        .top-right-logo { position: absolute; top: 15px; right: 15px; width: 100px; z-index: 100; filter: drop-shadow(0 2px 4px rgba(95,50,50,0.5)); }
        .brand-logo { width: 110px; margin-bottom: 15px; filter: drop-shadow(0 0 15px rgba(99,102,241,0.6)); }
        .nav-logo { width: 55px; margin-right: 12px; }
        .hidden { display: none !important; }
        
        .glass-panel {
            background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 15px;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
        }

        #authSection, #welcomeSection { height: 100vh; display: flex; justify-content: center; align-items: center; position: relative; }
        .card-inner { padding: 2.5rem; width: 90%; max-width: 400px; text-align: center; z-index: 10; }
        #mainSection { width: 95%; max-width: 1200px; margin: 20px auto; padding-bottom: 50px; position: relative; }

        .nav-bar { 
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex; justify-content: space-between; align-items: center; 
            padding: 1rem 20px; border-bottom: 1px solid rgba(255,255,255,0.1); 
            margin: 100px 20px 30px 20px;
            background: transparent;
            box-shadow: none;
        }

        /* Navigation Tabs */
        .nav-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            position: sticky;
            top: 85px;
            z-index: 99;
            background: transparent;
            padding: 10px 20px;
            margin-left: 20px;
            margin-right: 20px;
        }

        .nav-tab {
            padding: 12px 25px;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
        }

        .nav-tab-summary {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(67, 56, 202, 0.3) 100%);
            color: #a5b4fc;
            border: 1px solid rgba(99, 102, 241, 0.4);
        }

        .nav-tab-summary:hover, .nav-tab-summary.active {
            background: linear-gradient(135deg, var(--rosa-primary) 0%, var(--rosa-dark) 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
            transform: translateY(-2px);
        }

        .nav-tab-data {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.3) 100%);
            color: #6ee7b7;
            border: 1px solid rgba(16, 185, 129, 0.4);
        }

        .nav-tab-data:hover, .nav-tab-data.active {
            background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
            transform: translateY(-2px);
        }

        .nav-tab-report {
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(126, 34, 206, 0.3) 100%);
            color: #d8b4fe;
            border: 1px solid rgba(168, 85, 247, 0.4);
        }

        .nav-tab-report:hover, .nav-tab-report.active {
            background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
            transform: translateY(-2px);
        }

        /* Dashboard View Transitions */
        .dashboard-view {
            animation: fadeInUp 0.4s ease-out forwards;
        }

        input, select, textarea { 
            width: 100%; padding: 12px; margin: 8px 0; border: none; border-radius: 10px; 
            box-sizing: border-box; font-size: 14px; background: rgba(255,255,255,0.95); color: #0f172a;
            font-family: inherit;
        }
        textarea { resize: vertical; min-height: 45px; }
        .file-label { display: block; text-align: left; font-size: 11px; color: #94a3b8; margin-bottom: 5px; margin-top: -3px; }

        .btn { padding: 12px 20px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.2s; width: 100%; margin-top: 5px; }
        .btn-primary { background: var(--rosa-primary); color: white; }
        .btn-danger { background: var(--danger); color: white; }
.btn-logout { background: rgba(239, 68, 68, 0.2); color: #fca5a5; width: auto; font-size: 0.8rem; border: 1px solid rgba(239, 68, 68, 0.3); padding: 8px 14px; transition: all 0.3s ease; }
        .btn-logout:hover { background: rgba(239, 68, 68, 0.4); color: white; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); border-color: rgba(239, 68, 68, 0.5); }
        
        .btn-trash { background: rgba(255, 255, 255, 0.1); color: white; width: auto; font-size: 0.8rem; border: 1px solid rgba(255,255,255,0.2); padding: 8px 14px; transition: all 0.3s ease; }
        .btn-trash:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2); border-color: rgba(255,255,255,0.4); }
        
        .btn-secondary { transition: all 0.3s ease; }
        .btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }

        .controls-grid {
            display: grid;
            grid-template-columns: 1fr 200px;
            gap: 15px;
            margin-bottom: 15px;
        }
        .search-input {
            background: rgba(255, 255, 255, 0.1) !important;
            color: white !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
        }
        .search-input::placeholder { color: rgba(255, 255, 255, 0.4); }

        /* Scrollable Document Container - independent scrolling */
        .document-scroll-container {
            max-height: calc(100vh - 280px);
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.05);
        }
        
        .document-scroll-container::-webkit-scrollbar {
            width: 8px;
        }
        
        .document-scroll-container::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
        }
        
        .document-scroll-container::-webkit-scrollbar-thumb {
            background: rgba(99, 102, 241, 0.5);
            border-radius: 4px;
        }
        
        .document-scroll-container::-webkit-scrollbar-thumb:hover {
            background: rgba(99, 102, 241, 0.7);
        }

        /* --- PROFESSIONAL STATUS SORT --- */
        .status-sort-solid {
            background: rgba(0, 0, 0, 0.6) !important;
            backdrop-filter: blur(15px) !important;
            -webkit-backdrop-filter: blur(15px) !important;
            color: white !important;
            font-weight: 600 !important;
            cursor: pointer;
            border: 1px solid rgba(255,255,255,0.15) !important;
            text-transform: uppercase;
            font-size: 11px !important;
            letter-spacing: 1px;
            padding: 12px 40px 12px 16px !important;
            appearance: none;
            -moz-appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
            background-repeat: no-repeat !important;
            background-position: right 14px center !important;
            background-size: 16px !important;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 15px rgba(99, 102, 241, 0.2) !important;
            border-radius: 50px !important;
            min-width: 160px;
            position: relative;
            z-index: 100;
        }

        /* Dropdown panel fix - removes white outside bar */
        .status-sort-solid:focus {
            outline: none !important;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5), 0 4px 15px rgba(99, 102, 241, 0.35) !important;
            border-color: rgba(255, 255, 255, 0.5) !important;
        }

        /* Style the dropdown list when open */
        .status-sort-solid::-webkit-select-arrow,
        .status-sort-solid::-webkit-select-arrow {
            display: none;
        }

        /* Fix for dropdown options panel - webkit browsers */
        @supports (-webkit-appearance: none) {
            .status-sort-solid {
                -webkit-border-radius: 10px;
                border-radius: 10px;
            }
        }

        /* Add border and dark background to dropdown when expanded */
        .status-sort-solid:active,
        .status-sort-solid[aria-expanded="true"] {
            border-color: rgba(255, 255, 255, 0.5) !important;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5), 0 8px 25px rgba(99, 102, 241, 0.5) !important;
        }

        /* Ensure options have proper styling */
        .status-sort-solid option {
            background-color: #1e1b4b !important;
            color: white !important;
            padding: 14px 16px !important;
            font-size: 12px !important;
            font-weight: 500 !important;
            border: none !important;
            border-bottom: 1px solid rgba(255,255,255,0.05) !important;
            outline: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
            border-radius: 25px !important;
            margin: 2px 4px !important;
        }

        /* Style dropdown list box - webkit */
        .status-sort-solid::-webkit-select-listbox {
            background-color: #1e1b4b !important;
            border-radius: 20px !important;
            border: 1px solid rgba(99, 102, 241, 0.5) !important;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
            padding: 8px !important;
        }

        /* Style dropdown list box - moz */
        .status-sort-solid:-moz-focusring {
            color: transparent !important;
            text-shadow: 0 0 0 white !important;
        }

        /* Firefox specific */
        @-moz-document url-prefix() {
            .status-sort-solid option {
                background-color: #1e1b4b !important;
                color: white !important;
            }
        }


        .table-wrapper { overflow-x: auto; margin-top: 10px; }
        table { width: 100%; border-collapse: collapse; min-width: 1000px; background: rgba(0, 0, 0, 0.2); border-radius: 12px; overflow: hidden; }
        th { text-align: center; padding: 15px; background: rgba(255,255,255,0.05); font-size: 11px; text-transform: uppercase; color: #94a3b8; letter-spacing: 1px; }
        td { padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; text-align: center; }

        .badge { padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: bold; min-width: 90px; display: inline-block; text-align: center; }
        .expired { background: var(--danger); }
        .warning { background: var(--warning); color: black; }
        .secure { background: var(--success); }

        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; display: flex; justify-content: center; align-items: center; }
        .trash-content { width: 95%; max-width: 800px; max-height: 80vh; overflow-y: auto; padding: 25px; }
        
        /* Trash Modal - Custom Blue Transparent Scrollbar */
        .trash-content::-webkit-scrollbar {
            width: 8px;
        }
        
        .trash-content::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
        }
        
        .trash-content::-webkit-scrollbar-thumb {
            background: rgba(99, 102, 241, 0.5);
            border-radius: 4px;
        }
        
        .trash-content::-webkit-scrollbar-thumb:hover {
            background: rgba(99, 102, 241, 0.7);
        }
        
        .trash-content {
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.05);
        }

        /* Summary Dashboard Styles */
        .summary-dashboard {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 15px;
            margin-bottom: 25px;
        }

        .summary-card {
            background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .summary-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            border-radius: 12px 12px 0 0;
        }

        .summary-card.total::before { background: linear-gradient(90deg, var(--rosa-primary), var(--rosa-dark)); }
        .summary-card.secure::before { background: linear-gradient(90deg, var(--success), #059669); }
        .summary-card.warning::before { background: linear-gradient(90deg, var(--warning), #d97706); }
        .summary-card.expired::before { background: linear-gradient(90deg, var(--danger), #dc2626); }

        .summary-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.3);
            border-color: rgba(255,255,255,0.2);
        }

        .summary-icon {
            font-size: 2.2rem;
            margin-bottom: 8px;
            display: block;
        }

        .summary-number {
            font-size: 2.2rem;
            font-weight: 700;
            line-height: 1;
            margin-bottom: 5px;
        }

        .summary-card.total .summary-number { color: #a5b4fc; }
        .summary-card.secure .summary-number { color: #6ee7b7; }
        .summary-card.warning .summary-number { color: #fcd34d; }
        .summary-card.expired .summary-number { color: #fca5a5; }

        .summary-label {
            font-size: 14px;
            color: rgba(255,255,255,0.7);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .summary-percentage {
            font-size: 1.2rem;
            font-weight: 600;
            margin-top: 10px;
            padding: 8px 15px;
            border-radius: 20px;
            display: inline-block;
        }

        .summary-card.total .summary-percentage { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
        .summary-card.secure .summary-percentage { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
        .summary-card.warning .summary-percentage { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
        .summary-card.expired .summary-percentage { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

        /* Progress Bar */
        .progress-container {
            margin-top: 15px;
            background: rgba(0,0,0,0.3);
            border-radius: 10px;
            height: 8px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            border-radius: 10px;
            transition: width 0.5s ease;
        }

        .progress-bar.secure { background: linear-gradient(90deg, var(--success), #34d399); }
        .progress-bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
        .progress-bar.expired { background: linear-gradient(90deg, var(--danger), #f87171); }

        /* Quick Stats Row */
        .quick-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-top: 15px;
        }

        .quick-stat {
            background: rgba(255,255,255,0.05);
            border-radius: 10px;
            padding: 12px;
            text-align: center;
        }

        .quick-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--rosa-primary);
        }

        .quick-stat-label {
            font-size: 11px;
            color: rgba(255,255,255,0.5);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 5px;
        }

        /* Bar Chart Styles */
        .chart-container {
            margin-top: 25px;
            padding: 20px;
            background: rgba(255,255,255,0.03);
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.05);
        }

        .chart-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 20px;
            text-align: center;
            color: rgba(255,255,255,0.8);
        }

        .bar-chart {
            display: flex;
            align-items: flex-end;
            justify-content: center;
            gap: 15px;
            height: 180px;
            padding: 0 10px;
        }

        .bar-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            min-width: 60px;
        }

        .bar {
            width: 50px;
            border-radius: 6px 6px 0 0;
            transition: all 0.3s ease;
            position: relative;
            cursor: pointer;
            min-height: 20px;
        }

        .bar:hover {
            transform: scaleY(1.05);
            filter: brightness(1.2);
        }

        .bar.total-bar {
            background: linear-gradient(180deg, var(--rosa-primary) 0%, var(--rosa-dark) 100%);
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
        }

        .bar-value {
            font-size: 14px;
            font-weight: 700;
            color: white;
            position: absolute;
            top: -25px;
            left: 50%;
            transform: translateX(-50%);
            white-space: nowrap;
        }

        .bar-label {
            font-size: 12px;
            color: rgba(255,255,255,0.6);
            font-weight: 500;
        }

        .chart-legend {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 15px;
            font-size: 12px;
            color: rgba(255,255,255,0.5);
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--rosa-primary);
        }

.no-data-message {
            text-align: center;
            padding: 40px;
            color: rgba(255,255,255,0.4);
            font-style: italic;
        }

        /* --- ROSA BOT STYLES --- */
        .rosa-bot-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 9999;
            font-family: 'Segoe UI', sans-serif;
            filter: none !important;
            -webkit-filter: none !important;
        }

        .rosa-bot-toggle-btn {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: transparent !important;
            border: none !important;
            cursor: pointer;
            box-shadow: none !important;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: none !important;
            outline: none !important;
            -webkit-tap-highlight-color: transparent !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            -moz-backface-visibility: hidden;
            -ms-backface-visibility: hidden;
            filter: none !important;
            transform: none !important;
        }

        .rosa-bot-toggle-btn:hover {
            transform: none !important;
            box-shadow: none !important;
            background: transparent !important;
            filter: none !important;
        }

        .rosa-bot-toggle-btn:active {
            transform: none !important;
            box-shadow: none !important;
            background: transparent !important;
            filter: none !important;
        }

        .rosa-bot-toggle-btn:focus {
            outline: none !important;
            box-shadow: none !important;
            background: transparent !important;
            filter: none !important;
        }

.rosa-bot-toggle-btn img {
            width: 65px;
            height: 65px;
            border-radius: 50%;
            border: none !important;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
            outline: none !important;
            -webkit-box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
            filter: none !important;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            transition: all 0.3s ease !important;
        }

        /* Glow animation on hover */
        .rosa-bot-toggle-btn:hover img {
            box-shadow: 0 0 25px rgba(99, 102, 241, 0.8), 0 0 50px rgba(99, 102, 241, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3) !important;
            -webkit-box-shadow: 0 0 25px rgba(99, 102, 241, 0.8), 0 0 50px rgba(99, 102, 241, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3) !important;
            transform: scale(1.05);
            filter: brightness(1.1) !important;
        }

        .rosa-bot-popup {
            position: absolute;
            bottom: 80px;
            right: 0;
            width: 350px;
            max-height: 450px;
            background: rgba(15, 23, 42, 0.98);
            border: 1px solid rgba(99, 102, 241, 0.3);
            border-radius: 15px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            display: none;
            flex-direction: column;
            overflow: hidden;
            animation: slideInUp 0.3s ease-out;
            filter: none !important;
        }

        .rosa-bot-popup:hover {
            filter: none !important;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
            border: 1px solid rgba(99, 102, 241, 0.3) !important;
        }

        .rosa-bot-popup.show {
            display: flex;
        }

        @keyframes slideInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .rosa-bot-header {
            background: linear-gradient(135deg, var(--rosa-primary) 0%, var(--rosa-dark) 100%);
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .rosa-bot-header img {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.3);
            box-shadow: none !important;
            filter: none !important;
        }

        .rosa-bot-header-info {
            flex: 1;
        }

        .rosa-bot-title {
            color: white;
            font-size: 16px;
            font-weight: 600;
            margin: 0;
        }

        .rosa-bot-subtitle {
            color: rgba(255, 255, 255, 0.7);
            font-size: 11px;
            margin: 0;
        }

        .rosa-bot-close {
            background: rgba(255, 255, 255, 0.2) !important;
            border: none !important;
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: none !important;
            box-shadow: none !important;
            filter: none !important;
        }

        .rosa-bot-close:hover {
            background: rgba(255, 255, 255, 0.3) !important;
            transform: rotate(90deg);
            box-shadow: none !important;
            filter: none !important;
        }

        .rosa-bot-messages {
            flex: 1;
            padding: 15px;
            overflow-y: auto;
            max-height: 280px;
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.05);
        }

        .rosa-bot-messages::-webkit-scrollbar {
            width: 8px;
        }

        .rosa-bot-messages::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
        }

        .rosa-bot-messages::-webkit-scrollbar-thumb {
            background: rgba(99, 102, 241, 0.5);
            border-radius: 4px;
        }

        .rosa-bot-messages::-webkit-scrollbar-thumb:hover {
            background: rgba(99, 102, 241, 0.7);
        }

        .rosa-bot-welcome {
            text-align: center;
            padding: 20px 10px;
            color: rgba(255, 255, 255, 0.8);
        }

        .rosa-bot-welcome-icon {
            font-size: 40px;
            margin-bottom: 10px;
        }

        .rosa-bot-welcome h4 {
            margin: 0 0 8px 0;
            color: var(--rosa-primary);
        }

        .rosa-bot-welcome p {
            font-size: 12px;
            margin: 0;
            opacity: 0.7;
        }

        .rosa-bot-expiry-item {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 10px;
            border-left: 3px solid var(--warning);
        }

        .rosa-bot-expiry-item.urgent {
            border-left-color: var(--danger);
            background: rgba(239, 68, 68, 0.1);
        }

        .rosa-bot-expiry-name {
            font-weight: 600;
            color: white;
            font-size: 13px;
            margin-bottom: 4px;
        }

        .rosa-bot-expiry-info {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
        }

        .rosa-bot-expiry-days {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 600;
            font-size: 11px;
            margin-left: 5px;
        }

        .rosa-bot-expiry-days.warning {
            background: rgba(245, 158, 11, 0.2);
            color: var(--warning);
        }

        .rosa-bot-expiry-days.urgent {
            background: rgba(239, 68, 68, 0.2);
            color: var(--danger);
        }

        .rosa-bot-no-expiry {
            text-align: center;
            padding: 20px;
            color: rgba(255, 255, 255, 0.5);
            font-size: 13px;
        }

        .rosa-bot-no-expiry-icon {
            font-size: 30px;
            margin-bottom: 10px;
        }

        .rosa-bot-actions {
            padding: 15px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .rosa-bot-action-btn {
            background: linear-gradient(135deg, var(--rosa-primary) 0%, var(--rosa-dark) 100%);
            color: white;
            border: none;
            padding: 12px 15px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s ease;
        }

        .rosa-bot-action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
        }

        .rosa-bot-refresh-btn {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .rosa-bot-refresh-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            box-shadow: none;
        }

        /* Report Menu Button Selection Styles */
        .report-category-btn, .report-area-btn {
            transition: all 0.3s ease;
            position: relative;
        }

        .report-category-btn.selected, .report-area-btn.selected {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
            border-width: 2px;
        }

        /* Bold color for selected category buttons */
        .report-category-btn.selected {
            background: rgba(99, 102, 241, 0.4) !important;
            border-color: #a5b4fc !important;
            color: white !important;
            font-weight: 700;
        }

        /* Bold color for selected area buttons */
        .report-area-btn.selected {
            background: rgba(139, 92, 246, 0.4) !important;
            border-color: #c4b5fd !important;
            color: white !important;
            font-weight: 700;
        }

        /* Hide Selection indicator */
        .selection-indicator {
            display: none !important;
        }

        /* ============================================================
           ROSA DISPLAY FIX - Prevent background/compositor repaint
           artifacts during browser resize, snap, minimize/maximize,
           or when the pointer moves over the window controls.
           Existing UI/functionality is preserved.
           ============================================================ */
        html, body {
            background-color: #1a253d !important;
            background-image: none !important;
            background-attachment: scroll !important;
        }

        body {
            position: relative;
            isolation: isolate;
        }

        /* Keep the refinery background on its own fixed compositor layer.
           This avoids Chrome/Edge repaint artifacts caused by combining
           background-attachment: fixed with backdrop-filter. */
        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: -1;
            pointer-events: none;
            background-image:
                linear-gradient(rgba(34, 46, 74, 0.85), rgba(33, 48, 82, 0.85)),
                url('assets/refinery-background.jpeg');
            background-size: cover;
            background-position: center center;
            background-repeat: no-repeat;
            transform: translateZ(0);
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            will-change: transform;
        }

        /* Make the initial glass login panel visually stable while retaining
           the same glass appearance. The fallback background prevents a
           temporary rectangular flash if backdrop-filter is repainted. */
        .glass-panel {
            background: rgba(255, 255, 255, 0.045);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        @media (prefers-reduced-motion: reduce) {
            html.page-ready body { transition: none !important; }
        }


        /* ============================================================
           ROSA STABILITY PATCH v2
           Prevent Chrome/Edge compositor artifacts on the initial login
           screen.  No application/database logic is changed.
           ============================================================ */
        html, body {
            background-color: #1a253d !important;
            background-image:
                linear-gradient(rgba(34, 46, 74, 0.85), rgba(33, 48, 82, 0.85)),
                url('assets/refinery-background.jpeg') !important;
            background-size: cover !important;
            background-position: center center !important;
            background-repeat: no-repeat !important;
            background-attachment: scroll !important;
        }

        /* Remove the extra fixed compositor layer introduced by the first
           display patch. The normal document background is more stable. */
        body::before {
            content: none !important;
            display: none !important;
        }

        /* The login/welcome glass is intentionally rendered without
           backdrop-filter. This eliminates the rectangular repaint/gradient
           flash while keeping the same translucent visual treatment. */
        #authSection .glass-panel,
        #welcomeSection .glass-panel {
            background: rgba(24, 37, 61, 0.78) !important;
            -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
            transform: none !important;
            -webkit-transform: none !important;
            will-change: auto !important;
            contain: paint !important;
        }

        /* Do not animate transform on the initial login container. */
        #authSection.window-fade,
        #welcomeSection.window-fade {
            animation: rosaStableFade 0.35s ease-out forwards !important;
            transform: none !important;
            -webkit-transform: none !important;
            will-change: opacity !important;
        }

        @keyframes rosaStableFade {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Avoid GPU layer promotion caused by the generic glass-panel rule. */
        .glass-panel {
            transform: none;
            -webkit-transform: none;
            will-change: auto;
        }

        @media (prefers-reduced-motion: reduce) {
            #authSection.window-fade,
        #welcomeSection.window-fade {
            animation: none !important;
            opacity: 1 !important;
        }
        }

    

/* ===== INLINE STYLE BLOCK ===== */

/* ROSA BACKGROUND LOCK v16 — fixed viewport background */
html, body {
    margin: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    background: #1a253d !important;
    background-image: none !important;
    background-attachment: scroll !important;
}

html {
    min-height: 100% !important;
}

body {
    position: relative !important;
    isolation: isolate !important;
    overflow-x: hidden !important;
}

/* The refinery photo is locked to the browser viewport. It is NOT tied to
   document height, menu height, scrolling, or section changes. */
body::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0 !important;
    pointer-events: none !important;
    display: block !important;
    background-color: #1a253d !important;
    background-image:
        linear-gradient(rgba(34, 46, 74, 0.85), rgba(33, 48, 82, 0.85)),
        url("assets/refinery-background.jpeg") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* Every normal application layer stays above the fixed photo. */
body > * {
    position: relative;
    z-index: 1;
}

/* Preserve fixed overlays above the application. */
.modal-overlay,
.confirm-overlay,
#toast-container {
    z-index: 10000 !important;
}

/* Login/welcome panels must not create a new full-page background. */
#authSection,
#welcomeSection,
#mainSection {
    background: transparent !important;
}


/* ===== INLINE STYLE BLOCK ===== */

        /* Keep the app layout independent from the fixed refinery background. */
        #mainSection, #welcomeSection, #authSection { position: relative; z-index: 1; }
        #loaderSection, #trashModal, #confirmModal { z-index: 10000 !important; }
    