/* ==========================================================================
   LEXUNA DIGITAL MULTIMEDIA - ADMIN DASHBOARD STYLE
   ========================================================================== */

/* --- 1. CSS VARIABLES (Tema & Warna) --- */
:root {
    /* Color Palette */
    --primary-color: #4361ee;
    --primary-hover: #3a53d0;
    --secondary-color: #3f3f46;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Background & Surface */
    --bg-body: #f4f7fe;
    --bg-surface: #ffffff;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    
    /* Text Colors */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Layout & Shadow */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --border-radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

/* --- 2. RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 15px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- 3. LAYOUT MAIN WRAPPER --- */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Cegah flex item melebihi container */
    transition: all var(--transition-speed) ease;
}

/* --- 4. SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease;
    z-index: 1000;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 20px;
}

.brand-logo {
    max-height: 40px;
    max-width: 100%;
}

.sidebar-menu {
    padding: 20px 0;
    overflow-y: auto;
}

.menu-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    padding: 10px 25px;
    margin-top: 10px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.sidebar-menu li a i {
    width: 25px;
    font-size: 18px;
    text-align: center;
    margin-right: 15px;
}

.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 21px; /* Mengurangi padding karena border */
}

/* Sidebar Collapsed State (Dikendalikan oleh JS) */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand img {
    display: none; /* Logo disembunyikan saat collapse, bisa diganti logo ikon */
}

.sidebar.collapsed .sidebar-menu li a span,
.sidebar.collapsed .menu-title {
    display: none;
}

/* --- 5. HEADER --- */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.btn-toggle:hover {
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    padding: 8px 15px;
    border-radius: 20px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    margin-left: 10px;
    width: 250px;
    font-size: 14px;
}

.notifications {
    position: relative;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-profile .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

/* --- 6. MAIN CONTENT & WIDGETS --- */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 5px;
}

.content-header p {
    color: var(--text-muted);
}

/* Grid System untuk Widget */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.widget-card {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease;
}

.widget-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.widget-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.widget-icon.primary { background: rgba(67, 97, 238, 0.1); color: var(--primary-color); }
.widget-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.widget-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.widget-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); }

.widget-info h3 {
    font-size: 22px;
    margin-bottom: 5px;
}

.widget-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- 7. KOTAK KONTEN (CARD) & TABEL --- */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.btn-sm {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: var(--primary-hover);
}

.card-body {
    padding: 25px;
    overflow-x: auto; /* Agar tabel bisa digeser di HP */
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.status-badge.pending { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }

/* --- 8. FOOTER --- */
.main-footer {
    background: var(--bg-surface);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    color: var(--text-muted);
}

.main-footer strong {
    color: var(--primary-color);
}

.footer-links a {
    margin-left: 15px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* --- 9. RESPONSIVE DESIGN (MOBILE & TABLET) --- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        left: -260px; /* Sembunyikan default di tablet/mobile */
    }
    
    .sidebar.active {
        left: 0; /* Muncul saat di-toggle via JS */
    }
    
    .search-bar input {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .search-bar {
        display: none; /* Sembunyikan search bar di layar sangat kecil */
    }
    
    .main-footer {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
}