/* ==========================================================================
   CSS DESIGN SYSTEM: NONG WUA SO PHITTAYAKOM INTERNSHIP SYSTEM
   STYLE: Premium Light Mode + Glassmorphism
   ========================================================================== */

/* 1. CONFIGURATION & VARIABLES */
:root {
    --primary: #003893;
    --primary-light: #0056d2;
    --primary-glow: rgba(0, 56, 147, 0.15);
    --secondary: #fec20c;
    --dark: #2b2d42;
    --light: #f8f9fa;
    
    /* Status Colors */
    --status-pending: #ffd166;
    --status-pending-text: #6f4e00;
    --status-cancelled: #ff4d6d;
    --status-cancelled-text: #ffffff;
    --status-completed: #06d6a0;
    --status-completed-text: #ffffff;
    
    /* Glassmorphic variables */
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --glass-blur: blur(14px);
    
    /* Layout & Fonts */
    --font-thai: 'Sarabun', 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-thai);
    color: var(--dark);
    background: linear-gradient(135deg, #eef1f6 0%, #e3e9f3 50%, #d5e0f2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 2. BACKGROUND GLOW EFFECTS */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.55;
    pointer-events: none;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(142, 197, 252, 0.6) 0%, rgba(224, 195, 252, 0.2) 70%);
    top: -100px;
    right: -100px;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(254, 194, 12, 0.35) 0%, rgba(255, 255, 255, 0.1) 70%);
    bottom: -150px;
    left: -150px;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 56, 147, 0.12) 0%, rgba(254, 194, 12, 0.08) 70%);
    top: 40%;
    left: 35%;
}

/* 3. APPLICATION CONTAINER */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 4. MAIN HEADER & NAVIGATION */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    width: 100%;
}

.school-logo {
    height: 75px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
    transition: transform 0.5s ease;
}

.school-logo:hover {
    transform: rotate(360deg);
}

.title-group h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.title-group h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    backdrop-filter: blur(8px);
    width: auto;
    max-width: 100%;
    overflow-x: auto;
}

/* Hide Scrollbar for Nav */
.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    border: none;
    background: transparent;
    padding: 10px 22px;
    border-radius: 30px;
    color: var(--dark);
    font-family: var(--font-thai);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-btn i {
    font-size: 1.05rem;
    color: #6c757d;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary);
}

.nav-btn:hover i {
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 56, 147, 0.25);
}

.nav-btn.active i {
    color: #ffffff;
}

/* 5. GLASS CARDS & GENERAL LAYOUT */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 16px;
}

.card-header h3, .card-header h4 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i, .card-header h4 i {
    color: var(--primary);
}

.card-header p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 4px;
}

/* SPA Tabs Switching */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.4s ease-out;
}

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

/* 6. FORM STYLING & VALIDATIONS */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

label i {
    color: var(--primary-light);
}

.required {
    color: var(--status-cancelled);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="url"],
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.7);
    font-family: var(--font-thai);
    font-size: 0.95rem;
    color: var(--dark);
    transition: var(--transition);
    outline: none;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder {
    color: #adb5bd;
}

input:focus, select:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-readonly {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    color: #555555 !important;
    cursor: not-allowed;
    font-weight: 600;
}

.input-help {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Error states */
.error-msg {
    color: var(--status-cancelled);
    font-size: 0.85rem;
    display: none;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.form-group.invalid input,
.form-group.invalid select {
    border-color: var(--status-cancelled);
    background: rgba(255, 77, 109, 0.03);
}

.form-group.invalid .error-msg {
    display: flex;
}

/* Toggle Buttons for Radio Options */
.button-toggle-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.6);
    color: var(--dark);
    font-family: var(--font-thai);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-light);
}

.toggle-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(89, 97, 249, 0.2);
}

/* Toggle btn with danger action (Yes/No) */
#btn-contact-yes.active {
    background: #06d6a0;
    border-color: #06d6a0;
    box-shadow: 0 4px 12px rgba(6, 214, 160, 0.2);
}

#btn-contact-no.active {
    background: #ef233c;
    border-color: #ef233c;
    box-shadow: 0 4px 12px rgba(239, 35, 60, 0.2);
}

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

.alert-danger {
    background: rgba(255, 77, 109, 0.12);
    border: 1px solid rgba(255, 77, 109, 0.3);
    color: #d90429;
}

.alert-banner i {
    font-size: 1.2rem;
}

/* Dynamic Forms */
.student-forms-section {
    margin-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 24px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.student-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.student-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dotted rgba(0,0,0,0.08);
}

/* Form Action Buttons */
.submit-btn, .save-btn, .action-btn {
    border: none;
    font-family: var(--font-thai);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #0056d2 100%);
    color: #ffffff;
    padding: 14px 30px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(0, 56, 147, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 56, 147, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #cccccc;
    color: #666666;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 7. STATUS SEARCHING TAB */
.search-card {
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.search-box-container {
    margin: 24px 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    width: 100%;
}

.search-input-wrapper input {
    padding-left: 46px;
    font-size: 1.05rem;
    border-radius: 16px;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.15rem;
}

.search-btn {
    background: var(--primary);
    border: none;
    color: #ffffff;
    padding: 0 28px;
    border-radius: 16px;
    font-family: var(--font-thai);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Search Results Cards */
.result-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.status-badge-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.result-id {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.status-badge {
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.pending {
    background: var(--status-pending);
    color: var(--status-pending-text);
}

.status-badge.cancelled {
    background: var(--status-cancelled);
    color: var(--status-cancelled-text);
}

.status-badge.completed {
    background: var(--status-completed);
    color: var(--status-completed-text);
}

.result-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.info-item {
    font-size: 0.95rem;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.info-value {
    color: var(--dark);
    font-weight: 500;
}

.student-list-container {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.student-list-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-item {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

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

.download-section {
    text-align: center;
}

.download-pdf-btn {
    background: linear-gradient(135deg, #2ec4b6 0%, #0f9f90 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: var(--font-thai);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 196, 182, 0.3);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.download-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 196, 182, 0.45);
}

/* 8. DASHBOARD STATISTICS */
.dashboard-card {
    margin-top: 30px;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 700;
}

.filter-select {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    width: auto;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.stat-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.stat-info h4 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-info p {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
}

/* Stat Box Specific Themes */
.box-total .stat-icon { background: rgba(0, 56, 147, 0.1); color: var(--primary); }
.box-total h4 { color: var(--primary); }

.box-pending .stat-icon { background: rgba(255, 209, 102, 0.15); color: #d09000; }
.box-pending h4 { color: #d09000; }

.box-cancelled .stat-icon { background: rgba(255, 77, 109, 0.1); color: #ff4d6d; }
.box-cancelled h4 { color: #ff4d6d; }

.box-completed .stat-icon { background: rgba(6, 214, 160, 0.1); color: #06d6a0; }
.box-completed h4 { color: #06d6a0; }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.chart-container h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
    text-align: left;
    width: 100%;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 250px !important;
}

/* 9. ADMIN SYSTEM STYLING */
.login-card {
    max-width: 450px;
    margin: 40px auto;
}

.security-icon {
    font-size: 3rem;
    color: var(--primary);
    background: rgba(0, 56, 147, 0.08);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #6c757d;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Admin Dashboard Panel */
.admin-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(255, 255, 255, 0.45);
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-profile i {
    font-size: 2.5rem;
    color: var(--primary);
}

.profile-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    display: block;
}

.profile-school {
    font-size: 0.8rem;
    color: #6c757d;
}

.admin-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.secondary-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.danger-btn {
    background: #ef233c;
    color: #ffffff;
}

.danger-btn:hover {
    background: #d90429;
    box-shadow: 0 4px 12px rgba(239, 35, 60, 0.3);
}

/* Config Card */
.config-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 56, 147, 0.3);
}

/* Admin Data Table Styling */
.table-card {
    overflow: hidden;
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-search-box {
    position: relative;
}

.table-search-box input {
    padding-left: 36px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.85rem;
    width: 250px;
    border-radius: 8px;
}

.table-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.85rem;
}

.refresh-btn {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.12);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    transition: var(--transition);
}

.refresh-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.refresh-btn:hover i {
    animation: rotate 0.8s ease-in-out;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    background: rgba(0, 56, 147, 0.08);
    color: var(--dark);
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(0, 56, 147, 0.15);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* PDF Upload Button in Table */
.pdf-upload-label {
    background: rgba(0, 56, 147, 0.08);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.pdf-upload-label:hover {
    background: var(--primary);
    color: #ffffff;
}

.pdf-upload-label input[type="file"] {
    display: none;
}

.pdf-link-btn {
    color: #0c8577;
    background: rgba(46, 196, 182, 0.12);
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pdf-link-btn:hover {
    background: #2ec4b6;
    color: #ffffff;
}

/* Action Buttons inside Table */
.tb-action-group {
    display: flex;
    gap: 6px;
}

.tb-btn {
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tb-btn-edit {
    background: rgba(255, 209, 102, 0.2);
    color: #a67000;
}

.tb-btn-edit:hover {
    background: #ffd166;
    color: #3d2b00;
}

.tb-btn-delete {
    background: rgba(255, 77, 109, 0.15);
    color: #ef233c;
}

.tb-btn-delete:hover {
    background: #ff4d6d;
    color: #ffffff;
}

/* Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--primary);
}

.loading-spinner i {
    font-size: 1.8rem;
}

.loading-spinner p {
    font-size: 0.85rem;
    color: #6c757d;
}

/* 10. MODAL DIALOG STYLE */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    width: 100%;
    max-width: 550px;
    margin-bottom: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.modal-header h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: #6c757d;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal-btn:hover {
    color: #ef233c;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.modal-actions button {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Animation utilities */
.hidden {
    display: none !important;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

/* 11. FOOTER SECTION */
.main-footer {
    margin-top: auto;
    padding-top: 40px;
}

.footer-glass {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(8px);
    text-align: center;
    box-shadow: var(--glass-shadow);
}

.contact-info {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.contact-label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.contact-detail {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.contact-name {
    font-weight: 600;
    color: var(--dark);
}

.contact-phone a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.contact-phone a:hover {
    text-decoration: underline;
}

.contact-divider {
    color: rgba(0,0,0,0.2);
}

.copyright p {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 12. RESPONSIVE MEDIA QUERIES */

/* Tablet & iPad */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table th, .data-table td {
        padding: 10px 12px;
    }
}

/* Mobile Screens */
@media (max-width: 768px) {
    .main-header {
        align-items: flex-start;
    }
    
    .logo-area {
        gap: 12px;
    }
    
    .school-logo {
        height: 60px;
    }
    
    .title-group h1 {
        font-size: 1.3rem;
    }
    
    .title-group h2 {
        font-size: 0.95rem;
    }
    
    .nav-menu {
        width: 100%;
        border-radius: 12px;
        padding: 4px;
    }
    
    .nav-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.85rem;
        justify-content: center;
    }
    
    .nav-btn span {
        display: none; /* ซ่อนข้อความ เหลือแต่ไอคอนในมือถือ */
    }
    
    .nav-btn.active span {
        display: inline; /* แสดงข้อความปุ่มที่ทำงานอยู่ */
    }
    
    .glass-card {
        padding: 20px 16px;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-btn {
        padding: 12px;
        justify-content: center;
    }
    
    .result-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .flex-header {
        flex-direction: column;
    }
    
    .dashboard-filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-group {
        flex: 1;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .admin-top-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .admin-buttons {
        width: 100%;
    }
    
    .admin-buttons button {
        flex: 1;
    }
    
    .table-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search-box input {
        width: 100%;
    }
}
