/* ============================================================
   1,000자 에세이 수행평가 웹앱 스타일시트 (style.css)
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --bg-base: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-sub: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   공통 및 유틸리티
   ============================================================ */
.hidden {
    display: none !important;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

input, select, textarea {
    font-family: inherit;
    color: inherit;
}

.text-green { color: var(--success); }
.text-center { text-align: center; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* ============================================================
   상단 헤더
   ============================================================ */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

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

.logo-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.title-group h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.sub-badge {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    background-color: var(--primary-light);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

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

.cf-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.status-dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-base);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 26px;
    height: 26px;
    background-color: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.user-info {
    display: flex;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.user-info .num {
    color: var(--primary);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background-color: #e2e8f0;
    color: var(--danger);
}

.btn-outline-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.btn-outline-sm:hover {
    background-color: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary-border);
}

.btn-ai-badge {
    background-color: #fdf4ff;
    border-color: #f0abfc;
    color: #a21caf;
}
.btn-ai-badge:hover {
    background-color: #fae8ff;
    color: #86198f;
    border-color: #e879f9;
}
.btn-ai-badge.ai-active {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
}

/* ============================================================
   로그인 뷰
   ============================================================ */
#login-view {
    min-height: calc(100vh - 75px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at top right, #eff6ff, #f8fafc 60%);
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.icon-circle {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.login-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-sub);
    font-size: 0.95rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background-color: #fafbfc;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-guide-box {
    background-color: #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #475569;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.guide-item i {
    color: var(--primary);
    margin-top: 2px;
}

.btn-primary-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: 0.5rem;
}
.btn-primary-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* ============================================================
   메인 에세이 평가 뷰
   ============================================================ */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

/* 루브릭 배너 */
.rubric-banner {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.rubric-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rubric-tag {
    background: #fef3c7;
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.rubric-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rubric-text .highlight {
    color: var(--text-main);
    font-weight: 600;
}

.tab-controls {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* 2컬럼 레이아웃 (에디터 + 실시간 지표) */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
}

@media (max-width: 1024px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
}

.editor-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topic-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.topic-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-select-wrapper label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.topic-select-wrapper select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background-color: #fff;
    cursor: pointer;
}

.custom-topic-input {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.textarea-wrapper {
    position: relative;
    padding: 1.25rem 1.5rem;
    flex: 1;
}

#essay-textarea {
    width: 100%;
    min-height: 480px;
    border: none;
    resize: vertical;
    font-family: 'Noto Serif KR', serif;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #1e293b;
    background: transparent;
    outline: none;
}

#essay-textarea::placeholder {
    font-family: 'Pretendard', sans-serif;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

.save-status {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.editor-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-subtle {
    padding: 0.6rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.btn-subtle:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.btn-accent:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

/* ============================================================
   우측 지표 패널 (1,000자 게이지 & 실시간 노력 점수)
   ============================================================ */
.metrics-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metric-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.badge-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.badge-gray { background: #e2e8f0; color: #475569; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }

.gauge-display {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.char-count-hero {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

#metric-char-count {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.char-goal {
    font-size: 1.1rem;
    color: var(--text-sub);
    font-weight: 600;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 12px;
    background-color: #f1f5f9;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-sub);
    font-weight: 500;
}

.target-label {
    color: var(--primary);
    font-weight: 700;
}

.sub-char-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.sub-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.sub-stat .label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.sub-stat strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

/* 실시간 노력 점수 */
.live-score-box {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

#live-total-score {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.max-pts {
    font-size: 0.75rem;
    color: var(--text-sub);
    font-weight: 600;
}

.effort-rubric-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.rubric-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rubric-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
}

.rubric-name {
    color: #475569;
    font-weight: 600;
}

.rubric-val {
    color: var(--text-main);
    font-weight: 700;
}

.mini-bar {
    width: 100%;
    height: 6px;
    background-color: #f1f5f9;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.live-hint-box {
    background-color: #eff6ff;
    border-left: 3px solid var(--primary);
    padding: 0.7rem 0.85rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.75rem;
    color: #1e40af;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.5;
}

.live-hint-box i {
    margin-top: 2px;
}

/* ============================================================
   히스토리 뷰
   ============================================================ */
.history-container {
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

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

.history-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.history-topic {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.history-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.history-score-badge {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.history-score-badge .score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-sub);
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

/* ============================================================
   교사용 현황 대시보드
   ============================================================ */
.teacher-dashboard {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.teacher-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.teacher-actions {
    display: flex;
    gap: 8px;
}

.btn-primary-sm {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
}
.btn-primary-sm:hover {
    background: var(--primary-hover);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.table-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

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

.data-table th {
    background-color: #f8fafc;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #334155;
}

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

/* ============================================================
   모달 (성적표 팝업)
   ============================================================ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.report-meta-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item.full-width {
    grid-column: 1 / -1;
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.meta-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
}

.score-banner {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-banner-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.banner-label {
    font-size: 0.82rem;
    opacity: 0.9;
}

.banner-comment {
    font-size: 1.1rem;
    font-weight: 700;
}

.big-score {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
}

.score-unit {
    font-size: 1rem;
    opacity: 0.85;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
}

.breakdown-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.item-header span {
    font-weight: 600;
    color: #475569;
}

.progress-track {
    width: 100%;
    height: 7px;
    background-color: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-val {
    height: 100%;
    background-color: var(--primary);
    border-radius: var(--radius-full);
}

.breakdown-item small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.teacher-feedback-card {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 1rem;
}

.teacher-feedback-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-content {
    font-size: 0.85rem;
    color: #14532d;
    white-space: pre-line;
    line-height: 1.6;
}

.essay-preview-details summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.preview-content-box {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Noto Serif KR', serif;
    font-size: 0.9rem;
    white-space: pre-line;
    line-height: 1.7;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

/* ============================================================
   인쇄 전용 스타일 (성적표 출력)
   ============================================================ */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-report, #printable-report * {
        visibility: visible;
    }
    #printable-report {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
    }
    .modal-backdrop {
        position: static;
        background: transparent;
        padding: 0;
    }
    .modal-card {
        box-shadow: none;
        max-height: none;
    }
    .modal-header, .modal-footer {
        display: none !important;
    }
}
