/* ============================================================
 * STYLESHEET DASHBOARD ADMIN MODERN
 * Warna Utama: #2563EB (Royal Blue)
 * Warna Sekunder: #0EA5E9 (Sky Blue)
 * Warna Latar Belakang: #F8FAFC (Soft Grey Blue)
 * Font: Poppins
 * ============================================================ */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --secondary: #0EA5E9;
    --secondary-hover: #0284C7;
    --bg-body: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 70px;
    --transition-speed: 0.3s;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ============================================================
 * KONTAINER LAYOUT & SIDEBAR
 * ============================================================ */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #FFFFFF;
    color: var(--text-main);
    border-right: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease-in-out;
    z-index: 1000;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

#sidebar.collapsed {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

#sidebar .sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #FFFFFF;
}

#sidebar .sidebar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

#sidebar .sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

#sidebar.collapsed .sidebar-brand span,
#sidebar.collapsed .sidebar-brand .brand-text {
    display: none;
}

#sidebar ul.components {
    padding: 1.5rem 0.75rem;
    list-style: none;
}

#sidebar ul li {
    margin-bottom: 0.35rem;
}

#sidebar ul li a {
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    white-space: nowrap;
}

#sidebar ul li a i {
    font-size: 1.2rem;
    min-width: 1.5rem;
    text-align: center;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 600;
}

#sidebar.collapsed ul li a span {
    display: none;
}

/* ============================================================
 * KONTEN UTAMA & NAVBAR
 * ============================================================ */
#content {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: all var(--transition-speed) ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

.main-navbar {
    height: var(--navbar-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.navbar-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* ============================================================
 * KARTU & WIDGET STATISTIK
 * ============================================================ */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(37, 99, 235, 0.3);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-icon.primary { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.stat-icon.secondary { background: rgba(14, 165, 233, 0.1); color: var(--secondary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.stat-details h6 {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-details h3 {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0;
}

/* Kartu Kontainer Grafik/Chart */
.chart-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.chart-card:hover {
    box-shadow: var(--card-shadow-hover);
}

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

.chart-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ============================================================
 * TABEL & KONTROL FORM
 * ============================================================ */
.custom-table-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-responsive {
    margin: 0;
}

.table {
    margin-bottom: 0;
    color: var(--text-main);
    vertical-align: middle;
}

.table thead th {
    background: #F1F5F9;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.2rem;
}

.table tbody td {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Paginasi & Badge */
.badge-status {
    padding: 0.35em 0.75em;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-status.completed { background: #D1FAE5; color: #065F46; }
.badge-status.pending { background: #FEF3C7; color: #92400E; }
.badge-status.processing { background: #E0F2FE; color: #075985; }
.badge-status.cancelled { background: #FEE2E2; color: #991B1B; }

/* Tombol Kustom */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    border-radius: 8px;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
}

/* Styling Modal */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================================
 * GAYA HALAMAN LOGIN
 * ============================================================ */
.login-body {
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-brand h4 {
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

/* ============================================================
 * BREAKPOINT RESPONSIF
 * ============================================================ */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.mobile-show {
        margin-left: 0;
    }
    #content {
        margin-left: 0 !important;
    }
}
