/* ═══════════════════════════════════════
   MPLATS V2 — 마이페이지
   ═══════════════════════════════════════ */

/* 탭 바 */
.mp-tab-bar {
    display: flex;
    gap: 4px;
    margin: 24px 0 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}
.mp-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    font-family: inherit;
}
.mp-tab:hover { color: #1e293b; }
.mp-tab.active {
    background: #fff;
    color: #6d28d9;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* 패널 표시/숨김 (인라인 스타일 회피) */
.mp-panel { padding: 8px 0; }
.mp-hidden { display: none; }

/* 로딩/오류/빈 상태 */
.mp-loading, .mp-error, .mp-empty-card {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
}
.mp-error { color: #ef4444; }
.mp-empty-icon { margin-bottom: 14px; }
.mp-empty-card p { margin: 0 0 16px; }

/* 카드 */
.mp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}
.mp-card + .mp-card { margin-top: 16px; }
.mp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}
.mp-card-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.mp-card-plan {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

/* 배지 */
.mp-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}
.mp-badge.status-active     { background: #dcfce7; color: #16a34a; }
.mp-badge.status-grace      { background: #fef3c7; color: #b45309; }
.mp-badge.status-cancelled  { background: #fee2e2; color: #dc2626; }
.mp-badge.status-expired    { background: #f1f5f9; color: #64748b; }
.mp-badge.status-paid       { background: #dbeafe; color: #1d4ed8; }
.mp-badge.status-ready      { background: #fef3c7; color: #ca8a04; }
.mp-badge.status-refunded   { background: #fde2e7; color: #be185d; }
.mp-badge.status-failed     { background: #fee2e2; color: #dc2626; }
.mp-badge.status-pending    { background: #fef3c7; color: #b45309; }
.mp-badge.status-approved   { background: #dcfce7; color: #16a34a; }
.mp-badge.status-rejected   { background: #fee2e2; color: #dc2626; }
.mp-badge.status-completed  { background: #ddd6fe; color: #5b21b6; }

/* 카드 행 */
.mp-card-rows {
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
}
.mp-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    gap: 12px;
}
.mp-row span { color: #64748b; }
.mp-row strong { color: #0f172a; font-weight: 600; text-align: right; }

/* 액션 버튼 */
.mp-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.mp-btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
    background: none;
}
.mp-btn.primary    { background: #6d28d9; color: #fff; }
.mp-btn.primary:hover { background: #5b21b6; }
.mp-btn.secondary  { background: #f1f5f9; color: #475569; }
.mp-btn.secondary:hover { background: #e2e8f0; }
.mp-btn.danger     { background: #fff; color: #dc2626; border-color: #fecaca; }
.mp-btn.danger:hover { background: #fef2f2; }
.mp-btn:disabled, .mp-btn.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: transparent;
}

/* 결제 이력 테이블 */
.mp-payments-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.mp-payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 720px;
}
.mp-payments-table th,
.mp-payments-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}
.mp-payments-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}
.mp-payments-table tbody tr:hover { background: #fafbfd; }
.mp-payments-table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.mp-payments-table td.actions { text-align: right; white-space: nowrap; }

.mp-text-muted { color: #cbd5e1; }

/* STEP B-4: 자동 갱신 토글 */
.mp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.mp-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mp-toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 11px;
    transition: background .2s;
}
.mp-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.mp-toggle input[type="checkbox"]:checked + .mp-toggle-slider {
    background: #6d28d9;
}
.mp-toggle input[type="checkbox"]:checked + .mp-toggle-slider::before {
    transform: translateX(18px);
}
.mp-toggle input[type="checkbox"]:disabled + .mp-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}
.mp-toggle-text {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

/* 환불 신청 폼 */
.mp-refund-section { margin-top: 4px; }
.mp-refund-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}
.mp-refund-payments {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}
.mp-refund-pay-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.mp-refund-pay-item.selected {
    border-color: #6d28d9;
    background: #f5f3ff;
}
.mp-refund-pay-meta {
    font-size: 13px;
    color: #475569;
}
.mp-refund-pay-meta strong {
    color: #0f172a;
    margin-right: 6px;
}
.mp-refund-pay-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.mp-refund-pay-radio input[type="radio"] {
    accent-color: #6d28d9;
    cursor: pointer;
}
.mp-refund-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}
.mp-refund-form label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
    font-weight: 600;
}
.mp-refund-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.mp-refund-form textarea:focus {
    outline: none;
    border-color: #6d28d9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.mp-refund-note {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.6;
}
.mp-refund-actions {
    margin-top: 12px;
    text-align: right;
}

/* 환불 신청 이력 */
.mp-refund-history-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.mp-refund-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 640px;
}
.mp-refund-history-table th,
.mp-refund-history-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}
.mp-refund-history-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

/* 페이지네이션 */
.mp-paging {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}
/* STEP H-3: 총 건수 정보 */
.mp-paging-info {
    text-align: center;
    margin-top: 12px;
    color: #94a3b8;
    font-size: 12px;
}
.mp-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.mp-page-btn.active {
    background: #6d28d9;
    color: #fff;
    border-color: #6d28d9;
}
.mp-page-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* 반응형 */
@media (max-width: 768px) {
    .mp-tab-bar { flex-wrap: wrap; }
    .mp-tab { font-size: 13px; padding: 8px 12px; }
    .mp-card { padding: 18px; }
    .mp-card-plan { font-size: 18px; }
    .mp-row { flex-wrap: wrap; }
    .mp-row strong { text-align: left; width: 100%; }
}
