/* ===========================================
   Repit Admin — Mint Fresh Theme
   =========================================== */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');
* {
    box-sizing: border-box;
}

body {
    margin: 0;
}


/* ===== 로그인 화면 ===== */

body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0E6B58 0%, #1B6B57 50%, #2EC4B6 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: 0 20px 50px rgba(15, 61, 51, 0.25);
}

.login-card h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0F3D33;
    text-align: center;
}

.login-card .subtitle {
    margin: 0 0 28px 0;
    font-size: 13px;
    color: #6E8880;
    text-align: center;
}

.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0F3D33;
    margin-bottom: 6px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid #D9EDE7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0F3D33;
    background: #FBFEFD;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: #2EC4B6;
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.login-card button[type="submit"] {
    width: 100%;
    padding: 13px;
    background: #2EC4B6;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.login-card button[type="submit"]:hover {
    background: #22A99C;
}

.login-card button[type="submit"]:active {
    transform: translateY(1px);
}

#error-msg {
    display: none;
    margin-top: 16px;
    margin-bottom: 0;
    padding: 10px 14px;
    background: #FDECE7;
    color: #C0472B;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}


/* ===== 관리자 대시보드 레이아웃 ===== */

body.dashboard-page {
    background: #F1FBF8;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0E6B58;
    color: #BFE8DC;
    display: flex;
    flex-direction: column;
    padding: 28px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
}

.sidebar-brand {
    padding: 0 28px 28px 28px;
    border-bottom: 1px solid rgba(191, 232, 220, 0.15);
    margin-bottom: 20px;
}

.sidebar-brand .brand-main {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-sub {
    font-size: 12px;
    color: #7FC4B0;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #BFE8DC;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
    background: rgba(191, 232, 220, 0.08);
    color: #FFFFFF;
}

.sidebar-nav a.active {
    background: #2EC4B6;
    color: #0F3D33;
    font-weight: 700;
}

.sidebar .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 16px 0 16px;
    border-top: 1px solid rgba(191, 232, 220, 0.15);
    margin-top: 16px;
}

.sidebar-footer button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: #BFE8DC;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-footer button:hover {
    background: rgba(214, 108, 68, 0.15);
    color: #D66C44;
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 40px 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.topbar h1 {
    font-size: 24px;
    color: #0F3D33;
    margin: 0 0 6px 0;
}

.topbar p {
    font-size: 14px;
    color: #6E8880;
    margin: 0;
}

.topbar .today {
    font-size: 13px;
    color: #6E8880;
}


/* ===== 통계 카드 ===== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #6E8880;
}


/* ===== 빠른 작업 카드 ===== */

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 16px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.action-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 61, 51, 0.14);
}

.action-card .action-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #E3F8F1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-card .action-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 4px;
}

.action-card .action-desc {
    font-size: 13px;
    color: #6E8880;
}


/* ===== 설문 문항 관리 ===== */

.question-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.question-badge {
    flex-shrink: 0;
    min-width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #0E6B58;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.question-text {
    font-size: 16px;
    font-weight: 700;
    color: #0F3D33;
}

.answer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.answer-chip {
    background: #E3F8F1;
    color: #0F3D33;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
}

.question-meta {
    font-size: 12px;
    color: #8FA69D;
}

.empty-state {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 60px 24px;
    text-align: center;
    color: #6E8880;
    font-size: 14px;
}

/* ===== 설문 그룹 (진단 종류) ===== */

.group-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.group-card {
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
    overflow: hidden;
}

.group-card-ungrouped {
    border: 1px dashed #D9EDE7;
    box-shadow: none;
}

.group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
}

.group-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.group-toggle-icon {
    display: inline-block;
    font-size: 11px;
    color: #8FA69D;
    transition: transform 0.15s ease;
}

.group-toggle-icon.open {
    transform: rotate(90deg);
}

.group-name {
    font-size: 17px;
    font-weight: 700;
    color: #0F3D33;
}

.group-count-badge {
    font-size: 12px;
    font-weight: 600;
    color: #0E6B58;
    background: #E3F8F1;
    padding: 4px 12px;
    border-radius: 999px;
}

.group-inactive-badge {
    font-size: 11px;
    font-weight: 700;
    color: #C0472B;
    background: #FDECE7;
    padding: 3px 10px;
    border-radius: 999px;
}

.group-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.group-action-link {
    font-size: 13px;
    font-weight: 600;
}

.group-action-btn {
    font-size: 13px;
    font-weight: 600;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.group-edit-btn {
    color: #0E6B58;
    background: #E3F8F1;
}

.group-edit-btn:hover {
    background: #D2F0E6;
}

.group-delete-btn {
    color: #C0472B;
    background: #FDECE7;
}

.group-delete-btn:hover {
    background: #FBDCD4;
}

.group-card-desc {
    padding: 0 24px 16px 24px;
    margin-top: -12px;
    font-size: 13px;
    color: #6E8880;
}

.group-card-body {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid #F1FBF8;
}

.group-card-body .question-card {
    box-shadow: none;
    border: 1px solid #E3F8F1;
    margin-top: 16px;
}

.group-card-body .question-card:first-child {
    margin-top: 16px;
}

/* ===== 설문 문항 등록/수정 폼 ===== */

.form-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 32px 36px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
    max-width: 640px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0F3D33;
    margin-bottom: 6px;
}


.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6E8880;
}

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F3D33;
    margin: 28px 0 16px;
    padding-top: 20px;
    border-top: 1px dashed #D9EDE7;
}

.form-card input[type="text"],
.form-card input[type="number"],
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #D9EDE7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #0F3D33;
    background: #FBFEFD;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    resize: vertical;
}

.form-card input[type="text"]:focus,
.form-card input[type="number"]:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: none;
    border-color: #2EC4B6;
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.answer-row input[type="number"] {
    width: 70px;
    flex-shrink: 0;
}

.answer-row input[type="text"] {
    flex: 1;
}

.answer-card {
    border: 1px solid #D9EDE7;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #FBFEFD;
}

.answer-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-row-top input[type="number"] {
    width: 70px;
    flex-shrink: 0;
}

.answer-row-top input[type="text"] {
    flex: 1;
}

.answer-description {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid #D9EDE7;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #6E8880;
    background: #FFFFFF;
}

.answer-description:focus {
    outline: none;
    border-color: #2EC4B6;
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.tag-rows {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #D9EDE7;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-row .tag-scalp-type {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #D9EDE7;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #0F3D33;
    background: #FFFFFF;
}

.form-card .tag-row .tag-score {
    width: 70px;
    flex-shrink: 0;
    padding: 8px 10px;
    border: 1px solid #D9EDE7;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #0F3D33;
    background: #FFFFFF;
}

.btn-remove-tag {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: #FDECE7;
    color: #C0472B;
    font-size: 14px;
    cursor: pointer;
}

.btn-remove-tag:hover {
    background: #FBDCD4;
}

.btn-add-tag {
    align-self: flex-start;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px dashed #2EC4B6;
    background: #F1FBF8;
    color: #0E6B58;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-add-tag:hover {
    background: #E3F8F1;
}

.btn-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #FDECE7;
    color: #C0472B;
    font-size: 16px;
    cursor: pointer;
}

.btn-remove:hover {
    background: #FBDCD4;
}

.btn-add-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px dashed #2EC4B6;
    background: #F1FBF8;
    color: #0E6B58;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    margin-bottom: 28px;
}

.btn-add-option:hover {
    background: #E3F8F1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary {
    padding: 12px 28px;
    background: #2EC4B6;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: #22A99C;
}

.btn-secondary {
    padding: 12px 28px;
    background: #FFFFFF;
    color: #6E8880;
    border: 1px solid #D9EDE7;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s ease;
}

.btn-secondary:hover {
    background: #F1FBF8;
}

/* 문항 카드의 "수정" 링크 */
.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.question-edit-link {
    font-size: 13px;
    font-weight: 600;
    color: #0E6B58;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    background: #E3F8F1;
    transition: background 0.15s ease;
}

.question-edit-link:hover {
    background: #D2F0E6;
}

/* ===== 솔루션 상품 관리 ===== */

.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.product-thumb {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    background: #F1FBF8;
    flex-shrink: 0;
}

.product-thumb-empty {
    border: 1px dashed #D9EDE7;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: #0F3D33;
}

.product-inactive-badge {
    font-size: 11px;
    font-weight: 700;
    color: #C0472B;
    background: #FDECE7;
    padding: 3px 10px;
    border-radius: 999px;
    margin-left: 8px;
}

.product-id-badge {
    font-size: 12px;
    font-weight: 600;
    color: #8FA69D;
    margin-left: 8px;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.product-edit-link {
    font-size: 13px;
    font-weight: 600;
    color: #0E6B58;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    background: #E3F8F1;
    transition: background 0.15s ease;
}

.product-edit-link:hover {
    background: #D2F0E6;
}

.product-delete-btn {
    font-size: 13px;
    font-weight: 600;
    color: #C0472B;
    background: #FDECE7;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.product-delete-btn:hover {
    background: #FBDCD4;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: #0E6B58;
    margin-bottom: 8px;
}

.product-desc {
    font-size: 13px;
    color: #6E8880;
    margin-bottom: 12px;
    line-height: 1.5;
}

.condition-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.condition-chip {
    background: #E3F8F1;
    color: #0F3D33;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
}
.meta-chip {
    background: #F0F4F2;
    color: #4A5F58;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #D9EDE7;
}

.product-extra-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
    padding: 10px 12px;
    background: #F7FBFA;
    border-radius: 10px;
}

.extra-field-row {
    display: flex;
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.5;
}

.extra-field-label {
    flex-shrink: 0;
    width: 84px;
    color: #8FA69D;
    font-weight: 600;
}

.extra-field-value {
    color: #0F3D33;
    white-space: pre-wrap;
}

.related-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-product-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid #E5F2EE;
    border-radius: 14px;
}

.related-product-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}


.product-meta {
    font-size: 12px;
    color: #8FA69D;
}


/* ===== 진단 테스트 ===== */

.group-select-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.group-select-card {
    text-align: left;
    background: #FFFFFF;
    border: 1px solid #D9EDE7;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.group-select-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 61, 51, 0.14);
    border-color: #2EC4B6;
}

.group-select-name {
    font-size: 16px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 6px;
}

.group-select-desc {
    font-size: 13px;
    color: #6E8880;
    margin-bottom: 10px;
    line-height: 1.4;
}

.group-select-count {
    font-size: 12px;
    font-weight: 600;
    color: #0E6B58;
    background: #E3F8F1;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
}

.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.quiz-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
}

.quiz-question {
    font-size: 15px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 14px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #D9EDE7;
    border-radius: 10px;
    font-size: 14px;
    color: #0F3D33;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option input[type="checkbox"] {
    accent-color: #2EC4B6;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.quiz-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quiz-option-desc {
    font-size: 12px;
    color: #8FA69D;
}

.quiz-option:hover {
    background: #F1FBF8;
}

.quiz-option-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.quiz-option-disabled:hover {
    background: none;
}

.quiz-option input[type="radio"] {
    accent-color: #2EC4B6;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.score-summary {
    margin-bottom: 24px;
}

.quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.quiz-progress {
    font-size: 13px;
    color: #8FA69D;
    font-weight: 600;
}

.live-panel {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

#livePanel #liveEmpty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* ===== 모달 ===== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 61, 51, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 28px 28px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(15, 61, 51, 0.25);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 10px;
}

.modal-message {
    font-size: 14px;
    color: #6E8880;
    line-height: 1.5;
    margin-bottom: 24px;
    white-space: pre-line;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 10px 20px;
    font-size: 13px;
}

.question-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-delete-btn {
    font-size: 13px;
    font-weight: 600;
    color: #C0472B;
    background: #FDECE7;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.question-delete-btn:hover {
    background: #FBDCD4;
}

.sidebar-footer a.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #BFE8DC;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-footer a.sidebar-footer-link:hover {
    background: rgba(191, 232, 220, 0.08);
    color: #FFFFFF;
}

.role-select {
    padding: 6px 10px;
    border: 1px solid #D9EDE7;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #0F3D33;
    background: #FBFEFD;
    cursor: pointer;
}

/* ===== 진단 응답 통계 ===== */

.dashboard-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(15, 61, 51, 0.08);
    margin-bottom: 24px;
}

.dashboard-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #6E8880;
    padding: 10px 12px;
    border-bottom: 1px solid #E5F2EE;
    white-space: nowrap;
}

.data-table td {
    font-size: 13.5px;
    color: #0F3D33;
    padding: 12px;
    border-bottom: 1px solid #F1FBF8;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table-wrap {
    overflow-x: auto;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: #C7D6D1;
}

.status-dot.active {
    background: #2EC4B6;
}

.status-dot.inactive {
    background: #C0472B;
}

.deleted-label {
    font-size: 11px;
    font-weight: 700;
    color: #C0472B;
    background: #FDECE7;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    white-space: nowrap;
}

.changed-label {
    font-size: 11px;
    font-weight: 700;
    color: #B9770E;
    background: #FFF3DC;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    white-space: nowrap;
}

.bar-meter {
    position: relative;
    background: #F1FBF8;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-top: 6px;
}

.bar-meter-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #2EC4B6;
    border-radius: 999px;
}

.question-stat-block {
    margin-bottom: 28px;
}

.question-stat-block:last-child {
    margin-bottom: 0;
}

.question-stat-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F3D33;
    margin-bottom: 12px;
}

.answer-stat-row {
    display: grid;
    grid-template-columns: 220px 1fr 64px;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.answer-stat-label {
    font-size: 13px;
    color: #0F3D33;
}

.answer-stat-count {
    font-size: 12px;
    color: #6E8880;
    text-align: right;
    white-space: nowrap;
}

/* ===== 진단 응답 검색 ===== */

.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-field label {
    font-size: 12px;
    font-weight: 600;
    color: #6E8880;
}

.search-field select,
.search-field input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #D9EDE7;
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0F3D33;
    background: #FBFEFD;
    min-width: 160px;
}

.search-field select:focus,
.search-field input[type="date"]:focus {
    outline: none;
    border-color: #2EC4B6;
    box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}

.search-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-date-range span {
    color: #8FA69D;
    font-size: 13px;
}

.search-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.search-result-count {
    margin-top: 10px;
    font-size: 12px;
    color: #6E8880;
    text-align: right;
}