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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 1줄: 카테고리 영역 */
.category-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.category-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #007bff;
    background-color: white;
    color: #007bff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.category-btn:hover {
    background-color: #007bff;
    color: white;
}

.category-btn.active {
    background-color: #007bff;
    color: white;
}

.add-category-btn {
    padding: 10px 20px;
    border: 2px dashed #28a745;
    background-color: white;
    color: #28a745;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: bold;
}

.add-category-btn:hover {
    background-color: #28a745;
    color: white;
}

.category-input-container {
    display: none;
    align-items: center;
    gap: 10px;
}

.category-input-container.active {
    display: flex;
}

.category-input {
    padding: 8px 15px;
    border: 2px solid #28a745;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.category-save-btn, .category-cancel-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.category-save-btn {
    background-color: #28a745;
    color: white;
}

.category-cancel-btn {
    background-color: #6c757d;
    color: white;
}

/* 2줄: 데이터 입력 영역 */
.input-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.input-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.input-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.type-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.type-group-divider {
    width: 1px;
    height: 40px;
    background-color: #dee2e6;
}

.type-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s;
}

.type-btn:not(.active) {
    opacity: 0.3;
}

.type-btn.active {
    opacity: 1;
}

.income-btn {
    background-color: #007bff;
    color: white;
}

.income-btn:not(.active) {
    background-color: #cfe2ff;
    color: #084298;
}

.expense-btn {
    background-color: #dc3545;
    color: white;
}

.expense-btn:not(.active) {
    background-color: #f8d7da;
    color: #842029;
}

.hash-btn {
    background-color: #6f42c1;
    color: white;
}

.hash-btn:not(.active) {
    background-color: #e0cffc;
    color: #6f42c1;
}

.world-btn {
    background-color: #fd7e14;
    color: white;
}

.world-btn:not(.active) {
    background-color: #ffe5d0;
    color: #fd7e14;
}

.input-field {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    flex: 1;
    min-width: 150px;
}

.input-field:focus {
    border-color: #007bff;
}

.submit-btn, .history-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s;
}

.submit-btn {
    background-color: #28a745;
    color: white;
}

.submit-btn:hover {
    background-color: #218838;
}

.history-btn {
    background-color: #6c757d;
    color: white;
}

.history-btn:hover {
    background-color: #5a6268;
}

/* 엑셀 업로드 섹션 */
.excel-upload-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.excel-upload-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.excel-upload-btn {
    padding: 12px 25px;
    border: 2px solid #17a2b8;
    background-color: white;
    color: #17a2b8;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s;
}

.excel-upload-btn:hover {
    background-color: #17a2b8;
    color: white;
}

.selected-file-name {
    color: #666;
    font-size: 14px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.excel-submit-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    background-color: #17a2b8;
    color: white;
    transition: all 0.3s;
}

.excel-submit-btn:hover {
    background-color: #138496;
}

.excel-submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.excel-cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    background-color: #dc3545;
    color: white;
    transition: all 0.3s;
}

.excel-cancel-btn:hover {
    background-color: #c82333;
}

.excel-cancel-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.cancel-info {
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
}

/* 3줄: 대시보드 영역 */
.dashboard-section {
    padding: 20px;
    background-color: #f8f9fa;
}

.dashboard-months {
    display: flex;
    gap: 20px;
    justify-content: space-around;
}

.month-column {
    flex: 1;
    min-width: 250px;
}

.month-column h3 {
    text-align: center;
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dashboard-item {
    padding: 15px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-item h4 {
    font-size: 14px;
    margin: 0;
    color: #666;
}

.dashboard-item .amount {
    font-size: 20px;
    font-weight: bold;
}

.income-amount {
    color: #007bff;
}

.expense-amount {
    color: #dc3545;
}

.total-amount {
    color: #28a745;
}

@media (max-width: 768px) {
    .dashboard-months {
        flex-direction: column;
    }
}

.alert {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 내역 섹션 스타일 */
.history-section {
    background-color: white;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.history-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.history-header:hover {
    background-color: #e9ecef;
}

.history-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.history-search {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.history-search.collapsed {
    display: none;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #007bff;
}

.history-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.history-body.collapsed {
    display: none;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
}

.history-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.history-table tbody tr {
    cursor: pointer;
    user-select: none;
}

.history-table tbody tr:hover {
    background-color: #f8f9fa;
}

.history-table tbody tr.long-pressing {
    background-color: #ffe0e0;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.type-income {
    background-color: #cfe2ff;
    color: #084298;
}

.type-expense {
    background-color: #f8d7da;
    color: #842029;
}

/* 거래내역 금액 색상 */
.amount-income {
    color: #007bff;
    font-weight: bold;
}

.amount-expense {
    color: #dc3545;
    font-weight: bold;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* 툴팁 박스 스타일 */
.tooltip-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 20px;
    max-width: 350px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.tooltip-box.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.tooltip-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-icon {
    font-size: 20px;
}

.tooltip-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tooltip-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tooltip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.5;
}

.tooltip-item-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.tooltip-item-text {
    color: #555;
}

.tooltip-item-text strong {
    color: #333;
    font-weight: 600;
}

.tooltip-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 999;
}

.tooltip-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

.tooltip-toggle-btn.hidden {
    display: none;
}

/* 탭 네비게이션 */
.tab-navigation {
    display: flex;
    background-color: #343a40;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background-color: #495057;
    color: white;
}

.tab-btn.active {
    background-color: #495057;
    color: white;
    border-bottom: 3px solid #007bff;
}

.tab-back {
    flex: none;
    margin-left: auto;
    text-decoration: none;
}

/* 예산 대시보드 */
.budget-dashboard-section {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.budget-header h2 {
    color: #333;
    font-size: 20px;
    margin: 0;
}

.budget-period-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-period-label {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.budget-period-dates {
    font-size: 14px;
    color: #666;
}

.budget-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.budget-card {
    flex: 1;
    min-width: 180px;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.budget-card h4 {
    color: #666;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.budget-amount {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.budget-carryover { color: #17a2b8; }
.budget-spent { color: #dc3545; }
.budget-remaining { color: #28a745; }
.budget-over { color: #dc3545; }

/* 이월 카드 호버 툴팁 */
.carryover-card {
    position: relative;
    cursor: pointer;
}

.carryover-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background-color: #333;
    color: white;
    border-radius: 8px;
    padding: 12px 15px;
    min-width: 220px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 13px;
}

.carryover-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #333;
}

.carryover-card:hover .carryover-tooltip {
    display: block;
}

.carryover-tooltip-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #555;
}

.carryover-tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.carryover-tooltip-label {
    color: #ccc;
}

.carryover-tooltip-value.positive {
    color: #5fd97f;
}

.carryover-tooltip-value.negative {
    color: #ff7b7b;
}

.carryover-tooltip-total {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #555;
    font-weight: bold;
    color: #17a2b8;
}

.carryover-tooltip-empty {
    color: #aaa;
    text-align: center;
}

/* 예산 입력 섹션 */
.budget-input-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.budget-input-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.budget-input-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* 예산 지출 내역 */
.budget-history-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.budget-history-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

/* 기간별 요약 */
.budget-period-history-section {
    padding: 20px;
    background-color: #f8f9fa;
}

.budget-period-history-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.period-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.period-summary-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.period-summary-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.period-remaining-positive {
    color: #28a745;
    font-weight: bold;
}

.period-remaining-negative {
    color: #dc3545;
    font-weight: bold;
}

/* 상여금 증량 섹션 */
.bonus-increase-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.bonus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bonus-header h2 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.bonus-toggle-btn {
    padding: 8px 18px;
    border: 2px solid #6f42c1;
    background-color: white;
    color: #6f42c1;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.bonus-toggle-btn:hover {
    background-color: #6f42c1;
    color: white;
}

.bonus-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.bonus-form-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bonus-form-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bonus-form-row label {
    min-width: 100px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.bonus-form-row .input-field {
    max-width: 200px;
}

.bonus-type-group {
    display: flex;
    gap: 10px;
}

.bonus-type-btn {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 5px;
}

.bonus-type-btn.active {
    background-color: #6f42c1;
    color: white;
    opacity: 1;
}

.bonus-type-btn:not(.active) {
    background-color: #e0cffc;
    color: #6f42c1;
    opacity: 0.6;
}

.bonus-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

/* 할부 차감 섹션 */
.installment-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.installment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.installment-header h2 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.installment-toggle-btn {
    padding: 8px 18px;
    border: 2px solid #e83e8c;
    background-color: white;
    color: #e83e8c;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.installment-toggle-btn:hover {
    background-color: #e83e8c;
    color: white;
}

.installment-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.installment-form-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.installment-form-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.installment-form-row label {
    min-width: 100px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.installment-form-row .input-field {
    max-width: 200px;
}

.installment-preview {
    padding: 10px 15px;
    background-color: #fff3cd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #856404;
    display: none;
}

.installment-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.installment-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #e83e8c;
}

.installment-card.completed {
    opacity: 0.5;
    border-left-color: #adb5bd;
}

.installment-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.installment-card-desc {
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.installment-card-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.installment-card-badge.active {
    background-color: #e83e8c;
    color: white;
}

.installment-card-badge.done {
    background-color: #adb5bd;
    color: white;
}

.installment-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.installment-card-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.installment-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.installment-progress-fill {
    height: 100%;
    background-color: #e83e8c;
    border-radius: 4px;
    transition: width 0.3s;
}

.installment-card.completed .installment-progress-fill {
    background-color: #adb5bd;
}

.installment-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.installment-card-remaining {
    color: #e83e8c;
    font-weight: bold;
}

.installment-card.completed .installment-card-remaining {
    color: #adb5bd;
}

.installment-delete-btn {
    padding: 4px 12px;
    border: 1px solid #dc3545;
    background-color: white;
    color: #dc3545;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.installment-delete-btn:hover {
    background-color: #dc3545;
    color: white;
}

.cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    background-color: #6c757d;
    color: white;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

.bonus-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.bonus-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-size: 13px;
}

.bonus-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.bonus-table tbody tr {
    cursor: pointer;
    user-select: none;
}

.bonus-table tbody tr:hover {
    background-color: #f8f9fa;
}

.bonus-table tbody tr.long-pressing {
    background-color: #ffe0e0;
}

.bonus-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.bonus-type-badge.lump_sum {
    background-color: #d4edda;
    color: #155724;
}

.bonus-type-badge.installment {
    background-color: #cfe2ff;
    color: #084298;
}

.bonus-per-month {
    color: #6f42c1;
    font-weight: bold;
}

.budget-bonus-label {
    font-size: 11px;
    color: #6f42c1;
    margin-top: 5px;
}

@media (max-width: 768px) {
    /* 전체 패딩 축소 */
    body {
        padding: 5px;
    }

    .container {
        border-radius: 5px;
    }

    /* 탭 버튼 */
    .tab-btn {
        font-size: 15px;
        padding: 14px 10px;
    }

    /* ===== 복지비용 탭 모바일 최적화 ===== */

    /* 예산 대시보드 */
    .budget-dashboard-section {
        padding: 15px 12px;
    }

    .budget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 15px;
    }

    .budget-header h2 {
        font-size: 18px;
    }

    .budget-period-info {
        flex-direction: column;
        gap: 2px;
    }

    .budget-period-label {
        font-size: 16px;
    }

    .budget-period-dates {
        font-size: 13px;
    }

    /* 예산 카드 - 2x2 그리드 */
    .budget-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .budget-card {
        min-width: unset;
        padding: 14px 10px;
    }

    .budget-card h4 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .budget-amount {
        font-size: 17px;
    }

    .budget-bonus-label {
        font-size: 10px;
    }

    /* 이월 툴팁 모바일 */
    .carryover-tooltip {
        left: 0;
        transform: none;
        min-width: 180px;
    }

    .carryover-tooltip::before {
        left: 30%;
    }

    /* 상여금 증량 섹션 */
    .bonus-increase-section {
        padding: 15px 12px;
    }

    .bonus-header h2 {
        font-size: 16px;
    }

    .bonus-toggle-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .bonus-form {
        padding: 15px 12px;
    }

    .bonus-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bonus-form-row label {
        min-width: auto;
        font-size: 13px;
    }

    .bonus-form-row .input-field {
        max-width: 100%;
        width: 100%;
    }

    .bonus-form-actions {
        width: 100%;
    }

    .bonus-form-actions .submit-btn,
    .bonus-form-actions .cancel-btn {
        flex: 1;
        padding: 10px;
        font-size: 14px;
    }

    /* 상여금 테이블 - 가로 스크롤 */
    .bonus-increase-section .bonus-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bonus-table th,
    .bonus-table td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* 할부 차감 섹션 */
    .installment-section {
        padding: 15px 12px;
    }

    .installment-header h2 {
        font-size: 16px;
    }

    .installment-toggle-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .installment-form {
        padding: 15px 12px;
    }

    .installment-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .installment-form-row label {
        min-width: auto;
        font-size: 13px;
    }

    .installment-form-row .input-field {
        max-width: 100%;
        width: 100%;
    }

    .installment-form-actions {
        width: 100%;
    }

    .installment-form-actions .submit-btn,
    .installment-form-actions .cancel-btn {
        flex: 1;
        padding: 10px;
        font-size: 14px;
    }

    .installment-card-info {
        flex-direction: column;
        gap: 5px;
    }

    /* 지출 입력 섹션 */
    .budget-input-section {
        padding: 15px 12px;
    }

    .budget-input-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .budget-input-controls {
        flex-direction: column;
        gap: 10px;
    }

    .budget-input-controls .input-field {
        width: 100%;
        min-width: unset;
        padding: 12px;
        font-size: 16px;
    }

    .budget-input-controls .submit-btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    /* 지출 내역 섹션 */
    .budget-history-section {
        padding: 15px 12px;
    }

    .budget-history-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .budget-history-section .history-table th,
    .budget-history-section .history-table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* 기간별 요약 */
    .budget-period-history-section {
        padding: 15px 12px;
    }

    .budget-period-history-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* 기간별 요약 테이블 - 가로 스크롤 */
    .budget-period-history-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .period-summary-table th,
    .period-summary-table td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* ===== 가계부 탭 모바일 최적화 ===== */

    .category-section {
        padding: 15px 12px;
    }

    .category-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .input-section {
        padding: 15px 12px;
    }

    .input-section h2 {
        font-size: 16px;
    }

    .input-controls {
        gap: 10px;
    }

    .type-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .input-field {
        min-width: 100px;
        font-size: 16px;
    }

    .submit-btn, .history-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .dashboard-section {
        padding: 15px 12px;
    }

    .dashboard-months {
        flex-direction: column;
    }

    .month-column {
        min-width: unset;
    }

    .dashboard-item .amount {
        font-size: 17px;
    }

    .history-section {
        margin-top: 10px;
    }

    .history-header {
        padding: 15px 12px;
    }

    .history-header h2 {
        font-size: 17px;
    }

    .history-search {
        padding: 10px 12px;
    }

    .history-body {
        padding: 10px;
    }

    .history-table th,
    .history-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
}
