/* === 온라인티켓 스타일 === */

:root {
    --primary: #2dd4a8;
    --primary-dark: #1fb992;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #222222;
    --text-light: #666666;
    --border: #e5e7eb;
    --radius: 8px;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* === 헤더 === */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
    text-decoration: none;
}

.header-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* === 카드 === */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.form-section {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-label.required::before {
    content: '*';
    color: var(--danger);
    margin-right: 3px;
}

/* === 상품권 버튼 === */
.voucher-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voucher-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text);
}

.voucher-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.voucher-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* === 입력 === */
.input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.15s;
    background: #fff;
    color: var(--text);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 212, 168, 0.1);
}

select.input {
    appearance: auto;
}

/* === 핀 입력 행 === */
.pin-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.pin-input {
    flex: 3;
}

.amount-input {
    flex: 1;
    min-width: 120px;
}

/* === 버튼 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-size: 16px;
    margin-top: 12px;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-add-pin, .btn-remove-pin {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 18px;
    border-radius: 50%;
}

.btn-add-pin {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-remove-pin {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-register {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 4px;
}

/* === 수수료 정보 === */
.fee-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.fee-item {
    text-align: center;
}

.fee-label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
}

.fee-value {
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
}

.fee-item.highlight {
    background: #fff;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
}

.accent {
    color: var(--danger) !important;
}

/* === 폼 그리드 === */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 12px;
}

/* === 체크박스 === */
.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-label {
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-label a {
    color: var(--primary-dark);
}

/* === 테이블 === */
.pin-table, .admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pin-table th, .pin-table td,
.admin-table th, .admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.pin-table th, .admin-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-light);
}

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

/* === 조회 === */
.lookup-row {
    display: flex;
    gap: 8px;
}

.lookup-row .input {
    flex: 1;
}

.lookup-card {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius);
}

.lookup-row-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.lookup-row-info:last-child {
    border-bottom: none;
}

.error-text {
    color: var(--danger);
    text-align: center;
    padding: 20px;
}

/* === 공지 === */
.notice-box {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
}

.notice-box ul {
    padding-left: 20px;
}

/* === 모달 === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 800px;
}

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

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 4px;
}

.modal-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
}

/* === 푸터 === */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-light);
}

/* === 상태 배지 === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-processing {
    background: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* === 상태 텍스트 === */
.status-pending { color: var(--warning); }
.status-processing { color: #3b82f6; }
.status-completed { color: var(--success); }
.status-rejected { color: var(--danger); }

/* === 관리자 === */
.admin-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    padding: 32px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-header {
    background: #1a1a2e;
    border-bottom: none;
}

.admin-header .logo {
    color: #fff;
}

.admin-header .btn {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    background: transparent;
}

.admin-header .btn:hover {
    background: rgba(255,255,255,0.1);
}

/* === 통계 === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-pending .stat-value { color: var(--warning); }
.stat-success .stat-value { color: var(--success); }

/* === 필터 바 === */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 4px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.15s;
}

.filter-tab:hover {
    background: #e5e7eb;
}

.filter-tab.active {
    background: var(--primary);
    color: #fff;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form .input {
    width: 240px;
}

/* === 상세 모달 === */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.detail-table {
    width: 100%;
    font-size: 13px;
}

.detail-table th {
    padding: 6px 0;
    color: var(--text-light);
    font-weight: 500;
    width: 80px;
    vertical-align: top;
}

.detail-table td {
    padding: 6px 0;
}

/* === 페이지네이션 === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
}

.page-link:hover {
    background: var(--border);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
}

/* === 알림 === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* === 반응형 === */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .fee-info {
        grid-template-columns: 1fr 1fr;
    }

    .pin-row {
        flex-wrap: wrap;
    }

    .pin-input {
        flex: 1 1 100%;
    }

    .amount-input {
        flex: 1;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form .input {
        width: 100%;
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .container {
        padding: 0 12px;
    }

    .form-card {
        padding: 20px 16px;
    }
}
