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

:root {
    --primary: #00BFFF;
    --primary-bg: rgba(0, 191, 255, 0.1);
    --dark-text: #1e293b;
    --light-text: #64748b;
    --border-color: #cbd5e1;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    display: flex;
    min-height: 100vh;
    color: var(--dark-text);
}

/* --- SIDEBAR & LAYOUT (Desktop) --- */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    z-index: 1000;
    transition: 0.3s ease;
}

.logo {
    padding: 30px;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    display: flex; align-items: center; gap: 10px;
}

.menu { flex: 1; list-style: none; padding: 0 15px; margin: 0; overflow-y: auto; }
.menu-label { font-size: 11px; font-weight: 700; color: #94a3b8; margin: 20px 10px 10px; text-transform: uppercase; }
.menu li a { display: flex; align-items: center; padding: 12px 15px; color: var(--light-text); text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 10px; margin-bottom: 5px; }
.menu li a i { width: 25px; font-size: 18px; }
.menu li a:hover, .menu li a.active { background: var(--primary-bg); color: var(--primary); }

.user-panel { padding: 20px; background: #ffffff; border-top: 1px solid #e2e8f0; }
.user-info-card { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 10px; background: #f8fafc; border-radius: 12px; }
.user-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.user-text { overflow: hidden; }
.user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

/* --- MOBILE SPECIFIC UI (Overlay & Toggle) --- */
/* Lớp phủ màn hình (Overlay) */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-overlay.active { display: block; opacity: 1; }

/* Nút mở menu (Hamburger) */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px; right: 15px;
    z-index: 998;
    background: #fff;
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 20px;
    transition: 0.2s;
}
.mobile-toggle:active { transform: scale(0.95); }

/* Nút đóng menu bên trong Sidebar */
.close-sidebar-btn {
    display: none;
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    color: #ff4757;
    border: 1px solid #ff4757;
    width: 35px; height: 35px;
    border-radius: 8px;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.close-sidebar-btn:hover { background: #ff4757; color: #fff; }

/* --- BUTTONS --- */
.btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.2s; border: none; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #009acd; box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3); }
.btn-outline { border: 1px solid var(--border-color); color: var(--dark-text); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f0f9ff; }
.btn-primary-soft { background: var(--primary-bg); color: var(--primary); }
.btn-danger-soft { background: rgba(255, 71, 87, 0.1); color: #ff4757; }

/* --- MAIN CONTENT --- */
.main-content { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); padding: 40px; }

/* --- ADMIN DASHBOARD & SETTINGS STYLES --- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; }

.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    display: flex; align-items: center; gap: 10px;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--dark-text); }
.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--dark-text);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
textarea.form-control { min-height: 100px; resize: vertical; }

.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col-6 { width: 50%; padding: 0 10px; }
.col-12 { width: 100%; padding: 0 10px; }
.form-text { font-size: 12px; color: var(--light-text); margin-top: 5px; }

/* --- TABLE STYLES --- */
.table-responsive { overflow-x: auto; width: 100%; }
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table-custom th {
    background-color: #f8fafc; color: #64748b; font-weight: 600; text-transform: uppercase;
    font-size: 12px; padding: 15px 20px; text-align: left; border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.table-custom td { padding: 15px 20px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; color: #1e293b; transition: background 0.2s; }
.table-custom tbody tr:hover td { background-color: #f0f9ff; }

.table-avatar {
    width: 40px !important; height: 40px !important; min-width: 40px;
    border-radius: 50%; object-fit: cover; vertical-align: middle;
    margin-right: 12px; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- BADGES --- */
.badge { padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; display: inline-block; }
.badge-active { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-pending { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge-admin { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* --- MODAL --- */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto;
    background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
}
.modal-content {
    background-color: #fefefe; margin: 5% auto; padding: 0;
    border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%; max-width: 500px; animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn { from {transform: translateY(-50px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }
.modal-header { padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 700; color: #333; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px; border-top: 1px solid #eee; text-align: right; background: #f9fafb; border-radius: 0 0 12px 12px; }
.close-modal { color: #aaa; font-size: 24px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: #000; }

/* --- SEARCH & PAGINATION --- */
.search-box { position: relative; max-width: 300px; }
.search-box input { padding-left: 40px; border-radius: 20px; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }

.pagination { display: flex; gap: 5px; margin-top: 20px; justify-content: flex-end; }
.page-link {
    padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none;
    color: var(--dark-text); font-size: 13px; font-weight: 500; background: #fff; transition: 0.2s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); background: #f0f9ff; }
.page-link.disabled { opacity: 0.5; pointer-events: none; background: #f8fafc; }

/* --- RESPONSIVE MEDIA QUERIES (Updated) --- */
@media (max-width: 768px) {
    /* Sidebar trượt từ trái sang */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 5px 0 25px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    .sidebar.active { transform: translateX(0); }
    
    /* Hiện các nút mobile */
    .mobile-toggle { display: block; }
    .close-sidebar-btn { display: flex; }
    
    /* Điều chỉnh Main Content */
    .main-content {
        margin-left: 0; width: 100%;
        padding: 70px 20px 20px 20px; /* Tăng padding-top để tránh bị nút toggle che */
    }
    
    /* Form Grid trên mobile */
    .col-6 { width: 100%; }
    
    /* Logo căn chỉnh */
    .logo { padding-right: 60px; }
}