/* 공통 입력 필드 */
input, select, textarea {
    text-align: center; width: 100%; padding: 10px 12px;
    border: 1px solid var(--primary); border-radius: 24px;
    font-size: 16px; height: 44px; box-sizing: border-box;
    -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { text-align: center; }
textarea { height: 80px; resize: vertical; }
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.form-row.two-cols { grid-template-columns: repeat(2, 1fr); }
.form-row.one-col { grid-template-columns: 1fr; }
label, .form-group label {
    display: inline-block; background: #FEF3C7; border: 1px solid var(--primary);
    border-radius: 20px; padding: 4px 12px; margin-bottom: 10px; margin-left: 8px;
    font-weight: 600; font-size: 0.7rem;
}
select { text-align: center; text-align-last: center; }
input[type="date"] { text-align: center; }
input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.input-with-button { display: flex; gap: 8px; align-items: center; }
.input-with-button input, .input-with-button select { flex: 1; text-align: center; }
.date-input-wrapper { display: flex; gap: 8px; align-items: center; }
.date-input-wrapper input { flex: 1; text-align: center; }
.date-calendar-btn {
    background: #FEF3C7; border: 1px solid var(--primary); border-radius: 40px;
    padding: 0 12px; height: 44px; font-size: 0.8rem; font-weight: 500;
    color: #C2410C; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.modal-footer { flex-shrink: 0; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 12px; display: flex; justify-content: flex-end; gap: 12px; }

/* 모달 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background: white; border-radius: 28px; width: 90%; max-width: 800px; min-width: 300px; max-height: 90vh; overflow: hidden; padding: 24px; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; position: sticky; top: 0; background: white; padding-bottom: 10px; border-bottom: 1px solid var(--border); z-index: 10; flex-shrink: 0; gap: 12px; flex-wrap: wrap; }
.close-modal { background: #FFF3E0; color: #E67E22; border: none; width: 38px; height: 38px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; flex-shrink: 0; margin-left: auto; }
.form-scroll { overflow-y: auto; flex: 1; margin-top: 10px; padding-right: 5px; min-height: 0; -webkit-overflow-scrolling: touch; }
.btn-cancel { background: #FFF3E0; color: #E67E22; border: 1px solid var(--primary); padding: 8px 20px; border-radius: 40px; cursor: pointer; }
.btn-prominent { background: var(--primary); color: white; padding: 10px 24px; border-radius: 40px; border: none; font-weight: bold; cursor: pointer; }

/* 옵션 */
.option-buttons { display: flex; flex-direction: column; gap: 12px; }
.option-buttons button { padding: 12px; font-size: 1rem; background: #FFF3E0; color: #E67E22; border: 1px solid var(--primary); border-radius: 40px; cursor: pointer; }

/* 상세 */
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0; gap: 12px; }
.detail-buttons-bar { display: flex; gap: 12px; align-items: center; }
.detail-total { background: #FEF3C7; padding: 8px 18px; border-radius: 40px; font-size: 0.9rem; font-weight: bold; color: #C2410C; white-space: nowrap; }
#detailGroupsContainer { overflow-y: auto; flex: 1; }
.season-group { margin-bottom: 20px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.group-header { background: #f8fafc; padding: 12px 20px; font-weight: bold; color: var(--primary); font-size: 0.95rem; }
.subtotal-row { background: #fffbeb; }

/* 계약금 */
.deposit-header-right { display: flex; gap: 20px; align-items: center; }
.deleted-table td, .deleted-table th { font-size: 0.7rem; padding: 6px 3px; }
.deleted-table .action-btn { font-size: 0.6rem; padding: 3px 6px; }

/* 토스트 */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 10px 20px; border-radius: 40px; font-size: 0.9rem; z-index: 3000; }

/* 매뉴얼 */
.manual-content { max-height: 55vh; overflow-y: auto; padding: 16px 20px 24px 20px; background: linear-gradient(145deg, #ffffff 0%, #f9fafb 100%); border-radius: 20px; font-size: 0.95rem; line-height: 1.55; color: #1e293b; }
.manual-content h4 { color: var(--primary); margin: 24px 0 12px 0; font-size: 1.2rem; font-weight: 600; border-left: 5px solid var(--primary); padding-left: 14px; background: rgba(99,102,241,0.08); border-radius: 0 12px 12px 0; }
.manual-content p { margin: 14px 0; background: white; padding: 12px 16px; border-radius: 20px; }
.manual-content ul { margin: 12px 0 16px 24px; background: white; padding: 12px 16px 12px 32px; border-radius: 20px; }
.manual-content li { margin: 10px 0; }
.btn-sample { display: inline-block; padding: 4px 12px; border-radius: 30px; font-size: 0.75rem; font-weight: 500; margin: 0 4px; white-space: nowrap; }
.btn-sample.green { background: #d1fae5; color: #047857; border: 1px solid #10b981; }
.btn-sample.blue { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }
.btn-sample.orange { background: #fed7aa; color: #9a3412; border: 1px solid #f97316; }
.btn-sample.red { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; }
.btn-sample.purple { background: #e9d5ff; color: #6b21a5; border: 1px solid #a855f7; }
.season-header { display: flex; align-items: center; gap: 8px; background: #f1f5f9; padding: 4px 12px; border-radius: 40px; }
.season-header span { font-size: 0.8rem; }
.season-header select { border: 1px solid var(--primary); border-radius: 40px; padding: 4px 8px; font-size: 0.8rem; background: white; min-width: 80px; text-align: center; height: 36px; }

/* 반응형 */
@media (max-width: 480px) {
    .form-row, .form-row.two-cols, .form-row.one-col { display: flex; flex-direction: column; gap: 12px; }
    .modal-content { width: 95%; max-width: 95%; padding: 16px; }
    input, select { height: 40px; font-size: 14px; }
}
@media (min-width: 768px) {
    .modal-content { padding: 32px; }
}

@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area { position: absolute; top: 0; left: 0; width: 100%; }
    table { width: 100%; border-collapse: collapse; }
    th, td { border: 1px solid #000; padding: 8px; text-align: center; }
    th { background: #f2f2f2; }
}