/**
 * Glassmorphism & Responsive Design System
 * Comprehensive styling for all screen sizes with glassmorphism effects
 */

:root {
    /* Glassmorphism Variables */
    --glass-bg-light: rgba(255, 255, 255, 0.25);
    --glass-bg-medium: rgba(255, 255, 255, 0.15);
    --glass-bg-dark: rgba(30, 41, 59, 0.75);
    --glass-bg-darker: rgba(15, 23, 42, 0.85);
    
    --glass-border-light: rgba(255, 255, 255, 0.18);
    --glass-border-medium: rgba(255, 255, 255, 0.1);
    --glass-border-dark: rgba(255, 255, 255, 0.05);
    
    --glass-shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-shadow-medium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-shadow-heavy: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    
    --blur-light: blur(10px);
    --blur-medium: blur(15px);
    --blur-heavy: blur(20px);
    
    /* Spacing & Layout */
    --sidebar-width: 260px;
    --sidebar-width-tablet: 240px;
    --sidebar-width-mobile: 280px;
    
    /* Colors */
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    --text-light: #94a3b8;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    /* Responsive Breakpoints */
    --breakpoint-xs: 400px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* Base Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.glass-medium {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--blur-medium);
    -webkit-backdrop-filter: var(--blur-medium);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-radius: 16px;
    border: 1px solid var(--glass-border-medium);
    box-shadow: var(--glass-shadow-medium);
}

.glass-darker {
    background: var(--glass-bg-darker);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-radius: 16px;
    border: 1px solid var(--glass-border-dark);
    box-shadow: var(--glass-shadow-medium);
}

/* Card Components */
.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.25);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.primary { border-left-color: var(--primary-color); }
.stat-card.success { border-left-color: var(--success-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.info { border-left-color: var(--info-color); }

.content-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Card header & title - same styling as settings/users for all list/detail views */
.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 197, 253, 0.06) 50%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.card-title-custom {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    padding-left: 1rem;
    letter-spacing: -0.02em;
}

.card-title-custom::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.25rem;
    border-radius: 2px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.card-title-custom i {
    color: var(--primary-color);
}

/* Soft badge variants for status (used in visitors, etc.) */
.bg-success-soft {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}
.bg-secondary-soft {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}
.truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.bg-info-soft {
    background: rgba(13, 202, 240, 0.1);
    color: #0891b2;
}
.visitor-photo-placeholder {
    height: 200px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.avatar-group-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Elements with Glassmorphism */
.glass-input {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.glass-select {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
}

/* Global consistent form input sizing */
.form-control,
.form-select {
    font-size: 0.8125rem !important;
    padding: 0.3rem 0.65rem !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: unset !important;
}
textarea.form-control {
    font-size: 0.8125rem !important;
    padding: 0.375rem 0.65rem !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    line-height: 1.4 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15) !important;
}

input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="time"].form-control,
input[type="month"].form-control,
input[type="week"].form-control {
    font-size: 0.8125rem !important;
    padding: 0.3rem 0.65rem !important;
    height: auto !important;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.15);
}

.glass-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    border: none;
}

.glass-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, var(--primary-color));
    color: white;
}

/* ============================================
   GLOBAL BUTTON GLASSMORPHISM STYLING
   Apply glassmorphism effects to ALL buttons
   ============================================ */

/* Base button glassmorphism - excludes btn-close, auth buttons, password-toggle */
/* Removed global white background - let specific button classes handle colors */

/* Button hover effects */
button:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):not(.password-toggle):hover,
.btn:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    transform: translateY(-2px) !important;
}

/* Button active/focus states */
button:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):not(.password-toggle):active,
.btn:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):active,
input[type="button"]:active,
input[type="submit"]:active,
button:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):not(.password-toggle):focus,
.btn:not(.btn-close):not(.btn-login):not(.btn-reset):not(.btn-submit):focus,
input[type="button"]:focus,
input[type="submit"]:focus {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Bootstrap Primary Button - Uses system preference color */
.btn-primary {
    background: var(--btn-primary-color, #3b82f6) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid var(--btn-primary-color, #3b82f6) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius, 12px) !important;
}

.btn-primary:hover {
    filter: brightness(0.9) !important;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Bootstrap Secondary Button - Uses system preference color */
.btn-secondary {
    background: var(--btn-secondary-color, #6c757d) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid var(--btn-secondary-color, #6c757d) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius, 12px) !important;
}

.btn-secondary:hover {
    filter: brightness(0.9) !important;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Bootstrap Success Button - Uses system preference color */
.btn-success {
    background: var(--btn-success-color, #198754) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid var(--btn-success-color, #198754) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius, 12px) !important;
}

.btn-success:hover {
    filter: brightness(0.9) !important;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Bootstrap Danger Button - Uses system preference color */
.btn-danger {
    background: var(--btn-danger-color, #dc3545) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid var(--btn-danger-color, #dc3545) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius, 12px) !important;
}

.btn-danger:hover {
    filter: brightness(0.9) !important;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Bootstrap Warning Button */
.btn-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9)) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 16px 0 rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.95), rgba(245, 158, 11, 0.95)) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 8px 24px 0 rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: #1e293b !important;
}

/* Bootstrap Info Button */
.btn-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(8, 145, 178, 0.9)) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.95), rgba(6, 182, 212, 0.95)) !important;
    border-color: rgba(6, 182, 212, 0.5) !important;
    box-shadow: 0 8px 24px 0 rgba(6, 182, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    color: white !important;
}

/* Bootstrap Light Button */
.btn-light {
    background: rgba(248, 249, 250, 0.9) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-light:hover {
    background: rgba(248, 249, 250, 1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
    color: #1e293b !important;
}

/* Bootstrap Dark Button */
.btn-dark {
    background: rgba(33, 37, 41, 0.9) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 1px solid rgba(33, 37, 41, 0.4) !important;
    color: white !important;
    box-shadow: 0 4px 16px 0 rgba(33, 37, 41, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-dark:hover {
    background: rgba(33, 37, 41, 0.95) !important;
    border-color: rgba(33, 37, 41, 0.5) !important;
    box-shadow: 0 8px 24px 0 rgba(33, 37, 41, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* Bootstrap Outline Buttons */
.btn-outline-primary {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(59, 130, 246, 0.6) !important;
    color: #3b82f6 !important;
    box-shadow: 0 4px 16px 0 rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-primary:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.8) !important;
    color: #2563eb !important;
    box-shadow: 0 8px 24px 0 rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(108, 117, 125, 0.6) !important;
    color: #6c757d !important;
    box-shadow: 0 4px 16px 0 rgba(108, 117, 125, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-secondary:hover {
    background: rgba(108, 117, 125, 0.15) !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
    color: #5a6268 !important;
    box-shadow: 0 8px 24px 0 rgba(108, 117, 125, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-outline-success {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(16, 185, 129, 0.6) !important;
    color: #10b981 !important;
    box-shadow: 0 4px 16px 0 rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-success:hover {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.8) !important;
    color: #059669 !important;
    box-shadow: 0 8px 24px 0 rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-outline-danger {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(239, 68, 68, 0.6) !important;
    color: #ef4444 !important;
    box-shadow: 0 4px 16px 0 rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    color: #dc2626 !important;
    box-shadow: 0 8px 24px 0 rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-outline-warning {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(245, 158, 11, 0.6) !important;
    color: #f59e0b !important;
    box-shadow: 0 4px 16px 0 rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.8) !important;
    color: #d97706 !important;
    box-shadow: 0 8px 24px 0 rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.btn-outline-info {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: var(--blur-light) !important;
    -webkit-backdrop-filter: var(--blur-light) !important;
    border: 2px solid rgba(6, 182, 212, 0.6) !important;
    color: #06b6d4 !important;
    box-shadow: 0 4px 16px 0 rgba(6, 182, 212, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.btn-outline-info:hover {
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: rgba(6, 182, 212, 0.8) !important;
    color: #0891b2 !important;
    box-shadow: 0 8px 24px 0 rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

/* Button sizes */
.btn-sm {
    border-radius: 10px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
}

.btn-lg {
    border-radius: 14px !important;
    padding: 0.875rem 2rem !important;
    font-size: 1.125rem !important;
}

/* Disabled buttons */
button:disabled,
.btn:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

button:disabled:hover,
.btn:disabled:hover,
input[type="button"]:disabled:hover,
input[type="submit"]:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Alert close button: plain X only - no glassmorphism (login, dashboard, all alerts) */
.alert .btn-close {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: transparent !important;
    opacity: 0.5 !important;
}
.alert .btn-close:hover {
    opacity: 0.75 !important;
}

/* Button groups */
.btn-group .btn {
    border-radius: 0 !important;
}

.btn-group .btn:first-child {
    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;
}

.btn-group .btn:last-child {
    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

/* Link buttons */
a.btn {
    text-decoration: none !important;
}

/* ============================================
   GLOBAL TABLE STYLING SYSTEM
   Modern glassmorphism tables for all views
   ============================================ */

/* Base Table Styles - Applied to ALL tables */
.table {
    width: 100%;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-collapse: separate;
    border-spacing: 0;
}

/* Table Header */
.table thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.table thead th {
    padding: 0.375rem 0.625rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #1e293b;
    border: none;
    vertical-align: middle;
    white-space: nowrap;
    position: relative;
    line-height: 1.3;
}

.table thead th:first-child {
    border-top-left-radius: 0;
}

.table thead th:last-child {
    border-top-right-radius: 0;
}

.table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
}

/* Table Body */
.table tbody {
    background: rgba(255, 255, 255, 0.6);
}

.table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.5);
    height: auto;
}

.table tbody tr:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.1);
}

.table tbody td {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: #334155;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    vertical-align: middle;
    background: transparent;
    line-height: 1.3;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* Striped Rows */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(248, 250, 252, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.table-striped tbody tr:nth-of-type(odd):hover {
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.table-striped tbody tr:nth-of-type(even) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* Bordered Table */
.table-bordered {
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.table-bordered thead th,
.table-bordered tbody td {
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.table-bordered thead th {
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

/* All tables should have visible row borders */
.table tbody td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.table tbody tr:last-child td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* Hover Effect */
.table-hover tbody tr {
    cursor: pointer;
}

.table-hover tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 4px 0 0 rgba(59, 130, 246, 0.5);
}

/* Small Table - Even more compact */
.table-sm thead th,
.table-sm tbody td {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.table-sm thead th {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
}

/* Table with Glassmorphism Class (for explicit styling) */
.glass-table {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Table Actions Column */
.table-actions {
    white-space: nowrap;
    width: 1%;
}

.table-actions .btn {
    margin: 0 0.125rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Table Status Badges */
.table .badge {
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.6875rem;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    line-height: 1.2;
}

/* Table Images */
.table img {
    border-radius: 6px;
    object-fit: cover;
}

.table .table-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Table Links */
.table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.table a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Table Responsive Wrapper */
.table-responsive {
    border-radius: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.table-responsive .table {
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

/* Empty State */
.table-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: block;
}

.table-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* Table Footer */
.table tfoot {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-top: 2px solid rgba(59, 130, 246, 0.2);
}

.table tfoot td {
    padding: 0.375rem 0.625rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #1e293b;
    border: none;
    line-height: 1.3;
}

/* Table with Card Wrapper */
.table-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.table-card .table {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Sortable Table Headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

.table th.sortable:hover {
    background: rgba(59, 130, 246, 0.1);
}

.table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--text-light);
    opacity: 0.5;
}

.table th.sortable.sort-asc::after {
    content: '↑';
    color: var(--primary-color);
    opacity: 1;
}

.table th.sortable.sort-desc::after {
    content: '↓';
    color: var(--primary-color);
    opacity: 1;
}

/* Table Variants */
.table-primary thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
}

.table-success thead {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
}

.table-warning thead {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
}

.table-danger thead {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
}

.table-info thead {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(8, 145, 178, 0.15) 100%);
}

/* Table Loading State */
.table-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ============================================
   GLOBAL PAGINATION (tables / list views)
   Use: <?= view('partials/pagination', ['pager' => $pager, 'itemLabel' => 'students']) ?>
   ============================================ */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 0.8125rem;
}

.pagination-bar-summary {
    color: var(--text-muted, #64748b);
}

.pagination-bar-links {
    display: flex;
    align-items: center;
}

/* Global pagination nav (links) */
.pagination-global-wrapper {
    display: inline-block;
}

.pagination-global {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-global .page-item {
    display: inline-block;
}

.pagination-global .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pagination-global .page-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1d4ed8;
}

.pagination-global .page-item.active .page-link {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    border-color: rgba(59, 130, 246, 0.4);
    color: #1d4ed8;
    font-weight: 600;
}

.pagination-global .page-item.disabled .page-link {
    background: rgba(248, 250, 252, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    color: #94a3b8;
    cursor: not-allowed;
}

/* Settings > Users: column dropdown must appear over filter card and table */
.users-page-header {
    position: relative;
    z-index: 1050;
}
.column-selector-dropdown {
    position: relative;
    z-index: 1060;
}
.column-selector-dropdown .users-columns-dropdown.dropdown-menu {
    z-index: 1060 !important;
}
/* When open, pin menu to viewport so it is never behind filter/table */
.column-selector-dropdown .users-columns-dropdown.dropdown-menu.show {
    position: fixed !important;
    z-index: 9999 !important;
}
.users-page-filters,
.users-page-table-wrap {
    position: relative;
    z-index: 1;
}

/* Table Pagination Integration (legacy / inline) */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0;
    font-size: 0.8125rem;
}

/* Table Search/Filter Bar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px 16px 0 0;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

/* Responsive Utilities */
.responsive-container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

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

.responsive-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive Typography */
.responsive-heading {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.responsive-text {
    font-size: clamp(0.875rem, 2vw, 1rem);
    line-height: 1.6;
}

.responsive-subheading {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    font-weight: 600;
}

/* Mobile-First Responsive Design */
@media (max-width: 400px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .stat-card,
    .content-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .responsive-container {
        max-width: 540px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .responsive-container {
        max-width: 720px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .stat-card,
    .content-card {
        padding: 1.5rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .responsive-container {
        max-width: 960px;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .responsive-container {
        max-width: 1140px;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Extra Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .responsive-container {
        max-width: 1320px;
    }
}

/* Tablet Specific (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        --sidebar-width: var(--sidebar-width-tablet);
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .content-card {
        padding: 1.25rem;
    }
}

/* Mobile Specific (up to 767px) */
@media (max-width: 767px) {
    :root {
        --sidebar-width: var(--sidebar-width-mobile);
    }
    
    .stat-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .content-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }
    
    /* Responsive Tables */
    .table {
        font-size: 0.8125rem;
        border-radius: 0;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.375rem 0.5rem;
    }
    
    .table thead th {
        font-size: 0.7rem;
    }
    
    .table tbody td {
        font-size: 0.75rem;
    }
    
    .table-responsive {
        border-radius: 0;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 576px) {
        .table-responsive {
            display: block;
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        .table {
            min-width: 600px;
        }
        
        .table thead th,
        .table tbody td {
            padding: 0.3rem 0.4rem;
            font-size: 0.75rem;
        }
        
        .table thead th {
            font-size: 0.6875rem;
        }
        
        .table-actions {
            position: sticky;
            right: 0;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .stat-card,
    .content-card {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .glass,
    .glass-medium,
    .glass-dark,
    .stat-card,
    .content-card {
        background: white;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glass,
    .stat-card,
    .content-card {
        border-width: 0.5px;
    }
}

/* Reduced Motion (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    .glass,
    .stat-card,
    .content-card,
    .glass-btn {
        transition: none;
    }
    
    .stat-card:hover,
    .content-card:hover,
    .glass-btn:hover {
        transform: none;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg-light: rgba(30, 41, 59, 0.4);
        --glass-bg-medium: rgba(30, 41, 59, 0.6);
        --text-dark: #f1f5f9;
        --text-muted: #cbd5e1;
    }
}

/* Utility Classes */
.glass-padding-sm { padding: 0.75rem; }
.glass-padding-md { padding: 1.5rem; }
.glass-padding-lg { padding: 2rem; }

.glass-margin-sm { margin: 0.75rem; }
.glass-margin-md { margin: 1.5rem; }
.glass-margin-lg { margin: 2rem; }

.glass-rounded-sm { border-radius: 8px; }
.glass-rounded-md { border-radius: 16px; }
.glass-rounded-lg { border-radius: 24px; }

/* Animation Utilities */
@keyframes glassFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-animate {
    animation: glassFadeIn 0.5s ease-out;
}

/* Scrollbar Styling for Glass Elements */
.glass-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.glass-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Flatpickr theme overrides */
.flatpickr-calendar {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: inherit;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.flatpickr-day.today {
    border-color: var(--primary-color);
}
.flatpickr-day.today:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--primary-color);
}
.flatpickr-input.form-control[readonly] {
    background-color: #fff !important;
    cursor: pointer;
}
.flatpickr-input ~ .form-control[readonly] {
    background-color: #fff !important;
}

.glass-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.glass-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
