
        @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
        * { box-sizing: border-box; }
        body { font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif; background-color: #f5f5f5; margin: 0; padding: 0; color: #333; overflow-x: hidden; min-height: 100vh; }
        
        /* APP SHELL */
        .app-shell { display: flex; min-height: 100vh; align-items: stretch; background-color: #f5f5f5; }
        
        /* RIGHT PANEL — Rekomendasi Aksi — fixed width, tidak rebutan ruang */
        .right-panel {
            flex: 0 0 380px;
            width: 380px;
            padding: 16px 16px 16px 0px;
            display: flex;
            flex-direction: column;
            position: sticky;
            top: 0;
            height: 100vh;
            box-sizing: border-box;
            overflow: hidden;
            background: #f5f5f5;
            transition: flex-basis 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .right-panel-inner {
            background: #fff;
            border-radius: 0 12px 12px 0;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border: 1px solid #e8e8e8;
            border-left: none;
            box-shadow: 2px 0 8px rgba(0,0,0,0.04);
        }
        .right-panel-header {
            font-size: 0.8em;
            font-weight: 800;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 14px 16px 12px;
            border-bottom: 1px solid #f0f0f0;
            flex-shrink: 0;
            background: #fafafa;
        }
        #alertBanner {
            flex: 1;
            min-height: 0;
            margin: 0 !important;
            border-radius: 0;
            overflow-y: auto;
            box-sizing: border-box;
            border-left: none !important;
            padding: 14px 16px;
            font-size: 0.88em;
        }
        #alertBanner.alert-ok,
        #alertBanner.alert-danger,
        #alertBanner.alert-warning {
            display: flex !important;
            flex-direction: column;
        }
        #alertBanner > div {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        
        /* SIDEBAR — Dark Theme */
        .sidebar { width: 220px; min-width: 220px; background: #1a1a1a; display: flex; flex-direction: column; padding: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.4); position: sticky; top: 0; height: 100vh; overflow: hidden; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1); will-change: width; z-index: 100; }
        .sidebar-header { padding: 16px 14px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); background: #000; }
        .sidebar-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
        .sidebar-logo-icon { width: 36px; height: 36px; background: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2em; flex-shrink: 0; }
        .sidebar-title { color: #fff; font-size: 0.82em; font-weight: 800; line-height: 1.2; letter-spacing: 0.3px; }
        .sidebar-subtitle { color: #ee4d2d; font-size: 0.62em; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
        .sidebar-version { display: inline-block; background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.6); font-size: 0.58em; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-top: 6px; letter-spacing: 0.5px; }

        /* NAV SCROLL AREA */
        .sidebar-nav { flex: 1; padding: 10px 0; display: flex; flex-direction: column; gap: 0; overflow-y: auto; overflow-x: hidden; }
        .sidebar-nav::-webkit-scrollbar { width: 3px; }
        .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
        .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

        /* COLLAPSIBLE DRAWER GROUP */
        .nav-drawer { width: 100%; }
        .nav-drawer-header {
            display: flex; align-items: center; justify-content: space-between;
            width: 100%; padding: 9px 14px 9px 12px;
            border: none; background: transparent; cursor: pointer;
            font-family: inherit; text-align: left;
            border-top: 1px solid rgba(255,255,255,0.06);
            transition: background 0.15s;
        }
        .nav-drawer-header:hover { background: rgba(255,255,255,0.04); }
        .nav-drawer-header:first-child { border-top: none; }
        .nav-drawer-label {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.68em; font-weight: 800; text-transform: uppercase;
            letter-spacing: 1.2px; color: rgba(255,255,255,0.5);
        }
        .nav-drawer-label .drawer-icon {
            width: 22px; height: 22px; border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.95em; flex-shrink: 0;
        }
        /* Rasio Keuangan drawer — teal accent */
        .nav-drawer[data-group="rasio"] .nav-drawer-label { color: #34d399; }
        .nav-drawer[data-group="rasio"] .drawer-icon { background: rgba(52,211,153,0.15); }
        /* Price Optimizer drawer — orange accent */
        .nav-drawer[data-group="price"] .nav-drawer-label { color: #fb923c; }
        .nav-drawer[data-group="price"] .drawer-icon { background: rgba(251,146,60,0.15); }

        .nav-drawer-chevron {
            width: 14px; height: 14px; flex-shrink: 0;
            color: rgba(255,255,255,0.35);
            transition: transform 0.25s ease;
        }
        .nav-drawer.open .nav-drawer-chevron { transform: rotate(180deg); }

        /* Drawer body — animated */
        .nav-drawer-body {
            overflow: hidden;
            max-height: 0;
            transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .nav-drawer.open .nav-drawer-body { max-height: 500px; }
        .nav-drawer-inner { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 2px; }

        /* TAB BUTTONS inside drawer */
        .tab-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: transparent; color: rgba(255,255,255,0.6); cursor: pointer; border-radius: 8px; font-family: inherit; font-size: 0.8em; font-weight: 600; text-align: left; transition: all 0.18s ease; position: relative; }
        .tab-btn:hover:not(.active) { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
        .tab-btn.active { background: rgba(238,77,45,0.18); color: #fff; font-weight: 700; }
        .tab-btn.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 55%; background: #ee4d2d; border-radius: 0 3px 3px 0; }
        .tab-btn-icon { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,0.07); display: flex; align-items: center; justify-content: center; font-size: 0.9em; flex-shrink: 0; transition: background 0.18s; }
        .tab-btn.active .tab-btn-icon { background: rgba(238,77,45,0.25); }
        .tab-btn-label { flex: 1; }

        /* Lainnya section */
        .sidebar-section-label { color: rgba(255,255,255,0.3); font-size: 0.58em; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; padding: 10px 14px 4px; }
        .sidebar-lainnya { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }

        /* Active button accent — warna sesuai drawer group */
        .nav-drawer[data-group="rasio"] .tab-btn:hover:not(.active) { background: rgba(52,211,153,0.07); }
        .nav-drawer[data-group="rasio"] .tab-btn.active { background: rgba(52,211,153,0.12); }
        .nav-drawer[data-group="rasio"] .tab-btn.active::before { background: #34d399; }
        .nav-drawer[data-group="rasio"] .tab-btn.active .tab-btn-icon { background: rgba(52,211,153,0.2); }
        .nav-drawer[data-group="price"] .tab-btn.active { background: rgba(238,77,45,0.15); }
        .nav-drawer[data-group="price"] .tab-btn.active::before { background: #ee4d2d; }
        .nav-drawer[data-group="price"] .tab-btn.active .tab-btn-icon { background: rgba(238,77,45,0.25); }

        /* sidebar-footer defined below in footer section */
        
        /* MAIN CONTENT */
        .main-content { flex: 1; min-width: 0; padding: 16px 0 16px 20px; overflow-x: hidden; background: #f5f5f5; transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid #f0f0f0; }
        .page-title { font-size: 1.1em; font-weight: 800; color: #1a1a2e; }
        .page-subtitle { font-size: 0.72em; color: #888; font-weight: 500; margin-top: 2px; }
        
        .container { max-width: 100%; background: transparent; padding: 0; border-radius: 0; box-shadow: none; }
        h2 { display: none; }
        .btn-clear { background: #fff1f0; color: #d93025; border: 1px solid #ffccc7; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.75em; }
        .tab-bar { display: none; }
        .tab-panel { display:none; }
        /* CARD WRAPPER for tab content */
        .tab-panel.active { display: block; background: #fff; border-radius: 14px 0 0 14px; padding: 20px; box-shadow: none; border: 1px solid #ebebeb; border-right: none; width: 100%; box-sizing: border-box; }
        
        /* PAGE HEADER per tab */
        .tab-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #f5f5f5; }
        .tab-page-title { font-size: 1em; font-weight: 800; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
        .tab-page-title-icon { width: 30px; height: 30px; background: linear-gradient(135deg, #ee4d2d, #f07a1a); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.9em; }
        .tab-page-subtitle { font-size: 0.7em; color: #aaa; font-weight: 500; margin-top: 2px; }
        

        .sidebar .tab-btn-label,
        .sidebar .sidebar-title,
        .sidebar .sidebar-subtitle,
        .sidebar .sidebar-section-label,
        .sidebar .sidebar-footer-text,
        .sidebar .sidebar-version,
        .sidebar .nav-drawer-label span,
        .sidebar .nav-drawer-chevron {
            transition: opacity 0.2s ease;
            white-space: nowrap;
            overflow: hidden;
        }
        /* Collapsed: shrink sidebar to logo+icons only */
        .sidebar.collapsed {
            width: 70px !important;
            min-width: 70px !important;
        }
        /* Right panel melebar otomatis saat sidebar collapse */
        .sidebar.collapsed ~ .main-content ~ .right-panel,
        .app-shell:has(.sidebar.collapsed) .right-panel {
            flex: 0 0 530px;
            width: 530px;
        }
        .sidebar.collapsed .tab-btn-label,
        .sidebar.collapsed .sidebar-title,
        .sidebar.collapsed .sidebar-subtitle,
        .sidebar.collapsed .sidebar-section-label,
        .sidebar.collapsed .sidebar-footer-text,
        .sidebar.collapsed .sidebar-version,
        .sidebar.collapsed .nav-drawer-label span,
        .sidebar.collapsed .nav-drawer-chevron {
            opacity: 0;
            pointer-events: none;
            width: 0;
            overflow: hidden;
        }
        /* Collapsed: force drawers open so icons visible */
        .sidebar.collapsed .nav-drawer-body { max-height: 500px !important; }
        .sidebar.collapsed .nav-drawer-header { justify-content: center; padding: 8px 0; }
        .sidebar.collapsed .nav-drawer-label { gap: 0; }
        .sidebar.collapsed .nav-drawer-inner { padding: 2px 4px 6px; align-items: center; }
        .sidebar.collapsed .sidebar-lainnya { padding: 0 4px 6px; align-items: center; }
        /* Collapsed: center icons */
        .sidebar.collapsed .tab-btn {
            justify-content: center;
            padding: 9px 0;
        }
        .sidebar.collapsed .sidebar-logo {
            justify-content: center;
        }
        .sidebar.collapsed .sidebar-header {
            padding: 14px 10px;
            align-items: center;
            justify-content: center;
        }
        .sidebar.collapsed .sidebar-footer {
            padding: 10px 8px;
            justify-content: center;
        }

        /* Responsive */
        @media(max-width: 768px) {
            .sidebar { width: 64px; min-width: 64px; }
            .sidebar-title, .sidebar-subtitle, .tab-btn-label, .sidebar-section-label, .sidebar-footer-text, .sidebar-version { display: none; }
            .nav-drawer-label span, .nav-drawer-chevron { display: none; }
            .nav-drawer-header { justify-content: center; padding: 8px 0; }
            .nav-drawer-body { max-height: 500px !important; }
            .nav-drawer-inner { padding: 2px 4px 6px; align-items: center; }
            .sidebar-lainnya { padding: 0 4px 6px; align-items: center; }
            .sidebar-logo-icon { margin: 0 auto; }
            .sidebar-header { padding: 14px 8px; text-align: center; }
            .tab-btn { justify-content: center; padding: 9px 8px; }
            .tab-btn-icon { margin: 0; }
            .main-content { padding: 12px; }
        }

        .paste-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 10px; }
        .paste-area-1, .paste-area-2 { width:100%; padding:10px; border-radius:8px; font-size:11px; box-sizing:border-box; min-height:70px; outline:none; }
        .paste-area-1 { border:2px dashed #ea580c; background:#fff7f0; }
        .paste-area-2 { border:2px dashed #16a34a; background:#f0fdf4; }
        .paste-label { font-size:0.72em; font-weight:800; letter-spacing:0.5px; margin-bottom:4px; padding:3px 8px; border-radius:5px; display:inline-block; }
        .paste-label-1 { color:#ea580c; background:#fff7ed; border:1px solid #fed7aa; }
        .paste-label-2 { color:#16a34a; background:#f0fdf4; border:1px solid #bbf7d0; }
        .btn-calculate { width:100%; background:#ee4d2d; color:white; border:none; padding:12px; border-radius:10px; font-size:1.1em; font-weight:bold; cursor:pointer; margin-bottom:15px; transition:0.3s; }
        .btn-calculate:hover { background:#d93025; }
        .dashboard-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px; }
        .dash-card { padding:12px 5px; border-radius:12px; text-align:center; color:white; display:flex; flex-direction:column; justify-content:center; align-items:center; }
        .dash-card span { display:block; font-size:0.68em; font-weight:bold; text-transform:uppercase; margin-bottom:5px; opacity:0.9; }
        .dash-card strong { font-size:1.4em; display:block; line-height:1; }
        .dash-sub-badge { background:rgba(255,255,255,0.25); padding:3px 8px; border-radius:6px; font-size:0.85em; font-weight:700; margin-top:6px; min-width:60%; }
        .bg-blue{background:#3730a3} .bg-teal{background:#0d9488} .bg-green{background:#166534} .bg-orange{background:#ea580c} .bg-red{background:#991b1b!important}
        .grid-layout { display:grid; grid-template-columns:1.1fr 0.9fr; gap:15px; align-items:stretch; }
        .grid-2-col { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
        .section { background:#fdfdfd; border:1px solid #eee; border-radius:12px; padding:15px; display:flex; flex-direction:column; }
        .section-title { font-weight:bold; color:#2c3e50; border-bottom:3px solid #ee4d2d; display:inline-block; margin-bottom:12px; padding-bottom:3px; font-size:0.85em; }
        .sec-subtitle { font-weight:800; font-size:0.75em; margin:10px 0 5px 0; letter-spacing:0.5px; }
        .row-opr-variable { background:rgba(255,243,205,0.6); padding:8px; border-radius:8px; margin-bottom:10px; border:1px solid #ffeeba; color:#856404; font-weight:bold; font-size:0.85em; }
        .info-row { display:flex; justify-content:space-between; margin-bottom:9px; font-size:0.86em; align-items:center; line-height:1.4; }
        .row-highlight { background:#fff5f2; padding:8px; border-radius:8px; margin:5px 0; border:1px solid #ffd8d1; }
        .pct-label { font-size:0.75em; color:#333; background:#e0e0e0; padding:1px 5px; border-radius:4px; min-width:35px; text-align:center; font-weight:bold; border:1px solid #ccc; }
        .row-hidden { display:none; }
        .row-hidden.visible { display:flex; }
        #rowSaldoNote.visible { display:block; }
        .qty-badge { display:inline-block; background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; padding:1px 8px; border-radius:4px; font-size:0.75em; font-weight:bold; }
        
        /* Proyeksi Stretch */
        .bottom-projection-grid { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:10px; margin-top:15px; flex-grow:1; }
        .mini-card { background:#fff; border:1px solid #e2e8f0; padding:15px; border-radius:10px; border-left:5px solid #333; display:flex; flex-direction:column; justify-content:center; }
        .mini-card span { font-size:0.7em; color:#64748b; font-weight:bold; text-transform:uppercase; display:block; margin-bottom:5px; }
        .mini-card strong { font-size:1.1em; color:#0f172a; display:block; }
        .profit-highlight { margin-top:12px; flex-grow:1; background:#ecfdf5; border:1px solid #bbf7d0; border-left:5px solid #166534; padding:16px; border-radius:12px; text-align:center; display:flex; flex-direction:column; justify-content:center; box-sizing:border-box;}
        .profit-highlight span { font-size:0.72em; color:#166534; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
        .profit-highlight strong { display:block; font-size:1.6em; color:#14532d; margin-top:4px; font-weight:800; }
        .profit-highlight.rugi { background:#fff0f0; border:1px solid #fecaca; border-left:5px solid #991b1b; }
        .profit-highlight.rugi span { color:#991b1b; }
        .profit-highlight.rugi strong { color:#7f1d1d; }
        
        .form-group { margin-bottom:10px; }
        .form-group label { display:block; font-size:0.7em; font-weight:700; color:#555; margin-bottom:3px; text-transform:uppercase;}
        input[type=text], input[type=number] { width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; box-sizing:border-box; font-size:0.9em; outline:none; font-weight:600; }
        input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .bg-input-opr { background:#fff9db; padding:10px; border-radius:10px; margin-bottom:10px; border:1px solid #ffeeba; }
        
        /* Banner & Checklist 5 Opsi */
        .alert-banner { display:none; padding:16px 18px; border-radius:12px; font-size:0.92em; border-left:6px solid; flex-direction:column; align-items:flex-start; }
        .alert-danger  { display:flex!important; background:#fff0f0; color:#991b1b; border-color:#ef4444; }
        .alert-warning { display:flex!important; background:#fffbeb; color:#92400e; border-color:#f59e0b; }
        .alert-ok      { display:flex!important; background:#f0fdf4; color:#14532d; border-color:#22c55e; flex-direction:column; align-items:flex-start;}
        .opsi-list { margin:8px 0 0 20px; padding:0; line-height:1.6; }
        .opsi-list li { margin-bottom:4px; }

        /* CSS Simulator & Reverse & History */
        .sim-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:18px; }
        .scenario-card { border:1.5px solid #eee; border-radius:12px; padding:14px; background:#fafafa; }
        .scenario-title { font-size:0.75em; font-weight:800; text-transform:uppercase; margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid #eee; }
        .s1 { color:#3730a3 } .s2 { color:#ea580c } .s3 { color:#166534 }
        .sim-row { display:flex; justify-content:space-between; font-size:0.8em; margin-bottom:4px; }
        .sim-val { font-weight:700; }
        .sim-npm { font-size:1.15em; font-weight:800; text-align:center; margin-top:8px; padding:6px; border-radius:8px; }
        .npm-ok{background:#dcfce7;color:#166534} .npm-warn{background:#fef9c3;color:#854d0e} .npm-bad{background:#fee2e2;color:#991b1b}
        .slider-group { margin-bottom:14px; }
        .slider-group label { font-size:0.75em; font-weight:700; color:#555; display:flex; justify-content:space-between; }
        .slider-group label span { color:#ee4d2d; font-weight:800; }
        input[type=range] { width:100%; margin-top:5px; accent-color:#ee4d2d; }
        .reverse-box { background:#f8f4ff; border:1.5px solid #c4b5fd; border-radius:12px; padding:18px; }
        .reverse-result { background:#fff; border:2px solid #ee4d2d; border-radius:12px; padding:16px; text-align:center; margin-bottom:12px; }
        .big-price { font-size:2em; font-weight:800; color:#ee4d2d; }
        .result-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:12px; }
        .result-mini { background:#f8f8f8; border-radius:8px; padding:10px; text-align:center; }
        .result-mini span { font-size:0.68em; color:#888; text-transform:uppercase; font-weight:700; display:block; margin-bottom:3px; }
        .result-mini strong { font-size:0.9em; color:#333; }
        .history-list { list-style:none; padding:0; margin:0; }
        .history-item { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:8px; border:1px solid #eee; margin-bottom:8px; font-size:0.82em; background:#fff; }
        .history-badge { font-size:0.7em; padding:2px 8px; border-radius:12px; font-weight:700; }
        .h-ok{background:#dcfce7;color:#166534} .h-warn{background:#fef9c3;color:#854d0e} .h-bad{background:#fee2e2;color:#991b1b}
        @keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
        #btnUG:hover { opacity:0.88; transform:translateY(-1px); }
        .btn-sm { font-size:0.75em; background:#fff1f0; color:#d93025; border:1px solid #ffccc7; padding:4px 10px; border-radius:6px; cursor:pointer; }

        /* Rasio Keuangan Upload Boxes */
        .rk-upload-box { background:#fff; border:2px dashed #ddd; border-radius:12px; padding:14px 10px; text-align:center; cursor:pointer; transition:all 0.18s; display:flex; flex-direction:column; align-items:center; gap:4px; min-height:110px; justify-content:center; }
        .rk-upload-box:hover { border-color:#ee4d2d; background:#fff9f8; }
        .rk-upload-box.uploaded { border-color:#16a34a; background:#f0fdf4; border-style:solid; }
        .rk-upload-box.uploaded .rk-upload-icon { filter: none; }
        .rk-upload-icon { font-size:1.6em; margin-bottom:2px; }
        .rk-upload-label { font-size:0.78em; font-weight:800; color:#333; }
        .rk-upload-sub { font-size:0.65em; color:#888; font-weight:500; }
        .rk-upload-status { font-size:0.65em; font-weight:700; color:#bbb; margin-top:2px; }
        .rk-upload-box.uploaded .rk-upload-status { color:#16a34a; }

        /* Rasio tabel rows */
        .rk-row-header td { background:#fef9c3; color:#92400e; font-weight:800; font-size:0.8em; text-transform:uppercase; padding:7px 14px; letter-spacing:0.5px; }
        .rk-row-normal td { padding:8px 14px; border-bottom:1px solid #f5f5f5; color:#333; font-size:0.88em; }
        .rk-row-normal:hover td { background:#fafafa; }
        .rk-row-sub td { padding:6px 14px 6px 22px; border-bottom:1px solid #f9f9f9; color:#666; font-size:0.82em; }
        .rk-row-sub:hover td { background:#fafafa; }
        /* RASIO ADMIN — baris khusus, tegas, penting */
        .rk-row-admin-total td { background:#fff0f0; color:#1a1a1a; font-weight:800; font-size:0.95em; text-transform:uppercase; padding:10px 14px; letter-spacing:0.5px; border-top:2px solid #ef4444; border-bottom:1px solid #fca5a5; }
        .rk-admin-badge { display:inline-flex; align-items:center; gap:4px; background:#e5e7eb; border:1.5px solid #9ca3af; color:#111; font-weight:900; font-size:0.95em; padding:4px 10px; border-radius:2px; letter-spacing:0.3px; white-space:nowrap; }
        .rk-row-total td { padding:9px 14px; background:#fff5f2; font-weight:800; color:#1a1a2e; border-top:2px solid #ee4d2d; font-size:0.9em; }
        .rk-row-laba td { padding:10px 14px; font-weight:800; font-size:0.95em; }
        .rk-val-neg { color:#991b1b; }
        .rk-val-pos { color:#166534; }
        .rk-val-neutral { color:#333; }
        .rk-pct { font-size:0.82em; font-weight:800; padding:3px 9px; border-radius:5px; display:inline-block; min-width:58px; text-align:center; letter-spacing:0.2px; }
        .rk-pct-red { background:#fee2e2; color:#991b1b; }
        .rk-pct-yellow { background:#fef9c3; color:#854d0e; }
        .rk-pct-green { background:#dcfce7; color:#166534; }
        .rk-pct-blue { background:#dbeafe; color:#1d4ed8; }


        .md-field { margin-bottom:10px; }
        .md-field:last-child { margin-bottom:0; }
        .md-field label { display:block;font-size:0.68em;font-weight:700;color:#666;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:4px; }
        .md-field input { width:100%;padding:8px 10px;border:1.5px solid #e5e5e5;border-radius:8px;font-size:0.88em;font-weight:600;outline:none;box-sizing:border-box;transition:border-color 0.15s; }
        .md-field input:focus { border-color:#ee4d2d; }
        .hpp-row { border-bottom:1px solid #f0f0f0;transition:background 0.1s; }
        .hpp-row:hover { background:#fafafa; }
        .hpp-row:last-child { border-bottom:none; }
        .hpp-row td { padding:9px 14px;color:#333;vertical-align:middle; }
        .sku-chip { display:inline-block;background:#f0f4ff;color:#3730a3;border:1px solid #c7d2fe;padding:2px 8px;border-radius:5px;font-size:0.82em;font-weight:700;font-family:monospace; }
        .hpp-val { font-weight:800;color:#166534; }

        /* Rekap Tahunan */
        .rekap-th-metrik { background:#ee4d2d;color:#fff;padding:9px 14px;text-align:left;font-weight:800;font-size:0.82em;letter-spacing:0.5px;white-space:nowrap;min-width:180px;position:sticky;left:0;z-index:2; }
        .rekap-th-bulan  { background:#1a1a2e;color:#fff;padding:9px 14px;text-align:center;font-weight:800;font-size:0.8em;min-width:130px;white-space:nowrap; }
        .rekap-td-label  { padding:7px 14px;font-weight:700;color:#222;background:#fff;font-size:0.84em;white-space:nowrap;position:sticky;left:0;z-index:1;border-right:2px solid #f0f0f0; }
        .rekap-td-label.sub { font-weight:500;color:#666;padding-left:22px; }
        .rekap-td-label.header-row { background:#fef9c3;color:#92400e;font-weight:800;font-size:0.76em;text-transform:uppercase;letter-spacing:0.5px; }
        .rekap-td-input  { padding:4px 8px;text-align:right; }
        .rekap-td-input input { width:100%;border:1px solid transparent;border-radius:5px;padding:5px 8px;font-size:0.84em;font-weight:700;text-align:right;outline:none;background:transparent;transition:all 0.15s; }
        .rekap-td-input input:focus { border-color:#ee4d2d;background:#fff9f8; }
        .rekap-row-even td { background:#f8f8f8; }
        .rekap-row-even .rekap-td-label { background:#f8f8f8; }
        .rekap-row-odd  td { background:#fff; }
        .rekap-row-odd  .rekap-td-label { background:#fff; }
        .rekap-row-header td { background:#fef9c3; }
        .rekap-row-laba td  { background:#fff0f0;font-weight:800;color:#991b1b;border-top:2px solid #ef4444; }
        .rekap-row-laba.positif td { background:#f0fdf4;color:#166534;border-top:2px solid #22c55e; }
        .rekap-bulan-header { display:flex;align-items:center;justify-content:center;gap:6px; }
        .rekap-del-btn { background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;font-size:0.85em;padding:0 2px;line-height:1; }
        .rekap-del-btn:hover { color:#fff; }
    
        

        
        /* Tooltip when collapsed */
        .sidebar.collapsed .tab-btn[data-tooltip] {
            position: relative;
        }
        .sidebar.collapsed .tab-btn[data-tooltip]:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 68px;
            top: 50%;
            transform: translateY(-50%);
            background: #1a1a2e;
            color: #fff;
            padding: 5px 12px;
            border-radius: 8px;
            font-size: 0.75em;
            white-space: nowrap;
            z-index: 9999;
            box-shadow: 0 4px 14px rgba(0,0,0,0.22);
            pointer-events: none;
        }
        .sidebar.collapsed .tab-btn[data-tooltip]:hover::before {
            content: '';
            position: absolute;
            left: 62px;
            top: 50%;
            transform: translateY(-50%);
            border: 5px solid transparent;
            border-right-color: #1a1a2e;
            z-index: 9999;
        }


        
        /* ── FOOTER ─────────────────────────────── */
        .sidebar-footer { padding: 10px 10px 12px; background: #000; border-top: 1px solid rgba(255,255,255,0.08); display:flex; align-items:center; gap:8px; }
        .sidebar-footer-text { text-align: left; line-height: 1.4; flex:1; }
        .footer-v    { font-size: 0.65em; color: #34d399; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; display: block; }
        .footer-by   { font-size: 0.78em; color: rgba(255,255,255,0.6); font-weight: 500; letter-spacing: 0.5px; margin-bottom: 3px; display: block; }
        .footer-name { font-size: 1em; color: #fff; font-weight: 800; letter-spacing: 1px; display: block; }
        .sidebar.collapsed .sidebar-footer-text { display: none; }

        
        
        
        .sidebar-toggle-fixed svg { display: block; }

        
        /* Detail Biaya — spacing & typography improvements */
        .info-row + .info-row { border-top: 0px; }
        .section-divider { border: none; border-top: 1px solid #f0f0f0; margin: 8px 0; }
        .info-row .row-label { font-size: 0.86em; color: #444; }
        .info-row .row-value { font-size: 0.86em; font-weight: 600; }
        
        /* TOTAL ADMIN row — lebih tegas */
        .row-total-admin {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 700;
            color: #ee4d2d;
            border-top: 1.5px solid #f0f0f0;
            border-bottom: 1.5px solid #f0f0f0;
            padding: 8px 0;
            margin: 6px 0 8px;
            font-size: 0.87em;
        }
        
        /* Sub-rows Admin Pesanan, Biaya Layanan, etc — indent kiri */
        .info-row-sub {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.84em;
            align-items: center;
            padding-left: 10px;
            color: #555;
        }
        
        /* Uang Masuk Saldo — lebih bernapas */
        .row-uang-masuk {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 2px solid #eee;
            font-size: 0.88em;
            font-weight: 600;
        }
        
        /* Note italic (saldo iklan, ditanggung seller) */
        .row-note-italic {
            font-size: 0.72em;
            color: #6b7280;
            font-style: italic;
            margin: -5px 0 7px 2px;
            line-height: 1.4;
        }
        .row-note-italic.orange { color: #b45309; }

        
/* ════════════════════════════════════════════════
   MODAL TOKO — selalu di atas semua elemen
   ════════════════════════════════════════════════ */
#tokoModal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(0,0,0,0.75) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ── Pastikan app wrapper tidak buat stacking context ── */
.app-wrapper, .main-content, .tab-panel { isolation: auto !important; }

/* ══════════════════════════════════════════════════
   TOKO SWITCHER — Lazada vibes (v2)
   ══════════════════════════════════════════════════ */
.toko-switcher {
    margin: 0 10px 8px;
    position: relative;
}
.toko-switcher-inner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px 7px;
    background: #252525;
    border: 0.5px solid rgba(238,77,45,0.35);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.toko-switcher-inner:hover {
    background: #2a2a2a;
    border-color: rgba(238,77,45,0.6);
}
.toko-switcher-icon {
    width: 30px; height: 30px;
    background: #ee4d2d;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.toko-switcher-info { flex: 1; min-width: 0; }
.toko-switcher-label {
    font-size: 9px; font-weight: 600;
    color: rgba(255,255,255,0.38);
    letter-spacing: 1.3px; text-transform: uppercase;
    margin-bottom: 1px;
}
.toko-switcher-nama {
    font-size: 13px; font-weight: 600;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toko-switcher-chevron { flex-shrink: 0; transition: transform 0.2s; }
.toko-switcher-chevron.open { transform: rotate(180deg); }
.toko-switcher-hint {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; color: rgba(255,255,255,0.28);
    padding: 4px 4px 0;
}

/* ── DROPDOWN ──────────────────────────────────── */
.toko-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #1e1e1e;
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    z-index: 999999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    overflow: hidden;
}
.toko-dropdown.open { display: block; }
.toko-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 12px 10px;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
}
.toko-dropdown-title { font-size: 12px; font-weight: 600; color: #fff; }
.toko-dropdown-sub { font-size: 10px; color: rgba(255,255,255,0.38); margin-top: 1px; }
.toko-dropdown-close {
    width: 22px; height: 22px;
    background: rgba(255,255,255,0.07);
    border: none; border-radius: 5px;
    color: rgba(255,255,255,0.45);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.toko-dropdown-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.toko-dropdown-list { padding: 6px; max-height: 200px; overflow-y: auto; }
.toko-dropdown-loading { font-size: 11px; color: rgba(255,255,255,0.35); padding: 8px 6px; }

/* Item toko */
.toko-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 8px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 4px;
    border: 0.5px solid transparent;
}
.toko-item:last-child { margin-bottom: 0; }
.toko-item:hover { background: rgba(255,255,255,0.06); }
.toko-item.active {
    background: rgba(238,77,45,0.1);
    border-color: rgba(238,77,45,0.3);
}
.toko-item-icon {
    width: 32px; height: 32px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.toko-item.active .toko-item-icon { background: #ee4d2d; }
.toko-item:not(.active) .toko-item-icon { background: rgba(255,255,255,0.07); }
.toko-item-info { flex: 1; min-width: 0; }
.toko-item-nama { font-size: 12px; font-weight: 600; color: #fff; }
.toko-item:not(.active) .toko-item-nama { color: rgba(255,255,255,0.75); }
.toko-item-desc { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }
.toko-item-badge {
    font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
    background: #ee4d2d; color: #fff;
    padding: 2px 6px; border-radius: 4px; text-transform: uppercase; flex-shrink: 0;
}
.toko-item-arrow { flex-shrink: 0; opacity: 0.3; }

/* Footer */
.toko-dropdown-footer {
    padding: 6px;
    border-top: 0.5px solid rgba(255,255,255,0.06);
}
.toko-dropdown-add {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 8px;
    border: 0.5px dashed rgba(255,255,255,0.12);
    border-radius: 7px;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
}
.toko-dropdown-add:hover { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.6); }
.toko-dropdown-addinput {
    display: flex; gap: 5px; padding: 6px 2px 0;
}
.toko-dropdown-addinput input {
    flex: 1; background: rgba(255,255,255,0.07);
    border: 0.5px solid rgba(255,255,255,0.12); border-radius: 6px;
    color: #fff; font-size: 11px; padding: 6px 8px; outline: none;
}
.toko-dropdown-addinput input:focus { border-color: #ee4d2d; }
.toko-dropdown-addinput button {
    background: #ee4d2d; color: #fff; border: none;
    border-radius: 6px; padding: 6px 10px;
    font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.toko-dropdown-addinput button:hover { background: #d94428; }

/* Kelola button */
.toko-dropdown-kelola {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: rgba(255,255,255,0.45);
    font-size: 11px; cursor: pointer;
    transition: all 0.12s; white-space: nowrap;
    flex-shrink: 0;
}
.toko-dropdown-kelola:hover { border-color: rgba(255,255,255,0.25); color: #fff; }

/* Mode kelola — tombol hapus di tiap item */
.toko-item-hapus {
    width: 22px; height: 22px;
    background: rgba(248,113,113,0.1);
    border: 0.5px solid rgba(248,113,113,0.25);
    border-radius: 5px; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.12s;
}
.toko-item-hapus:hover { background: rgba(248,113,113,0.25); }
.kelola-mode .toko-item-hapus { display: flex; }
.kelola-mode .toko-item-arrow,
.kelola-mode .toko-item-badge { display: none; }

/* ── Master Data Toko — Daftar Toko ── */
.md-toko-item {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 8px; border-radius: 7px;
    border: 0.5px solid #f0f0f0;
    transition: background 0.1s;
}
.md-toko-item.active {
    background: rgba(238,77,45,0.07);
    border-color: rgba(238,77,45,0.25);
}
.md-toko-item:hover { background: #fafafa; }
.md-toko-item.active:hover { background: rgba(238,77,45,0.1); }

.md-toko-icon {
    width: 22px; height: 22px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.md-toko-item.active .md-toko-icon { background: #ee4d2d; }
.md-toko-item:not(.active) .md-toko-icon { background: #f0f0f0; }

.md-toko-nama {
    flex: 1; font-size: 12px; font-weight: 600; color: #1a1a2e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-toko-item:not(.active) .md-toko-nama { color: #555; }

.md-toko-input {
    flex: 1; font-size: 12px; font-weight: 600;
    border: 1.5px solid #ee4d2d; border-radius: 5px;
    padding: 2px 6px; outline: none; color: #1a1a2e;
    text-transform: uppercase;
}

.md-toko-aksi { display: flex; gap: 3px; flex-shrink: 0; }
.md-toko-btn-edit, .md-toko-btn-del {
    width: 22px; height: 22px; border-radius: 5px;
    border: 0.5px solid #e0e0e0; background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #888; transition: all 0.12s;
}
.md-toko-btn-edit:hover { border-color: #3730a3; color: #3730a3; background: #f0f0ff; }
.md-toko-btn-del:hover  { border-color: #ef4444; background: #fff0f0; }

/* md-toko-item editing state */
.md-toko-item.editing {
    background: #fff7f5;
    border-color: #ee4d2d !important;
    box-shadow: 0 0 0 2px rgba(238,77,45,0.1);
}
.md-toko-item.editing .md-toko-nama { color: #ee4d2d !important; }
.md-toko-item { cursor: pointer; }

/* ── Master Data Toko — Dropdown Selector ── */
.md-toko-dd-item {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 10px; cursor: pointer;
    border-bottom: 0.5px solid #f5f5f5;
    transition: background 0.1s;
}
.md-toko-dd-item:last-child { border-bottom: none; }
.md-toko-dd-item:hover { background: #fafafa; }
.md-toko-dd-item.selected { background: #fff7f5; }
.md-toko-dd-icon {
    width: 20px; height: 20px; border-radius: 5px;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.md-toko-dd-icon.aktif { background: #ee4d2d; }

/* Dropdown overlay agar tidak dorong konten bawah */
#mdTokoDropdown {
    position: absolute !important;
    left: 0 !important; right: 0 !important;
    top: calc(100% + 4px) !important;
    z-index: 9999 !important;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
/* Pastikan blok toko punya position relative */
#mdTokoSelector {
    position: relative;
}
/* Wrapper blok toko */
.md-toko-selector-wrap {
    position: relative;
}
/* mdSettingWrap tidak perlu margin extra karena dropdown absolute */
#mdSettingWrap { margin-top: 0; }
