/* ===== Admin Dashboard CSS ===== */
:root {
    --primary: #F4845F;
    --primary-dark: #E06B42;
    --teal: #2A9D8F;
    --bg-dark: #1A2E35;
    --bg-sidebar: #15262B;
    --bg-main: #F4F7F8;
    --bg-card: #FFFFFF;
    --text-dark: #2D4A53;
    --text-muted: #7A9BA5;
    --border: #E2E8EA;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --radius-md: 10px;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-dark);
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--bg-dark);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
    transition: 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dark);
}

.btn-danger {
    background: #E63946;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-main), #EAEFF1);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.login-card h2 {
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-main);
}

.login-card .btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: white;
    padding: 2px;
}

.sidebar-header h3 {
    color: white;
    font-size: 1.2rem;
}

.sidebar-nav {
    padding: 1.5rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #A0B2B8;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary);
}

.nav-item .icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.page-title h2 {
    font-size: 1.2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--teal);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Content Body */
.content-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid var(--border);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admissions-icon {
    background: #FFF0EB;
    color: var(--primary);
}

.queries-icon {
    background: #E8F6F4;
    color: var(--teal);
}

.new-icon {
    background: #FFF3D6;
    color: #F9A826;
}

.stat-details h3 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-container.full-height {
    min-height: 500px;
}

.section-header,
.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3,
.table-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table th {
    background: #F8FAFB;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #F8FAFB;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Live Badge */
.live-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #E63946;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Badges in Tables */
.class-badge {
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.subject-badge {
    background: #E8F6F4;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Table cells */
.date-cell {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.message-cell {
    max-width: 250px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.meta-cell {
    max-width: 200px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scrollable tables */
.table-container {
    overflow-x: auto;
}

/* Accent links */
a[style*="color:var(--accent)"] {
    color: var(--teal) !important;
}

/* Topbar left */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Mobile Menu Button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1.4rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Sidebar Overlay - hidden by default */
.sidebar-overlay {
    display: none;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

    /* Show hamburger menu */
    .mobile-menu-btn {
        display: block;
    }

    /* Sidebar: off-screen by default, slide in when .open */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    /* Dark overlay behind sidebar */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Dashboard fills full width */
    .dashboard-wrapper {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 0 1rem;
        height: 56px;
    }

    .page-title h2 {
        font-size: 1rem;
    }

    .user-name {
        display: none;
    }

    /* Content padding */
    .content-body {
        padding: 1rem;
    }

    /* Stats cards stack */
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-details h3 {
        font-size: 1.4rem;
    }

    /* Section headers */
    .section-header,
    .table-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    /* Table cells compact */
    .data-table th,
    .data-table td {
        padding: 0.6rem 0.8rem;
        font-size: 0.78rem;
    }

    .data-table th {
        font-size: 0.7rem;
    }

    /* Login responsive */
    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .topbar {
        height: 50px;
        padding: 0 0.75rem;
    }

    .page-title h2 {
        font-size: 0.9rem;
    }

    .content-body {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .notification-bell {
        display: none;
    }
}