/* =============================================
   ADMIN PANEL CSS – Python Magique Super Admin
   ============================================= */

:root {
    --admin-primary: #5A9BFF;
    --admin-primary-dark: #3d7de8;
    --admin-secondary: #B983FF;
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-active: rgba(90, 155, 255, 0.15);
    --admin-bg: #f1f5f9;
    --admin-card-bg: #ffffff;
    --admin-text: #1e293b;
    --admin-muted: #64748b;
    --admin-border: #e2e8f0;
    --admin-danger: #ef4444;
    --admin-success: #22c55e;
    --admin-warning: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --radius: 14px;
    --sidebar-width: 260px;
    font-family: 'Nunito', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Nunito', sans-serif;
}

/* =============================================
   LOGIN SCREEN
   ============================================= */
.admin-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1a0533 100%);
    position: relative;
    overflow: hidden;
}

.admin-login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(90, 155, 255, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 70% 50%, rgba(185, 131, 255, 0.1) 0%, transparent 60%);
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 24px;
    width: 440px;
    max-width: 95%;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.login-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.login-card h1 {
    color: white;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1rem;
    margin-bottom: 35px;
}

.login-form {
    text-align: left;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 46px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s, background 0.2s;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-group input:focus {
    border-color: var(--admin-primary);
    background: rgba(90, 155, 255, 0.1);
}

.login-error {
    color: #ff8585;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 16px;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.back-to-site {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-to-site:hover {
    color: var(--admin-primary);
}

.login-hint {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

.login-hint code {
    color: var(--admin-primary);
    background: rgba(90, 155, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* =============================================
   ADMIN PANEL LAYOUT
   ============================================= */
.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--admin-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s;
    overflow-y: auto;
    scrollbar-width: none;
}

.admin-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo {
    font-size: 2rem;
}

.sidebar-title {
    color: white;
    font-weight: 900;
    font-size: 1.05rem;
}

.sidebar-subtitle {
    color: var(--admin-sidebar-text);
    font-size: 0.78rem;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-label {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 10px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--admin-sidebar-text);
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.96rem;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.sidebar-link.active {
    background: var(--admin-sidebar-active);
    color: var(--admin-primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--admin-primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.alert-badge {
    background: var(--admin-danger);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-logout {
    width: 100%;
    padding: 11px;
    background: rgba(239, 68, 68, 0.15);
    color: #ff8585;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-back-site {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--admin-sidebar-text);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-back-site:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* MAIN CONTENT */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOP BAR */
.admin-topbar {
    background: var(--admin-card-bg);
    border-bottom: 1px solid var(--admin-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--admin-muted);
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--admin-bg);
}

.breadcrumb {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--admin-text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-time {
    font-size: 0.9rem;
    color: var(--admin-muted);
    font-weight: 600;
}

.admin-avatar {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-secondary));
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
}

/* SECTIONS */
.admin-section {
    display: none;
    padding: 28px;
    flex: 1;
}

.admin-section.active-section {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--admin-primary);
}

.section-header p {
    color: var(--admin-muted);
    font-size: 1rem;
    margin-top: 4px;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--admin-card-bg);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-blue {
    border-color: #5A9BFF;
}

.stat-purple {
    border-color: #B983FF;
}

.stat-green {
    border-color: #22c55e;
}

.stat-orange {
    border-color: #f59e0b;
}

.stat-pink {
    border-color: #FF85B3;
}

.stat-teal {
    border-color: #45D09E;
}

.stat-gold {
    border-color: #FFE066;
}

.stat-silver {
    border-color: #c0c0c0;
}

.stat-bronze {
    border-color: #cd7f32;
}

.stat-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--admin-text);
    line-height: 1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--admin-muted);
    font-weight: 600;
    margin-top: 4px;
}

.stat-delta {
    font-size: 0.77rem;
    font-weight: 700;
    margin-top: 5px;
}

.stat-delta.up {
    color: var(--admin-success);
}

.stat-delta.neutral {
    color: var(--admin-muted);
}

.stat-delta.down {
    color: var(--admin-danger);
}

/* CHARTS */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--admin-card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--admin-text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card h3 i {
    color: var(--admin-primary);
}

/* ADMIN CARD */
.admin-card {
    background: var(--admin-card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.admin-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--admin-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card h3 i {
    color: var(--admin-primary);
}

/* BUTTONS */
.btn-admin-primary {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-dark));
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-admin-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-admin-secondary {
    background: var(--admin-bg);
    color: var(--admin-text);
    border: 1.5px solid var(--admin-border);
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-admin-secondary:hover {
    background: #e2e8f0;
}

.btn-admin-danger {
    background: linear-gradient(135deg, var(--admin-danger), #c42222);
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn-admin-danger:hover {
    opacity: 0.9;
}

/* TABLE */
.table-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--admin-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    color: var(--admin-text);
    background: var(--admin-card-bg);
    min-width: 200px;
}

.search-input:focus {
    border-color: var(--admin-primary);
}

.filter-select {
    padding: 10px 14px;
    border: 1.5px solid var(--admin-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    color: var(--admin-text);
    background: var(--admin-card-bg);
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.admin-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--admin-bg);
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--admin-border);
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
}

.user-avatar-cell {
    font-size: 1.6rem;
}

.role-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
}

.role-eleve {
    background: rgba(90, 155, 255, 0.12);
    color: var(--admin-primary);
}

.role-parent {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.role-admin {
    background: rgba(185, 131, 255, 0.12);
    color: #7c3aed;
}

.status-active {
    color: #22c55e;
    font-weight: 700;
    font-size: 0.85rem;
}

.status-blocked {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
}

.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-icon {
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 700;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 0.8;
}

.btn-edit {
    background: rgba(90, 155, 255, 0.1);
    color: var(--admin-primary);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--admin-danger);
}

.btn-block {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

/* ACTIVITY LIST */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    transition: background 0.15s;
}

.activity-item:hover {
    background: #f8fafc;
}

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.ai-blue {
    background: rgba(90, 155, 255, 0.12);
    color: var(--admin-primary);
}

.ai-green {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.ai-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.ai-red {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.ai-purple {
    background: rgba(185, 131, 255, 0.12);
    color: #7c3aed;
}

.activity-text {
    flex: 1;
    font-size: 0.92rem;
    color: var(--admin-text);
}

.activity-time {
    font-size: 0.78rem;
    color: var(--admin-muted);
    font-weight: 600;
}

/* COURSES GRID */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.course-admin-card {
    background: var(--admin-bg);
    border-radius: 12px;
    padding: 18px;
    border: 1.5px solid var(--admin-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.course-admin-card:hover {
    border-color: var(--admin-primary);
    box-shadow: var(--shadow-md);
}

.course-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.course-admin-level {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--admin-primary);
    background: rgba(90, 155, 255, 0.1);
    padding: 3px 10px;
    border-radius: 10px;
}

.course-admin-title {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
}

.course-admin-desc {
    font-size: 0.85rem;
    color: var(--admin-muted);
    margin-bottom: 14px;
}

.course-admin-footer {
    display: flex;
    gap: 8px;
}

/* EXERCISES */
.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exercise-admin-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1.5px solid var(--admin-border);
    border-radius: 12px;
    transition: border-color 0.2s;
}

.exercise-admin-item:hover {
    border-color: var(--admin-primary);
}

.exercise-num {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--admin-primary);
    min-width: 30px;
}

.exercise-info {
    flex: 1;
}

.exercise-title {
    font-weight: 800;
    font-size: 0.98rem;
    margin-bottom: 3px;
}

.exercise-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(90, 155, 255, 0.1);
    color: var(--admin-primary);
}

/* MINI-GAMES GRID */
.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-mg-card {
    background: var(--admin-card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--admin-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-mg-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.admin-mg-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.admin-mg-title {
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: 6px;
}

.admin-mg-level {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--admin-primary);
    background: rgba(90, 155, 255, 0.1);
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 12px;
}

.admin-mg-points {
    font-size: 0.85rem;
    color: var(--admin-muted);
    margin-bottom: 16px;
}

.admin-mg-actions {
    display: flex;
    gap: 8px;
}

/* LOG */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 340px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    font-size: 0.87rem;
}

.log-icon {
    font-size: 1rem;
}

.log-text {
    flex: 1;
    color: var(--admin-text);
}

.log-time {
    font-size: 0.76rem;
    color: var(--admin-muted);
    white-space: nowrap;
}

/* SECURITY ACTIONS */
.security-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* NOTIFICATIONS */
.notif-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 460px;
    overflow-y: auto;
}

.notif-item {
    padding: 14px;
    border-radius: 10px;
    border: 1.5px solid var(--admin-border);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.notif-item:hover {
    border-color: var(--admin-primary);
}

.notif-item-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.notif-item-message {
    color: var(--admin-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.notif-item-meta {
    font-size: 0.75rem;
    color: var(--admin-muted);
    display: flex;
    gap: 10px;
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--admin-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--admin-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    color: var(--admin-text);
    background: var(--admin-card-bg);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--admin-primary);
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-row label:first-child {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--admin-text);
    text-transform: none;
    letter-spacing: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--admin-primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

/* SETTINGS */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* MODAL */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.admin-modal-content {
    background: var(--admin-card-bg);
    border-radius: var(--radius);
    padding: 30px;
    width: 460px;
    max-width: 95%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.admin-modal-content h3 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* TOAST */
.admin-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e293b;
    color: white;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 2000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* RANKING ADMIN */
#ranking-admin-tbody .rank-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(90, 155, 255, 0.1);
    color: var(--admin-primary);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .notif-layout,
    .security-actions,
    .stats-grid-3 {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}