/* ==========================================
   CSS variables & Design System
   ========================================== */
:root {
    --primary: #0f2d59;
    --primary-light: #1e4a8a;
    --primary-rgb: 15, 45, 89;
    --secondary: #d4af37;
    --secondary-hover: #bda032;
    --secondary-rgb: 212, 175, 55;
    
    --bg-body: #f4f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #0a182e;
    --bg-sidebar-hover: #122849;
    
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --success-light: rgba(16, 185, 129, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    --info-light: rgba(59, 130, 246, 0.1);

    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 20px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(15, 45, 89, 0.08), 0 10px 10px -5px rgba(15, 45, 89, 0.04);
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Utilities */
.w-100 { width: 100%; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.overflow-x { overflow-x: auto; }
.required { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(15, 45, 89, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: rgba(15, 45, 89, 0.05);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* ==========================================
   Login Screen CSS Styling
   ========================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #09182e 0%, #1e3c72 100%);
    padding: 20px;
}

.login-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px;
    padding: 40px 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 90px;
    height: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header h2 {
    font-size: 19px;
    color: var(--primary);
    font-weight: 700;
}

.login-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.login-card label {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 6px;
    display: block;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    outline: none;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
    transition: var(--transition-fast);
}

.login-card input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 74, 138, 0.15);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

/* ==========================================
   App Container Layout
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* ==========================================
   Sidebar Styles
   ========================================== */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-smooth);
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-logo {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-info h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-info p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.user-profile-section {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.user-details h4 {
    font-size: 14px;
    font-weight: 500;
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 20px;
    margin-top: 2px;
}

.role-badge.teacher { background-color: var(--info-light); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.2); }
.role-badge.admin { background-color: var(--danger-light); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.2); }

.sidebar-nav {
    padding: 20px 12px;
    flex-grow: 1;
}

.sidebar-nav ul li {
    margin-bottom: 6px;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
}

.sidebar-nav ul li a i {
    width: 20px;
    font-size: 16px;
    text-align: center;
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li.active a {
    color: var(--text-white);
    background-color: var(--bg-sidebar-hover);
}

.sidebar-nav ul li.active a {
    border-left: 4px solid var(--secondary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Main Content Layout & Header
   ========================================== */
.main-content {
    flex-grow: 1;
    padding: 24px 32px 40px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 45, 89, 0.08);
}

.toggle-sidebar {
    display: none;
    font-size: 20px;
    cursor: pointer;
}

.page-title-area h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   Tab Contents & Display Controls
   ========================================== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* ==========================================
   Stats Cards Grid
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(15, 45, 89, 0.03);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bg-blue-light { background-color: var(--info-light); color: var(--info); }
.bg-gold-light { background-color: rgba(212, 175, 55, 0.12); color: #c09619; }
.bg-green-light { background-color: var(--success-light); color: var(--success); }
.bg-red-light { background-color: var(--danger-light); color: var(--danger); }

.stat-info h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0;
}

.stat-trend {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ==========================================
   Dashboard Widgets
   ========================================== */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
    flex-grow: 1;
}

/* Progress List Chart styling */
.chart-progress-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.progress-val {
    color: var(--primary);
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
}

.progress-bar.bg-blue { background-color: var(--info); }
.progress-bar.bg-purple { background-color: #8b5cf6; }
.progress-bar.bg-orange { background-color: var(--warning); }
.progress-bar.bg-green { background-color: var(--success); }

/* ==========================================
   Tables Style
   ========================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Table statuses & badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.success { background-color: var(--success-light); color: var(--success); }
.status-badge.pending { background-color: var(--warning-light); color: var(--warning); }
.status-badge.failed { background-color: var(--danger-light); color: var(--danger); }

/* ==========================================
   Reports Tab View Grid layout
   ========================================== */
.reports-search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    margin-bottom: 24px;
    gap: 12px;
}

.reports-search-bar i {
    color: var(--text-muted);
}

.reports-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-family: 'Sarabun', sans-serif;
    font-size: 14px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.report-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.report-card-header .date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.report-card-body h4 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 4px;
}

.report-card-body .company {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-scores-summary {
    background-color: #f8fafc;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-size: 12px;
}

.report-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    font-size: 12px;
}

/* ==========================================
   Forms Input Styling
   ========================================== */
.form-section {
    background-color: #f8fafc;
    border-radius: var(--border-radius-sm);
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.form-section h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 12px;
    border-bottom: 1.5px solid rgba(15, 45, 89, 0.08);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 500;
}

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

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    font-family: 'Sarabun', sans-serif;
    font-size: 13px;
    outline: none;
    width: 100%;
    background-color: var(--bg-card);
    transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 74, 138, 0.12);
}

/* Dynamic rows for Part 2 */
.student-row-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 2fr auto;
    gap: 12px;
    align-items: end;
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.btn-remove-row {
    background: transparent;
    color: var(--danger);
    font-size: 20px;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-fast);
}

.btn-remove-row:hover {
    transform: scale(1.1);
}

/* ==========================================
   Part 3: Evaluation Matrix Table
   ========================================== */
.evaluation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
    background-color: #ffffff;
}

.evaluation-table th,
.evaluation-table td {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}

.evaluation-table th {
    background-color: #f1f5f9;
    color: var(--primary);
    font-weight: 600;
}

.radios-cell {
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

.radio-lbl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.radio-lbl input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.live-score-panel {
    background-color: var(--primary);
    color: var(--text-white);
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* ==========================================
   Part 4: Photo Uploader Grid
   ========================================== */
.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
}

.photo-upload-box {
    position: relative;
    height: 120px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--border-radius-sm);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.photo-upload-box:hover {
    border-color: var(--primary-light);
    background-color: #f8fafc;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.upload-area i {
    font-size: 24px;
    margin-bottom: 6px;
    color: var(--primary-light);
}

.file-input-hide {
    display: none;
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
    background-color: #ffffff;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-container .btn-remove-img {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(239, 68, 68, 0.85);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

/* ==========================================
   Signature Drawing Pad Layout
   ========================================== */
.signature-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.signature-container {
    background-color: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--border-radius-sm);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#signature-pad {
    width: 100%;
    max-width: 450px;
    height: 150px;
    background-color: #f8fafc;
    border-radius: 4px;
    cursor: crosshair;
}

.btn-clear-sig {
    margin-top: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    transition: var(--transition-fast);
}

.btn-clear-sig:hover {
    color: var(--danger);
}

/* ==========================================
   Modal Dialog Layouts
   ========================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 24, 46, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

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

.modal-container {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Detailed report popup formatting */
.detail-modal {
    max-width: 750px;
}

.detail-view-container {
    padding: 10px;
}

.detail-header {
    text-align: center;
    margin-bottom: 24px;
}

.detail-logo {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 8px;
}

.detail-header h3 {
    font-size: 18px;
    color: var(--primary);
}

.detail-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-grid-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
    background-color: #f8fafc;
    padding: 16px;
    border-radius: var(--border-radius-sm);
}

.info-field {
    font-size: 13px;
}

.info-field label {
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-bottom: 2px;
}

.score-details-list {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.score-row-header {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr;
    background-color: #f1f5f9;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
}

.score-row {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.score-row:last-child {
    border-bottom: none;
}

.score-badge-detail {
    display: inline-block;
    padding: 2px 10px;
    background-color: rgba(212, 175, 55, 0.15);
    color: #856404;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
}

.text-opinion-box {
    margin-top: 16px;
    padding: 14px;
    border-left: 4px solid var(--primary);
    background-color: #f8fafc;
    font-size: 13px;
}

.text-opinion-box label {
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.photos-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.photo-summary-img {
    height: 100px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.photo-summary-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-signatures {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    text-align: center;
}

.sig-box {
    width: 200px;
}

.sig-image-container {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.sig-image-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.sig-box span {
    font-size: 12px;
    display: block;
    border-top: 1px dashed #cbd5e1;
    padding-top: 6px;
}

/* ==========================================
   Toast Notification Toast Style
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
}

.toast {
    background-color: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 5px solid var(--info);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast i {
    font-size: 18px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }

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

/* ==========================================
   Responsive Web Design Rules (Media Queries)
   ========================================== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .toggle-sidebar {
        display: block;
    }
    
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px 16px 30px;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .student-row-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .student-row-grid button {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

/* ==========================================
   OFFICIAL GOVERNMENT PRINT LAYOUT CSS (A4 Print Setup)
   ========================================== */
#print-layout-container {
    display: none;
    position: relative;
    width: 100%;
    color: #000000;
    background-color: #ffffff;
    font-family: "TH Sarabun New", "TH Sarabun PSK", "Sarabun", sans-serif;
    font-size: 16pt;
    line-height: 1.2;
    padding: 0px;
    margin: 0px;
}

@media print {
    /* Hide screen elements completely so they don't occupy layout space */
    body > *:not(#print-layout-container) {
        display: none !important;
    }
    
    #print-layout-container {
        display: block !important;
    }

    /* Page margins setting */
    @page {
        size: A4;
        margin-left: 1.0in;
        margin-right: 1.0in;
        margin-top: 1.0in;
        margin-bottom: 1.0in;
    }
}

.print-doc {
        width: 100%;
        background-color: #ffffff;
    }

    .print-header-logo {
        text-align: center;
        margin-top: 0px;
        margin-bottom: 6px;
    }

    .print-header-logo img {
        width: 70px;
        height: 70px;
        object-fit: contain;
    }

    .print-title {
        text-align: center;
        font-weight: bold;
        font-size: 18pt;
        margin-bottom: 10px;
    }

    .print-section-title {
        font-weight: bold;
        font-size: 18pt;
        border-bottom: 1px solid #000000;
        margin-top: 8px;
        margin-bottom: 3px;
        padding-bottom: 1px;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 4px;
        margin-bottom: 6px;
        font-size: 16pt;
    }

    .print-table th, .print-table td {
        border: 1px solid #000000;
        padding: 4px 8px;
        text-align: left;
    }

    .print-table th {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: bold;
        text-align: center;
    }

    .print-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .print-field {
        margin-bottom: 6px;
    }

    .print-field strong {
        font-weight: bold;
    }

    .print-textbox {
        padding: 2px 0px;
        margin-top: 2px;
        font-size: 16pt;
    }

    .print-signatures-area {
        margin-top: 15px;
        display: flex;
        justify-content: flex-end;
        text-align: center;
    }

    .print-sig-box {
        width: 250px;
    }

    .print-sig-img {
        height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
    }

    .print-sig-img img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .print-photos-section {
        page-break-before: always; /* push photos to next page */
        margin-top: 20px;
    }

    .print-photos-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 15px;
    }

    .print-photo-item {
        border: 1px solid #000000;
        padding: 5px;
        text-align: center;
    }

    .print-photo-item img {
        width: 100%;
        height: 150px;
        object-fit: cover;
    }
    
    .print-photo-item span {
        display: block;
        margin-top: 5px;
        font-size: 14pt;
    }
