* {
    box-sizing: border-box;
}

/* ================= ROOT ================= */
:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --input-bg: #334155;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --sidebar-width: 260px;
}

/* ================= BASE ================= */
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden; /* 🔥 penting biar tidak geser */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================= AUTH ================= */
.auth-container {
    width: 100%;
    max-width: 450px;
    margin: auto;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h3 { font-weight: 700; margin-bottom: 0.5rem; font-size: 1.75rem; }
.auth-header p { color: var(--text-muted); font-size: 0.95rem; }

.btn-auth {
    width: 100%;
    background: var(--primary);
    border: none;
    padding: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-top: 1rem;
}
.btn-auth:hover { background: var(--primary-hover); transform: translateY(-2px); }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ================= LAYOUT ================= */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid #334155;
    padding: 25px 15px;
    position: fixed;
    height: 100vh;
    z-index: 2000;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    background-color: var(--bg-dark);
    overflow-x: hidden;
}

/* 🔥 NAV */
.sidebar .nav-link {
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: 0.3s;
}
.sidebar .nav-link i { width: 30px; }

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* ================= CARD ================= */
.stat-card,
.service-card {
    background: var(--card-bg) !important;
    border: 1px solid #334155 !important;
    border-radius: 16px;
    padding: 20px;
}

/* ================= FORM ================= */
.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    background: var(--input-bg) !important;
    border: 1px solid #475569 !important;
    color: #ffffff !important;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none;
    background: #1e293b;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Autofill fix */
input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset;
}

/* ================= ALERT ================= */
.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid transparent;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border-color: var(--error);
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: var(--success);
}

/* ================= UTIL ================= */
.text-muted { color: #cbd5e1 !important; }
.stat-card p { color: #e2e8f0 !important; }

/* ================= TABLE FIX ================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 700px;
}

.table-responsive th,
.table-responsive td {
    white-space: nowrap;
}

.table {
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: transparent !important;
}

.table-hover tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* ================= MOBILE FIX ================= */
@media (max-width: 992px) {

    /* sidebar hidden */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* 🔥 FIX: hamburger bisa diklik */
    .main-content {
        margin-left: 0;
        padding: 20px;
        position: relative;
        z-index: 1;
    }

    /* 🔥 overlay jangan block klik */
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 1500;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* kecilin padding auth */
    .auth-card {
        padding: 1.5rem;
    }
}

/* ================= EXTRA SMALL DEVICE ================= */
@media (max-width: 576px) {

    .main-content {
        padding: 15px;
    }

    .auth-container {
        padding: 10px;
    }

    .auth-card {
        padding: 1.2rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}