/* =====================================================================
   BAHAMAS OPERATIONAL SYSTEM v2.0 - COMPLETE MASTER STYLE SHEET
   ===================================================================== */

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

:root {
    /* Theme Core Colors (Dark Purple Cyberpunk) */
    --bg-main: #0c0817;
    --bg-gradient: linear-gradient(135deg, #0c0817 0%, #160f29 100%);
    --bg-sidebar: #090512;
    
    /* Translucent Glassmorphism Elements */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.07);
    
    /* Typography Palette */
    --text-main: #ffffff;
    --text-muted: #8a82a5;
    --text-faint: #554e6c;

    /* Bahamas System Identity Colors */
    --accent-pink: #e91e63;
    --accent-pink-hover: #c2185b;
    --accent-cyan: #00bcd4;
    --accent-gold: #ffb300;
    --accent-green: #2ecc71;
    --accent-danger: #e74c3c;
    --accent-hold: #9b59b6;
}

/* =====================================================================
   1. STYLES DASAR & RESET DEFAULT BROWSER
   ===================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Custom Scrollbar Premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-pink);
}

/* Styling Tabel Elegan */
table tbody tr { transition: background 0.2s; }
table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

/* Mini Stats Bar */
.mini-stat-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.mini-stat { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 12px; border: 1px solid var(--glass-border); text-align: center; }
.mini-stat .val { font-size: 1.2rem; font-weight: 700; color: var(--accent-pink); }
.mini-stat .label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); }

/* =====================================================================
   2. TATA LETAK UTAMA (APP SHELL ARCHITECTURE)
   ===================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.brand-mark {
    background: var(--accent-pink);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.4);
}

.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item .ic {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    display: inline-block;
}

.nav-item:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(233, 30, 99, 0.12);
    color: var(--text-main);
    font-weight: 600;
    border-left: 3px solid var(--accent-pink);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
}

.logout-item {
    color: var(--text-muted);
}

.logout-item:hover {
    background: rgba(231, 76, 60, 0.12) !important;
    color: var(--accent-danger) !important;
}

/* Main Area & Content Layout */
.main-area {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 75px;
    background: rgba(12, 8, 23, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #a55eea, #4b7bec);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.content-area {
    padding: 30px;
    flex: 1;
}

/* Responsive Hamburger Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

/* Grid Stock Box (Penyelamat Tampilan) */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.stock-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    transition: 0.2s;
}
.stock-name { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; }
.stock-value { font-size: 1.1rem; font-weight: 700; color: #ffffff; }

/* =====================================================================
   3. KARTU VISUAL & GRID UTILITIES (GLASSMORPHISM CARDS)
   ===================================================================== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
    position: relative;
}

.glass-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* Grid Layouts */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Dashboard Statistics Cards */
.stat-card {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 110px;
}

.stat-accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.accent-pink-bar   { background: var(--accent-pink); box-shadow: 3px 0 12px rgba(233,30,99,0.4); }
.accent-gold-bar   { background: var(--accent-gold); box-shadow: 3px 0 12px rgba(255,179,0,0.4); }
.accent-cyan-bar   { background: var(--accent-cyan); box-shadow: 3px 0 12px rgba(0,188,212,0.4); }
.accent-green-bar  { background: var(--accent-green); box-shadow: 3px 0 12px rgba(46,204,113,0.4); }

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* =====================================================================
   4. INPUT DAN FORMULIR OPERASIONAL (FORM CONTROLS)
   ===================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label, label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-control, .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: rgba(233, 30, 99, 0.6);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.25);
    background: rgba(0, 0, 0, 0.45);
}

/* Fix dropdown options container styling background */
.form-group select option, select option {
    background: #140e26;
    color: #ffffff;
}

/* =====================================================================
   5. ARSITEKTUR TABEL REKONSILIASI (RESPONSIVE TABLES)
   ===================================================================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 5px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 550px; /* Menjamin kolom tidak gepeng atau bertumpuk */
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.01);
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* =====================================================================
   6. TOMBOL AKSES SISTEM (BUTTON DESIGN SYSTEM)
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
    outline: none;
}

.btn-primary, .btn-primary-full, .btn-primary-block {
    background: var(--accent-pink);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}
.btn-primary:hover, .btn-primary-full:hover, .btn-primary-block:hover {
    background: var(--accent-pink-hover);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.5);
}

.btn-danger {
    background: rgba(231, 76, 60, 0.12);
    color: var(--accent-danger);
    border: 1px solid rgba(231, 76, 60, 0.25);
}
.btn-danger:hover {
    background: var(--accent-danger);
    color: #ffffff;
}

.btn-success {
    background: rgba(46, 204, 113, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(46, 204, 113, 0.25);
}
.btn-success:hover {
    background: var(--accent-green);
    color: #ffffff;
}

.btn-gold {
    background: rgba(255, 179, 0, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 179, 0, 0.25);
}
.btn-gold:hover {
    background: var(--accent-gold);
    color: #0c0817;
}

.btn-block { width: 100%; padding: 12px; border-radius: 10px; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 6px; font-weight: 500; }

/* =====================================================================
   7. BADGES & TRANSACTIONS VISUAL STATUS (CONSOLIDATED)
   ===================================================================== */

/* Base Badge Style */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border: 1px solid transparent;
}

/* Transaction Status */
.badge-taken, .badge-hold { 
    background: rgba(0, 188, 212, 0.15); 
    color: var(--accent-cyan); 
    border-color: rgba(0, 188, 212, 0.3); 
}

.badge-sale, .badge-done { 
    background: rgba(46, 204, 113, 0.15); 
    color: var(--accent-green); 
    border-color: rgba(46, 204, 113, 0.3); 
}

.badge-return { 
    background: rgba(255, 179, 0, 0.15); 
    color: var(--accent-gold); 
    border-color: rgba(255, 179, 0, 0.3); 
}

.badge-cancelled, .badge-voided { 
    background: rgba(255, 255, 255, 0.05); 
    color: var(--text-muted); 
    border-color: rgba(255, 255, 255, 0.15); 
}

/* User & Role Status */
.badge-role { 
    background: rgba(0, 188, 212, 0.12); 
    color: var(--accent-cyan); 
    border-color: rgba(0, 188, 212, 0.2); 
}

.badge-aktif { 
    background: rgba(46, 204, 113, 0.12); 
    color: var(--accent-green); 
    border-color: rgba(46, 204, 113, 0.2); 
}

.badge-nonaktif { 
    background: rgba(231, 76, 60, 0.12); 
    color: var(--accent-danger); 
    border-color: rgba(231, 76, 60, 0.2); 
}

/* =====================================================================
   8. SISTEM UTILITY & ALERT FLASH NOTIFICATIONS
   ===================================================================== */
.text-faint { color: var(--text-muted); font-size: 0.8rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.flash {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}
.flash-sukses {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--accent-green);
}
.flash-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--accent-danger);
}

/* Kulkas Live Stock Pulse Warning Effect (< 98% Durability) */
@keyframes warningPulse {
    0% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.2); border-color: rgba(255,255,255,0.08); }
    50% { box-shadow: 0 0 15px rgba(231, 76, 60, 0.45); border-color: rgba(231, 76, 60, 0.5); }
    100% { box-shadow: 0 0 5px rgba(231, 76, 60, 0.2); border-color: rgba(255,255,255,0.08); }
}
.blink-warning {
    animation: warningPulse 2s infinite ease-in-out;
}


/* =====================================================================
   9. RESPONSIVE MEDIA QUERIES (BREAKPOINTS)
   ===================================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-area {
        margin-left: 0;
    }
    .hamburger {
        display: flex;
    }
    .topbar {
        padding: 0 20px;
    }
    .content-area {
        padding: 20px;
    }
}

/* Layout Kartu Statistik yang proporsional */
.stat-card-premium {
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s;
}

.stat-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.value-gagah {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

/* Styling Khusus Week Picker biar Gagah & Keliatan */
.week-picker-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-pink); /* Border pink supaya stand out */
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.week-picker-wrapper:hover {
    background: rgba(233, 30, 99, 0.1);
}

.week-picker-wrapper input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    width: 140px; /* Lebar pas buat week */
}

input[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}