/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151 !important;
    background-color: #f9fafb !important;
    /* 강제로 밝은 배경 적용 */
}

/* 다크모드 방지 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #f9fafb !important;
        color: #374151 !important;
    }
    
    .login-container {
        background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%) !important;
    }
    
    .login-card {
        background: white !important;
        color: #374151 !important;
    }
    
    input, textarea, select {
        background-color: white !important;
        color: #374151 !important;
        border-color: #d1d5db !important;
    }
}

/* Page Navigation */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 수업계획 안내 오버레이 - 새로 추가 */
.lesson-plan-guidance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.guidance-content {
    background: white !important;
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5e7eb;
    position: relative;
    animation: slideInUp 0.4s ease-out;
    color: #1f2937 !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guidance-icon {
    margin-bottom: 1.5rem;
}

.guidance-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937 !important;
    margin-bottom: 1rem;
}

.guidance-content p {
    color: #6b7280 !important;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.guidance-content p:last-of-type {
    margin-bottom: 2rem;
}

.guidance-content .btn {
    min-width: 150px;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

/* Header */
.header {
    background: white !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937 !important;
    margin-bottom: 0.25rem;
}

.user-info p {
    color: #6b7280 !important;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #f9fafb !important;
}

/* Enhanced Button Base Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    line-height: 1.5;
    outline: none;
    position: relative;
    min-height: 38px;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

/* Primary Button - 파란색 계열 */
.btn.primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn.primary:active {
    background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
    transform: translateY(0);
}

/* Secondary Button - 회색 계열 */
.btn.secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    color: #374151 !important;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn.secondary:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #1f2937 !important;
    border-color: #9ca3af;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn.secondary:active {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    transform: translateY(0);
}

/* Success Button - 녹색 계열 */
.btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn.success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn.success:active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(0);
}

/* Danger Button - 빨간색 계열 */
.btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn.danger:active {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(0);
}

/* Warning Button - 주황색 계열 */
.btn.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn.warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn.warning:active {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    transform: translateY(0);
}

/* Small Button Size */
.btn.small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    min-height: 32px;
}

.btn.small svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Large Button Size */
.btn.large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
}

.btn.large svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Logout Button 특별 스타일 */
.logout-btn {
    padding: 0.625rem 1rem;
    background: white !important;
    border: 1px solid #e5e7eb;
    color: #6b7280 !important;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-height: 38px;
}

.logout-btn:hover {
    color: #dc2626 !important;
    border-color: #fecaca;
    background: #fef2f2 !important;
    transform: translateY(-1px);
}

.logout-btn:active {
    background: #fee2e2 !important;
    transform: translateY(0);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151 !important;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white !important;
    color: #374151 !important;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: white !important;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.readonly-input {
    background-color: #f9fafb !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

/* Purchase Method Options */
.purchase-method-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white !important;
}

.radio-option:hover {
    border-color: #c7d2fe;
    background: #f8fafc !important;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked + .radio-custom + .radio-content {
    color: #4f46e5 !important;
}

.radio-option input[type="radio"]:checked ~ .radio-content strong {
    color: #4f46e5 !important;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #4f46e5;
    background: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.radio-custom {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.125rem;
    background: white !important;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 0.5rem;
    height: 0.5rem;
    background: #4f46e5;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4f46e5;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.radio-content p {
    color: #6b7280 !important;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.4;
}

/* File Upload Area */
.file-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    background: #fafafa !important;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #9ca3af;
    background: #f5f5f5 !important;
}

.file-upload-area.drag-over {
    border-color: #4f46e5;
    background: #f8fafc !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-content i {
    width: 3rem;
    height: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.file-upload-content p {
    color: #374151 !important;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-upload-content small {
    color: #6b7280 !important;
    font-size: 0.8rem;
}

/* Receipt Preview */
.receipt-preview {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white !important;
}

.receipt-preview img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.receipt-preview .btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    background: rgba(239, 68, 68, 0.9);
    color: white !important;
    border: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
    min-height: auto;
}

.receipt-preview .btn:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: none;
}

/* Receipt Info Section - 개선됨 */
.receipt-info {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.receipt-info.submitted {
    background: #dcfce7 !important;
    border-color: #bbf7d0;
}

.receipt-info.pending {
    background: #fef3c7 !important;
    border-color: #fde68a;
}

.receipt-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.receipt-details-summary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.receipt-details-summary small {
    color: #6b7280 !important;
    font-size: 0.75rem;
}

.receipt-help-text {
    color: #92400e !important;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.25rem;
    display: block;
}

.receipt-item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 0.25rem;
}

.receipt-item-info p {
    color: #6b7280 !important;
    font-size: 0.875rem;
}

/* Receipt Status */
.receipt-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.receipt-status.submitted {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.receipt-status.pending {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.receipt-status i {
    width: 0.875rem;
    height: 0.875rem;
}

.receipt-pending {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e !important;
    font-size: 0.75rem;
    font-weight: 500;
}

.receipt-pending i {
    width: 0.875rem;
    height: 0.875rem;
}

/* Receipt Viewer (Admin) - 개선됨 */
.receipt-viewer {
    display: grid;
    gap: 1.5rem;
}

.receipt-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.receipt-details {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #6b7280 !important;
    min-width: 100px;
    font-size: 0.875rem;
}

.detail-row span:last-child {
    color: #1f2937 !important;
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
    font-size: 0.875rem;
}

.receipt-image-container {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f9fafb !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.receipt-image-container img {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    object-fit: contain;
}

/* Modal Enhancements */
.modal-content.large {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Expanded Modal for Lesson Plan Management */
.modal-content.expanded {
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280 !important;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #374151 !important;
}

/* Purchase Method Badge */
.purchase-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.purchase-method-badge.online-purchase {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.purchase-method-badge.offline-purchase {
    background: #f3e8ff !important;
    color: #7c3aed !important;
}

.purchase-method-badge i {
    width: 0.875rem;
    height: 0.875rem;
}

/* Form Help Text */
.form-help {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280 !important;
    line-height: 1.4;
}

/* Modal - 개선된 버전 (위치 문제 완전 해결) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    /* 중앙 정렬을 위한 CSS Grid 사용 */
    place-items: center;
}

/* 모달이 활성화될 때 표시 - 개선됨 (show와 active 클래스 모두 지원) */
.modal.show,
.modal.active {
    display: grid !important;
    opacity: 1;
    visibility: visible;
}

/* 애니메이션이 없는 상태에서는 숨김 */
.modal:not(.show):not(.active) {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 모달 내용 */
.modal-content {
    background: white !important;
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    color: #1f2937 !important;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateZ(0);
    /* 모달 중앙 정렬 보장 */
    margin: auto;
    /* 모바일 대응 */
    min-width: 280px;
}

/* 모달 표시 애니메이션 */
.modal.show .modal-content,
.modal.active .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937 !important;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Cards */
.card {
    background: white !important;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #1f2937 !important;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.status-badge.approved {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.status-badge.rejected {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.status-badge.purchased {
    background: #dbeafe !important;
    color: #1e40af !important;
}

/* Lesson Plan Specific Styles */
.lesson-plan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #f9fafb !important;
}

.lesson-plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.lesson-plan-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937 !important;
    margin-bottom: 0.5rem;
}

.lesson-plan-header p {
    color: #6b7280 !important;
    font-size: 1rem;
}

.lesson-plan-content {
    background: white !important;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #1f2937 !important;
}

/* Lesson Plan Form Sections */
.basic-info-section,
.lesson-table-section,
.additional-info-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.basic-info-section:last-child,
.lesson-table-section:last-child,
.additional-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.basic-info-section h2,
.lesson-table-section h2,
.additional-info-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Lesson Table - 수정된 부분 */
.lesson-table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: white !important;
}

.lesson-table {
    width: 100%;
    min-width: 700px;
}

.table-header {
    display: grid;
    grid-template-columns: 120px 1fr 2fr; /* 수업 회차 | 수업 주제 | 수업 내용 */
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb;
}

.header-cell {
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151 !important;
    border-right: 1px solid #e5e7eb;
}

.header-cell:last-child {
    border-right: none;
}

.table-row {
    display: grid;
    grid-template-columns: 120px 1fr 2fr; /* 수업 회차 | 수업 주제 | 수업 내용 */
    border-bottom: 1px solid #e5e7eb;
    background: white !important;
}

.table-row:last-child {
    border-bottom: none;
}

.cell {
    padding: 0.75rem;
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.cell:last-child {
    border-right: none;
}

.lesson-number {
    font-weight: 500;
    color: #6b7280 !important;
    justify-content: center;
}

.topic-input,
.content-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    padding: 0.375rem;
    font-size: 0.875rem;
    background: white !important;
    color: #374151 !important;
}

.content-textarea {
    resize: vertical;
    min-height: 60px;
}

.topic-input:focus,
.content-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    background: white !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Notice Messages */
.deadline-notice,
.time-remaining-notice,
.edit-deadline-notice,
.success-message,
.test-mode-notice,
.override-notice,
.lesson-plan-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

/* Lesson Plan Messages */
.lesson-plan-message {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lesson-plan-message.info {
    background: #dbeafe !important;
    border: 1px solid #3b82f6;
    color: #1e40af !important;
}

.lesson-plan-message.success {
    background: #d1fae5 !important;
    border: 1px solid #10b981;
    color: #065f46 !important;
}

.lesson-plan-message.warning {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b;
    color: #92400e !important;
}

.lesson-plan-message.error {
    background: #fee2e2 !important;
    border: 1px solid #ef4444;
    color: #991b1b !important;
}

.deadline-notice {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b;
    color: #92400e !important;
}

.time-remaining-notice {
    background: #dbeafe !important;
    border: 1px solid #3b82f6;
    color: #1e40af !important;
}

.edit-deadline-notice {
    background: #fee2e2 !important;
    border: 1px solid #ef4444;
    color: #991b1b !important;
}

.success-message {
    background: #d1fae5 !important;
    border: 1px solid #10b981;
    color: #065f46 !important;
}

.test-mode-notice {
    background: #e0e7ff !important;
    border: 1px solid #6366f1;
    color: #4338ca !important;
}

.test-mode-notice.success {
    background: #dcfce7 !important;
    border: 1px solid #22c55e;
    color: #15803d !important;
}

.override-notice {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b;
    color: #92400e !important;
}

.override-notice.success {
    background: #dcfce7 !important;
    border: 1px solid #22c55e;
    color: #15803d !important;
}

.lesson-plan-required-notice,
.lesson-plan-draft-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: white !important;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    color: #1f2937 !important;
}

.notice-content {
    text-align: center;
}

.notice-content i {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #4f46e5;
}

.notice-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 0.5rem;
}

.notice-content p {
    color: #6b7280 !important;
    margin-bottom: 0.5rem;
}

/* Dashboard Notice */
.dashboard-notice {
    background: white !important;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4f46e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-notice .notice-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
}

.dashboard-notice .notice-content.warning {
    border-left-color: #f59e0b;
}

.dashboard-notice .notice-content.info {
    border-left-color: #3b82f6;
}

.dashboard-notice .notice-content i {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.dashboard-notice h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937 !important;
    margin-bottom: 0.25rem;
}

.dashboard-notice p {
    color: #6b7280 !important;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

/* Lesson Plan Status in Admin */
.lesson-plan-status {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.lesson-plan-status.completed {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.lesson-plan-status.draft {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.lesson-plan-status.not-started {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280 !important;
    background: white !important;
    border-radius: 0.5rem;
}

.empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.search-box input {
    padding-left: 2.5rem;
    background: white !important;
    color: #374151 !important;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .lesson-plan-container {
        padding: 1rem;
    }
    
    .lesson-plan-content {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 100px 1fr 1.5fr;
        font-size: 0.75rem;
    }
    
    .lesson-table {
        min-width: 600px;
    }

    /* 모바일 모달 최적화 - 개선됨 */
    .modal {
        padding: 0.5rem;
        /* 모바일에서 상단 정렬 */
        align-items: flex-start;
        place-items: start center;
        padding-top: 2rem;
    }
    
    .modal-content {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 4rem);
        width: 100%;
        margin: 0;
        min-width: auto;
    }
    
    .modal-content.expanded {
        width: 95vw;
        height: 85vh;
        max-width: none;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* 접근성 및 브라우저 호환성 개선 */
@supports not (display: grid) {
    .modal {
        display: table;
        table-layout: fixed;
    }
    
    .modal.show,
    .modal.active {
        display: table !important;
    }
    
    .modal-content {
        display: table-cell;
        vertical-align: middle;
        text-align: center;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .modal {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .modal-content {
        border: 2px solid #000;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
}

/* 모달 스택 관리 */
.modal.modal-backdrop {
    z-index: 1040;
}

.modal.modal-dialog {
    z-index: 1050;
}

/* 스크롤바 최적화 (모달에서) */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 모달 포커스 관리 */
.modal.show,
.modal.active {
    outline: none;
}

.modal-content:focus {
    outline: 2px solid #4f46e5;
    outline-offset: -2px;
}

/* 애니메이션 성능 최적화 */
.modal,
.modal-content {
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* 모달 닫기 시 애니메이션 */
.modal:not(.show):not(.active) .modal-content {
    animation: modalFadeOut 0.2s ease-in;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}
