/* Katipunan School Attendance Management System - CSS Styles */

/* CSS Variables for Design System */
:root {
    --background: hsl(210, 20%, 98%);
    --foreground: hsl(215, 25%, 27%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(215, 25%, 27%);
    --popover: hsl(0, 0%, 100%);
    --popover-foreground: hsl(215, 25%, 27%);
    --primary: #2b619e;
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(146, 60%, 45%);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsl(210, 20%, 96%);
    --muted-foreground: hsl(215, 15%, 50%);
    --accent: hsl(210, 40%, 92%);
    --accent-foreground: hsl(215, 25%, 27%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(0, 0%, 100%);
    --border: hsl(210, 20%, 90%);
    --input: hsl(210, 20%, 94%);
    --ring: hsl(210, 100%, 45%);
    --success: hsl(146, 60%, 45%);
    --success-foreground: hsl(0, 0%, 100%);
    --warning: hsl(43, 96%, 56%);
    --warning-foreground: hsl(0, 0%, 100%);
    --radius: 0.5rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px hsl(210, 20%, 85% / 0.3);
    --shadow-md: 0 4px 12px hsl(210, 20%, 80% / 0.15);
    --shadow-lg: 0 8px 25px hsl(210, 20%, 75% / 0.2);
    
    /* Responsive breakpoints */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
    --large: 1200px;
    
    /* Responsive spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    /* Safe area insets for notched devices */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* Dark mode variables */
.dark {
    --background: hsl(222.2, 84%, 4.9%);
    --foreground: hsl(210, 40%, 98%);
    --card: hsl(222.2, 84%, 4.9%);
    --card-foreground: hsl(210, 40%, 98%);
    --popover: hsl(222.2, 84%, 4.9%);
    --popover-foreground: hsl(210, 40%, 98%);
    --primary: #2b619e;
    --primary-foreground: hsl(222.2, 47.4%, 11.2%);
    --secondary: hsl(217.2, 32.6%, 17.5%);
    --secondary-foreground: hsl(210, 40%, 98%);
    --muted: hsl(217.2, 32.6%, 17.5%);
    --muted-foreground: hsl(215, 20.2%, 65.1%);
    --accent: hsl(217.2, 32.6%, 17.5%);
    --accent-foreground: hsl(210, 40%, 98%);
    --destructive: hsl(0, 62.8%, 30.6%);
    --destructive-foreground: hsl(210, 40%, 98%);
    --border: hsl(217.2, 32.6%, 17.5%);
    --input: hsl(217.2, 32.6%, 17.5%);
    --ring: hsl(212.7, 26.8%, 83.9%);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

/* Mobile defaults and safe-area support */
html, body {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

img, canvas, video {
    max-width: 100%;
    height: auto;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Mobile Backdrop */
.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-backdrop.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar Styles */
.sidebar {
    width: 16rem;
    background-color: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1500;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 4rem;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* School Logo Styling */
.school-logo {
    width: 50px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius);
    transition: var(--transition);
}

.school-logo:hover {
    transform: scale(1.05);
}

.brand-text h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted-foreground);
}

.brand-text p {
    font-size: 0.60rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    position: relative;
}

.brand-text p::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border);
}

.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group:first-child {
    margin-top: 0;
}

.nav-group h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar.collapsed .nav-group h4 span {
    display: none;
}

.nav-group ul {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--muted-foreground);
    text-decoration: none;
    border-radius: var(--radius);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.nav-link.active {
    background-color: hsl(var(--primary) / 0.1);
    color: var(--primary);
    font-weight: 600;
}

.nav-link i {
    width: 1rem;
    text-align: center;
}

.nav-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Hide text when sidebar is collapsed */
.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-item-content {
    display: none;
}

.sidebar.collapsed .nav-group h4 span {
    display: none;
}

/* Center icons when collapsed */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-group h4 {
    text-align: center;
    padding: 0.5rem;
}

.sidebar.collapsed .nav-group-toggle {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-group-toggle span {
    display: none;
}

.sidebar.collapsed .nav-group-toggle .nav-arrow {
    display: none;
}

/* Collapsible Navigation Groups */
.nav-group-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    width: 100%;
}

.nav-group-toggle:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.nav-group-toggle.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.nav-group-toggle i:first-child {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.nav-group-toggle .nav-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.nav-arrow {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.nav-group-toggle.expanded .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.expanded {
    max-height: 500px;
}

/* Hide main-level Sections when Classrooms is expanded */
.nav-group-toggle[data-target="classrooms-menu"].expanded ~ li .nav-group-toggle[data-target="sections-menu"] {
    display: none;
}

/* Hide arrow when collapsed */
.sidebar.collapsed .nav-arrow {
    display: none;
}

.nav-item-content .badge {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
}

.section-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.section-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.sidebar.collapsed .nav-item-content {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 16rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 16rem);
}

.sidebar.collapsed + .main-content {
    margin-left: 4rem;
    width: calc(100% - 4rem);
}

/* Dashboard Header */
.dashboard-header {
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    padding: calc(1rem + var(--safe-top)) 1rem 1rem 1rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1200;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-left: max(0px, var(--safe-left));
    padding-right: max(0px, var(--safe-right));
    flex-wrap: wrap;
}

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    transition: var(--transition);
    font-size: 1.25rem;
}

.mobile-menu-toggle:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

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

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark-mode-toggle {
    position: relative;
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
    transform: scale(1.05);
}

.dark-mode-toggle i {
    transition: var(--transition);
}

.dark-mode-toggle:hover i {
    transform: rotate(180deg);
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    font-size: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 1.5rem;
}

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

.dashboard-title h2 {
    font-size: clamp(1.25rem, 2.5vw + 0.5rem, 1.875rem);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.dashboard-title p {
    color: var(--muted-foreground);
}

.dashboard-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-badge {
    background-color: hsl(var(--primary) / 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.filter-badge.secondary {
    background-color: hsl(var(--secondary) / 0.1);
    color: var(--secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

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

.stat-header h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.stat-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.primary {
    background-color: var(--primary);
}

.stat-icon.success {
    background-color: var(--success);
}

.stat-icon.destructive {
    background-color: var(--destructive);
}

.stat-icon.warning {
    background-color: var(--warning);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* QR Scanner Section */
.qr-scanner-section {
    display: grid;
    margin-bottom: 2rem;
}

.qr-scanner-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.qr-scanner-card:hover {
    box-shadow: var(--shadow-md);
}

.qr-scanner-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}


.qr-scanner-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}


.qr-scanner-header p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}


.quick-actions-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quick-actions-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.quick-actions-card p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.action-badge.primary {
    background-color: hsl(var(--primary) / 0.1);
    color: var(--primary);
}

.action-badge.success {
    background-color: hsl(var(--success) / 0.1);
    color: var(--success);
}

.action-badge.secondary {
    background-color: hsl(var(--secondary) / 0.1);
    color: var(--secondary);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.chart-header p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.chart-content {
    height: 300px;
}

/* Student Table */
.student-table-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.table-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.table-title p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.table-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    max-width: 16rem;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.class-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    max-width: 8rem;
}

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

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

.student-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    white-space: nowrap !important;
}

.student-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.student-table tr:hover {
    background-color: hsl(var(--muted) / 0.5);
}

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

.student-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0; /* Prevent shrinking */
}

.student-avatar i {
    font-size: 0.875rem; /* Slightly larger for better icon visibility */
    line-height: 1;
}

.status-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-present {
    background-color: var(--success);
    color: var(--success-foreground);
}

.status-late {
    background-color: var(--warning);
    color: var(--warning-foreground);
}

.status-absent {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
}

.grade-badge {
    padding: 0.125rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    transition: var(--transition);
}

.dropdown-toggle:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--popover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 10rem;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--popover-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    position: relative;
}

.profile-arrow {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.profile-btn.active .profile-arrow {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 16rem;
    z-index: 1300;
    display: none;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: all 0.2s ease;
}

.profile-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.profile-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.profile-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.profile-info p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: 0.125rem 0 0 0;
}

.profile-menu-items {
    padding: 0.5rem 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
}

.profile-menu-item:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.profile-menu-item i {
    width: 1rem;
    text-align: center;
    color: var(--muted-foreground);
}

.profile-menu-item:hover i {
    color: inherit;
}

.profile-menu-item.text-destructive {
    color: var(--destructive);
}

.profile-menu-item.text-destructive:hover {
    background-color: hsl(var(--destructive) / 0.1);
    color: var(--destructive);
}

.profile-menu-item.text-destructive i {
    color: var(--destructive);
}

.profile-menu-divider {
    height: 1px;
    background-color: var(--border);
    margin: 0.5rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS touch target minimum */
}

/* Modern QR Scanner Button */
.qr-scanner-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background-color: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 56px;
    min-width: 200px;
}

.qr-scanner-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.qr-scanner-btn:hover::before {
    left: 100%;
}

.qr-scanner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.qr-scanner-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-scanner-btn i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.qr-scanner-btn:hover i {
    transform: scale(1.1);
}

.qr-scanner-btn:active i {
    transform: scale(0.95);
}

/* Responsive design for QR scanner button */
@media (max-width: 768px) {
    .qr-scanner-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-width: 180px;
        min-height: 50px;
    }
    
    .qr-scanner-btn i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .qr-scanner-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        min-width: 160px;
        min-height: 48px;
    }
    
    .qr-scanner-btn i {
        font-size: 1rem;
    }
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: var(--primary);
    opacity: 0.9;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn {
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

#addUserBtn {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.btn-outline {
    border-color: var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: transparent;
    color: var(--foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary);
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: calc(var(--spacing-md) + var(--safe-top)) var(--spacing-md) calc(var(--spacing-md) + var(--safe-bottom)) var(--spacing-md);
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 28rem;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.modal-body {
    padding: 1.5rem;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: calc(var(--spacing-md) + var(--safe-top)) var(--spacing-md) calc(var(--spacing-md) + var(--safe-bottom)) var(--spacing-md);
}

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

/* User Management Modal Styles */
.modal-content {
    background-color: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 32rem;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Button Styles */
.btn-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    border: 1px solid var(--destructive);
}

.btn-destructive:hover {
    background-color: hsl(0, 84%, 50%);
    border-color: hsl(0, 84%, 50%);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--input);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Profile View Styles */
.profile-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.profile-avatar-large {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-details {
    width: 100%;
}

.profile-details h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.profile-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.profile-field span {
    color: var(--foreground);
    font-size: 0.875rem;
}

/* Responsive adjustments for modals */
@media (max-width: 767px) {
    .modal-content {
        margin: 0;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .profile-view {
        gap: 1rem;
    }
    
    .profile-avatar-large {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Scanner */
.scanner-container {
    position: relative;
    margin-bottom: 1rem;
}

.scanner-video {
    width: 100%;
    height: 16rem;
    background-color: black;
    border-radius: var(--radius);
    object-fit: cover;
    transform: none !important;
}

@media (max-width: 767px) {
    .date-display {
        display: none;
    }
    .dashboard-header {
        padding-top: calc(0.75rem + var(--safe-top));
        padding-bottom: 0.75rem;
    }
    
    /* Mobile header - hide center content and notification button */
    .header-center {
        display: none;
    }
    
    .notification-btn {
        display: none;
    }
    
    /* Keep only dark mode toggle and profile dropdown visible */
    .header-right {
        gap: 0.75rem;
    }
    
    /* Ensure profile button shows only icon on mobile */
    .profile-btn {
        padding: 0.5rem;
        min-width: auto;
        font-size: 0; /* Hide text content */
        line-height: 0;
    }
    
    /* Show only the user icon */
    .profile-btn .fas.fa-user {
        font-size: 1rem;
        margin-right: 0;
    }
    
    /* Hide the dropdown arrow on mobile */
    .profile-btn .profile-arrow {
        display: none;
    }
    .scanner-video {
        height: 12rem;
    }
    
    .modal-content {
        margin: 0;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body {
        padding: var(--spacing-md);
    }
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-loading {
    text-align: center;
    color: white;
}

.scanner-loading i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scanner-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
    margin-right: 0.25rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.scanner-result {
    padding: 1rem;
    background-color: hsl(var(--success) / 0.1);
    border: 1px solid hsl(var(--success) / 0.2);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.scanner-mode {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.mode-toggle {
    display: inline-flex;
    gap: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.mode-btn.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.scanner-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.scanner-controls {
    display: flex;
    gap: 0.5rem;
}

.scanner-controls .btn {
    flex: 1;
}


/* Responsive Design */

/* Mobile First - Base styles (0px and up) */
.stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.qr-scanner-section {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.charts-section {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.dashboard-content {
    padding: var(--spacing-md);
}

.dashboard-header {
    padding: 1rem;
}

.dashboard-header-section {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.header-content {
    flex-direction: row;
    gap: var(--spacing-sm);
    align-items: center;
}

.header-right {
    flex-direction: row;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: nowrap;
}

.table-controls {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: stretch;
}

.search-box,
.class-select {
    width: 100%;
    max-width: none;
}

/* Small Mobile (480px and up) */
@media (min-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-content {
        padding: var(--spacing-lg);
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-right {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
}

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        transform: translateX(0);
        width: 16rem;
    }
    
    .main-content {
        margin-left: 16rem;
    }
    
    .sidebar.collapsed {
        width: 4rem;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 4rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qr-scanner-section {
        grid-template-columns: 1fr 2fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-header-section {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .table-controls {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    .search-box {
        max-width: 16rem;
    }
    
    .class-select {
        max-width: 8rem;
    }
}

/* Mobile styles (under 768px) */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 16rem;
        z-index: 1600; /* above backdrop and content */
        height: 100dvh; /* account for mobile browser UI */
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 16rem;
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .mobile-backdrop {
        display: block;
    }
    
    /* Typography adjustments for mobile */
    .dashboard-title h2 {
        font-size: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Card padding adjustments */
    .stat-card,
    .qr-scanner-card,
    .quick-actions-card,
    .chart-card,
    .student-table-card {
        padding: var(--spacing-md);
    }
    
    /* Table responsiveness */
    .table-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .student-table {
        min-width: 600px;
    }
    
    .student-table th,
    .student-table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .student-table th {
        white-space: nowrap !important;
    }
    
    .student-info {
        gap: 0.5rem;
    }
    
    .student-avatar {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.625rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .scanner-video {
        height: 12rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dashboard-content {
        padding: var(--spacing-xl);
    }
    
    .dashboard-header {
        padding: 1rem;
    }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .dashboard-content {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: var(--spacing-xl);
    }
    
    .header-content {
        max-width: none;
        width: 100%;
        margin: 0;
    }
}

/* Very Small Screens (under 480px) */
@media (max-width: 479px) {
    .dashboard-content {
        padding: var(--spacing-sm);
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .stat-card {
        padding: var(--spacing-sm);
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .dashboard-title h2 {
        font-size: 1.25rem;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .date-display {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .modal-content {
        width: calc(100% - 1rem);
        margin: 0.5rem;
    }
    
    .scanner-video {
        height: 10rem;
    }
    
    .student-table th {
        white-space: nowrap !important;
    }
}

/* Very small devices (≤360px wide) */
@media (max-width: 360px) {
    .dashboard-title h2 {
        font-size: 1.125rem;
    }
    .stat-card,
    .qr-scanner-card,
    .quick-actions-card,
    .chart-card,
    .student-table-card {
        padding: var(--spacing-sm);
    }
    .student-table {
        min-width: 520px;
    }
    .status-badge,
    .grade-badge {
        font-size: 0.7rem;
    }
    .student-table th {
        white-space: nowrap !important;
    }
}

/* Landscape phones with limited height */
@media (max-height: 480px) and (orientation: landscape) {
    .scanner-video {
        height: 8rem;
    }
    .chart-content {
        height: 220px;
    }
    .modal-content {
        max-height: calc(100vh - 1rem);
    }
    .dashboard-header {
        padding-top: calc(0.5rem + var(--safe-top));
        padding-bottom: 0.5rem;
    }
}

/* ===== FOOTER STYLES ===== */

.site-footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    margin-top: auto;
    width: 100%;
    /* Footer now inherits the main-content margin behavior */
}

.footer-content {
    display: grid;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer Brand Section */
.footer-brand {
    grid-column: 1 / -1;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.footer-logo i {
    font-size: 2rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin: 0;
    line-height: 1.2;
}

.footer-brand-text p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

.footer-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    max-width: 400px;
}

/* Footer Social Links */
.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--accent);
    color: var(--muted-foreground);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
}

.footer-social a:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer Sections */
.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--spacing-md);
    position: relative;
    padding-bottom: var(--spacing-xs);
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2rem;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 1px;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    padding: var(--spacing-xs) 0;
    transition: var(--transition);
    border-radius: var(--radius);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: var(--spacing-sm);
}

.footer-links a i {
    width: 1rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-links a:hover i {
    opacity: 1;
    color: var(--primary);
}

/* Footer Contact Section */
.footer-contact {
    grid-column: 1 / -1;
}

.contact-info {
    display: grid;
    gap: var(--spacing-lg);
}

.contact-item {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.contact-item i {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.contact-item div {
    flex: 1;
}

.contact-item strong {
    display: block;
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.contact-item p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Footer Bottom */
.footer-bottom {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: var(--spacing-sm);
}

.footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: var(--spacing-md);
}

.footer-copyright {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.footer-copyright p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin: 0;
}

.footer-version {
    font-size: 0.75rem !important;
    opacity: 0.8;
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.footer-bottom-links a {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

.footer-divider {
    color: var(--muted-foreground);
    opacity: 0.5;
}

/* ===== FOOTER RESPONSIVE DESIGN ===== */

/* Mobile First - Base styles (0px and up) */
.footer-content {
    grid-template-columns: 1fr;
    padding: var(--spacing-md) var(--spacing-md);
    gap: var(--spacing-md);
}

.footer-brand {
    text-align: center;
}

.footer-logo {
    justify-content: center;
}

.footer-social {
    justify-content: center;
}

.contact-info {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-sm);
}

/* Small Mobile (480px and up) */
@media (min-width: 480px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        text-align: left;
    }
    
    .footer-logo {
        justify-content: flex-start;
    }
    
    .footer-social {
        justify-content: flex-start;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
}

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        padding: var(--spacing-xl) var(--spacing-md);
        gap: var(--spacing-xl);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
    
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .footer-bottom-content {
        flex-direction: row;
        text-align: center;
        justify-content: center;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: 2fr repeat(3, 1fr);
        padding: var(--spacing-2xl) var(--spacing-md);
        gap: var(--spacing-2xl);
    }
    
    .footer-brand {
        grid-column: 1;
        grid-row: 1;
    }
    
    .footer-contact {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: var(--spacing-lg);
    }
    
    .contact-info {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .footer-content {
        grid-template-columns: 2fr repeat(3, 1fr) 2fr;
        gap: var(--spacing-2xl);
        padding: var(--spacing-2xl);
    }
    
    .footer-brand {
        grid-column: 1;
    }
    
    .footer-contact {
        grid-column: 5;
        grid-row: 1;
        margin-top: 0;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Very Small Screens (under 480px) */
@media (max-width: 479px) {
    .footer-content {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .footer-social a {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .footer-brand-text h3 {
        font-size: 1.25rem;
    }
    
    .contact-item {
        gap: var(--spacing-sm);
    }
    
    .footer-bottom {
        padding: var(--spacing-sm);
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .footer-divider {
        display: none;
    }
}

/* Very small devices (≤360px wide) */
@media (max-width: 360px) {
    .footer-brand-text h3 {
        font-size: 1.125rem;
    }
    
    .footer-description {
        font-size: 0.8125rem;
    }
    
    .contact-item p,
    .footer-links a,
    .footer-copyright p,
    .footer-bottom-links a {
        font-size: 0.8125rem;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.pagination-info {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--accent);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-number:hover:not(.active) {
    background: var(--accent);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination-number.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.records-per-page {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.records-per-page label {
    font-weight: 500;
}

.records-per-page select {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
}

.records-per-page select:hover {
    border-color: var(--primary);
}

.records-per-page select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--ring) / 0.2;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
    }
    
    .pagination-info {
        order: 2;
        margin-top: var(--spacing-sm);
    }
    
    .pagination-controls {
        order: 1;
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        font-size: 0.8125rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .pagination-number {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8125rem;
    }
    
    .records-per-page {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pagination-numbers {
        max-width: 100%;
        overflow-x: auto;
        padding: var(--spacing-xs) 0;
    }
    
    .pagination-btn span {
        display: none;
    }
    
    .pagination-btn i {
        margin: 0;
    }
}

/* Dashboard Header Styles */
.dashboard-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.dashboard-title h2 {
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--foreground);
    font-size: 1.5rem;
    font-weight: 600;
}

.dashboard-title p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Table Header Styles */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.table-title h3 {
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--foreground);
    font-size: 1.25rem;
    font-weight: 600;
}

.table-title p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.table-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--muted);
    border-bottom: 1px solid var(--border);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Dashboard table controls - single line layout */
.student-table-card .table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    margin-bottom: 0;
}

.student-table-card .table-controls .search-box {
    flex: 1;
    max-width: 300px;
}

.student-table-card .table-controls .btn {
    margin-left: auto;
}

.filter-controls {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.date-filter label {
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
}

.date-filter input[type="date"] {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
}

.date-filter input[type="date"]:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px var(--ring) / 0.2;
}

.no-records {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md);
}

.no-records-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--muted-foreground);
}

.no-records-content i {
    font-size: 3rem;
    color: var(--muted-foreground);
    opacity: 0.5;
}

.no-records-content h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.no-records-content p {
    margin: 0;
    font-size: 0.875rem;
    max-width: 400px;
    line-height: 1.5;
}

/* Student Profile Modal Styles */
.profile-section, .attendance-section {
    margin-bottom: var(--spacing-lg);
}

.profile-section h4, .attendance-section h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--foreground);
    font-size: 1.125rem;
    font-weight: 600;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.profile-item label {
    font-weight: 500;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.profile-item span {
    color: var(--foreground);
    font-weight: 500;
}

.attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.attendance-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    background: var(--muted);
}

.attendance-item.present {
    background: hsl(146, 60%, 45%, 0.1);
    color: var(--success);
}

.attendance-item.late {
    background: hsl(43, 96%, 56%, 0.1);
    color: var(--warning);
}

.attendance-item.absent {
    background: hsl(0, 84%, 60%, 0.1);
    color: var(--destructive);
}

.attendance-item.excused {
    background: hsl(210, 100%, 45%, 0.1);
    color: var(--primary);
}

.attendance-item i {
    font-size: 1.125rem;
}

.total-days {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--accent);
    border-radius: var(--radius);
    color: var(--foreground);
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--ring) / 0.2;
}

/* Student Table Enhancements */
.student-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.student-name {
    font-weight: 500;
    color: var(--foreground);
}

.student-id {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

.lrn-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.class-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent);
    color: var(--accent-foreground);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.time-badge {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.time-badge.time-absent {
    color: var(--muted-foreground);
    background: var(--muted);
}

.time-badge.time-excused {
    opacity: 0.5;
    color: var(--muted-foreground);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}

.time-badge.time-in {
    background: var(--success);
    color: var(--success-foreground);
}

.time-badge.time-out {
    background: var(--warning);
    color: var(--warning-foreground);
}

.time-badge.time-out.pending {
    background: var(--accent);
    color: var(--muted-foreground);
}

.grade-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    min-width: 2rem;
}

.grade-badge.grade-a,
.grade-badge.grade-aplus {
    background: var(--success);
    color: var(--success-foreground);
}

.grade-badge.grade-aminus,
.grade-badge.grade-b,
.grade-badge.grade-bplus {
    background: var(--warning);
    color: var(--warning-foreground);
}

.grade-badge.grade-bminus,
.grade-badge.grade-c,
.grade-badge.grade-cplus {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.action-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.875rem;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Enhanced action button styles */
.action-btn.btn-danger {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    border: 1px solid var(--destructive);
}

.action-btn.btn-danger:hover {
    background-color: hsl(0, 84%, 50%);
    border-color: hsl(0, 84%, 50%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn.btn-outline {
    background-color: transparent;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
}

.action-btn.btn-outline:hover {
    background-color: var(--accent);
    color: var(--foreground);
    border-color: var(--primary);
}

/* Action button spacing and alignment */
.action-group .action-btn:not(:last-child) {
    margin-right: var(--spacing-xs);
}

/* Responsive action buttons */
@media (max-width: 768px) {
    .action-group {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .action-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    font-size: 0.875rem;
}

.dropdown-toggle:hover {
    background: var(--accent);
    color: var(--foreground);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Table column alignment */
.student-table th:last-child,
.student-table td:last-child {
    text-align: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 12rem;
    z-index: 1000;
    display: none;
    padding: var(--spacing-xs) 0;
    margin-top: var(--spacing-xs);
}

.dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-xs);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover:not(.disabled) {
    background: var(--accent);
    color: var(--primary);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-item.text-destructive {
    color: var(--destructive);
}

.dropdown-item.text-destructive:hover {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-xs) 0;
}

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

/* Enhanced Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-md);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    background: var(--accent);
    color: var(--foreground);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    background: var(--muted);
}

/* Profile View Styles */
.profile-view {
    text-align: center;
}

.profile-avatar-large {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto var(--spacing-lg);
}

.profile-details {
    text-align: left;
}

.profile-field {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--muted);
    border-radius: var(--radius);
}

.profile-field label {
    font-weight: 600;
    color: var(--muted-foreground);
    min-width: 6rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.profile-field span {
    color: var(--foreground);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--foreground);
}

/* Enhanced Form Label Styles */
.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
}

.form-label i {
    color: var(--primary);
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
}

/* Enhanced Form Input Styles */
.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--muted-foreground);
    opacity: 0.7;
}

.form-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--ring) / 0.1;
    background: var(--card);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--foreground);
    margin: 0;
}

.checkbox-input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
}

.checkbox-text i {
    color: var(--primary);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--ring) / 0.1;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: var(--spacing-sm);
}

/* Field Warning Styles */
.field-warning {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--destructive);
    font-size: 0.875rem;
    font-weight: 500;
}

.field-warning i {
    font-size: 0.75rem;
}

/* Input validation states */
.form-group input:invalid {
    border-color: var(--destructive);
}

.form-group input:valid {
    border-color: var(--success);
}

/* Password strength indicator */
.password-strength {
    margin-top: var(--spacing-xs);
    height: 4px;
    background: var(--muted);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.password-strength-weak {
    background: var(--destructive);
    width: 33%;
}

.password-strength-medium {
    background: var(--warning);
    width: 66%;
}

.password-strength-strong {
    background: var(--success);
    width: 100%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* QR Scanner Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--foreground);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: var(--spacing-xs);
}

.modal-close:hover {
    color: var(--foreground);
}

.modal-body {
    padding: var(--spacing-lg);
}

.qr-scanner-container {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.qr-result {
    background: var(--accent);
    padding: var(--spacing-md);
    border-radius: var(--radius);
    margin-top: var(--spacing-md);
}

.modal-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border);
    background: var(--card);
}

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

/* Terms Acceptance */
.terms-acceptance {
    text-align: center;
    padding: var(--spacing-xs) 0 0;
    margin-bottom: var(--spacing-sm);
}

.terms-acceptance .checkbox-label {
    justify-content: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.terms-acceptance .checkbox-text {
    font-weight: 500;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* QR Confirmation Modal Student Info Card */
.student-info-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border);
}

.student-avatar-large {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.student-details-large {
    flex: 1;
}

.student-details-large h4 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

.student-meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.confirmation-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.qr-info {
    padding: var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.qr-info p {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 0.875rem;
    color: var(--foreground);
}

.qr-info p:last-child {
    margin-bottom: 0;
}

.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

/* Mobile responsive adjustments for confirmation modal */
@media (max-width: 767px) {
    .student-info-card {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .student-avatar-large {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .student-details-large h4 {
        font-size: 1.125rem;
    }
    
    .confirmation-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .confirmation-actions .btn {
        width: 100%;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 320px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-icon i {
    font-size: 14px;
}

.toast-title {
    font-weight: 600;
    color: var(--foreground);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

.toast-message {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-left: 28px;
}

.toast-info {
    border-left: 4px solid var(--success);
}

.toast-info .toast-icon {
    background: var(--success);
    color: white;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    background: var(--success);
    color: white;
}

.toast-error {
    border-left: 4px solid var(--destructive);
}

.toast-error .toast-icon {
    background: var(--destructive);
    color: white;
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    background: var(--warning);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header-section {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .records-per-page {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
        top: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Print styles */
@media print {
    .site-footer,
    .pagination-container,
    .dashboard-actions,
    .table-controls,
    .action-buttons {
        display: none;
    }
}

/* Enhanced Delete Button Styles */
.btn-danger {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    border: 1px solid var(--destructive);
}

.btn-danger:hover {
    background-color: hsl(0, 84%, 50%);
    border-color: hsl(0, 84%, 50%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Confirmation Dialog Styles */
.confirm-dialog {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 24rem;
    width: 100%;
    animation: modalSlideIn 0.3s ease-out;
}

.confirm-dialog .modal-header {
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-radius: var(--radius) var(--radius) 0 0;
}

.confirm-dialog .modal-header h3 {
    color: var(--destructive-foreground);
}

.confirm-dialog .modal-body {
    text-align: center;
    padding: var(--spacing-xl);
}

.confirm-dialog .modal-footer {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--muted);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Enhanced Action Button Hover Effects */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

/* Delete Button Special Effects */
.action-btn.btn-danger::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Action Button Tooltips */
.action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--foreground);
    color: var(--background);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease-out forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Action Button Adjustments */
@media (max-width: 480px) {
    .action-group {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }
    
    .action-btn[title]:hover::after {
        display: none;
    }
}

/* Reset Password Modal Styles */
.reset-password-info {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--muted);
    border-radius: var(--radius);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details h4 {
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--foreground);
    font-size: 1.125rem;
    font-weight: 600;
}

.user-details p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Random Password Display */
.random-password-display {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.generated-password label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
}

.password-field {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.password-field .form-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--card);
    border: 1px solid var(--border);
}

.password-field .btn {
    flex-shrink: 0;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: var(--spacing-xs);
    height: 4px;
    background: var(--muted);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.password-strength-weak {
    background: var(--destructive);
    width: 33%;
}

.password-strength-medium {
    background: var(--warning);
    width: 66%;
}

.password-strength-strong {
    background: var(--success);
    width: 100%;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* Field Warning Styles */
.field-warning {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--destructive);
    font-size: 0.875rem;
    font-weight: 500;
}

.field-warning i {
    font-size: 0.75rem;
}

/* Checkbox Label Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--foreground);
    margin: 0;
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--accent);
}

.checkbox-input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
}

.checkbox-text i {
    color: var(--primary);
    font-size: 0.875rem;
}

/* Modal Responsive Adjustments */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .user-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .password-field {
        flex-direction: column;
        align-items: stretch;
    }
    
    .password-field .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ===== MOBILE TABLE RESPONSIVENESS FIXES ===== */

/* Mobile table improvements for better responsiveness */
@media (max-width: 768px) {
    /* Table container improvements - allow horizontal scrolling */
    .student-table-card .table-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1.5rem; /* Add space for scrollbar and hint */
        border-radius: var(--radius);
        position: relative; /* For scroll hint positioning */
    }
    
    /* Keep minimum width for horizontal scrolling instead of forcing 100% */
    .student-table {
        min-width: 600px; /* Allow horizontal scroll instead of cramping */
        font-size: 0.875rem;
    }
    
    /* Improve table cell content wrapping */
    .student-table td {
        padding: 0.5rem 0.75rem;
        word-wrap: break-word;
        white-space: nowrap; /* Prevent wrapping to allow horizontal scroll */
    }
    
    /* User info column adjustments */
    .student-info {
        min-width: 120px;
    }
    
    .student-name {
        font-size: 0.875rem;
        line-height: 1.2;
    }
    
    .student-id {
        font-size: 0.75rem;
    }
    
    /* Email and phone badge improvements */
    .email-badge,
    .phone-badge {
        font-size: 0.75rem;
        word-break: break-all;
        line-height: 1.3;
    }
    
    .email-badge i,
    .phone-badge i {
        margin-right: 0.25rem;
    }
    
    /* Status badge improvements */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Time badge improvements */
    .time-badge {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .time-detail {
        font-size: 0.7rem;
    }
    
    /* Action buttons improvements */
    .action-buttons {
        min-width: 120px;
    }
    
    .action-group {
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
    }
    
    .action-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-width: 32px;
        height: 32px;
    }
    
    .action-btn i {
        font-size: 0.75rem;
    }
    
    /* Add scroll hint for mobile users */
    .student-table-card .table-content::after {
        content: "← Swipe to see more →";
        position: absolute;
        bottom: 0.25rem;
        right: 1rem;
        font-size: 0.7rem;
        color: var(--muted-foreground);
        opacity: 0.7;
        pointer-events: none;
        animation: fadeInOut 3s ease-in-out infinite;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 0.8; }
    }
}

/* Enhanced mobile styles for very small screens */
@media (max-width: 480px) {
    /* Keep table scrollable but make it more compact */
    .student-table {
        min-width: 500px; /* Slightly smaller but still scrollable */
        font-size: 0.8rem;
    }
    
    .student-table th,
    .student-table td {
        padding: 0.375rem 0.5rem;
    }
    
    /* Don't hide columns - let users scroll to see all data */
    /* Removed: Hide phone column - users can scroll to see it */
    
    /* Compact user info */
    .student-info {
        min-width: 100px;
    }
    
    .student-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .student-name {
        font-size: 0.8rem;
    }
    
    .student-id {
        font-size: 0.7rem;
    }
    
    /* Compact badges */
    .email-badge,
    .phone-badge,
    .status-badge,
    .time-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* More compact action buttons */
    .action-group {
        gap: 0.125rem;
    }
    
    .action-btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
        min-width: 28px;
        height: 28px;
    }
    
    .action-btn i {
        font-size: 0.7rem;
    }
    
    /* Stack action buttons vertically if needed */
    .action-group {
        flex-direction: column;
        align-items: center;
    }
}

/* Ultra-small screens (≤280px) - Card-like table layout */
@media (max-width: 280px) {
    /* Convert table to card layout for ultra-small screens */
    .student-table-card .table-content {
        overflow: visible;
    }
    
    .student-table,
    .student-table thead,
    .student-table tbody,
    .student-table th,
    .student-table td,
    .student-table tr {
        display: block;
    }
    
    .student-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .student-table tr {
        background-color: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 1rem;
        padding: 1rem;
        position: relative;
    }
    
    .student-table tr:hover {
        background-color: var(--card);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .student-table td {
        border: none;
        border-bottom: 1px solid var(--border);
        position: relative;
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }
    
    .student-table td:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .student-table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--muted-foreground);
        display: inline-block;
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    /* Special handling for user info cell */
    .student-table td:first-child:before {
        content: "User: ";
    }
    
    .student-table td:nth-child(2):before {
        content: "Email: ";
    }
    
    .student-table td:nth-child(3):before {
        content: "Phone: ";
        display: inline-block; /* Show phone column in card layout */
    }
    
    .student-table td:nth-child(4):before {
        content: "Terms: ";
    }
    
    .student-table td:nth-child(5):before {
        content: "Registered: ";
    }
    
    .student-table td:nth-child(6):before {
        content: "Actions: ";
    }
    
    /* Re-show hidden columns in card layout */
    .student-table td:nth-child(3) {
        display: block;
    }
    
    /* Improve action buttons in card layout */
    .action-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .action-btn {
        flex: 0 0 auto;
        padding: 0.5rem;
        min-width: 36px;
        height: 36px;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .student-table {
        font-size: 0.8rem;
    }
    
    .student-table th,
    .student-table td {
        padding: 0.375rem 0.5rem;
    }
    
    .action-btn {
        padding: 0.25rem 0.375rem;
        min-width: 28px;
        height: 28px;
    }
}

/* ===== MOBILE ACTION MENU STYLES ===== */

/* Mobile Action Menu Styles */
.desktop-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.mobile-action-menu {
    display: none;
    position: relative;
}

.mobile-menu-trigger {
    padding: 0.5rem;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.mobile-action-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--foreground);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.mobile-action-item:last-child {
    border-bottom: none;
}

.mobile-action-item:hover {
    background-color: var(--muted);
}

.mobile-action-item.danger {
    color: var(--destructive);
}

.mobile-action-item.danger:hover {
    background-color: hsl(var(--destructive) / 0.1);
}

.mobile-action-item i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .desktop-actions {
        display: none !important;
    }
    
    .mobile-action-menu {
        display: block !important;
    }
}

/* Dashboard: keep "View All Records" on one line in mobile */
@media (max-width: 768px) {
    .student-table-card .table-controls {
        flex-direction: row !important;
        align-items: center;
        gap: var(--spacing-sm);
        flex-wrap: nowrap; /* prevent wrapping to new line */
    }
    .student-table-card .table-controls .search-box {
        flex: 1 1 auto;
        width: auto; /* override generic mobile width:100% */
        max-width: none;
        min-width: 0; /* allow shrinking */
    }
    .student-table-card .table-controls .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    /* Attendance page: prevent table controls and filters from wrapping */
    .student-table-card .table-controls {
        flex-direction: row !important;
        align-items: center;
        gap: var(--spacing-sm);
        flex-wrap: nowrap;
        overflow-x: auto; /* allow horizontal scroll if needed */
        padding-bottom: 0.5rem; /* space for scrollbar */
    }
    
    .student-table-card .table-controls .records-per-page {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.8rem;
    }
    
    .student-table-card .table-controls .search-box {
        flex: 1 1 auto;
        min-width: 120px;
        max-width: none;
    }
    
    .student-table-card .table-controls .filter-controls {
        flex: 0 0 auto;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .filter-controls select,
    .filter-controls input {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}
