/* Position language button as part of header actions group - organic button grouping */
.language-dropdown {
    position: fixed;
    top: 2.75rem;
    right: 15.5rem; /* Closer spacing for organic button group */
    z-index: 120;
}

/* Mobile language menu - hidden by default on desktop */
.mobile-language-menu {
    display: none;
}

/* Mobile responsive positioning - hide fixed dropdown on mobile, use header button instead */
@media (max-width: 768px) {
    .language-dropdown {
        display: none !important;
    }

    /* Mobile language menu - shows below header */
    .mobile-language-menu {
        display: none;
        position: fixed;
        top: 70px;
        right: 20px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid #e5e7eb;
        padding: 8px;
        z-index: 150;
        min-width: 140px;
    }

    .mobile-language-menu.open {
        display: block;
    }

    .mobile-language-menu .language-option {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 12px 16px;
        background: none;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        font-size: 15px;
        color: #111827;
        transition: background 0.15s ease;
    }

    .mobile-language-menu .language-option:active {
        background: #f3f4f6;
    }

    .mobile-language-menu .language-option.active {
        background: #ecfdf5;
        color: #059669;
    }
}

/* Adjust for larger screens to maintain consistent spacing */
@media (min-width: 1400px) {
    .language-dropdown {
        right: 17rem;
    }
}

/* Match language button height and style to other header buttons for cohesive look */
.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem; /* Match .btn padding for vertical alignment */
    border-radius: 0.625rem; /* Match .btn border-radius instead of pill shape */
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
    font-size: 0.9375rem; /* Match .btn font-size */
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* Match hover behavior with other header buttons */
.language-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.15);
    background: rgba(255, 255, 255, 1);
}
.language-button .caret { font-size: 0.75rem; opacity: 0.6; }
.language-menu { position: absolute; right: 0; margin-top: 0.5rem; min-width: 130px; border-radius: 0.75rem; border: 1px solid rgba(15, 23, 42, 0.08); background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,0.12); padding: 0.25rem; opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none; transition: opacity 120ms ease, transform 120ms ease; }
.language-dropdown.open .language-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.language-menu .language-option { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.75rem; background: none; border: none; border-radius: 0.5rem; cursor: pointer; font-weight: 600; color: #0f172a; }
.language-menu .language-option:hover { background: #f8fafc; }
.language-menu .language-option.active { background: #eef2ff; color: #4338ca; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: #f8fafc !important;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.logo-text {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: white !important;
    margin-bottom: 0.25rem;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Logo gradient styles */
.logo-text-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-image {
    filter: brightness(0) saturate(100%) invert(28%) sepia(95%) saturate(2842%) hue-rotate(238deg) brightness(95%) contrast(95%);
    transition: filter 0.3s ease;
}

.logo-image:hover {
    filter: brightness(0) saturate(100%) invert(28%) sepia(95%) saturate(3000%) hue-rotate(238deg) brightness(100%) contrast(100%);
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0.75rem;
    color: #cbd5e1;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.nav-item.active {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: white;
    font-weight: 600;
}

/* Dropdown Chevron Animation */
.dropdown-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.nav-item-with-dropdown.dropdown-open .dropdown-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Nav Dropdown */
.nav-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 0 0.5rem 0;
    border-radius: 0.5rem;
}

.nav-dropdown.open {
    max-height: 1200px;
    opacity: 1;
    overflow-y: auto;
}

.dropdown-item {
    padding: 0.875rem 1rem 0.875rem 3rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    min-height: 3.5rem;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding-left: 3.25rem;
}

.dropdown-item:hover::before {
    height: 70%;
}

.dropdown-item.selected {
    background: rgba(217, 119, 6, 0.15);
    color: #f59e0b;
    font-weight: 600;
}

.dropdown-item.selected::before {
    height: 70%;
}

.dropdown-item:first-child {
    margin-top: 0.5rem;
}

.dropdown-item:last-child {
    margin-bottom: 0.5rem;
}

.dropdown-item-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 0.25rem;
}

.dropdown-item:hover .dropdown-item-icon {
    opacity: 1;
    transform: translateX(2px);
}

.dropdown-item-text {
    flex: 1;
    font-weight: 500;
}

.nav-badge {
    margin-left: auto;
    background: #dc2626;
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

/* Content Sections */
.content-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.content-section.active {
    display: block;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Branch View Header */
.branch-view-header {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.branch-view-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.branch-view-name {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.branch-view-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.branch-view-meta {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.branch-view-contact {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* Branch Content Grid */
.branch-content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.branch-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.branch-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header-inline {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.card-title-inline {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Branch Coaches List */
.branch-coaches-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.branch-coach-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: 0.625rem;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}

.branch-coach-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.branch-coach-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.branch-coach-info {
    flex: 1;
    min-width: 0;
}

.branch-coach-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.125rem;
}

.branch-coach-meta {
    font-size: 0.8125rem;
    color: #64748b;
}

.branch-coach-count {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Branch Students List */
.branch-students-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-height: 380px;
    overflow-y: auto;
}

.branch-student-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    border-radius: 0.625rem;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}

.branch-student-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.branch-student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.branch-student-info {
    flex: 1;
    min-width: 0;
}

.branch-student-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.125rem;
    font-size: 0.875rem;
}

.branch-student-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.branch-student-level {
    background: #fef3c7;
    color: #92400e;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Branch Chart Container */
.branch-chart-container {
    position: relative;
    height: 280px;
    padding: 0.5rem 0;
}

/* Scrollbar for students list */
.branch-students-list::-webkit-scrollbar {
    width: 6px;
}

.branch-students-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.branch-students-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.branch-students-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.header-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgb(217 119 6 / 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(217 119 6 / 0.4);
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.stat-icon.green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.stat-icon.amber {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    color: #6b21a8;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Filters */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#attendanceCoachFilterGroup {
    display: flex !important;
    flex-direction: column !important;
}

.filter-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.filter-select {
    padding: 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: #1e293b;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #cbd5e1;
}

.filter-select:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgb(217 119 6 / 0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    width: 300px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9375rem;
    color: #1e293b;
}

.search-box input::placeholder {
    color: #94a3b8;
}

.table-wrapper {
    overflow-x: auto;
}

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

thead {
    background: #f8fafc;
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f8fafc;
}

td {
    padding: 1.25rem 1.5rem;
    font-size: 0.9375rem;
    color: #334155;
}

.student-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.student-name {
    font-weight: 600;
    color: #1e293b;
}

/* Clickable coach name in table */
.clickable-coach {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-coach:hover {
    transform: translateX(4px);
}

.clickable-coach:hover .student-name {
    color: #0d9488 !important;
    text-decoration-color: #14b8a6 !important;
}

.clickable-coach .student-avatar {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

/* Coach table avatar with photo support */
.coach-table-avatar {
    overflow: hidden;
    flex-shrink: 0;
}

.coach-table-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.level-badge {
    display: inline-flex;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.icon-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: scale(1.05);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 0.875rem;
    color: #64748b;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .content-section {
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-title {
        font-size: 1.5rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.875rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    th, td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .student-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .icon-button {
        width: 32px;
        height: 32px;
    }

    /* Branch View Mobile */
    .branch-view-header {
        padding: 1.5rem;
    }

    .branch-view-info {
        flex-direction: column;
    }

    .branch-view-icon {
        width: 56px;
        height: 56px;
    }

    .branch-content-grid {
        grid-template-columns: 1fr;
    }

    .branch-chart-container {
        height: 240px;
    }

    .branch-students-list {
        max-height: 300px;
    }
}

.language-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 120;
}

.language-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.language-icon {
    font-size: 1rem;
}

.language-code {
    letter-spacing: 0.08em;
}

/* App Access Management */
.app-access-section .section-subtitle {
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.95rem;
}

.app-access-subtitle {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.95rem;
}

.app-access-invite,
.app-access-users {
    margin-bottom: 2rem;
}

.app-access-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: end;
}

.app-access-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.app-access-form-group label {
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.app-access-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: start;
}

.app-access-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.app-access-message-success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.app-access-message-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.app-access-users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-access-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
}

.app-access-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-access-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-access-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-access-user-details h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.app-access-user-details p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.app-access-role-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
}

.app-access-role-admin {
    background: #fee2e2;
    color: #b91c1c;
}

.app-access-role-coach {
    background: #dbeafe;
    color: #2563eb;
}

.app-access-role-viewer {
    background: #f3f4f6;
    color: #475569;
}

.app-access-role-selector {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 140px;
}

.app-access-role-selector:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.app-access-role-selector:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.app-access-role-selector option {
    padding: 0.5rem;
    font-weight: 600;
}

.app-access-permission-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
}

.app-access-permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
}

.app-access-permission-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
}

.app-access-admin-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}

.app-access-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.app-access-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.app-access-toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #cbd5e1;
    transition: 0.3s ease;
}

.app-access-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #ffffff;
    transition: 0.3s ease;
}

.app-access-toggle input:checked + .app-access-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-access-toggle input:checked + .app-access-toggle-slider::before {
    transform: translateX(20px);
}

.app-access-toggle input:disabled + .app-access-toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

.app-access-submit .spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    animation: app-access-spin 0.75s linear infinite;
}

.app-access-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
}

@keyframes app-access-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 150;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 0.625rem;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.15);
    transition: all 0.2s;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    width: 24px;
    height: 24px;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-overlay {
        display: block;
    }

    /* Sidebar - hidden by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 110;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Main content - full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4.5rem; /* Space for mobile menu button */
    }

    /* Header adjustments */
    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Stats cards - stack on mobile */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Filters - stack on mobile */
    .filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    /* Search bar full width */
    .search-bar {
        width: 100%;
    }

    /* Table - responsive scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .students-table {
        min-width: 800px; /* Maintain table structure, scroll horizontally */
    }

    .students-table th,
    .students-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Action buttons - smaller on mobile */
    .action-btn {
        width: 32px;
        height: 32px;
        padding: 0.375rem;
    }

    .action-btn i {
        width: 16px;
        height: 16px;
    }

    /* Buttons - full width on mobile */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Language dropdown positioning */
    .language-dropdown {
        top: 1rem;
        right: 1rem;
        z-index: 140;
    }

    .language-button {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    /* Student info in table - adjust spacing */
    .student-info h3 {
        font-size: 0.9375rem;
    }

    .student-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    /* Status badges */
    .status-badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }

    /* App access form */
    .app-access-form {
        grid-template-columns: 1fr;
    }

    .app-access-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .app-access-user-card {
        padding: 1rem;
    }

    .app-access-permissions {
        gap: 0.75rem;
    }

    .app-access-permission-item {
        padding: 0.75rem;
    }

    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1.25rem;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Form groups in modals */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.875rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
        padding-top: 4rem;
    }

    .mobile-menu-toggle {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.625rem;
    }

    .mobile-menu-toggle i {
        width: 20px;
        height: 20px;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .students-table {
        min-width: 700px;
    }

    .students-table th,
    .students-table td {
        padding: 0.625rem 0.375rem;
        font-size: 0.8125rem;
    }

    .language-dropdown {
        top: 0.75rem;
        right: 0.75rem;
    }

    .language-button {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .modal-content {
        width: 100%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* ===================================
   Mobile Student Cards
   =================================== */

/* Hide mobile cards on desktop by default */
.mobile-student-cards {
    display: none;
}

/* Show mobile cards only on mobile/tablet */
@media (max-width: 768px) {
    .mobile-student-cards {
        display: block;
        padding: 0.5rem;
    }

    /* Hide desktop table on mobile */
    .students-table-wrapper {
        display: none;
    }
}

/* Mobile student card styling */
.mobile-student-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.mobile-card-info {
    flex: 1;
    min-width: 0;
}

.mobile-card-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.mobile-card-meta {
    font-size: 0.8125rem;
    color: #64748b;
}

.mobile-card-status {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    flex-shrink: 0;
}

.mobile-card-status.active {
    background: #dcfce7;
    color: #166534;
}

.mobile-card-status.frozen {
    background: #dbeafe;
    color: #1e40af;
}

.mobile-card-status.left {
    background: #fee2e2;
    color: #991b1b;
}

.mobile-card-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-card-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-card-detail-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.mobile-card-detail-value {
    font-size: 0.875rem;
    color: #0f172a;
    font-weight: 600;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-card-actions .icon-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    min-height: 44px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===================================
   COACH PERSONAL CARDS
   Differentiated from student cards with teal theme
   =================================== */

/* Coach card container */
.mobile-coach-card {
    background: #fff;
    border-radius: 0.875rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-coach-card:hover {
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.2);
}

/* Coach card header with avatar and name */
.mobile-coach-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

/* Coach avatar - Teal gradient */
.mobile-coach-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid rgba(20, 184, 166, 0.15);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}

.mobile-coach-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Coach info section */
.mobile-coach-info {
    flex: 1;
    min-width: 0;
}

/* Coach edit button on card */
.mobile-coach-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: #f0fdfa;
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: #14b8a6;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-coach-edit-btn:hover {
    background: #14b8a6;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.mobile-coach-edit-btn i,
.mobile-coach-edit-btn svg {
    width: 16px;
    height: 16px;
}

.mobile-coach-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: #0f172a;
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

/* Branch badge */
.mobile-coach-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    color: #0d9488;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.mobile-coach-branch-badge i {
    width: 12px;
    height: 12px;
}

/* Bio section */
.mobile-coach-bio {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stats row */
.mobile-coach-stats {
    display: flex;
    gap: 1rem;
    padding: 0.875rem 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 0.875rem;
}

.mobile-coach-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.mobile-coach-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
}

.mobile-coach-stat-label {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Contact info */
.mobile-coach-contacts {
    margin-bottom: 0.875rem;
}

.mobile-coach-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.375rem;
}

.mobile-coach-contact:last-child {
    margin-bottom: 0;
}

.mobile-coach-contact i {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

/* Social links container */
.mobile-coach-socials {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Social buttons base */
.mobile-coach-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    flex: 1;
    max-width: 140px;
}

.mobile-coach-social-btn i {
    width: 18px;
    height: 18px;
}

/* Instagram button - gradient */
.mobile-coach-social-btn.instagram {
    background: linear-gradient(135deg, #f9a8d4 0%, #c084fc 50%, #fb923c 100%);
    color: #fff;
}

.mobile-coach-social-btn.instagram:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.4);
}

/* WhatsApp button - green gradient */
.mobile-coach-social-btn.whatsapp {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.mobile-coach-social-btn.whatsapp:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Coach cards grid for desktop */
.coach-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}

/* Mobile responsive adjustments for coach cards */
@media (max-width: 768px) {
    .coach-cards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .mobile-coach-card {
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .mobile-coach-avatar {
        width: 52px;
        height: 52px;
        border-width: 2px;
        font-size: 1rem;
    }

    .mobile-coach-name {
        font-size: 1rem;
    }

    .mobile-coach-socials {
        justify-content: stretch;
    }

    .mobile-coach-social-btn {
        max-width: none;
    }
}

/* ===================================
   MOBILE-FIRST REDESIGN (Wise Style)
   =================================== */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 64px;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item.active {
    color: #059669;
}

.mobile-nav-item.active i {
    stroke-width: 2.5;
}

.mobile-nav-item i {
    width: 24px;
    height: 24px;
}

.mobile-nav-item span {
    white-space: nowrap;
}

/* Center FAB-style Add button */
.mobile-nav-item.add-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white !important;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin-top: -24px;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
    justify-content: center;
    padding: 0;
    flex-direction: row;
    gap: 0;
}

.mobile-nav-item.add-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.mobile-nav-item.add-btn i {
    width: 28px;
    height: 28px;
}

.mobile-nav-item.add-btn span {
    display: none;
}

/* Mobile Header - Wise Style */
/* Hidden by default on desktop */
.mobile-header {
    display: none !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.mobile-header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-icon-btn:active {
    transform: scale(0.95);
    background: #e5e7eb;
}

.mobile-icon-btn i {
    width: 20px;
    height: 20px;
}

/* Mobile Search Bar */
/* Hidden by default on desktop */
.mobile-search-container {
    display: none !important;
    padding: 0 20px 16px;
    background: #ffffff;
}

.mobile-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.mobile-search-box:focus-within {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.mobile-search-box i {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    flex-shrink: 0;
}

.mobile-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: #111827;
}

.mobile-search-box input::placeholder {
    color: #9ca3af;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 0 20px 16px;
    background: #f3f4f6;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: calc(100% - 40px);
}

.mobile-filter-toggle:active {
    background: #e5e7eb;
}

.mobile-filter-toggle i {
    width: 18px;
    height: 18px;
}

.mobile-filter-toggle .filter-count {
    background: #059669;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Mobile Section Title */
.mobile-section-title {
    display: none;
    padding: 24px 20px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Show mobile elements on mobile */
@media (max-width: 768px) {
    /* Fix horizontal overflow/dead space */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: block !important;
    }

    /* Show mobile header */
    .mobile-header {
        display: flex !important;
    }

    /* Show mobile search */
    .mobile-search-container {
        display: block !important;
    }

    /* Show mobile filter toggle */
    .mobile-filter-toggle {
        display: flex !important;
    }

    /* Show mobile section title */
    .mobile-section-title {
        display: block !important;
    }

    /* Hide desktop sidebar completely */
    .sidebar {
        display: none !important;
    }

    /* Hide desktop mobile menu toggle */
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Hide mobile overlay */
    .mobile-overlay {
        display: none !important;
    }

    /* Adjust main content for mobile */
    .main-content {
        margin-left: 0;
        padding: 0;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
    }

    /* Hide desktop header */
    .header {
        display: none;
    }

    /* Mobile Stats Grid - 2x2 Grid Layout (Wise Style) */
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 16px 20px !important;
        margin: 0 !important;
        overflow-x: visible !important;
        scroll-snap-type: none !important;
    }

    .stats-grid::-webkit-scrollbar {
        display: none;
    }

    .stat-card {
        flex: none;
        padding: 16px;
        border-radius: 14px;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        box-shadow: none;
    }

    .stat-card:hover {
        transform: none;
        box-shadow: none;
    }

    .stat-header {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .stat-icon i {
        width: 20px !important;
        height: 20px !important;
    }

    .stat-value {
        font-size: 28px;
        font-weight: 700;
        color: #111827;
        line-height: 1;
    }

    .stat-label {
        font-size: 13px;
        color: #6b7280;
        margin-top: 4px;
        font-weight: 500;
    }

    /* Hide desktop filters, show only when expanded */
    .filters {
        display: none;
        padding: 16px;
        background: #f9fafb;
        border-radius: 16px;
        margin: 0 20px 16px;
        border: none;
    }

    .filters.mobile-expanded {
        display: block;
    }

    .filters-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 15px;
        border: 1px solid #e5e7eb;
        background: #ffffff;
    }

    /* Mobile Table Container */
    .table-container {
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .table-header {
        display: none;
    }

    .table-wrapper {
        display: none;
    }

    /* Mobile Student Cards - Transaction Style */
    .mobile-student-cards {
        display: block;
        padding: 0;
    }

    .mobile-student-card {
        display: flex;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #f3f4f6;
        background: #ffffff;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
        cursor: pointer;
        transition: background 0.15s ease;
    }

    .mobile-student-card:active {
        background: #f9fafb;
    }

    .mobile-student-card:last-child {
        border-bottom: none;
    }

    .mobile-card-header {
        display: flex;
        align-items: center;
        gap: 0;
        margin-bottom: 0;
        flex: 1;
    }

    .mobile-card-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        margin-right: 16px;
        flex-shrink: 0;
        font-size: 16px;
    }

    .mobile-card-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-card-name {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-card-meta {
        font-size: 14px;
        color: #6b7280;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-card-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        margin-left: 12px;
    }

    .mobile-card-level {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
    }

    .mobile-card-status {
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        text-transform: capitalize;
    }

    .mobile-card-status.active {
        background: #dcfce7;
        color: #166534;
    }

    .mobile-card-status.frozen {
        background: #dbeafe;
        color: #1e40af;
    }

    .mobile-card-status.left {
        background: #fee2e2;
        color: #991b1b;
    }

    /* Hide card details and actions on mobile transaction style */
    .mobile-card-details,
    .mobile-card-actions {
        display: none;
    }

    /* Pagination on mobile */
    .pagination {
        padding: 16px 20px;
        border-top: none;
        justify-content: center;
    }

    .pagination-info {
        font-size: 14px;
        color: #6b7280;
    }

    /* Language dropdown mobile position */
    .language-dropdown {
        top: auto;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: 180;
    }

    /* Modal adjustments for mobile with bottom nav */
    .modal-content {
        max-height: calc(100vh - 100px);
        margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    /* ===================================
       MOBILE BRANCH SECTION REDESIGN
       Native mobile experience
       =================================== */

    /* Branch Header - Compact Card Style */
    .branch-view-header {
        margin: 0;
        padding: 16px 20px;
        border-radius: 0;
        box-shadow: none;
        background: #ffffff;
        border-bottom: 1px solid #f3f4f6;
    }

    .branch-view-info {
        flex-direction: column;
        gap: 16px;
    }

    .branch-view-name {
        gap: 14px;
    }

    .branch-view-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .branch-view-icon i {
        width: 26px !important;
        height: 26px !important;
    }

    #branchSection .header-title,
    #coachSection .header-title {
        font-size: 20px;
        font-weight: 700;
        color: #111827;
        margin: 0;
    }

    .branch-view-meta {
        font-size: 14px;
        color: #6b7280;
        margin-top: 2px;
    }

    /* Contact Items - Tappable Action Buttons */
    .branch-view-contact {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .contact-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        background: #f3f4f6;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
        transition: all 0.15s ease;
        text-decoration: none;
    }

    .contact-item:active {
        background: #e5e7eb;
        transform: scale(0.98);
    }

    .contact-item i {
        width: 18px !important;
        height: 18px !important;
        color: #059669;
    }

    /* Branch Stats - Inline 3-column Grid */
    #branchSection .stats-grid,
    #coachSection .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 16px 20px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    #branchSection .stat-card,
    #coachSection .stat-card {
        flex: none;
        padding: 14px;
        border-radius: 14px;
    }

    #branchSection .stat-value,
    #coachSection .stat-value {
        font-size: 24px;
    }

    #branchSection .stat-label,
    #coachSection .stat-label {
        font-size: 11px;
        line-height: 1.3;
    }

    /* Hide 4th stat card on mobile (avg level) - only show 3 key stats */
    #branchSection .stats-grid .stat-card:nth-child(4),
    #coachSection .stats-grid .stat-card:nth-child(4) {
        display: none;
    }

    /* Branch Content Grid - Stack vertically */
    .branch-content-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin-top: 0;
    }

    /* Branch Cards - Flat list style */
    .branch-card {
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: #ffffff;
        border-bottom: 8px solid #f3f4f6;
    }

    .branch-card:hover {
        transform: none;
        box-shadow: none;
    }

    .branch-card:last-child {
        border-bottom: none;
    }

    /* Card Headers - Section style */
    .card-header-inline {
        padding: 16px 20px;
        margin-bottom: 0;
        border-bottom: 1px solid #f3f4f6;
        background: #fafafa;
    }

    .card-title-inline {
        font-size: 14px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .card-title-inline i {
        width: 18px !important;
        height: 18px !important;
        color: #9ca3af;
    }

    /* Coaches List - Transaction style */
    .branch-coaches-list {
        padding: 0;
        gap: 0;
    }

    .branch-coach-item {
        padding: 16px 20px;
        margin: 0;
        border-radius: 0;
        background: #ffffff;
        border-bottom: 1px solid #f3f4f6;
    }

    .branch-coach-item:last-child {
        border-bottom: none;
    }

    .branch-coach-item:active {
        background: #f9fafb;
    }

    .branch-coach-item:hover {
        transform: none;
        background: #ffffff;
    }

    .branch-coach-avatar {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .branch-coach-info {
        flex: 1;
    }

    .branch-coach-name {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
    }

    .branch-coach-email {
        font-size: 14px;
        color: #6b7280;
        margin-top: 2px;
    }

    /* Hide charts on mobile - show simple list instead */
    .branch-chart-container {
        padding: 20px;
        min-height: auto;
    }

    .branch-chart-container canvas {
        max-height: 200px !important;
    }

    /* Students List in Branch */
    .branch-students-list {
        padding: 0;
    }

    .branch-student-item {
        padding: 16px 20px;
        border-bottom: 1px solid #f3f4f6;
    }

    .branch-student-item:last-child {
        border-bottom: none;
    }

    /* Coach section specific */
    #coachSection .branch-view-icon {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    }

    /* Add chevron indicator for clickable items */
    .branch-coach-item::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid #d1d5db;
        border-bottom: 2px solid #d1d5db;
        transform: rotate(-45deg);
        margin-left: auto;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .mobile-nav-item {
        padding: 8px 8px;
        min-width: 56px;
        font-size: 10px;
    }

    .mobile-nav-item.add-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        margin-top: -20px;
    }

    .mobile-nav-item.add-btn i {
        width: 24px;
        height: 24px;
    }

    .stat-card {
        flex: 0 0 120px;
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .mobile-header-title {
        font-size: 24px;
    }
}

/* iOS Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .main-content {
            padding-bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }
}

/* ============================================
   ATTENDANCE TRACKING STYLES
   ============================================ */

/* Toggle Switch - Generic reusable style */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 20px;
    background: #cbd5e1;
    transition: 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #ffffff;
    transition: 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Attendance Calendar Table */
.attendance-calendar {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.attendance-calendar th,
.attendance-calendar td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.attendance-calendar th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    color: #475569;
    position: sticky;
    top: 0;
    z-index: 10;
}

.attendance-calendar th.student-name-header {
    text-align: left;
    min-width: 180px;
    position: sticky;
    left: 0;
    background: #f1f5f9;
    z-index: 20;
}

.attendance-calendar td.student-name-cell {
    text-align: left;
    font-weight: 500;
    color: #1e293b;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 5;
    border-right: 2px solid #e2e8f0;
}

.attendance-calendar td.date-cell {
    min-width: 36px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.attendance-calendar td.date-cell:hover {
    background: #f1f5f9;
    transform: scale(1.05);
}

.attendance-calendar td.weekend {
    background: #fef3c7;
}

.attendance-calendar th.weekend {
    background: #fef3c7;
}

/* Attendance status cells */
.attendance-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.attendance-cell:hover {
    transform: scale(1.1);
}

.attendance-cell.present {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.attendance-cell.absent {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.attendance-cell.late {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.attendance-cell.excused {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #93c5fd;
}

.attendance-cell.no_homework {
    background: #fef3c7;
    color: #ca8a04;
    border: 1px solid #fde047;
}

.attendance-cell.empty {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

/* Attendance Checkbox Cell - New simplified design */
.attendance-checkbox-cell {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.attendance-checkbox-cell:hover {
    background-color: #f1f5f9;
}

.attendance-checkbox {
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.attendance-checkbox:hover {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.attendance-checkbox.checked {
    background: #22c55e;
    border-color: #22c55e;
}

.attendance-checkbox.checked svg {
    width: 16px;
    height: 16px;
    color: white;
}

.attendance-checkbox svg {
    width: 16px;
    height: 16px;
}

/* ====================================
   ATTENDANCE MODE SELECTOR
   ==================================== */

.attendance-mode-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
}

.attendance-mode-selector label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #475569;
}

.attendance-mode-buttons {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.attendance-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.attendance-mode-btn:hover {
    background: #f8fafc;
    color: #475569;
}

.attendance-mode-btn svg {
    width: 16px;
    height: 16px;
}

/* Active state for Present mode */
.attendance-mode-btn#attendanceModePresent.active {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Active state for Excused mode */
.attendance-mode-btn#attendanceModeExcused.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Active state for Absent mode */
.attendance-mode-btn#attendanceModeAbsent.active {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Active state for No Homework mode */
.attendance-mode-btn#attendanceModeNoHomework.active {
    background: #eab308;
    color: white;
    border-color: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}

/* ====================================
   ATTENDANCE CHECKBOX STATUS STATES
   ==================================== */

/* Excused status - Blue checkmark */
.attendance-checkbox.excused {
    background: #3b82f6;
    border-color: #3b82f6;
}

.attendance-checkbox.excused:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Absent status - Red X */
.attendance-checkbox.absent {
    background: #ef4444;
    border-color: #ef4444;
}

.attendance-checkbox.absent:hover {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* No Homework status - Yellow book */
.attendance-checkbox.no_homework {
    background: #eab308;
    border-color: #eab308;
}

.attendance-checkbox.no_homework:hover {
    border-color: #eab308;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}

.attendance-checkbox.excused svg,
.attendance-checkbox.absent svg,
.attendance-checkbox.no_homework svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* ====================================
   MOBILE RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .attendance-mode-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .attendance-mode-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .attendance-mode-btn {
        flex: 1;
        justify-content: center;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Hide text labels on mobile, show only icons */
    .attendance-mode-btn span {
        display: none;
    }
}

/* Student header cell styling */
.attendance-student-header {
    text-align: left !important;
    min-width: 180px;
    position: sticky;
    left: 0;
    background: #f8fafc;
    z-index: 20;
    border-right: 2px solid #e2e8f0;
    padding: 0.5rem !important;
}

/* Attendance search bar in student header */
.attendance-search-container {
    position: relative;
    width: 100%;
}

.attendance-search-input {
    width: 100%;
    padding: 0.4rem 0.5rem 0.4rem 1.8rem;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.attendance-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.attendance-search-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.attendance-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* Attendance Search Dropdown */
.attendance-search-dropdown {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    min-width: 250px;
}

.attendance-search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}

.attendance-search-result:hover {
    background-color: #f8fafc;
}

.attendance-search-result:last-child {
    border-bottom: none;
}

.attendance-search-result-name {
    font-weight: 500;
    color: #334155;
}

.attendance-search-result-slot {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.attendance-search-no-results {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.attendance-search-more {
    padding: 8px 12px;
    text-align: center;
    color: #64748b;
    font-size: 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Row highlight animation for search navigation */
.attendance-row-highlight {
    animation: highlightAttendanceRow 2s ease-out;
}

@keyframes highlightAttendanceRow {
    0% { background-color: #fef3c7; }
    100% { background-color: transparent; }
}

/* Ensure student rows have transition for highlight */
tr[data-student-id] {
    transition: background-color 0.3s;
}

.attendance-student-cell {
    text-align: left !important;
    font-weight: 500;
    color: #1e293b;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 10;
    border-right: 2px solid #e2e8f0;
    min-width: 180px;
}

/* Student action menu - dropdown from drag handle */
.student-action-menu {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 160px;
    overflow: hidden;
    transform: translateY(4px);
}

.student-action-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: white;
    border: none;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    white-space: nowrap;
}

.student-action-menu button:hover {
    background: #fef2f2;
}

.student-action-menu button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Drag handle container */
.drag-handle-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Make drag handle clickable with hover feedback */
.drag-handle {
    transition: color 0.15s ease;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.drag-handle:hover {
    color: #64748b !important;
    background: rgba(0, 0, 0, 0.05);
}

.attendance-day-header {
    min-width: 44px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #475569;
    background: #f8fafc;
}

.attendance-day-header.weekend {
    background: #fef3c7;
}

.attendance-rate-header {
    display: none;
}

.attendance-rate-cell {
    display: none;
}

/* Attendance Rate Badge */
.attendance-rate-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.attendance-rate-badge.high,
.attendance-rate-badge.good {
    background: #dcfce7;
    color: #15803d;
}

.attendance-rate-badge.medium,
.attendance-rate-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.attendance-rate-badge.low {
    background: #fee2e2;
    color: #dc2626;
}

/* Time Slot Section Headers */
.attendance-time-slot-header {
    background: #f1f5f9;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.attendance-time-slot-header:hover {
    background: #e2e8f0;
}

.attendance-time-slot-cell {
    padding: 0.5rem 1rem !important;
    background: #f1f5f9;
    border: none !important;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    transition: background 0.15s ease;
}

.attendance-time-slot-header:hover .attendance-time-slot-cell {
    background: #e2e8f0;
}

.time-slot-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
}

.time-slot-label svg {
    color: #64748b;
}

/* Chevron rotation animation for expand/collapse */
.time-slot-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.time-slot-chevron.expanded {
    transform: rotate(90deg);
}

.time-slot-count {
    font-weight: 400;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 0.25rem;
}

/* Make time slot label cell sticky for better UX when scrolling horizontally */
.attendance-time-slot-label-cell {
    position: sticky !important;
    left: 0 !important;
    z-index: 15 !important;
    background: #f1f5f9 !important;
    min-width: 180px !important;
    max-width: 180px !important;
    width: 180px !important;
}

.attendance-time-slot-header:hover .attendance-time-slot-label-cell {
    background: #e2e8f0 !important;
}

/* Empty date cells in time slot row */
.attendance-time-slot-date-cell {
    width: 50px !important;
    min-width: 50px !important;
    padding: 0.5rem !important;
}

/* ============================================
   DRAG AND DROP STYLES
   ============================================ */

/* Drag handle styling */
.drag-handle {
    opacity: 0.4;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.time-slot-student-row:hover .drag-handle {
    opacity: 1;
    color: #6366f1 !important;
}

/* Student row being dragged */
.time-slot-student-row.dragging {
    opacity: 0.5;
    background: #e0e7ff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.time-slot-student-row.dragging td {
    background: #e0e7ff !important;
}

/* Draggable student row cursor */
.time-slot-student-row[draggable="true"] {
    cursor: grab;
}

.time-slot-student-row[draggable="true"]:active {
    cursor: grabbing;
}

/* Time slot header as drop target - available state */
.attendance-time-slot-header.drop-target-available {
    background: #f0fdf4 !important;
}

.attendance-time-slot-header.drop-target-available .attendance-time-slot-cell {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
}

.attendance-time-slot-header.drop-target-available .attendance-time-slot-label-cell {
    background: #f0fdf4 !important;
}

/* Time slot header as drop target - hover state */
.attendance-time-slot-header.drop-target-hover {
    background: #dcfce7 !important;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.attendance-time-slot-header.drop-target-hover .attendance-time-slot-cell {
    background: #dcfce7 !important;
    border: 2px dashed #22c55e !important;
}

.attendance-time-slot-header.drop-target-hover .attendance-time-slot-label-cell {
    background: #dcfce7 !important;
}

.attendance-time-slot-header.drop-target-hover .time-slot-label {
    color: #16a34a !important;
}

/* Drop indicator animation */
@keyframes dropPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.attendance-time-slot-header.drop-target-hover {
    animation: dropPulse 1s infinite;
}

/* Empty row as drop target - available state */
.time-slot-empty-row.drop-target-available {
    background: #f0fdf4 !important;
}

.time-slot-empty-row.drop-target-available td {
    background: #f0fdf4 !important;
    opacity: 1 !important;
}

/* Empty row as drop target - hover state */
.time-slot-empty-row.drop-target-hover {
    background: #dcfce7 !important;
}

.time-slot-empty-row.drop-target-hover td {
    background: #dcfce7 !important;
    opacity: 1 !important;
}

.time-slot-empty-row.drop-target-hover .attendance-student-cell div {
    opacity: 1 !important;
}

.time-slot-empty-row.drop-target-hover .student-avatar {
    background: #22c55e !important;
    color: white !important;
}

.time-slot-empty-row.drop-target-hover span {
    color: #16a34a !important;
    font-style: normal !important;
}

/* Import Wizard Steps */
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.wizard-step.active .wizard-step-number {
    background: #5F192B;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(95, 25, 43, 0.3);
}

.wizard-step.completed .wizard-step-number {
    background: #10b981;
    color: white;
}

.wizard-step-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

.wizard-step.active .wizard-step-label {
    color: #1e293b;
    font-weight: 600;
}

.wizard-step-connector {
    width: 60px;
    height: 2px;
    background: #e2e8f0;
    margin-top: 18px;
}

.wizard-step-connector.completed {
    background: #10b981;
}

/* Sheet Tabs for Import */
.sheet-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sheet-tab:hover {
    border-color: #5F192B;
    color: #5F192B;
}

.sheet-tab.active {
    background: #5F192B;
    border-color: #5F192B;
    color: white;
}

.sheet-tab.selected {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.sheet-tab-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #5F192B;
}

/* Name Matching Row */
.name-match-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.name-match-row:hover {
    background: #f8fafc;
}

.name-match-row.matched {
    background: #f0fdf4;
}

.name-match-row.unmatched {
    background: #fffbeb;
}

.match-confidence {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.match-confidence.high {
    background: #dcfce7;
    color: #15803d;
}

.match-confidence.medium {
    background: #fef3c7;
    color: #d97706;
}

.match-confidence.low {
    background: #fee2e2;
    color: #dc2626;
}

.match-student-select {
    padding: 0.375rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    min-width: 180px;
    max-width: 220px;
}

.save-alias-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid #10b981;
    border-radius: 0.375rem;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.save-alias-btn:hover {
    background: #10b981;
    color: white;
}

/* Low Attendance Alert Item */
.low-attendance-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.low-attendance-alert:last-child {
    margin-bottom: 0;
}

.low-attendance-alert .alert-student {
    font-weight: 600;
    color: #1e293b;
}

.low-attendance-alert .alert-rate {
    color: #d97706;
    font-weight: 700;
}

.low-attendance-alert .alert-details {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Excel Drop Zone Styles */
#excelDropZone.dragover {
    border-color: #5F192B;
    background: #fdf2f4;
}

/* Mobile Responsive Attendance */
@media (max-width: 768px) {
    /* Mobile-optimized filters for attendance */
    #attendanceSection .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    #attendanceSection .filter-group {
        width: 100%;
    }

    /* Hide desktop stats, show mobile filter cards instead */
    #attendanceSection .stats-grid {
        display: none !important;
    }

    /* Mobile filter cards (replacing stats) */
    .mobile-attendance-filters {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Hide desktop filters on mobile */
    #attendanceSection .filters {
        display: none !important;
    }

    .mobile-filter-card {
        background: white;
        border-radius: 0.75rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .mobile-filter-card label {
        display: block;
        font-size: 0.875rem;
        font-weight: 600;
        color: #475569;
        margin-bottom: 0.5rem;
    }

    .mobile-filter-card select {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        font-size: 0.9375rem;
        color: #1e293b;
        background: #f8fafc;
        transition: all 0.2s ease;
    }

    .mobile-filter-card select:focus {
        outline: none;
        border-color: #5F192B;
        background: white;
    }

    /* Month navigation optimized for mobile */
    .attendance-month-nav {
        margin-bottom: 1rem !important;
        padding: 0.75rem 1rem;
        background: white;
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .attendance-month-nav h2 {
        font-size: 1.125rem !important;
        font-weight: 700 !important;
        min-width: auto !important;
        max-width: none !important;
        flex: 1 !important;
        color: #1e293b;
    }

    .attendance-month-nav button {
        padding: 0.625rem !important;
        border-radius: 0.5rem !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        transition: all 0.2s ease !important;
    }

    .attendance-month-nav button:active {
        background: #e2e8f0 !important;
        transform: scale(0.95);
    }

    .attendance-month-nav button svg {
        width: 20px !important;
        height: 20px !important;
        color: #475569;
    }

    /* Calendar grid optimizations */
    .attendance-calendar th,
    .attendance-calendar td {
        padding: 0.25rem;
        font-size: 0.7rem;
    }

    .attendance-cell {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .attendance-cell:active {
        transform: scale(0.9);
    }

    .attendance-calendar th.student-name-header,
    .attendance-calendar td.student-name-cell {
        min-width: 100px;
        max-width: 120px;
        font-size: 0.75rem;
        position: sticky;
        left: 0;
        background: white;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    }

    /* Time slot label cell - sticky on mobile for horizontal scrolling - reduced width to fit more dates */
    .attendance-time-slot-label-cell {
        position: sticky !important;
        left: 0 !important;
        z-index: 15 !important;
        background: #f1f5f9 !important;
        min-width: 110px !important;
        max-width: 110px !important;
        width: 110px !important;
        box-shadow: 2px 0 4px rgba(0,0,0,0.08) !important;
        padding: 0.35rem 0.5rem !important;
    }

    .attendance-time-slot-header:hover .attendance-time-slot-label-cell {
        background: #e2e8f0 !important;
    }

    /* Time slot label - compact on mobile */
    .time-slot-label {
        font-size: 0.65rem !important;
        gap: 0.25rem !important;
    }

    .time-slot-label svg {
        width: 11px !important;
        height: 11px !important;
    }

    .time-slot-count {
        font-size: 0.6rem !important;
    }

    /* Reduce checkbox size on mobile to fit more columns */
    .attendance-checkbox {
        width: 20px !important;
        height: 20px !important;
    }

    .attendance-checkbox svg {
        width: 12px !important;
        height: 12px !important;
    }

    .attendance-checkbox.checked svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Reduce checkbox cell padding and set minimum width on mobile */
    .attendance-checkbox-cell {
        padding: 0.25rem !important;
        min-width: 44px !important;
        width: 44px !important;
        max-width: 44px !important;
    }

    /* Reduce day header font on mobile and set width */
    .attendance-day-header {
        font-size: 0.65rem !important;
        padding: 0.35rem 0.25rem !important;
        min-width: 44px !important;
        width: 44px !important;
        max-width: 44px !important;
    }

    .attendance-day-header > div {
        gap: 1px !important;
    }

    .attendance-day-header span:first-child {
        font-size: 0.6rem !important;
    }

    /* Reduce student cell width on mobile */
    .attendance-student-cell {
        min-width: 120px !important;
        max-width: 120px !important;
        width: 120px !important;
        position: sticky !important;
        left: 0 !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
        z-index: 20 !important;
        box-shadow: 2px 0 4px rgba(0,0,0,0.1) !important;
        padding: 0.35rem 0.4rem !important;
        font-size: 0.65rem !important;
        opacity: 1 !important;
        overflow: hidden !important;
    }

    /* Stack student name vertically on mobile */
    .attendance-student-cell > div {
        overflow: hidden !important;
    }

    .attendance-student-cell .student-name-text {
        display: flex !important;
        flex-direction: column !important;
        line-height: 1.1 !important;
        gap: 0 !important;
    }

    .attendance-student-cell .student-name-text .first-name,
    .attendance-student-cell .student-name-text .last-name {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 75px !important;
        font-size: 0.75rem !important;
    }

    .attendance-student-cell .student-name-text .first-name {
        font-weight: 600 !important;
    }

    .attendance-student-cell .student-name-text .last-name {
        font-weight: 400 !important;
        color: #64748b !important;
    }

    /* Smaller avatars on mobile */
    .student-avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.65rem !important;
    }

    /* Smaller drag handle on mobile */
    .drag-handle svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Student action menu - mobile optimized */
    .student-action-menu {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .student-action-menu button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .student-action-menu button svg {
        width: 12px;
        height: 12px;
    }

    /* Reduce gap between elements in student cell */
    .attendance-student-cell > div {
        gap: 0.3rem !important;
    }

    /* Ensure student rows have solid white background on mobile */
    .time-slot-student-row .attendance-student-cell {
        background: #ffffff !important;
        background-color: #ffffff !important;
    }

    .time-slot-student-row:hover .attendance-student-cell,
    .time-slot-student-row.dragging .attendance-student-cell {
        background: #ffffff !important;
        background-color: #ffffff !important;
    }

    /* Legend optimized for mobile */
    .attendance-legend {
        gap: 1rem !important;
        padding: 0.75rem !important;
    }

    .attendance-legend > div {
        flex: 1 1 auto;
    }

    .wizard-step-connector {
        width: 30px;
    }

    .wizard-step-label {
        font-size: 0.625rem;
    }

    .wizard-step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .sheet-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .attendance-legend {
        flex-direction: column;
        gap: 0.75rem;
    }

    .attendance-legend > div:last-child {
        margin-left: 0;
    }
}

/* ============================================
   ADD STUDENT TO CALENDAR BUTTON & MODAL
   ============================================ */

/* Add Student button in attendance header */
.attendance-add-student-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.attendance-add-student-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
}

.attendance-add-student-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.attendance-add-student-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Add Student Search Container in Modal */
.add-student-search-container {
    position: relative;
}

.add-student-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.add-student-search-container .form-input {
    padding-left: 2.5rem;
}

/* Add Student Search Dropdown */
.add-student-search-dropdown {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10001;
}

.add-student-search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.add-student-search-result:hover {
    background-color: #f8fafc;
}

.add-student-search-result:last-child {
    border-bottom: none;
}

.add-student-search-result-name {
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}

.add-student-search-result-slot {
    font-size: 0.6875rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.add-student-search-no-results {
    padding: 0.875rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8125rem;
}

/* Selected Student Display */
.add-student-selected-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
}

#addStudentSelectedName {
    font-weight: 600;
    color: #065f46;
    font-size: 0.875rem;
}

.add-student-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: white;
    border: 1px solid #d1fae5;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
}

.add-student-clear-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Mobile responsive for Add Student button */
@media (max-width: 768px) {
    .attendance-add-student-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
        gap: 0.3rem;
    }

    .attendance-add-student-btn svg {
        width: 11px;
        height: 11px;
    }

    /* Reduce student header width on mobile to match student cells */
    .attendance-student-header {
        min-width: 110px !important;
        max-width: 110px !important;
        width: 110px !important;
        padding: 0.35rem 0.4rem !important;
    }

    .add-student-search-dropdown {
        max-height: 200px;
    }
}

/* ============================================
 * USER ACTIVITY ANALYTICS STYLES
 * ============================================ */

/* Period filter buttons */
.period-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.period-btn.active {
    background: #5F192B;
    border-color: #5F192B;
    color: white;
}

.period-btn.active:hover {
    background: #7f1d1d;
    border-color: #7f1d1d;
}

/* Activity stats styling */
.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.stat-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: #f3f4f6;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Session actions modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: 0.375rem;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Responsive adjustments for User Activity */
@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .period-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

/* ========================================
   MORE MENU - Mobile Settings Page
   ======================================== */
.more-menu-list {
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.more-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.more-menu-item:active {
    background: #f9fafb;
    transform: scale(0.99);
}

.more-menu-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.more-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-menu-icon i {
    width: 20px;
    height: 20px;
}

.more-menu-chevron {
    width: 18px;
    height: 18px;
    color: #9ca3af;
}

.more-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.more-menu-logout {
    color: #dc2626;
}

/* ========================================
   MOBILE USER ACTIVITY RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    /* Summary cards: 2x2 grid */
    #userActivitySummaryCards {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        padding: 0 4px;
    }
    
    #userActivitySummaryCards .stat-card {
        padding: 14px !important;
        margin: 0 !important;
    }
    
    #userActivitySummaryCards .stat-card-value {
        font-size: 1.5rem !important;
    }
    
    #userActivitySummaryCards .stat-card-title {
        font-size: 0.7rem !important;
    }
    
    /* Period filter: scrollable pills */
    #userActivitySection .flex.flex-wrap.gap-4.mb-6 {
        flex-direction: column;
        gap: 8px !important;
    }
    
    #userActivitySection .flex.flex-wrap.gap-2 {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 4px;
        flex-wrap: nowrap !important;
    }
    
    #userActivitySection .period-btn {
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 20px;
        flex-shrink: 0;
    }
    
    /* Activity stats table: card view on mobile */
    #userActivitySection .table-container {
        padding: 0 !important;
        overflow-x: visible !important;
    }
    
    /* Make tables horizontally scrollable */
    #userActivitySection .data-table {
        font-size: 13px;
    }
    
    #userActivitySection .data-table th,
    #userActivitySection .data-table td {
        padding: 10px 8px !important;
        white-space: nowrap;
    }
    
    /* Session history as cards */
    #sessionHistoryTableBody tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 8px;
        padding: 12px;
        background: #fff;
    }
    
    #sessionHistoryTableBody td {
        display: block;
        padding: 2px 0 !important;
        border: none !important;
        text-align: left !important;
    }
    
    #sessionHistoryTableBody td:first-child {
        font-weight: 600;
        color: #1f2937;
        font-size: 14px;
    }
    
    #sessionHistoryTableBody td:nth-child(2),
    #sessionHistoryTableBody td:nth-child(3) {
        font-size: 13px;
        color: #6b7280;
    }
    
    #sessionHistoryTableBody td:last-child {
        margin-top: 8px;
    }
    
    /* Hide session history table header on mobile */
    #userActivitySection .table-container:last-of-type thead {
        display: none;
    }
    
    /* User selector full width */
    #userActivityUserSelect {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 14px 12px !important;
        border-radius: 12px !important;
    }
    
    /* Session actions modal: full screen on mobile */
    #sessionActionsModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    #sessionActionsModal .data-table {
        font-size: 12px;
    }
    
    #sessionActionsModal .data-table th,
    #sessionActionsModal .data-table td {
        padding: 8px 6px !important;
    }
    
    /* User Activity header actions */
    #userActivitySection .header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    #userActivitySection .header-actions {
        width: 100%;
    }
    
    #userActivitySection .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   CUSTOM DATE RANGE PICKER
   ======================================== */
.custom-date-range {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.date-range-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range-field {
    flex: 1;
    min-width: 120px;
}

.date-range-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.date-apply-btn {
    padding: 10px 20px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #059669 !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    cursor: pointer;
}

.date-apply-btn:hover {
    background: #047857 !important;
}

@media (max-width: 768px) {
    .date-range-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-range-field {
        width: 100%;
    }
    
    .date-input {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 14px 12px;
    }
    
    .date-apply-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px !important;
    }
}

/* Coach Activity mobile fixes */
@media (max-width: 768px) {
    #coachActivitySection .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    #coachActivitySection .stats-grid .stat-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    
    #coachActivitySection .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    #coachActivitySection .data-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    #coachActivitySection .data-table th,
    #coachActivitySection .data-table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }
    
    #coachActivitySection .data-table td:nth-child(5) {
        white-space: normal;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Status History filters - responsive */
#statusHistorySection .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}
#statusHistorySection .stats-grid .form-input {
    width: 100%;
    text-overflow: ellipsis;
}
@media (max-width: 640px) {
    #statusHistorySection .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    #statusHistorySection .stats-grid .stat-card:last-child {
        grid-column: 1 / -1;
    }
}
