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

:root {
    --primary-color: #0F52BA; 
    --primary-hover: #0B3E8C;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --primary-color: #3B82F6; 
    --primary-hover: #60A5FA;
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
    font-size: 0.85rem; /* Lebih kecil dan compact */
}

/* Corporate Card Container */
.glass-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Lebih kotak */
    box-shadow: var(--shadow-sm);
    padding: 1rem; /* Lebih compact */
    transition: box-shadow 0.3s ease;
}

.glass-container:hover {
    box-shadow: var(--shadow-md);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.4rem 0.75rem; /* Lebih compact */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Lebih kotak */
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem; /* Lebih compact */
    border: none;
    border-radius: 4px; /* Lebih kotak */
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-success { background: var(--secondary-color); color: white; }
.btn-success:hover { background: #0EA5E9; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-block { width: 100%; }

/* Layout (Sidebar & Main) */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    height: 100vh;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.nav-links {
    list-style: none;
}

.nav-header {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 0.5rem;
}

.nav-header:hover {
    background: rgba(0,0,0,0.03);
    color: var(--primary-color);
}

[data-theme="dark"] .nav-header:hover {
    background: rgba(255,255,255,0.05);
}

.submenu-icon {
    transition: transform 0.3s ease;
}

.nav-category.active .submenu-icon {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    padding-left: 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 0.4rem 1rem 0.4rem 2rem; /* Indented a bit */
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-links li a:hover, .nav-links li a.active {
    color: var(--primary-color);
    background: var(--bg-color);
    border-left: 4px solid var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 1rem 1.5rem; /* Thinner */
    overflow-y: auto;
    height: 100vh;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title h2 {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.15rem;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 4px; /* Lebih kotak */
}

.stat-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.6rem 0.75rem; /* Lebih compact */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-color);
}

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

/* Badges */
.badge {
    padding: 0.2rem 0.4rem;
    border-radius: 2px; /* Lebih kotak */
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-baru { background: #E0F2FE; color: #0284C7; }
.badge-proses { background: #FEF3C7; color: #D97706; }
.badge-selesai { background: #D1FAE5; color: #059669; }
.badge-batal { background: #FEE2E2; color: #DC2626; }

/* Mobile Menu & Responsiveness */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Hamburger overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .dashboard-layout { flex-direction: column; }
    
    /* Off-canvas Sidebar */
    .sidebar {
        position: fixed; 
        top: 0; 
        left: -280px; 
        width: 260px; 
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
    }

    /* Adjust main content padding */
    .main-content { 
        padding: 1rem; 
        width: 100%;
        height: 100vh;
        overflow-y: auto;
    }

    .top-header {
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    #mobile-menu-btn {
        display: block !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Force all inline grids to 1 column on mobile */
    [style*="display: grid"], [style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Fix table cut-offs by ensuring overflow */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
}

/* Map Container */
#map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    z-index: 1;
}

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
