:root {
    --primary-color: #7c4dff;
    --bg-color: #f8f9fa;
    --text-main: #2d3748;
    --text-muted: #718096;
}

body {
    font-family: 'Pretendard', sans-serif;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

.mobile-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.mobile-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.user-welcome { font-weight: 700; color: var(--primary-color); }
.trial-badge { background: #fff9db; color: #f08c00; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; margin-top: 2px; display: inline-block; }

/* Calendar */
.calendar-nav { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #eee; border-top: 1px solid #eee; }
.day-header { background: white; text-align: center; padding: 10px 0; font-size: 0.8rem; font-weight: 700; }
.day { background: white; min-height: 65px; display: flex; flex-direction: column; align-items: center; padding: 5px 0; font-size: 0.9rem; cursor: pointer; position: relative; }
.day.selected { background: #f0ebff; border: 1px solid var(--primary-color); z-index: 1; }
.day.today { color: var(--primary-color); font-weight: 700; }
.day.sunday { color: #ff4d4d; }
.day.saturday { color: #4d94ff; }

.holiday-name { font-size: 0.55rem; color: #ff4d4d; margin-bottom: 2px; }
.day-summary {
    margin-top: 2px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 2px;
    overflow: hidden;
}

.summary-schedule {
    font-size: 0.55rem;
    color: #4a5568;
    background: #f1f3f5;
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90%;
}

.summary-amount {
    font-size: 0.6rem;
    font-weight: 700;
}

.amt-in { color: #4d94ff; }  /* 입금: 파랑 */
.amt-out { color: #ff4d4d; } /* 지출: 빨강 */

/* Type Toggle Buttons */
.type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.type-toggle button {
    flex: 1;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.type-toggle button#type-out.active { background: #fff0f0; color: #ff4d4d; border-color: #ff4d4d; }
.type-toggle button#type-in.active { background: #f0f7ff; color: #4d94ff; border-color: #4d94ff; }

/* Inline Detail (Compact View) */
.inline-detail {
    grid-column: 1 / -1;
    background: #fdfdff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 20px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown { from { max-height: 0; opacity: 0; } to { max-height: 1000px; opacity: 1; } }

.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #f1f3f5; padding-bottom: 10px; }
.detail-date { margin: 0; font-size: 1rem; color: var(--primary-color); }
.close-detail { background: none; border: none; font-size: 1.5rem; color: #adb5bd; }

.detail-content { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-list-section h4 { margin: 0 0 10px; font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }

.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f8f9fa; font-size: 0.9rem; }
.delete-btn { background: none; border: none; color: #dee2e6; font-size: 1rem; }

.day-total { text-align: right; margin-top: 10px; font-weight: 700; color: #ff4d4d; border-top: 1px dashed #eee; padding-top: 10px; }

/* Bottom Area & Floating Button */
.bottom-area { padding: 20px; border-top: 1px solid #eee; background: white; }
.monthly-summary-bar { font-weight: 700; margin-bottom: 15px; text-align: center; font-size: 0.95rem; }

.floating-add-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
    cursor: pointer;
}

/* Add Item Modal & Tabs */
.add-item-box { border-radius: 24px 24px 0 0 !important; }
.tabs { display: flex; gap: 10px; margin-bottom: 20px; background: #f1f3f5; padding: 5px; border-radius: 12px; }
.tabs button { flex: 1; padding: 10px; border: none; border-radius: 8px; background: none; color: var(--text-muted); font-weight: 700; }
.tabs button.active { background: white; color: var(--primary-color); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

.add-form { display: flex; flex-direction: column; gap: 10px; animation: fadeIn 0.2s; }
.add-form input { width: 100%; padding: 15px; border: 1px solid #eee; border-radius: 12px; font-size: 1rem; box-sizing: border-box; }

/* Modals General */
.auth-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: flex-end; z-index: 1000; }
.auth-box { background: white; width: 100%; padding: 30px 20px; position: relative; }
.primary-btn { padding: 15px; background: var(--primary-color); color: white; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; }
.icon-btn { background: none; border: none; font-size: 1.2rem; margin-left: 10px; }
.login-nav-btn { background: var(--primary-color); color: white; border: none; padding: 6px 15px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
