:root {
    font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: #1f2937;
    background: #f3f4f6;
    line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f3f4f6; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 230px; padding: 24px 16px;
    background: #111827; color: #e5e7eb; display: flex; flex-direction: column;
}
.brand { font-size: 21px; font-weight: 800; margin: 0 10px 26px; color: white; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { text-decoration: none; padding: 11px 13px; border-radius: 9px; }
.sidebar nav a:hover, .sidebar nav a.active { background: #2563eb; color: white; }
.sidebar-footer { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 12px; border-top: 1px solid #374151; }
.sidebar-footer a { color: #93c5fd; }
.main-content { margin-left: 230px; padding: 28px; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-header h1 { margin: 0; font-size: 27px; }
.mobile-menu { display: none; }
.card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgb(0 0 0 / 8%); margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-header h2, .card h2, .card h3 { margin: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: white; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgb(0 0 0 / 8%); }
.stat-label { color: #6b7280; font-size: 14px; }
.stat-value { margin-top: 8px; font-size: 30px; font-weight: 800; }
.two-column { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
th { color: #4b5563; font-size: 13px; background: #f9fafb; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 13px; border: 0; border-radius: 8px; background: #e5e7eb; color: #111827; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: #2563eb; color: white; }
.btn-danger { background: #dc2626; color: white; }
.btn-success { background: #059669; color: white; }
.btn-small { min-height: 30px; padding: 5px 9px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: grid; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 11px; background: white; }
textarea { min-height: 130px; resize: vertical; }
textarea.editor { min-height: 520px; font-family: "D2Coding", Consolas, monospace; line-height: 1.75; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #e5e7eb; color: #374151; }
.badge-final-success { background: #065f46; color: #ffffff; box-shadow: 0 0 0 2px #a7f3d0 inset; }
.badge-final-danger { background: #7f1d1d; color: #ffffff; box-shadow: 0 0 0 2px #fecaca inset; }
.alert { padding: 13px 15px; margin-bottom: 16px; border-radius: 9px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }
.meta-list { display: grid; grid-template-columns: 140px 1fr; gap: 9px 16px; }
.meta-list dt { color: #6b7280; font-weight: 700; }
.meta-list dd { margin: 0; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 4px solid #2563eb; padding: 4px 0 4px 14px; }
.timeline-item strong { display: block; }
.muted { color: #6b7280; }
.empty { padding: 35px 10px; text-align: center; color: #6b7280; }
.search-result { border-bottom: 1px solid #e5e7eb; padding: 14px 0; }
.search-result:last-child { border-bottom: 0; }
.counter { text-align: right; color: #6b7280; font-size: 13px; margin-top: 6px; }
.counter.over-limit { color: #dc2626; font-weight: 800; }
.inline-form { display: inline; }
pre.readonly-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; line-height: 1.8; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: white; padding: 28px; border-radius: 16px; box-shadow: 0 8px 30px rgb(0 0 0 / 12%); }
.login-card h1 { margin-top: 0; }
.login-card .form-group { margin-bottom: 15px; }

@media (max-width: 1050px) {
    .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; z-index: 20; }
    body.menu-open .sidebar { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 18px; }
    .mobile-menu { display: inline-flex; border: 0; background: white; border-radius: 8px; padding: 7px 10px; }
    .form-grid, .filters, .grid-cards { grid-template-columns: 1fr; }
    .meta-list { grid-template-columns: 1fr; gap: 2px; }
}

/* v2: 단계별 전형 상태 */
.stage-section {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}
.stage-header { align-items: flex-start; }
.stage-header p { margin: 6px 0 0; }
.current-stage-preview {
    flex: 0 0 auto;
    padding: 10px 13px;
    border-radius: 9px;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 14px;
}
.stage-status-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(90px, 1fr)) minmax(90px, 1fr);
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}
.stage-grid-heading,
.stage-name,
.stage-check {
    min-height: 52px;
    padding: 12px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}
.stage-grid-heading {
    min-height: 44px;
    font-weight: 800;
    background: #eef2f7;
}
.stage-status-heading { justify-content: center; }
.stage-name { font-weight: 700; }
.stage-check {
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}
.stage-check input { width: 18px; height: 18px; margin: 0; }
.stage-check-progress:has(input:checked) { background: #dbeafe; color: #1e40af; }
.stage-check-pass:has(input:checked) { background: #d1fae5; color: #065f46; }
.stage-check-fail:has(input:checked) { background: #fee2e2; color: #991b1b; }
.stage-check-final:has(input:checked) { background: #ede9fe; color: #5b21b6; }
.stage-status-grid > :nth-child(5n) { border-right: 0; }
.stage-status-grid > :nth-last-child(-n + 5) { border-bottom: 0; }
.stage-summary-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.stage-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}
.stage-summary-row.is-selected { background: white; border-color: #bfdbfe; }
.stage-summary-row.is-final { border-color: #8b5cf6; background: #f5f3ff; }

@media (max-width: 760px) {
    .stage-section { padding: 14px; }
    .stage-header { display: grid; }
    .current-stage-preview { width: 100%; }
    .stage-status-grid {
        grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(62px, .7fr)) minmax(62px, .7fr);
        font-size: 12px;
        overflow-x: auto;
    }
    .stage-grid-heading, .stage-name, .stage-check { padding: 9px 6px; }
    .stage-check span { display: none; }
    .stage-summary-list { grid-template-columns: 1fr; }
}

/* v3: 버전 로그, 어학 점수, 교육 사항 */
.sidebar-version {
    margin-top: auto;
    padding: 12px 12px 6px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
}
.sidebar-version + .sidebar-footer { margin-top: 0; }
.is-hidden { display: none !important; }
.field-help { color: #6b7280; font-size: 12px; }
.input-with-suffix {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
}
.input-with-suffix span { color: #4b5563; font-weight: 700; }
.changelog-list { display: grid; gap: 10px; }
.changelog-item {
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: #f9fafb;
    overflow: hidden;
}
.changelog-item summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    cursor: pointer;
    list-style: none;
}
.changelog-item summary::-webkit-details-marker { display: none; }
.changelog-item summary::after {
    content: '＋';
    grid-column: 4;
    color: #6b7280;
    font-weight: 800;
}
.changelog-item[open] summary::after { content: '−'; }
.changelog-item time { color: #6b7280; font-size: 13px; }
.changelog-item ul {
    margin: 0;
    padding: 0 22px 15px 55px;
    color: #4b5563;
}
.changelog-item li + li { margin-top: 5px; }
.version-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .changelog-item summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
    .changelog-item time {
        grid-column: 2;
        grid-row: 2;
    }
    .changelog-item summary::after {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
    .changelog-item ul { padding-left: 34px; }
}

/* v4: 학력 평점 계산, 프로젝트, 봉사활동 */
.stat-value.small { font-size: 25px; }
.subsection {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
.subsection > h3 { margin-bottom: 15px; }
.academic-summary-cards { margin-top: 18px; }
.academic-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.summary-panel {
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}
.summary-panel h3 { margin: 0 0 12px; }
.metric-list { display: grid; gap: 0; margin: 0; }
.metric-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 2px;
    border-bottom: 1px solid #e5e7eb;
}
.metric-list > div:last-child { border-bottom: 0; }
.metric-list dt { color: #4b5563; }
.metric-list dd { margin: 0; font-weight: 800; }
.metric-list .emphasis { color: #1e40af; font-weight: 800; }
.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}
.inline-check input { width: 18px; height: 18px; margin: 0; }
.inline-check.compact { min-height: auto; font-size: 13px; }
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.date-with-same input:disabled { background: #f3f4f6; color: #4b5563; }
.course-manager, .project-manager { scroll-margin-top: 20px; }
.course-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1050px) {
    .course-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .academic-summary-grid, .course-form-grid { grid-template-columns: 1fr; }
    .label-row { align-items: flex-start; }
}

/* v5.1.0 account settings */
.form-group.full-width { grid-column: 1 / -1; }
.help-text { margin-top: 6px; color: #6b7280; font-size: 13px; }

/* v6 열람용 계정 */
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-top:8px}
.check-card{display:flex;align-items:center;gap:9px;padding:12px;border:1px solid var(--border,#d9dee8);border-radius:10px;background:#fff;cursor:pointer}
.check-card input{width:auto;margin:0}.single-check{max-width:220px}.role-label{display:inline-block;margin-left:5px;padding:2px 6px;border-radius:999px;background:rgba(255,255,255,.14);font-size:11px}.readonly-banner{margin-top:4px;font-size:12px;color:#64748b}.role-viewer .admin-only{display:none!important}


/* v7: 지원 구분, 최종 단계, 자기소개서 본문 표시 */
.choice-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.choice-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 90px;
    padding: 10px 13px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}
.choice-check:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
.choice-check input { width: 18px; height: 18px; margin: 0; }
.filters-applications { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.cover-letter-table { min-width: 980px; }
.cover-letter-content {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    line-height: 1.7;
    min-width: 300px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}
.cover-letter-content.compact { max-height: 150px; min-width: 260px; }
.cover-letter-count { margin-top: 6px; text-align: right; font-size: 12px; }
.cover-letter-list { display: grid; gap: 14px; }
.cover-letter-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}
.cover-letter-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.cover-letter-company { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cover-letter-question {
    padding: 11px 13px;
    border-radius: 9px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
    line-height: 1.65;
}
.cover-letter-body {
    margin-top: 10px;
    padding: 14px;
    max-height: 340px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #f9fafb;
    white-space: normal;
    word-break: break-word;
    line-height: 1.8;
}
.cover-letter-body mark,
.cover-letter-question mark {
    padding: 0 2px;
    background: #fde68a;
    color: #78350f;
    border-radius: 3px;
}
.cover-letter-meta { margin-top: 9px; text-align: right; font-size: 12px; }

@media (max-width: 1050px) {
    .filters-applications { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-applications .btn { align-self: end; }
}
@media (max-width: 760px) {
    .filters-applications { grid-template-columns: 1fr; }
    .cover-letter-item-header { display: grid; }
    .cover-letter-item-header .actions { justify-content: flex-start; }
}
