/* Admin Global Style - BGrade Analytics PRO (Master Suite Edition) */

:root {
    /* Day Mode (Default) */
    --bg-deep: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    --primary: #2563eb;
    --primary-light: rgba(37, 99, 235, 0.1);
    --accent: #3b82f6;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --sidebar-bg: #ffffff;
    --sidebar-text: #0f172a;
}

[data-theme="dark"] {
    /* Night Mode (Premium Dark) */
    --bg-deep: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-card: rgba(30, 41, 59, 0.8);
    --primary: #3b82f6;
    --primary-light: rgba(59, 130, 246, 0.1);
    --accent: #4e9fe5;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --sidebar-bg: rgba(15, 23, 42, 0.9);
    --sidebar-text: #ffffff;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* Sidebar Styling (Desktop) */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-dim);
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.logout-container {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #f87171;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: calc(100% - 280px);
}

/* Common Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

.page-header p {
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* Component: Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.stat-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

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

.stat-label {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

/* Component: Table Cards */
.table-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1.25rem 1rem;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-main);
}

tr:last-child td { border-bottom: none; }

/* Component: Filter Bars */
.filter-bar {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.form-group { flex: 1; min-width: 200px; }
.form-group label { display: block; margin-bottom: 0.75rem; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }

.input-field {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}
.input-field:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-light); }

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4); }

/* Component: Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.badge-mobile { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-desktop { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-tablet { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-active { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }

/* Component: Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.page-link {
    padding: 0.6rem 1.1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}
.page-link:hover, .page-link.active { background: var(--primary); border-color: var(--primary); color: white; }

/* Login Page UI */
.login-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    margin: 0;
}
.login-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    border-radius: 28px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-up { animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* Mobile Bottom Navigation (Fix for mobile view) */
@media (max-width: 1024px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: fixed; top: 0; padding: 1rem 1.5rem; flex-direction: row; justify-content: space-between; align-items: center; border-right: none; border-bottom: 1px solid var(--border); }
    .nav-list, .logout-container { display: none; }
    .main-content { width: 100%; padding: 6rem 1.25rem 6.5rem; }
    .nav-mobile-bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-panel); backdrop-filter: blur(25px); border-top: 1px solid var(--border); padding: 0.875rem 0.5rem; justify-content: space-around; z-index: 1000; }
    .nav-mobile-link { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; color: var(--text-dim); text-decoration: none; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
    .nav-mobile-link.active { color: var(--primary); }
    .nav-mobile-link i { font-size: 1.5rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

.nav-mobile-bottom { display: none; }
