/* ==================== COMMON STYLES ==================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=Pacifico&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #DC3245;
    --primary-gradient: linear-gradient(135deg, #DC3245 0%, #B71C1C 100%);
    --primary-soft: rgba(220, 50, 69, 0.1);
    --primary-dark: #B71C1C;
    --white: #ffffff;
    --black: #000000;

    /* Theme-aware Backgrounds (Premium Light Mode) */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.8);
    --sidebar-bg: rgba(255, 255, 255, 0.8);

    /* Theme-aware Text */
    --text-main: #1e293b;
    --text-dim: #64748b;
    --border-main: rgba(0, 0, 0, 0.06);

    /* Premium Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.03);
    --blur: blur(20px);

    /* Backgrounds */
    --light-bg: #f8f9fa;
    --dark-bg: #0f172a;

    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.08);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-full: 9999px;

    /* Semantic Colors */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --secondary-color: #3b82f6;
    --border-color: rgba(0, 0, 0, 0.08);
}

body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --header-bg: rgba(15, 23, 42, 0.95);
    --sidebar-bg: rgba(30, 41, 59, 0.6);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --border-main: rgba(255, 255, 255, 0.08);
    --white: #1e293b;
    --light-bg: #0f172a;
}

/* ==================== GLOBAL SIDEBAR COLLAPSE ==================== */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s ease, right 0.3s ease !important;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-mini-width) !important;
}

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .user-info {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
}

body.sidebar-collapsed .sidebar-logo-img {
    width: 45px !important;
    height: 45px !important;
    margin: 0 auto 15px !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    pointer-events: auto !important;
}

body.sidebar-collapsed .sidebar-header {
    padding: 15px 0 !important;
    flex-direction: column;
    justify-content: center;
    border-bottom: none;
    min-height: auto;
}

body.sidebar-collapsed .nav-item {
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 10px 15px !important;
    border-radius: 16px;
    width: 60px;
    height: 60px;
    min-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1.5px solid transparent;
    gap: 0 !important;
}

body.sidebar-collapsed .nav-item:hover {
    background: var(--white) !important;
    border-color: var(--primary-soft) !important;
    box-shadow: var(--shadow-sm) !important;
    transform: translateY(-2px) translateX(0) !important;
    color: var(--primary-color) !important;
}

/* Force icons to stay centered without horizontal shift */
body.sidebar-collapsed .nav-item i,
body.sidebar-collapsed .nav-item:hover i {
    transform: translateX(0) !important;
}

body.sidebar-collapsed .nav-item:hover i {
    transform: scale(1.1) translateX(0) !important;
}

body.sidebar-collapsed .sidebar-nav {
    padding: 20px 0 !important;
    align-items: center;
}

body.sidebar-collapsed .nav-item i {
    margin: 0 !important;
    font-size: 24px;
    width: auto;
    text-align: center;
}

body.sidebar-collapsed .nav-item.active {
    background: white !important;
    color: var(--primary-color) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid rgba(225, 29, 72, 0.1) !important;
    position: relative;
    transform: scale(1.05) translateX(0) !important;
}

body.sidebar-collapsed .nav-item.active:hover {
    transform: scale(1.05) translateY(-2px) translateX(0) !important;
}

body.sidebar-collapsed .nav-item:hover i {
    transform: scale(1.1) translateX(0) !important;
}

body.sidebar-collapsed .nav-item.active i {
    filter: drop-shadow(0 0 5px rgba(225, 29, 72, 0.3));
}

body.sidebar-collapsed .user-profile:hover {
    transform: translateY(-2px) translateX(0) !important;
}

body.sidebar-collapsed .user-profile {
    margin: 20px auto 10px !important;
    padding: 0 !important;
    width: 48px !important;
    height: 48px !important;
    justify-content: center !important;
    border: none !important;
    background: var(--primary-soft) !important;
}

body.sidebar-collapsed .user-info {
    display: none !important;
}

body.sidebar-collapsed .user-avatar {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    background: none !important;
    color: var(--primary-color) !important;
    border: 1.5px solid var(--primary-soft) !important;
}

body.sidebar-collapsed .main-content {
    margin-left: calc(var(--sidebar-mini-width) + 15px) !important;
    width: calc(100% - var(--sidebar-mini-width) - 30px) !important;
}

body {
    font-family: 'Outfit', 'Lexend', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== HEADER ==================== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 50, 69, 0.3);
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 50, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-primary.active,
.btn-outline-primary.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(220, 50, 69, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.card-body {
    color: var(--text-light);
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success {
    background: var(--success-color);
}

.notification-error {
    background: var(--danger-color);
}

.notification-info {
    background: var(--secondary-color);
}

.notification-warning {
    background: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    border: 1px solid var(--border-main);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 2px solid var(--border-main);
    color: var(--text-main);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(220, 50, 69, 0.1);
}

/* ==================== TABLE ==================== */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    color: var(--text-main);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(220, 50, 69, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

/* ==================== CASH DISPLAY & INFO ==================== */
.student-info {
    background: var(--light-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.student-info p {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.student-info p:last-child {
    margin-bottom: 0;
}

.student-info strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.student-info span {
    font-weight: 700;
    color: var(--text-primary);
}

.cash-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 32px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 10px 20px rgba(255, 215, 0, 0.2);
    margin: 10px 0;
}

.cash-display i {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ==================== GRID ==================== */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px 8px;
    }

    .site-title {
        font-size: 20px;
    }

    .card {
        padding: 20px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 10px;
    }
}

/* ==================== GLASSMORPHISM ==================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md) !important;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
}

/* ==================== PREMIUM LANGUAGE SELECTOR ==================== */
/* ==================== PREMIUM LANGUAGE SELECTOR V2 ==================== */
.floating-lang-container {
    position: fixed;
    z-index: 10000;
    transition: var(--transition);
    pointer-events: none;
    right: 20px;
    bottom: 20px;
}

.index-lang {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    right: auto;
    bottom: auto;
}

.index-lang .lang-dropdown-menu {
    left: 70px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
}

.index-lang .lang-dropdown-menu.show {
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 768px) {

    .floating-lang-container,
    .lang-pos-right,
    .index-lang {
        position: fixed !important;
        right: 15px !important;
        bottom: 15px !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
    }

    .index-lang .lang-dropdown-menu {
        bottom: 70px !important;
        top: auto !important;
        left: auto !important;
        right: 0 !important;
        transform: translateY(10px) !important;
    }

    .index-lang .lang-dropdown-menu.show {
        transform: translateY(0) !important;
    }
}

.premium-lang-selector {
    position: relative;
    user-select: none;
    pointer-events: auto;
}

/* Redesigned Trigger Button */
.selected-lang {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.navbar-scrolled .selected-lang {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.selected-lang:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.selected-lang img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.selected-lang:hover img {
    transform: scale(1.1);
}

.selected-lang span {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.selected-lang i {
    font-size: 10px;
    opacity: 0.8;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-lang-selector.active .selected-lang i {
    transform: rotate(180deg);
}

/* Enhanced Dropdown Menu */
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 20px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transform-origin: top right;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.lang-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.95);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 1);
    border-top: 1px solid rgba(255, 255, 255, 1);
    z-index: -1;
}

.lang-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
}

.lang-item:hover {
    background: rgba(220, 50, 69, 0.05);
    color: var(--primary-color);
    transform: scale(1.02);
}

.lang-item.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(220, 50, 69, 0.3);
}

.lang-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.lang-item.active img {
    border-color: rgba(255, 255, 255, 0.8);
}

/* Micro-animations */
@keyframes langPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 50, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 50, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 50, 69, 0);
    }
}

.lang-pulse {
    animation: langPulse 2s infinite;
}

.lang-item .name {
    font-size: 14px;
}

/* ==================== MICRO-ANIMATIONS ==================== */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-3px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--primary-soft);
}

.tap-active:active {
    transform: scale(0.95);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== PREMIUM CHAT UI ==================== */
.chat-wrapper,
.admin-chat-layout {
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.4) !important;
}

.chat-header {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.contact-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-online {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message.mine {
    align-self: flex-end;
}

.message.theirs {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 14px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.message.mine .message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.theirs .message-bubble {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-time {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

.chat-input-area {
    padding: 20px;
    background: white;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-input-area input {
    flex: 1;
    border: 2px solid #f0f0f0;
    border-radius: 25px;
    padding: 10px 20px;
    outline: none;
    transition: var(--transition);
}

.chat-input-area input:focus {
    border-color: var(--primary-color);
}

.btn-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-send:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 15px rgba(220, 50, 69, 0.3);
}

/* ==================== ADMIN CHAT SPECIFIC ==================== */
.admin-chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
}

.chat-sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
}

.chat-search {
    padding: 15px;
}

.chat-search input {
    width: 100%;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #eee;
    font-size: 13px;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.contact-item:hover {
    background: rgba(220, 50, 69, 0.05);
}

.contact-item.active {
    background: var(--primary-soft);
    border-right: 3px solid var(--primary-color);
}

.contact-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 15px;
}

.chat-welcome i {
    font-size: 60px;
    opacity: 0.2;
}

/* ==================== ATTENDANCE INDICATORS ==================== */
.attendance-matrix-container {
    overflow-x: auto;
    padding-bottom: 10px;
}

.attendance-matrix {
    display: flex;
    gap: 4px;
}

.student-history-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.history-day {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    cursor: help;
    transition: var(--transition);
}

.history-day.present {
    background: #4CAF50;
}

.history-day.absent {
    background: #F44336;
}

.history-day.late {
    background: #FF9800;
}

.history-day.excused {
    background: #2196F3;
}

.history-day.empty {
    background: #f0f0f0;
    color: #ccc;
}

.history-day:hover {
    transform: scale(1.15);
    z-index: 10;
}

/* ==================== RESPONSIVE CHAT ==================== */
@media (max-width: 800px) {
    .admin-chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
        /* In simple mobile view, hide sidebar when chat is open or vice versa */
    }
}

/* ==================== MOBILE SHORTCUTS TRIGGER & OVERLAY ==================== */
.mobile-nav-controls {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.mobile-shortcuts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.mobile-shortcuts-btn:active {
    transform: scale(0.9);
}

.shortcuts-overlay-menu {
    position: fixed;
    top: 80px;
    /* Adjust based on header height */
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1100;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shortcuts-overlay-menu.show {
    display: flex;
}

.shortcuts-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 5px;
}

.shortcuts-overlay-header h3 {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.context-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.context-pill i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.context-pill:active {
    background: #f1f5f9;
}

.context-pill.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.context-pill.active i {
    color: white;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1800px) {
    .mobile-nav-controls {
        display: flex;
    }

    #sidebar-teachers-container,
    #sidebar-groups-container {
        display: none !important;
    }
}

.animate-fade-in {
    animation: fadeInScale 0.4s ease forwards;
}

/* Branch Footer Card (Sidebar bottom) */
.branch-footer-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 15px;
    border: 1px solid rgba(220, 50, 69, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.branch-footer-card:hover {
    box-shadow: 0 8px 25px rgba(220, 50, 69, 0.1);
    transform: translateY(-2px);
    border-color: rgba(220, 50, 69, 0.3);
}

.branch-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

.branch-card-header i:first-child {
    color: var(--primary-color);
    font-size: 18px;
}

.branch-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.branch-card-body .label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.branch-card-body select {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #f1f5f9;
    background: #f8fafc;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23DC3245'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.branch-card-body select option {
    padding: 12px;
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 8px;
}

.branch-card-body select option:hover,
.branch-card-body select option:checked {
    background: var(--primary-soft);
    color: var(--primary-color);
}

/* Sidebar structure */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.user-profile-switcher {
    width: 100%;
    margin-top: auto;
    padding: 15px 10px 15px;
    background: transparent;
    flex-shrink: 0;
}

.user-profile {
    margin-top: auto;
    padding: 15px 10px 15px;
    flex-shrink: 0;
}

.branch-card-body select:hover {
    border-color: var(--primary-color);
    background-color: #fff;
}

.branch-card-body select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Sidebar collapsed state */
body.sidebar-collapsed .branch-footer-card {
    padding: 12px;
}

body.sidebar-collapsed .branch-card-header span,
body.sidebar-collapsed .branch-card-body {
    display: none;
}

body.sidebar-collapsed .branch-card-header {
    margin-bottom: 0;
    justify-content: center;
}

/* Compact Branch Switcher (Header) */
.branch-compact-switcher {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    z-index: 10;
}

.branch-info-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s var(--transition);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.branch-info-pill i:first-child {
    color: var(--primary-color);
    font-size: 16px;
}

.branch-info-pill i.fa-chevron-down {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.branch-current-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-compact-switcher select.branch-select-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    appearance: none;
}

.branch-compact-switcher:hover .branch-info-pill {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px var(--primary-soft);
    transform: translateY(-2px);
}

.rotate-icon {
    animation: rotate 4s linear infinite;
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Header Switcher Position */
#headerBranchSwitcher {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
}

.page-header>div {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    #headerBranchSwitcher {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }

    .page-header>div {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Show only icon when sidebar is collapsed */
body.sidebar-collapsed .branch-compact-switcher .branch-current-name,
body.sidebar-collapsed .branch-compact-switcher i:last-child {
    display: none;
}

body.sidebar-collapsed .branch-info-pill {
    padding: 8px;
    justify-content: center;
}