:root {
    --sidebar-width: 240px;
    --sidebar-shrink: 80px;
}

#mainContent {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}
body.sidebar-shrinked #mainContent {
    margin-left: var(--sidebar-shrink);
}

/* ============================================
   PPIApps - Modern iOS Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-color);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* Animated Background */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.bg-blob:nth-child(1) {
    width: 400px;
    height: 400px;
    background: #a5b4fc;
    top: -100px;
    left: -100px;
}

.bg-blob:nth-child(2) {
    width: 300px;
    height: 300px;
    background: #fbcfe8;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.bg-blob:nth-child(3) {
    width: 250px;
    height: 250px;
    background: #bfdbfe;
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-nav {
    background: rgb(255 255 255 / 26%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    border-radius: 25px;
}

.glass-card {
    background: rgb(255 255 255 / 50%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border-radius: 25px;
    transition: all var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* Sidebar */
#sidebar {
    box-shadow: 0px 0px 40px 30px #fafafa9e;
    z-index: 50 !important;
}

.sidebar {
    transition: all var(--transition);
    width: var(--sidebar-width);
}

.sidebar.shrink {
    width: var(--sidebar-shrink);
}

.sidebar.shrink .sidebar-item {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar.shrink .sidebar-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 auto !important;
}

.sidebar.shrink .sidebar-text {
    display: none;
}

.sidebar.shrink .app-logo {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
}

.sidebar.shrink .app-logo svg {
    width: 24px !important;
    height: 24px !important;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateX(4px);
}

.sidebar-item.active:hover {
    background: var(--primary-color);
    color: white;
}

.sidebar-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Form Elements */
.input-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 10px 16px;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 2px 2px 2px #00000012;
}

.input-glass:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* App Logo */
.app-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        box-shadow: 0px 0px 40px 30px #fafafa9e;
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        max-height: 100vh !important;
    }
    
    #sidebar.show {
        left: 0 !important;
    }
    
    #mainContent {
        margin-left: 0 !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 280px;
        width: calc(100% - 280px);
        height: 100%;
        background: rgb(255 255 255 / 50%);
        z-index: 40;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.show {
        display: block !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* Logout button hover */


/* Logout button hover - text merah */
.sidebar-item.logout:hover {
    background: none !important;
    color: #ff0000 !important;
    transform: translateX(4px);
}


/* Table row hover */
table tbody tr:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, transparent) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Tombol aksi hover */
button:hover, a:hover {
    transition: all 0.2s ease;
}

.bg-blue-50:hover {
    background: #dbeafe !important;
}

.bg-red-50:hover {
    background: #fee2e2 !important;
}

/* Menu induk dropdown hover */
.sidebar-item[onclick^="toggleDropdown"]:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateX(4px);
}

.sidebar-item[onclick^="toggleDropdown"]:hover svg {
    color: white !important;
}

/* Menu anak dropdown hover */
#produkDropdown .sidebar-item:hover,
#laporanDropdown .sidebar-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}


/* Mobile: dropdown selalu terbuka */
@media (max-width: 768px) {
    #produkDropdown,
    #laporanDropdown {
        display: block !important;
    }
    
    #produkDropdown.hidden,
    #laporanDropdown.hidden {
        display: block !important;
    }
}


/* User profile sticky di bawah sidebar */
#sidebar {
    display: flex;
    flex-direction: column;
}

#sidebar nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#sidebar .border-t.border-white\/50.pt-4 {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: rgb(255 255 255 / 80%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgb(255 255 255 / 50%);
    padding: 12px 4px;
    z-index: 10;
}


/* Tombol aksi di tabel - sama tinggi */
button[class*="bg-blue-50"],
button[class*="bg-red-50"] {
    height: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

form.inline button[class*="bg-red-50"] {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
