/* 뷰 전환 토글 */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    /* justify-content: space-between; */
}

.view-toggle {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px;
    border-radius: 12px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.8);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.toggle-btn i {
    font-size: 16px;
}

/* 달력 뷰 */
.calendar-view,
.grid-view {
    transition: opacity 0.3s ease;
}

#calendar {
    padding: 20px;
    min-height: 600px;
}

/* FullCalendar 커스텀 스타일 */
.fc {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fc .fc-toolbar-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

.fc .fc-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: none;
}

.fc .fc-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.fc .fc-button:disabled {
    opacity: 0.5;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.fc-daygrid-day {
    cursor: pointer;
    transition: background-color 0.2s;
}

.fc-daygrid-day:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.fc-daygrid-day.fc-day-today {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.fc-daygrid-day-number {
    padding: 8px;
    font-weight: 600;
}

/* 달력 이벤트 스타일 */
.fc-event {
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    margin: 2px 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.fc-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fc-event-title {
    font-weight: 600;
}

.fc-daygrid-event-dot {
    display: none;
}

/* 일별 총액 표시 */
.daily-total {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-today {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e2e8f0;
    color: #4a5568;
}

.btn-today:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* 필터 카드 */
.filter-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input,
.filter-select,
.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

.date-input:focus,
.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-filter,
.btn-reset {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-reset:hover {
    background: #cbd5e0;
}

/* 요약 카드 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-4px);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.summary-info {
    flex: 1;
}

.summary-label {
    font-size: 14px;
    color: #718096;
    margin-bottom: 4px;
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

/* 테이블 카드 */
.table-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.table-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.btn-add,
.btn-save,
.btn-export {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.btn-export {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
}

/* TUI Grid 커스텀 스타일 */
#grid {
    margin-top: 20px;
}

/* AG Grid 커스텀 스타일 */
#grid {
    width: 100%;
    height: 600px;
    margin: 20px 0;
}

.ag-theme-alpine {
    --ag-header-background-color: #f8f9fa;
    --ag-odd-row-background-color: rgba(255, 255, 255, 0.5);
    --ag-row-hover-color: rgba(102, 126, 234, 0.1);
    --ag-selected-row-background-color: rgba(102, 126, 234, 0.2);
    --ag-border-color: rgba(0, 0, 0, 0.1);
    --ag-header-foreground-color: #1a202c;
    --ag-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 12px;
    overflow: hidden;
}

.ag-header-cell-label {
    font-weight: 600;
}

.ag-root-wrapper {
    border-radius: 12px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.delete-btn::before {
    content: '삭제';
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
    }

    .view-toggle {
        width: 100%;
        order: 3;
    }

    .toggle-btn span {
        display: none;
    }

    .toggle-btn {
        flex: 1;
        justify-content: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-filter,
    .btn-reset {
        width: 100%;
        justify-content: center;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .table-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-add,
    .btn-save,
    .btn-export,
    .btn-today {
        width: 100%;
        justify-content: center;
    }

    #calendar {
        padding: 10px;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc .fc-toolbar-title {
        font-size: 18px;
    }

    .daily-total {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* 모달 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

/* SweetAlert2 커스텀 스타일 */
.swal2-container {
    z-index: 10001 !important;
}

.swal2-popup {
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.swal2-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
}

.swal2-html-container {
    font-size: 16px !important;
    color: #4a5568 !important;
}

.swal2-confirm,
.swal2-cancel {
    border-radius: 12px !important;
    padding: 12px 32px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4) !important;
}

.swal2-cancel:hover {
    transform: translateY(-2px) !important;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-body {
    padding: 28px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-group .required {
    color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    background: rgba(249, 250, 251, 0.8);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #4a5568;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-delete {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.modal-footer .btn-save {
    padding: 12px 28px;
    margin: 0;
}

/* 모바일에서 모달 최적화 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .modal-actions {
        width: 100%;
    }

    .btn-cancel,
    .modal-footer .btn-save {
        flex: 1;
    }

    .btn-delete {
        width: 100%;
        justify-content: center;
    }
}
