/* =========================================
   MY CASH FLOW — WISE × BAND DESIGN SYSTEM
   ========================================= */

:root {
    --w-dark:   #163300;   /* 브랜드 다크 그린 (사이드바·로고·CTA 전용) */
    --w-lime:   #9FE870;   /* 브랜드 라임 (포인트 전용) */
    --w-lime2:  #C5F5A0;
    --w-lime3:  #EEF9E4;
    --w-bg:     #F9FAFB;   /* 토스식 뉴트럴 배경 */
    --w-white:  #FFFFFF;
    --w-text:   #191F28;   /* 토스식 다크 텍스트 */
    --w-gray:   #6B7280;
    --w-border: #E8EAED;   /* 뉴트럴 라이트 그레이 보더 */
    --w-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

/* --- BASE --- */
body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--w-bg);
    color: var(--w-text);
}

/* --- CHART CONTAINERS --- */
.chart-container { position: relative; width: 100%; height: 300px; max-height: 400px; margin: auto; }
.chart-container-lg { position: relative; width: 100%; height: 450px; max-height: 600px; }

/* --- SCROLLBARS --- */
.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }
#main-content::-webkit-scrollbar { width: 5px; }
#main-content::-webkit-scrollbar-track { background: var(--w-bg); }
#main-content::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

/* --- ANIMATIONS --- */
.fade-in { animation: fadeIn 0.28s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.toast-enter { animation: slideInRight 0.3s ease-out forwards; }
.toast-leave { animation: fadeOut 0.3s ease-in forwards; }
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ─── ASSET / CASH MODAL (Bottom-Sheet mobile, Centered desktop) ─── */
@keyframes slideUpSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }

.asset-modal-overlay {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.asset-modal-panel {
    background: #fff;
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 24px max(32px, env(safe-area-inset-bottom));
    animation: slideUpSheet 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
}
.asset-modal-backdrop-anim { animation: fadeInBackdrop 0.22s ease; }
.modal-drag-handle {
    width: 40px; height: 4px;
    background: #E8EAED; border-radius: 100px;
    margin: 6px auto 22px;
}
.asset-input {
    width: 100%; padding: 14px 16px;
    border-radius: 14px; border: 1.5px solid #E8EAED;
    background: #F9FAFB; color: #191F28;
    font-size: 15px; font-weight: 700; outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.asset-input:focus { border-color: #191F28; background: #fff; }
.asset-input::placeholder { color: #C4C9D4; font-weight: 500; }
.asset-btn-primary {
    width: 100%; padding: 16px;
    border-radius: 16px; background: #163300; color: #fff;
    font-size: 15px; font-weight: 900; border: none; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.asset-btn-primary:hover { background: #1e4700; }
.asset-btn-primary:active { transform: scale(0.98); }
.asset-field-label {
    display: block; font-size: 11px; font-weight: 900;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: #9CA3AF; margin-bottom: 8px;
}
@media (min-width: 768px) {
    .asset-modal-overlay { align-items: center; }
    .asset-modal-panel {
        border-radius: 24px;
        max-width: 468px; width: 100%;
        margin: 20px; padding: 32px;
        max-height: calc(100dvh - 48px);
        animation: fadeIn 0.22s ease-out;
    }
    .modal-drag-handle { display: none; }
}
/* ─────────────────────────────────────────────────────────── */

/* --- SIDEBAR (WISE DARK GREEN) --- */
#sidebar {
    background-color: var(--w-dark);
    border-right: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 모바일 사이드바 오버레이 ── */
@keyframes slideInSidebar {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
@keyframes slideOutSidebar {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
#mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 55;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeInBackdrop 0.22s ease;
}
#mobile-overlay.active { display: block; }
#sidebar.mobile-open {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 280px !important;
    z-index: 60 !important;
    animation: slideInSidebar 0.3s cubic-bezier(0.32,0.72,0,1);
}
#sidebarToggleBtn {
    background-color: #254d07;
    border-color: #2e6008;
    color: rgba(255,255,255,0.4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#sidebarToggleBtn:hover { color: var(--w-lime); }

/* ─── ADMIN TOGGLE SWITCH ─── */
.admin-toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.admin-toggle input { display:none; }
.admin-toggle-slider {
    position:absolute; inset:0; background:#E5E7EB; border-radius:999px;
    cursor:pointer; transition:0.22s ease;
}
.admin-toggle-slider::before {
    content:''; position:absolute; width:18px; height:18px;
    left:3px; top:3px; background:white; border-radius:50%;
    transition:0.22s ease; box-shadow:0 1px 3px rgba(0,0,0,0.18);
}
.admin-toggle input:checked + .admin-toggle-slider { background:#163300; }
.admin-toggle input:checked + .admin-toggle-slider::before { transform:translateX(20px); }

.nav-item {
    margin: 3px 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
    transition: all 0.18s ease;
}
.nav-item:hover:not(.active) {
    background-color: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
}
.nav-item.active {
    background-color: var(--w-lime);
    color: var(--w-dark);
    font-weight: 800;
}
.nav-item.active i { color: var(--w-dark) !important; }

/* --- SIDEBAR COLLAPSE --- */
.w-20 .hide-on-collapse { display: none !important; }
.w-20 .nav-item { justify-content: center; margin: 3px 8px; padding: 12px 0; }
.w-20 .nav-item i { margin-right: 0 !important; font-size: 1.2rem; }
.w-20 .logo-container { justify-content: center; padding: 0; }
.w-20 .profile-container { padding: 12px 8px; }
.w-20 .profile-container .auth-btn-wrapper { justify-content: center; padding: 8px; background-color: transparent; }
.w-20 .profile-container .auth-btn-wrapper:hover { background-color: rgba(255,255,255,0.07); }

/* --- WISE CARD --- */
.w-card {
    background: var(--w-white);
    border-radius: 20px;
    border: 1px solid var(--w-border);
    box-shadow: var(--w-shadow);
}
.w-card-dark {
    background: var(--w-dark);
    border-radius: 20px;
    border: none;
}

/* --- BUTTONS --- */
.btn-wise {
    background: var(--w-dark);
    color: var(--w-lime);
    font-weight: 800;
    border-radius: 100px;
    transition: all 0.18s;
    letter-spacing: -0.01em;
}
.btn-wise:hover { background: #1e4900; transform: translateY(-1px); }
.btn-lime {
    background: var(--w-lime);
    color: var(--w-dark);
    font-weight: 800;
    border-radius: 100px;
    transition: all 0.18s;
}
.btn-lime:hover { background: #8cda5e; transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--w-dark);
    font-weight: 700;
    border-radius: 100px;
    border: 1.5px solid var(--w-border);
    transition: all 0.18s;
}
.btn-ghost:hover { background: var(--w-lime3); border-color: var(--w-lime); }

/* --- KPI HERO CARD --- */
.kpi-hero {
    background: var(--w-dark);
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}
.kpi-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: rgba(159,232,112,0.12);
    border-radius: 50%;
}
.kpi-hero::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -20px;
    width: 120px; height: 120px;
    background: rgba(159,232,112,0.07);
    border-radius: 50%;
}

/* --- WISE BADGE --- */
.wise-badge {
    background: #F3F4F6;
    color: #4B5563;
    font-weight: 700;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}
.wise-badge-dark {
    background: rgba(159,232,112,0.18);
    color: var(--w-lime);
    font-weight: 700;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 100px;
}

/* --- HEALTH TOOLTIP --- */
.health-tooltip-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* --- TOAST --- */
.toast-success { border-left: 3px solid var(--w-lime); }
.toast-error { border-left: 3px solid #FF4A4A; }
.toast-warning { border-left: 3px solid #F59E0B; }

/* --- PROGRESS BAR --- */
.wise-progress-track { background: #F3F4F6; border-radius: 100px; height: 6px; }
.wise-progress-fill { background: #5bac22; border-radius: 100px; height: 6px; transition: width 0.6s ease; }

/* --- TABLE ROWS --- */
.wise-row:hover { background: #F9FAFB; }

/* --- MOBILE HEADER --- */
#mobile-header { background: var(--w-dark); }

/* --- INPUT FOCUS --- */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--w-lime) !important;
    box-shadow: 0 0 0 3px rgba(159,232,112,0.2) !important;
}
