/* member/css/network.css - 행정 네트워크 (network.html / js/network.js) */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f3f6fa;
    color: var(--ink);
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    font-size: 15px;
}

/* ── 위 막대 ── */
.net-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 24px;
    background: var(--brand-gradient-deep);
    color: #fff;
    box-shadow: 0 2px 12px rgba(10, 61, 115, 0.25);
}
.net-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.net-brand img { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 4px; object-fit: contain; }
.net-brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.net-brand small { font-size: 12px; opacity: 0.85; }
.net-brand b { font-size: 19px; font-weight: 900; letter-spacing: -0.3px; }
.net-top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.net-user { font-size: 13px; font-weight: 700; opacity: 0.95; }
.net-home { color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.net-home:hover { text-decoration: underline; }

/* ── 탭 (성도현황 / 재정현황) ── */
.net-tabs {
    display: flex; gap: 4px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.net-tab {
    padding: 14px 22px 12px;
    border: 0; border-bottom: 3px solid transparent;
    background: none; color: var(--ink-muted);
    font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.net-tab:hover { color: var(--brand-700); }
.net-tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-600); }

.net-main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }

.net-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.net-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 900; letter-spacing: -0.3px; }
.net-card h2 small { font-size: 13px; font-weight: 500; color: var(--ink-muted); }

/* ── 사용안내 ── */
.net-guide { background: var(--brand-50); border-color: var(--brand-200); }
.net-guide summary { cursor: pointer; font-size: 16px; font-weight: 900; color: var(--brand-900); }
.net-guide ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.75; color: #334155; }
.net-guide b { color: var(--brand-900); }

/* ── 필터 ── */
.net-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.net-select {
    height: 40px; padding: 0 10px;
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    background: #fff; color: var(--ink);
    font: inherit; font-size: 14px;
}
.net-select:disabled { background: #f1f5f9; color: var(--ink); opacity: 1; }
#f-church { min-width: 220px; max-width: 100%; }
.net-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.net-range span { color: var(--ink-muted); font-weight: 700; }

.net-seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.net-seg button {
    height: 38px; padding: 0 14px;
    border: 0; border-left: 1px solid #e2e8f0;
    background: none; color: #475569;
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.net-seg button:first-child { border-left: 0; }
.net-seg button.is-on { background: var(--brand-600); color: #fff; }

.net-views { display: flex; gap: 6px; margin-left: auto; }
.net-btn {
    height: 40px; padding: 0 16px;
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    background: #fff; color: #334155;
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.net-btn:hover { border-color: var(--brand-600); color: var(--brand-700); }
.net-btn.is-on { background: var(--brand-100); border-color: var(--brand-600); color: var(--brand-900); }
.net-btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.net-btn-primary:hover { background: var(--brand-700); color: #fff; }
.net-btn:disabled { opacity: 0.6; cursor: default; }

/* ── 차트 (화면 높이에 맞춰 크게 → 아래 차트는 스크롤해서 본다) ── */
.net-chart-card { padding: 20px 22px 24px; }
.net-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.net-chart-head h2 { margin: 0; }
.net-chart-box { position: relative; height: clamp(440px, 70vh, 760px); }

/* ── 목록 ── */
.net-table-wrap { overflow-x: auto; }
.net-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.net-table th, .net-table td { padding: 9px 12px; border-bottom: 1px solid #edf2f7; text-align: left; white-space: nowrap; }
.net-table thead th { position: sticky; top: 0; background: #f8fafc; color: #475569; font-size: 13px; }
.net-table .num { text-align: right; }
.net-table input {
    width: 130px; height: 36px; padding: 0 10px;
    border: 1px solid #cbd5e1; border-radius: 8px;
    font: inherit; text-align: right;
}
.net-table input:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--brand-ring); }
.net-table tr.is-dirty td { background: #fffbea; }
.net-neg { color: #c2410c; }
.net-save-bar {
    position: sticky; bottom: 0;
    display: flex; justify-content: flex-end; align-items: center; gap: 12px;
    padding: 12px 0 0; background: #fff;
}
.net-unsaved { color: #b45309; font-size: 13px; font-weight: 700; }

.net-muted { color: var(--ink-muted); line-height: 1.6; }
.net-empty { padding: 12px 16px; background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius-sm); }
.net-warn { padding: 12px 16px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-sm); color: #9a3412; }

.net-gate { max-width: 560px; margin: 40px auto; padding: 28px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); }
.net-gate p { margin: 0 0 16px; line-height: 1.7; }

.net-flash {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
    padding: 10px 20px; border-radius: 999px;
    background: #0f172a; color: #fff; font-weight: 700;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

@media (max-width: 760px) {
    .net-top { padding: 10px 16px; }
    .net-brand b { font-size: 16px; }
    .net-user { display: none; }
    .net-tabs { padding: 0 8px; }
    .net-tab { padding: 12px 14px 10px; font-size: 15px; }
    .net-main { padding: 14px 16px 48px; }
    .net-card { padding: 14px 14px; }
    #f-church { min-width: 0; width: 100%; }
    .net-views { margin-left: 0; width: 100%; }
    .net-views .net-btn { flex: 1; }
    .net-chart-box { height: clamp(360px, 62vh, 560px); }
    .net-table input { width: 96px; }
}

/* ── 목록 (Total 상자 · 제목 · 표) ── */
.net-kind-tabs { margin-bottom: 16px; }
.net-list-head { display: grid; grid-template-columns: 220px 1fr 220px; align-items: center; gap: 16px; margin-bottom: 18px; }
.net-total { padding: 14px 18px; background: #fde4e4; border-bottom: 3px solid #f4a3a3; border-radius: 4px; color: #e5484d; }
.net-total small { display: block; font-size: 15px; }
.net-total b { display: block; margin-top: 6px; font-size: 30px; font-weight: 500; }
.net-list-title { text-align: center; }
.net-list-title h2 { margin: 0; font-size: 26px; font-weight: 700; }
.net-list-title p { margin: 4px 0 0; color: #475569; font-size: 15px; }
.net-note { margin: 0 0 12px; }
.net-list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.net-search { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.net-search input { height: 40px; width: 240px; max-width: 60vw; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); font: inherit; }

.net-table tbody tr:nth-child(odd) td { background: #fafbfc; }
.net-table tbody tr.is-empty td { color: #94a3b8; background: #fff; }
.net-table tfoot td { background: #eef4fb; border-top: 2px solid #cbd5e1; font-weight: 700; }
.net-finance-table th { white-space: normal; min-width: 76px; max-width: 120px; vertical-align: bottom; line-height: 1.35; }
.net-finance-table th:first-child { min-width: 40px; }
.net-members-table td { padding-top: 14px; padding-bottom: 14px; }
.net-sortable { cursor: pointer; user-select: none; }
.net-sortable:hover { color: var(--brand-700); }
.net-sort-ic { margin-left: 6px; font-size: 11px; color: #94a3b8; }
.net-sortable.is-sorted .net-sort-ic { color: var(--brand-600); }

.net-period { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.net-memo { display: inline-flex; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: #334155; cursor: pointer; border-radius: 50%; }
.net-memo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.net-memo.has-memo { color: var(--brand-600); }
.net-memo.has-memo svg { fill: var(--brand-100); }
.net-memo:disabled { cursor: default; opacity: 0.35; }
.net-memo:not(:disabled):hover { color: var(--brand-700); background: var(--brand-50); }

.net-actions { white-space: nowrap; }
.net-mini { height: 30px; padding: 0 10px; margin-right: 6px; border: 1px solid #e2e8f0; border-radius: 4px; background: #f1f5f9; color: #1f2937; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.net-mini:hover { background: #e2e8f0; }
.net-mini-warn { background: #f6a93b; border-color: #f6a93b; color: #fff; }
.net-mini-warn:hover { background: #e8962a; }
.net-mini-warn.has-reason { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }

.net-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; font-size: 15px; color: #334155; }
.net-pages { display: flex; gap: 4px; }
.net-pages button { min-width: 36px; height: 36px; border: 0; border-bottom: 2px solid transparent; background: none; color: #64748b; font: inherit; cursor: pointer; }
.net-pages button.is-on { color: #e5484d; border-bottom-color: #e5484d; font-weight: 700; }
.net-pages button:disabled { opacity: 0.35; cursor: default; }

/* ── 창 ── */
body.net-modal-open { overflow: hidden; }
.net-modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, 0.45); }
.net-modal[hidden] { display: none; }
.net-modal-box { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: var(--radius-md); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3); }
.net-modal-box.is-wide { max-width: 920px; }
.net-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.net-modal-head h2 { margin: 0; font-size: 18px; }
.net-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #64748b; }
.net-modal-body { padding: 16px 20px; overflow-y: auto; }
.net-modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.net-grow { flex: 1; }
.net-btn-danger { border-color: #fecaca; color: #b91c1c; }
.net-btn-danger:hover { border-color: #b91c1c; color: #b91c1c; background: #fef2f2; }
.net-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.net-form-grid fieldset { margin: 0; padding: 10px 14px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.net-form-grid legend { padding: 0 6px; font-weight: 900; color: var(--brand-900); }
.net-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: #334155; }
.net-field input, .net-field textarea, .net-textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-weight: 400; font-size: 15px; }
.net-field input[type="number"] { text-align: right; }
.net-field input:focus, .net-field textarea:focus, .net-textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--brand-ring); }
.net-finance-form .net-field { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-weight: 500; }
.net-finance-form .net-field span { flex: 1; min-width: 0; }
.net-finance-form .net-field input { width: 130px; flex: none; padding: 6px 8px; }
.net-cat-total { margin: 8px 0 6px; padding-top: 8px; border-top: 1px dashed #cbd5e1; text-align: right; font-weight: 700; }
.net-cat-total b { font-size: 17px; color: var(--brand-900); }
.net-compare { margin: 0 0 8px; padding: 8px 12px; background: var(--brand-50); border-radius: 8px; font-weight: 700; color: var(--brand-900); }

@media (max-width: 760px) {
    .net-list-head { grid-template-columns: 1fr; }
    .net-total { display: flex; align-items: baseline; justify-content: space-between; }
    .net-total b { margin: 0; font-size: 24px; }
    .net-list-title h2 { font-size: 20px; }
    .net-form-grid { grid-template-columns: 1fr; }
    .net-search input { width: 160px; }
}