@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #f43f5e;
    --info: #3b82f6;
    
    --bg-main: #0b1020;
    --bg-surface: #111827;
    --bg-sidebar: #0b1020;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --glass-bg: rgba(30, 41, 59, 1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    
    --budget-card-bg: rgba(255, 255, 255, 0.1);
    --budget-card-border: transparent;
     
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --header-padding-y: 1.5rem;
    --header-height: 6rem;
}

body.light-theme {
    /* Bright & Clean Colors */
    --bg-main: #f7f9fc;
    --bg-surface: #f5f7fb;
    --bg-sidebar: #f7f9fc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --glass-bg: rgba(255, 255, 255, 1);
    --glass-border: #f1f5f9; /* Soft border */
    --glass-blur: blur(20px);
    
    --budget-card-bg: rgba(0, 0, 0, 0.04);
    --budget-card-border: transparent;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);

    /* Remove Dark Mode Gradient */
    background-image: none !important;
    background-color: var(--bg-main) !important;
}

/* Light Theme Specific Components overrides */
body.light-theme .header {
    /* Top fully transparent, bottom 50% opacity */
    background: linear-gradient(to bottom, rgba(247, 249, 252, 1) 0%, rgba(247, 249, 252, 0.5) 100%);
    border-bottom: none; /* Remove border for cleaner look */
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea,
body.light-theme .edit-input,
body.light-theme .select-trigger {
    background: #f8fafc; /* Very light gray for inputs */
    border-color: #e2e8f0;
    color: var(--text-primary);
}

body.light-theme .date-input-wrapper input {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .btn-secondary:hover {
    color: var(--text-primary) !important; /* Dark text for light theme */
    border-color: #e2e8f0 !important; /* Neutral border color for light theme */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important; /* Gray shadow for light theme */
}

body.light-theme .card {
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px -2px rgba(0,0,0,0.05); /* Softer, spread shadow */
}

body.light-theme aside {
    border-right: 1px solid #f1f5f9;
}

body.light-theme .selection-grid {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .nav-item:hover, 
body.light-theme .nav-item.active {
    background: #eff6ff;
    color: var(--primary);
}

body.light-theme .progress-container {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .item-icon {
    background: rgba(148, 163, 184, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh; /* 고정 높이 */
    overflow: hidden; /* 전체 스크롤 방지 */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

/* 스크롤바 숨기기 (스크롤 기능은 유지) */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.app-wrapper {
    display: flex;
    height: 100vh; /* 화면 꽉 채우기 */
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    background: rgba(15, 23, 42, 0.3);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

/* Sidebar */
aside {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 200; /* Ensure sidebar is above main content */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-gradient {
    background: linear-gradient(to right, #818cf8, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.nav-item i {
    font-size: 1.25rem;
}

/* Main Content */
main {
    flex: 1;
    padding: 2.5rem;
    padding-top: 0;
    padding-bottom: 2vh;
    width: 100%;
    height: 100%; /* 부모 높이에 맞춤 */
    min-height: 0; /* Flexbox 스크롤 버그 방지 */
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

main::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Edge */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Top fully transparent, bottom 50% opacity */
    background: linear-gradient(to bottom, rgba(11, 16, 32, 1) 0%, rgba(11, 16, 32, 0.5) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: -2.5rem -2.5rem 2.5rem -2.5rem; /* Negate main padding */
    padding: var(--header-padding-y) 2.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.income-value { color: var(--success); }
.expense-value { color: var(--danger); }

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    min-height: 200px;
    max-height: 300px;
    height: 25vh; /* 뷰포트 높이의 25% */
    position: relative;
    width: 100%;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* 최근 거래 내역 축소 버전 */
.compact-history .transaction-item {
    padding: 0.75rem;
}

.compact-history .item-details h4 {
    font-size: 0.9rem;
}

.compact-history .item-details p {
    font-size: 0.75rem;
}

.compact-history .amount {
    font-size: 0.95rem;
}

/* 이번 달 요약 위젯 */
.month-summary-widget {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.summary-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Forms */
h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-group-inline label {
    margin-bottom: 0;
    min-width: 70px;
    flex-shrink: 0;
}

.input-group-inline input,
.input-group-inline .date-input-wrapper {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

textarea {
    resize: none;
    min-height: 100px;
    overflow-y: auto;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

/* 원형 + 버튼 (거래 추가) */
.add-transaction-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.add-transaction-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.add-transaction-btn:active {
    transform: scale(0.95);
}

.add-transaction-btn i {
    width: 24px;
    height: 24px;
}

/* 모달 닫기 버튼 */
.modal-close-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-close-btn i {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-color: var(--glass-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn-secondary.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.type-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.type-toggle input { display: none; }
.type-toggle label {
    flex: 1;
    text-align: center;
    padding: 0.65rem;
    margin-bottom: 0;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-secondary);
}

.type-toggle input:checked + label {
    background: var(--primary);
    color: white;
}

.type-toggle input:checked + label[for*="income"] { background: var(--success); }
.type-toggle input:checked + label[for*="expense"] { background: var(--danger); }
.type-toggle input:checked + label[for*="transfer"] { background: var(--info); }

/* Transaction List */
.transaction-history {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.transaction-history::-webkit-scrollbar {
    width: 6px;
}

.transaction-history::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* History Date Grouping */
.history-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    text-align: center;
}
.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
}
.empty-state .empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.empty-state .empty-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.date-label {
    font-weight: 400;
    color: var(--text-muted);
}

.daily-totals {
    font-weight: 400;
    font-size: 0.85rem;
}

.transaction-item {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    transition: var(--transition);
    border-radius: 16px;
    margin-bottom: 0.5rem;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.item-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(100, 116, 139, 0.15);
}

.emoji-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.6rem;
}

.item-icon .emoji-icon {
    font-size: 1.8rem;
}

.grid-icon .emoji-icon {
    font-size: 1.5rem;
}

.empty-circle-icon {
    display: inline-flex;
    width: 1.3rem;
    height: 1.3rem;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    box-sizing: border-box;
}

.item-icon .empty-circle-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2.5px;
}

.grid-icon .empty-circle-icon {
    width: 1.3rem;
    height: 1.3rem;
    border-width: 2px;
}

.icon-income { color: var(--success); }
.icon-expense { color: var(--danger); }
.icon-transfer { color: var(--text-muted); }

.item-details h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.3rem;
}

.item-amount {
    text-align: right;
}

.amount-value {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
}

.btn-delete {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    width: auto;
}

.btn-delete:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
    transform: none;
    box-shadow: none;
}

/* Manage Lists */
.manage-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.manage-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: var(--transition);
}

.manage-tag:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
}

.manage-tag button {
    background: transparent;
    padding: 0;
    width: auto;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.manage-tag button:hover {
    color: var(--danger);
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* View Transitions */
.content-view {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}
.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.calendar-day-label-row,
.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin: 0;
}


.calendar-day-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem;
}
    .calendar-day-label {
        text-align: center;
        font-weight: 700;
        color: var(--text-muted);
    }

    .week-summary {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0 0.85rem;
        margin: 0rem;
        background: rgba(255, 255, 255, 0.08);
        border: none;
        border-radius: 8px;
        font-weight: 700;
        color: var(--text-primary);
    }

body.light-theme .week-summary {
    background: rgba(0, 0, 0, 0.08);
    }

    .week-income { 
        color: var(--success);
        display: inline-block;
        margin-right: 1.5rem;
    }
    .week-expense { 
        color: var(--danger);
        display: inline-block;
    }

.calendar-day {
    height: 70px; /* Fixed height for consistency */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: var(--transition);
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.today {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.day-number {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.day-amounts {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 0;
}

.day-income {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
    line-height: 1.1;
    text-align: right;
    width: 100%;
    padding-right: 3px;
}

.day-expense {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 500;
    line-height: 1.1;
    text-align: right;
    width: 100%;
    padding-right: 3px;
}

/* Budget Bars */
.budget-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.progress-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Custom Form Styling */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.date-input-wrapper input {
    width: 100%;
    padding-right: 3rem !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    pointer-events: none; /* Make overlay handle clicks */
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* Changed: Transparent to see context */
    display: none;
    z-index: 2000;
}

#date-picker-modal {
    z-index: 10003; /* Higher than detail modal (10002) */
}

.modal-overlay.active {
    display: block;
}

.date-picker-content {
    position: fixed; /* Positioned via JS near trigger */
    width: 340px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    z-index: 10003; /* Higher than detail modal (10002) */
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.date-picker-header h4 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    flex: 1;
}

.date-picker-header button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.date-picker-header button i,
.date-picker-header button svg {
    width: 36px !important;
    height: 36px !important;
    stroke: var(--text-primary) !important;
    stroke-width: 4px !important;
    color: var(--text-primary) !important;
}

.date-picker-header button:hover i,
.date-picker-header button:hover svg {
    stroke: var(--primary-light) !important;
    color: var(--primary-light) !important;
}

.picker-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 1.5rem;
}

.picker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.picker-day.selected {
    background: var(--primary);
    color: white;
}

.picker-day.today {
    color: var(--primary-light);
    font-weight: 700;
    text-decoration: underline;
}

.picker-day.not-current {
    color: var(--text-muted);
    opacity: 0.3;
}

.time-picker-section, .clock-picker-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.time-picker-section {
    display: flex;
    gap: 1rem;
}

/* Clock Picker Styles */
.clock-picker-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.clock-display {
    width: 100%;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.clock-ampm-toggle-interactive {
    position: absolute;
    left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clock-ampm-toggle-interactive button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.clock-ampm-toggle-interactive button.active {
    background: white;
    color: var(--primary);
}

.clock-time-text {
    font-size: 3.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.clock-time-text span {
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.clock-time-text span.active {
    opacity: 1;
}

.clock-time-text .colon {
    margin: 0 0.25rem;
    opacity: 1;
}

.clock-face-container {
    width: 260px;
    height: 260px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    position: relative;
    border: 1px solid var(--glass-border);
}

.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: crosshair;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 100px; /* Matched to radius */
    background: var(--primary-light);
    transform-origin: bottom center;
    pointer-events: none;
    z-index: 2;
}

.hand-tip {
    position: absolute;
    top: -18px; /* Centered on tip */
    left: -17px;
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--primary-light);
}

.clock-number {
    position: absolute;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    user-select: none;
}

.clock-number.active {
    color: white;
    font-weight: 700;
}

.time-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-column label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.time-column select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.time-toggle-mini {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2px;
}

.time-toggle-mini button {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
}

.time-toggle-mini button.active {
    background: var(--primary);
    color: white;
}

.picker-footer {
    display: flex;
    gap: 1rem;
}

.picker-footer button {
    flex: 1;
}

.input-icon-right {
    position: absolute;
    right: 1.25rem;
    color: var(--text-muted);
    pointer-events: none;
}

.custom-select.mini .select-trigger {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.custom-select.mini .select-options {
    max-height: 150px;
}

.custom-select.mini .select-option {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Custom Select Styling */
.custom-select {
    position: relative;
    user-select: none;
}

/* custom-select 내부의 숨겨진 select는 완전히 보이지 않게 */
.custom-select select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
}

.custom-select.active .select-trigger {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.active .select-options {
    display: block;
}

.select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.select-option:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.select-option.selected {
    background: var(--primary);
    color: white;
}

.select-options::-webkit-scrollbar {
    width: 6px;
}

.select-options::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calendar Enhancements */
.calendar-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
    background: var(--bg-main);
}

#view-history .calendar-header {
    position: sticky;
    top: calc(var(--header-height) - 0.5rem);
    z-index: 110;
    background: var(--bg-main);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    border-radius: 12px;
    padding: 0.5rem;
}

.card .calendar-header {
    background: var(--glass-bg);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

body.light-theme #view-history .calendar-header {
    background: var(--bg-main);
}

body.light-theme .card .calendar-header {
    background: var(--glass-bg);
}

#view-history .card .calendar-header {
    background: var(--glass-bg);
}

.calendar-summary {
    display: flex;
    gap: 0.75rem;
    margin: 0 0.5rem 0.6rem;
}

.summary-card {
    flex: 1;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card span {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.summary-card.income strong { color: var(--success); }
.summary-card.expense strong { color: var(--danger); }

.calendar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    margin-left: 1rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

.calendar-nav h3 {
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    margin: 0;
}

body.light-theme .calendar-nav {
    background-image: none;
    background-color: var(--bg-main);
}

.calendar-nav .add-transaction-btn {
    margin-left: auto !important;
}

.calendar-nav button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.calendar-day {
    min-height: 80px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day.not-current {
    opacity: 0.3;
}

.day-number {
    font-size: 0.85rem;
    font-weight: 600;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: white;
}

.day-amount {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
    letter-spacing: -0.02em;
}

/* Settings: Mode Toggle */
.mode-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-option input {
    display: none;
}

.mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.mode-option input:checked + .mode-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.mode-card i {
    width: 24px;
    height: 24px;
}

/* Settings: Compact Toggle Group */
.compact-toggle-group {
    display: flex;
    gap: 0.5rem;
}

.compact-toggle-option input {
    display: none;
}

.compact-toggle-option {
    cursor: pointer;
}

.compact-toggle-option span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    width: 150px;
    justify-content: center;
}

.compact-toggle-option span i {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.compact-toggle-option input:checked + span {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-weight: 500;
}

.compact-toggle-option input:checked + span i {
    color: var(--primary-light);
}

/* Settings Row */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* 설정 섹션 - 10% 축소 */
    #view-settings h3 {
        font-size: 0.95rem;
    }

    #view-settings .compact-toggle-group {
        width: 100%;
    }

    #view-settings .compact-toggle-option {
        flex: 1;
    }

    #view-settings .compact-toggle-option span {
        padding: 0.45rem 0.72rem;
        font-size: 0.765rem;
        width: 100%;
    }

    #view-settings .compact-toggle-option span i {
        width: 18px;
        height: 18px;
    }

    /* 카테고리 관리, 결제수단 관리 - 10% 축소 */
    #view-settings .card h3 {
        font-size: 0.95rem;
    }

    #view-settings .card .btn-secondary {
        padding: 0.45rem 0.9rem;
        font-size: 0.81rem;
    }

    #view-settings .card .input-group input {
        font-size: 0.855rem;
        padding: 0.63rem 0.9rem;
    }

    #view-settings .card .btn-primary {
        font-size: 0.855rem;
        padding: 0.63rem 1.08rem;
    }

    #view-settings .manage-tag {
        padding: 0.54rem 0.9rem;
        font-size: 0.81rem;
    }

    #view-settings .manage-tag button {
        font-size: 0.99rem;
    }

    /* 관리자 섹션 - 10% 축소 */
    #admin-card h3,
    #admin-card h4 {
        font-size: 0.95rem;
    }

    #admin-card #admin-badge {
        font-size: 0.675rem;
        padding: 0.18rem 0.45rem;
    }

    #admin-card .btn-secondary {
        width: 32.4px;
        height: 32.4px;
        min-width: 32.4px;
    }

    #admin-card .btn-secondary i {
        width: 16.2px;
        height: 16.2px;
    }

    #admin-card #admin-user-list {
        font-size: 0.81rem;
    }
}

/* Selection Grid (Icon Mode) */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: var(--transition);
}

.grid-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px solid transparent;
    transition: var(--transition);
}

.grid-item span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* Grid Icons - No specific colors, icons are colorful emojis */

/* Active States for Vibrant Icons */
.grid-item.active .grid-icon { 
    border: 3px solid currentColor !important;
    transform: scale(1.15);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.5);
}

.grid-item.active span {
    color: var(--primary-light);
    font-weight: 700;
}

/* --- Responsive Design --- */

/* Desktop Refinements */
@media (min-width: 1025px) {
    .app-wrapper {
        margin: 2rem auto;
        border-radius: 24px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        height: calc(100vh - 4rem);
        overflow: hidden;
    }
    aside { height: 100%; }
}

/* Tablet / Small Desktop */
@media (max-width: 1024px) {
    aside { width: 80px; padding: 2rem 1rem; }
    .logo span, .nav-item span { display: none; }
    .logo { justify-content: center; margin-bottom: 1rem; }
    .logo i { font-size: 2.7rem; }
    .nav-item { justify-content: center; padding: 1rem; }
    .nav-item i { font-size: 2.7rem; }
    
    /* 축약형 사이드바에서 로고/아바타 영역 숨김 */
    aside > div:first-child { display: none; }
    
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}

/* Tablet & Small PC (중간 크기) */
@media (max-width: 1024px) {
    /* Transaction Item 반응형 - 태블릿/작은 PC */
    .transaction-item {
        padding: 1rem;
    }
    
    .item-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .item-details h4 {
        font-size: 0.925rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .item-meta {
        font-size: 0.75rem;
        gap: 0.6rem;
    }
    
    .amount-value {
        font-size: 1rem;
    }
    
    .item-amount span:last-child {
        font-size: 0.75rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    :root {
        --header-padding-y: 0.75rem;
        --header-height: 4.5rem;
    }

    .app-wrapper {
        flex-direction: column;
        border: none;
        max-width: 100%;
        margin: 0;
    }

    /* Transform Sidebar to Bottom Nav */
    aside {
        width: 100%;
        height: auto;
        min-height: 70px;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto; /* Reset desktop top: 0 */
        flex-direction: row;
        padding: 0.5rem 1rem;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(20px);
        justify-content: center;
    }

    body.light-theme aside {
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid #e2e8f0;
    }

    .logo { display: none; } /* Hide Logo in mobile bottom nav */
    
    /* 사이드바 전체 로고/아바타 영역 숨김 */
    aside > div:first-child { display: none; }
    
    /* 로그아웃 버튼을 모바일 하단 네비에 표시 */
    aside > div:last-child { 
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    
    #mobile-avatar { 
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-weight: 600;
        height: 36px;
        line-height: 36px;
    .week-summary {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0.55rem 0.85rem;
        margin: 2px 0 6px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        font-weight: 700;
        color: var(--text-primary);
    }
    .week-amounts {
        display: flex;
        gap: 3rem;
        align-items: center;
    }
    .week-income { 
        color: var(--success);
        display: inline-block;
        margin-right: 1rem;
    }
    .week-expense { 
        color: var(--danger);
        display: inline-block;
    }
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        gap: 0;
        padding: 0;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 6px 4px;
        border-radius: 8px;
        flex: 1;
        justify-content: center;
        align-items: center;
        min-width: 0; /* Allow shrinking */
        display: flex !important;
    }

    .nav-item i { font-size: 1.3rem; }
    .nav-item span { 
        display: block !important; 
        font-size: 0.6rem; 
        font-weight: 500;
        color: inherit;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    main {
        padding: 1.5rem;
        padding-top: 0;
        padding-bottom: 10vh;
    }

    .header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        /* Mobile Sticky Adjustments */
        position: sticky;
        top: 0;
        z-index: 100;
        margin: -1.5rem -1.5rem 1.5rem -1.5rem;
        padding: var(--header-padding-y) 1.5rem;
    }

    .user-profile { width: 100%; justify-content: space-between; }

    .stats-grid { grid-template-columns: 1fr; }
    .charts-grid, .content-grid { grid-template-columns: 1fr; }
    
    /* Chart containers need more height on mobile */
    .chart-container {
        height: 300px;
        margin-bottom: 1rem;
    }
    
    .card { padding: 1.25rem; }
    
    .centered-modal {
        max-height: calc(100vh - 90px); /* 하단 네비 공간 제외 */
    }
    
    #view-history .calendar-header {
        top: calc(var(--header-height) - 0.5rem);
    }

    .calendar-grid { 
        gap: 2px;
        font-size: 0.8rem;
    }

    .calendar-day-label-row,
    .calendar-week-row {
        gap: 0;
    }

    .week-summary {
        margin: 0;
        padding: 0.2rem 0.7rem;
    }
    
    .calendar-day { 
        padding: 0 0.1rem;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    .day-number { font-size: 0.7rem; }
    .day-amount { font-size: 0.55rem; }
    .day-income, .day-expense { font-size: 0.5rem; }
    
    .day-amounts {
        margin-top: 2px;
    }

    /* Selection Grid optimization for smaller screens */
    .selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    .grid-icon { width: 40px; height: 40px; }
    
    /* Transaction Item 반응형 */
    .transaction-item {
        padding: 0.875rem;
        gap: 0.5rem;
    }
    
    .item-main {
        gap: 0.75rem;
        min-width: 0;
        flex: 1;
    }
    
    .item-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .item-details {
        min-width: 0;
        flex: 1;
    }
    
    .item-details h4 {
        font-size: 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .item-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .item-amount {
        flex-shrink: 0;
    }
    
    .amount-value {
        font-size: 0.95rem;
    }
    
    .item-amount span:last-child {
        font-size: 0.7rem;
    }
    
    .btn-delete {
        padding: 0.375rem;
    }
    
    .btn-delete i {
        width: 16px !important;
        height: 16px !important;
    }
}

.centered-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: visible; /* Allow date picker to overflow horizontally */
    z-index: 10002;
    pointer-events: auto;
    transition: none !important; /* 들썩이는 애니메이션 효과 제거 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.centered-modal::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.centered-modal:hover {
    transform: translate(-50%, -50%) !important; /* 중앙 위치 유지 */
    border-color: rgba(255, 255, 255, 0.2); /* 테두리만 살짝 밝게 */
}

/* Daily Transaction Item */
#transaction-form {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#transaction-form::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    #transaction-form {
        max-height: calc(100vh - 90px - 200px);
    }
}

#category-budget-list {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#category-budget-list::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    #category-budget-list {
        max-height: calc(100vh - 90px - 400px);
    }
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.modal-close-btn i {
    width: 18px;
    height: 18px;
}

#daily-transactions-list {
    max-height: calc(100vh - 280px); /* 모바일에서는 더 작게 */
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#daily-transactions-list::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    #daily-transactions-list {
        max-height: calc(100vh - 90px - 280px); /* 하단 네비 제외 */
    }
}

.daily-transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.daily-transaction-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.dropdown-item:hover, .dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.detail-modal-content {
    width: 450px;
    padding: 2.5rem;
}

.detail-modal-content:hover {
    box-shadow: var(--shadow-xl);
}

.edit-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.edit-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* Force Light Theme Background Fix */
body.light-theme {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
}

body.light-theme main {
    background-color: #ffffff !important;
}
/* 로그인 모달 스타일 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.4s ease;
}

.login-modal.active {
    display: flex;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 8px 16px -4px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.login-header i {
    color: #000000 !important;
    stroke: #000000 !important;
}

.login-header h2 {
    font-size: 2rem;
    color: #6366f1;
    margin: 0;
    font-weight: 700;
    transition: color 0.4s ease;
}

.login-modal .form-group {
    margin-bottom: 1.5rem;
}

.login-modal label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.5rem;
}

.login-modal input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #f8f9fa;
    color: #000000;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-modal input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-modal input::placeholder {
    color: #999999;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background-transition: background 0.4s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #000000;
    font-size: 0.875rem;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--primary-light);
}

/* 라이트 테마에서도 로그인 모달은 동일한 스타일 유지 */
body.light-theme .login-modal {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

body.light-theme .login-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

body.light-theme .login-modal input {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

body.light-theme .login-modal input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* 색상 테마 선택 */
.theme-selector {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10001;
}

.theme-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-color:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.theme-color.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.total-budget-card {
    background: var(--budget-card-bg) !important;
    border: none !important;
}