:root {
    --blue: #2463eb;
    --ink: #1c2f4d;
    --sub: #63748d;
    --line: #e3eaf3;
    --bg: #f5f8fc;
    --red: #db4b54;
    --green: #168266;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #fff; border-right: 1px solid var(--line); padding: 22px 15px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 900; font-size: 18px; padding: 5px 8px 22px; }
.brand > span { background: var(--blue); color: #fff; border-radius: 11px; padding: 10px; }
.brand small { display: block; color: var(--sub); font-size: 11px; font-weight: 500; margin-top: 4px; }
.profile { background: #f1f5fc; border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 18px; }
.profile small { display: block; color: var(--sub); margin-top: 5px; }
.nav { display: grid; gap: 5px; }
.nav a { padding: 12px 14px; border-radius: 9px; color: #51637c; font-weight: 700; }
.nav a:hover { background: #edf3ff; color: #1f59d9; }
.logout { position: absolute; bottom: 20px; left: 16px; right: 16px; text-align: center; border: 1px solid var(--line); padding: 10px; border-radius: 9px; }
.main { flex: 1; min-width: 0; padding: 28px max(24px, calc((100vw - 1450px) / 2)) 60px; }
h1 { margin: 0 0 20px; font-size: 26px; }
h2 { margin: 0 0 14px; font-size: 17px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.card small { color: var(--sub); }
.card strong { display: block; font-size: 23px; margin-top: 9px; }
.tablewrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 850px; font-size: 12px; }
th { background: #f8fafd; color: #70819b; text-align: left; padding: 12px 10px; white-space: nowrap; }
td { border-top: 1px solid #eef2f8; padding: 11px 10px; vertical-align: middle; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.wide { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 800; color: #536a87; margin-bottom: 6px; }
.field { width: 100%; min-height: 41px; border: 1px solid #d8e2f1; border-radius: 9px; padding: 9px 11px; background: #fff; }
textarea.field { min-height: 85px; }
.btn { display: inline-block; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 8px 11px; font-weight: 750; cursor: pointer; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.red { color: var(--red); border-color: #f0c8c8; }
.btn.green { color: var(--green); border-color: #bcead2; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 5px 8px; border-radius: 99px; background: #eef2f7; font-size: 11px; font-weight: 800; }
.pill.green { background: #e7f8ef; color: #168266; }
.pill.orange { background: #fff3df; color: #9e6614; }
.pill.red { background: #ffedf0; color: #c6404c; }
.notice { background: #eff5ff; border: 1px solid #d5e2fa; color: #345882; border-radius: 11px; padding: 12px 14px; line-height: 1.7; margin-bottom: 15px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 25px; }
.login-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.login-card .field { margin-bottom: 14px; }
.money { font-weight: 850; color: #214975; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } .sidebar { width: 205px; } }
@media (max-width: 700px) { .app { display: block; } .sidebar { position: static; width: 100%; height: auto; } .nav { display: flex; overflow-x: auto; } .nav a { white-space: nowrap; } .logout { position: static; display: block; margin-top: 10px; } .main { padding: 20px 12px; } .form-grid { grid-template-columns: 1fr; } .wide { grid-column: auto; } }

.page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.page-head h1{margin:0}.muted{color:#8a94a6}.topbar{display:flex;justify-content:space-between;margin-bottom:18px;color:#667085}.modal-wrap{position:fixed;inset:0;background:rgba(15,23,42,.48);display:flex;align-items:center;justify-content:center;z-index:9999;padding:20px}.modal-wrap.hidden{display:none}.modal{width:min(760px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:16px;box-shadow:0 24px 80px rgba(0,0,0,.25)}.modal-head,.modal-foot{padding:18px 22px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e7eb}.modal-foot{border-top:1px solid #e5e7eb;border-bottom:0;justify-content:flex-end;gap:8px}.modal-head h2{margin:0}.modal-body{padding:22px}.x{border:0;background:transparent;font-size:28px;cursor:pointer}.wide{grid-column:1/-1}textarea.field{resize:vertical}
.menu-label{font-size:12px;color:#98a2b3;font-weight:800;margin:20px 10px 8px}.nav a.active{background:#eaf1ff;color:#1557d5}.page-head{margin-bottom:22px}.page-head h1{font-size:28px}.page-head p{margin:7px 0 0}.inline-label{display:flex;align-items:center;gap:10px}.field.month{width:150px}.card em{display:block;font-style:normal;color:#98a2b3;font-size:11px;margin-top:7px}.dashboard8{grid-template-columns:repeat(4,1fr)}.good{color:#139b72}.panel h2+p{margin-top:-7px;margin-bottom:16px}.sidebar{width:220px}.main{padding-left:28px;padding-right:28px;max-width:1450px}.profile strong{font-size:16px}.tablewrap table{font-size:13px}@media(max-width:1050px){.dashboard8{grid-template-columns:repeat(2,1fr)}}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}@media(max-width:900px){.two-col{grid-template-columns:1fr}}
.emptybox{height:100px;border:1px solid var(--line);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#8a94a6}.panel small{color:#8a94a6}.panel+.panel{margin-top:16px}

/* ============================================================
   Mobile layout final override
   - Keep this block at the END of this file.
   - Earlier desktop rules redefine .sidebar/.main later in the file,
     so the mobile rules must be last to win the cascade.
   ============================================================ */
/* Long desktop menus remain in flow; logout never overlays navigation. */
@media (min-width: 761px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        box-sizing: border-box;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
    }
    .sidebar > * { flex-shrink: 0; }
    .sidebar .nav { margin-bottom: 20px; }
    .sidebar .logout {
        position: static;
        display: block;
        margin-top: auto;
    }
}

@media (max-width: 760px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app {
        display: block !important;
        width: 100%;
        min-width: 0;
    }

    .sidebar {
        display: block !important;
        position: static !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 12px 15px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--line);
        overflow: hidden;
    }

    .sidebar .brand,
    .brand {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 3px 0 10px !important;
        margin: 0;
        font-size: 16px !important;
    }

    .brand > span {
        flex: 0 0 auto;
        padding: 9px !important;
    }

    .brand small {
        font-size: 10px;
        line-height: 1.45;
        margin-top: 3px;
    }

    .profile,
    .menu-label,
    .logout {
        display: none !important;
    }

    .sidebar .nav,
    .nav {
        display: flex !important;
        width: 100%;
        max-width: 100%;
        gap: 5px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0 0 2px;
    }

    .sidebar .nav a,
    .nav a {
        flex: 0 0 auto;
        width: auto !important;
        white-space: nowrap;
        padding: 10px 12px !important;
        border-radius: 9px;
    }

    .main {
        display: block;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 21px 12px 45px !important;
    }

    .page-head {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-head h1 {
        font-size: 22px !important;
        line-height: 1.25;
    }

    .page-head p {
        font-size: 12px;
        line-height: 1.6;
    }

    .cards,
    .dashboard8 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }

    .card {
        min-width: 0;
        padding: 13px !important;
    }

    .card strong {
        font-size: 19px !important;
    }

    .panel {
        width: 100%;
        min-width: 0;
        padding: 13px !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .wide {
        grid-column: auto !important;
    }

    .tablewrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-wrap {
        padding: 10px !important;
    }

    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh;
    }

    .modal-head {
        padding: 16px !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    .modal-foot {
        padding: 12px !important;
    }
}

/* 콜백 중요 표시 */
.callback-row > td { background:#fff8cc !important; }
.callback-row > td:first-child { box-shadow:inset 4px 0 0 #e8b400; }
.callback-row:hover > td { background:#fff3a8 !important; }
.callback-badge { display:inline-block; padding:4px 8px; border-radius:999px; background:#ffe26a; color:#6d5200; font-size:11px; font-weight:900; border:1px solid #e5c54b; vertical-align:middle; }
.callback-time { color:#8a6500 !important; font-weight:800; }
.callback-field { background:#fffbea !important; border-color:#ead36a !important; font-weight:800; }
.callback-form-box { border:1px solid #eed878; background:#fffbea; border-radius:12px; padding:14px; }
