/* 1. Reset & Base Styling */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #F1F5F9;
}

/* 2. Navigation Styling */
.nav-item {
    width: 100%; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 16px;
    border-radius: 16px; 
    color: #94a3b8; 
    font-weight: 700; 
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    cursor: pointer; 
    border: none; 
    background: transparent;
}

.nav-item:hover { 
    background: #1E293B; 
    color: white; 
    transform: translateX(5px); 
}

.nav-item i { width: 18px; height: 18px; }

.nav-item.active { 
    background: #4F46E5; 
    color: white; 
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3); 
}

/* 3. Utility Classes */
.role-admin .owner-only { display: none !important; }

.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }

/* 4. Card & Forms */
.glass-card {
    background: white; 
    border-radius: 28px; 
    border: 1px solid #F1F5F9;
    box-shadow: 0 4px 25px -5px rgba(0,0,0,0.02); 
    padding: 32px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-input {
    width: 100%; padding: 14px; border-radius: 14px; border: 1.5px solid #E2E8F0;
    background: #F8FAFC; outline: none; transition: all 0.2s; font-weight: 600;
}

.form-input:focus { 
    border-color: #4F46E5; 
    background: white; 
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); 
}

/* 5. Inventory & Interactive Elements */
.product-checkbox-wrapper {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}

.group:hover .product-checkbox-wrapper {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.product-checkbox:checked + .product-checkbox-wrapper,
.has-selected .product-checkbox-wrapper {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

tr.selected-row { background-color: #f0f4ff !important; }

/* 6. Table & Matrix */
.sticky-left {
    position: sticky;
    left: 0;
    z-index: 10;
    background: white;
}

tbody tr:nth-child(even) { background-color: #F8FAFC; }
tbody tr:hover { background-color: #EEF2FF; }
table { border-spacing: 0; width: 100%; }
th { white-space: nowrap; padding: 16px; font-weight: 800; text-transform: uppercase; font-size: 11px; color: #64748b; }
td { padding: 16px; }

/* 7. Tag System */
.tag-container {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px;
    min-height: 52px; background: #F8FAFC; border: 1.5px solid #E2E8F0;
    border-radius: 14px; transition: 0.2s; align-items: center;
}

.tag-container:focus-within { 
    border-color: #4F46E5; background: white; 
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.05);
}

.tag-item {
    background: #4F46E5; color: white; padding: 6px 12px; border-radius: 10px;
    display: flex; align-items: center; gap: 8px; font-size: 11px;
    font-weight: 800; letter-spacing: 0.5px; animation: zoomIn 0.2s ease-out;
}

.tag-item button { background: transparent; border: none; color: #C7D2FE; cursor: pointer; display: flex; }
.tag-item button:hover { color: white; }
.tag-input { border: none !important; background: transparent !important; flex: 1; min-width: 100px; outline: none !important; font-weight: 600; color: #1E293B; }

/* 8. Confirm Modal (Strong Style) */
.confirm-danger #confirm-icon-bg { color: #e11d48; background: #fff1f2; }
.confirm-danger #confirm-ok-btn { background: #e11d48; box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.4); }
.confirm-danger #confirm-ok-btn:hover { background: #be123c; }

.confirm-warning #confirm-icon-bg { color: #d97706; background: #fffbeb; }
.confirm-warning #confirm-ok-btn { background: #d97706; box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.4); }

.confirm-success #confirm-icon-bg { color: #059669; background: #ecfdf5; }
.confirm-success #confirm-ok-btn { background: #059669; box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.4); }

#confirm-ok-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* 9. Toast Notification (Strong & Fast Side-Slide) */
.toast-fixed {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    pointer-events: auto;
    background: #0f172a; /* Deep Slate */
    padding: 14px 22px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: toast-slide-in 0.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.toast-success { border-left: 6px solid #10b981; }
.toast-error { border-left: 6px solid #f43f5e; }
.toast-info { border-left: 6px solid #3b82f6; }

@keyframes toast-slide-in {
    0% { opacity: 0; transform: translateX(100%) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

.toast-slide-out {
    animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
    to { opacity: 0; transform: translateX(120%); }
}

/* 10. Generic Animations */
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-in {
    animation: fadeIn 0.4s ease-out fill-both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media print {
    /* Memaksa warna dan background muncul saat diprint */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Sembunyikan elemen navigasi dan tombol */
    aside, 
    .print\:hidden, 
    button, 
    .dash-filter-btn, 
    input[type="date"],
    #sidebar-toggle {
        display: none !important;
    }

    /* Atur layout agar memenuhi kertas */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    #content {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Pastikan kartu tetap memiliki border dan bayangan tipis */
    .glass-card {
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
        break-inside: avoid; /* Mencegah kartu terpotong antar halaman */
        margin-bottom: 20px !important;
    }

    /* Pastikan teks berwarna tetap muncul */
    .text-emerald-600 { color: #059669 !important; }
    .text-indigo-600 { color: #4f46e5 !important; }
    .bg-indigo-600 { background-color: #4f46e5 !important; }
    .bg-slate-800 { background-color: #1e293b !important; }
}

.dash-filter-btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #94a3b8;
    transition: all 0.2s;
}

.dash-filter-btn.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media print {
    aside, .print\:hidden, button, .dash-filter-btn, input[type="date"] {
        display: none !important;
    }
    body { background: white; }
    .glass-card { border: 1px solid #e2e8f0 !important; box-shadow: none !important; }
}
/* --- ANIMASI UNTUK DIAGRAM DASHBOARD "ALA-ALA" --- */

@keyframes barGrow {
    from { width: 0; }
    to { /* Width diset via inline style di JS */ }
}

.animate-bar-grow {
    animation: barGrow 1s ease-out forwards;
    transform-origin: left;
}

/* Penyesuaian agar Donut Chart "Ala-ala" terlihat rapi */
.conic-gradient-chart {
    /* Base circle is Green (Laba) */
    background: #10b981; 
    position: relative;
}

/* HPP Slice (Gray) */
.conic-gradient-chart::after {
    content: '';
    position: absolute;
    inset: -12px; /* sesuaikan tebal border */
    border-radius: 50%;
    /* Ini dihandle via inline style conic-gradient di JS */
}
