/* ==========================================================================
   Profit Simulator & Cash Flow Stylesheet (src/modules/profit/profit.css)
   - Warm Gray Tone Theme (#F2F1ED)
   - Financial Sliders, Dynamic ROI Metrics & Expense Breakdown
   ========================================================================== */

#view-profit,
#view-profit-detail {
    width: 100%;
    min-height: 100vh;
    background: #F2F1ED;
    padding: 40px 20px 100px 20px;
    box-sizing: border-box;
}

.profit-main-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.profit-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.profit-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.profit-kpi-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #e2e8f0;
}

.profit-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.profit-kpi-val {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.profit-kpi-box.highlight {
    background: #0f172a;
    border-color: #0f172a;
}

.profit-kpi-box.highlight .profit-kpi-label {
    color: rgba(226, 255, 49, 0.85);
}

.profit-kpi-box.highlight .profit-kpi-val {
    color: #E2FF31;
}

@media (max-width: 1024px) {
    .profit-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #view-profit,
    #view-profit-detail {
        padding: 20px 14px 80px 14px;
    }
    .profit-card {
        padding: 20px;
        border-radius: 16px;
    }
    .profit-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   수익 계산 화면 틀: 배경·상단 바·여백과 --ax-* 변수 (2026-11-06 profitDetail.css에서 옮김).
   profitDetail.css는 수익 계산 화면에 들어갈 때 받으므로, 첫 화면부터 틀이 같도록 여기(모든 화면에서 받음)에 둔다.
   이 파일의 위 #view-profit 규칙보다 뒤에 있어야 지금과 같다
   ========================================================================== */
:root {
    --ax-canvas: #F2F1ED;
    --ax-card-bg: #FFFFFF;
    --ax-card-radius: 26px;
    --ax-card-border: 1px solid rgba(0, 0, 0, 0.04);
    --ax-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    --ax-black: #18181B;
    --ax-black-soft: #27272A;
    --ax-petrol: #006C76;
    --ax-blue: #3E5889;
    --ax-coral: #EF6A45;
    --ax-chalk: #DED9D3;
    --ax-gray-light: #F4F3F0;
    --ax-gray-border: #E6E5E0;
    --ax-text-main: #18181B;
    --ax-text-sub: #71717A;
    --ax-text-muted: #A1A1AA;
    --ax-font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
}

/* ── Apply Warm Gray Canvas Background Seamlessly ── */
body[data-route="profit-detail"],
html[data-route="profit-detail"],
body[data-route="profit-detail"] .admin-container,
body[data-route="profit-detail"] .admin-main,
body.route-profit-detail,
html.route-profit-detail,
body.route-profit-detail .admin-container,
body.route-profit-detail .admin-main,
body[data-route="calc"],
html[data-route="calc"],
body[data-route="calc"] .admin-container,
body[data-route="calc"] .admin-main,
body[data-route="profit-simple"],
html[data-route="profit-simple"],
body[data-route="profit-simple"] .admin-container,
body[data-route="profit-simple"] .admin-main,
body[data-route="simple"],
html[data-route="simple"],
body[data-route="simple"] .admin-container,
body[data-route="simple"] .admin-main,
#view-profit,
#view-profit-detail {
    background: #F2F1ED !important;
}

body[data-route="profit-detail"],
body[data-route="calc"],
body[data-route="profit-simple"],
body[data-route="simple"],
body.route-profit-detail {
    height: auto !important;
    overflow-y: visible !important; /* body가 스크롤 컨테이너가 되면 상단 바 sticky가 풀린다 (스크롤은 html이 맡음) */
    overflow-x: clip !important;
}

/* ── Top Navigation Bar Sticky Guarantee ── */
body[data-route="profit-detail"] .top-nav-bar,
body[data-route="calc"] .top-nav-bar,
body.route-profit-detail .top-nav-bar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: var(--nav-height, 72px) !important;
    min-height: var(--nav-height, 72px) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    z-index: 9999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-sizing: border-box !important;
}
@media (max-width: 1023px) {
    body[data-route="profit-detail"] .top-nav-bar,
    body[data-route="calc"] .top-nav-bar,
    body.route-profit-detail .top-nav-bar {
        height: var(--nav-height, 64px) !important;
        min-height: var(--nav-height, 64px) !important;
    }
}

body[data-route="profit-detail"] .admin-container,
body[data-route="calc"] .admin-container,
body.route-profit-detail .admin-container {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    background: #F2F1ED !important;
}

body[data-route="profit-detail"] .admin-main,
body[data-route="calc"] .admin-main,
body.route-profit-detail .admin-main {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    background: #F2F1ED !important;
    padding: 0 !important;
}

#view-profit-detail {
    padding: 16px 20px 80px 20px !important;
    box-sizing: border-box;
    font-family: var(--ax-font-family);
    color: var(--ax-text-main);
    min-height: 100%;
    width: 100%;
}
@media (max-width: 1023px) {
    #view-profit-detail {
        padding: 12px 12px 220px 12px !important; /* 하단 2배수 확장 바텀 독 여백 확보 */
    }
}

/* 조건 비교 계산기 화면 틀 (2026-11-07, /profit?tab=compare). 화면 안 스타일은 profitDetail.css */
#view-profit-compare {
    width: 100%;
    min-height: 100vh;
    background: #F2F1ED !important;
    padding: 16px 20px 100px 20px !important;
    box-sizing: border-box;
    font-family: var(--ax-font-family);
    color: var(--ax-text-main);
}
@media (max-width: 640px) {
    #view-profit-compare {
        padding: 12px 12px 90px 12px !important;
    }
}
