/* ========================================================
   ORACLE REDWOOD DESIGN SYSTEM - BASE (FIXED BY ZHANK)
   100% SINKRON DENGAN VARIABEL DASHBOARD, POS, & PRODUCTS
   ======================================================== */

:root {
    /* ðŸš€ FIX VARIABEL: Ditambahkan -- agar terbaca sempurna oleh fungsi var() di POS */
    --oracle-red: #C74634;
    --oracle-red-hover: #A83829;
    --oracle-red-light: rgba(199, 70, 52, 0.1);
    
    /* Neutrals & Backgrounds */
    --text-primary: #161513;
    --text-secondary: #5F5B57;
    --text-muted: #8A8580;
    --bg-primary: #ffffff;
    --bg-secondary: #f1efed;
    --bg-tertiary: #e8e6e3;
    
    /* Borders & Shadows (Oracle Signature) */
    --border-color: rgba(63, 58, 54, 0.2);
    --border-light: rgba(63, 58, 54, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.16);
    
    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Layout Engine */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oracle Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

a {
    color: var(--oracle-red);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--oracle-red-hover);
}

/* Typography Helpers */
.text-muted { color: var(--text-secondary); }
.text-red { color: var(--oracle-red); }
.fw-bold { font-weight: 700; }

/* Buttons Components (Oracle Style Spec) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--oracle-red);
    color: #ffffff;
    border-color: var(--oracle-red);
}

.btn-primary:hover {
    background-color: var(--oracle-red-hover);
    border-color: var(--oracle-red-hover);
    box-shadow: var(--shadow-md);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.btn-large, .btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-block {
    width: 100%;
}

/* Core Form Inputs Architecture */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--oracle-red);
    box-shadow: 0 0 0 3px var(--oracle-red-light);
}

/* Cards System Layout */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    box-sizing: border-box;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* System Alerts Feedback */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Master Structure Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* ========================================================
   🔥 SINKRONISASI MOBILE VIEW OVERRIDE ENGINE BY ZHANK
   DITARUH DI PALING BAWAH AGAR MENANG PRIORITAS OVERRIDE
   ======================================================== */

@media (max-width: 768px) {
    /* 1. Reset Sembunyikan default ke kiri luar layar HP */
    body aside.sidebar {
        position: fixed !important;
        top: 60px !important;
        left: -280px !important; /* Sembunyi total */
        width: 240px !important;
        height: calc(100vh - 60px) !important;
        z-index: 999999 !important;
        display: block !important;
        background: #ffffff !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none !important;
    }

    /* 2. Tarik paksa ke kanan nampil di HP pas class 'open' disuntik JS */
    body aside.sidebar.open {
        left: 0 !important;
        box-shadow: 4px 0 15px rgba(0,0,0,0.15) !important;
    }
    
    /* 3. Atur ulang lebar kontainer halaman agar simetris */
    body .main-wrapper {
        margin-left: 0 !important;
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box;
        overflow-x: hidden !important;
    }
    
    /* 4. Efek Blackout overlay buram di belakang menu HP */
    body:has(aside.sidebar.open)::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4) !important;
        z-index: 99998 !important;
        pointer-events: auto !important;
    }

    /* 5. Tweak Dropdown Logout Profil agar nampil presisi di HP */
    body .user-dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 12px !important;
        min-width: 150px !important;
        z-index: 1000000 !important;
    }
    body .user-dropdown.show {
        display: block !important;
    }
}