*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Arial,"Noto Sans KR",sans-serif;background:#f3f5f8;color:#14171f}
.hidden{display:none!important}button,input,select,textarea{font:inherit}
.login-page{min-height:100vh;display:grid;place-items:center;padding:20px}
.login-card{width:min(430px,100%);background:#fff;border:1px solid #e3e7ee;border-radius:18px;padding:30px;box-shadow:0 18px 60px rgba(30,38,55,.08)}
.login-logo{font-size:22px;font-weight:900}.login-card h1{margin:24px 0 6px}.login-card p{margin:0 0 22px;color:#78808c}
.login-card label,.modal label,.block-label,.edit-grid label{display:block;margin:14px 0 7px;font-size:13px;font-weight:800}
.login-card input,.field,.modal input,.modal select,.distribution-actions select,.tools select,.search-box input{width:100%;border:1px solid #ccd2dc;background:#fff;border-radius:10px;padding:11px 12px;outline:none}
.login-card input:focus,.field:focus,.modal input:focus,.search-box input:focus{border-color:#1f2937;box-shadow:0 0 0 3px rgba(31,41,55,.08)}
.btn{border:1px solid #cfd5df;background:#fff;border-radius:9px;padding:10px 13px;cursor:pointer;font-weight:700}
.btn.primary{background:#151b27;border-color:#151b27;color:#fff}.btn.danger{background:#b42318;border-color:#b42318;color:#fff}
.btn.good{background:#087443;border-color:#087443;color:#fff}.btn.ghost{background:transparent}.btn.full{width:100%;margin-top:12px}
.app{display:grid;grid-template-columns:215px minmax(0,1fr);min-height:100vh}
.sidebar{background:#111827;color:#fff;padding:22px 14px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.side-brand{padding:4px 8px 24px}.side-brand b{font-size:20px;display:block}.side-brand span{font-size:12px;color:#aeb7c6}
.sidebar nav{display:grid;gap:7px}.nav-btn{border:0;background:transparent;color:#d7ddea;text-align:left;border-radius:9px;padding:12px 13px;cursor:pointer;font-weight:800}
.nav-btn.active,.nav-btn:hover{background:#202a3a;color:#fff}.side-bottom{margin-top:auto}.who{font-size:11px;color:#9ea8b7;word-break:break-all;margin:0 6px 9px}
.sidebar .btn{color:#dce2ec;border-color:#374151}.main{padding:24px;min-width:0}
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.page-head h1{margin:0;font-size:26px}.page-head p{margin:5px 0 0;color:#747d8b;font-size:13px}
.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:12px}.stat-card{background:#fff;border:1px solid #e1e6ed;border-radius:12px;padding:14px 16px;text-align:left;cursor:pointer}
.stat-card span{display:block;color:#707987;font-size:12px}.stat-card b{display:block;font-size:25px;margin-top:5px}.stat-card.active{border-color:#253146;box-shadow:0 0 0 1px #253146}.stat-card.warn b{color:#b45309}
.panel{background:#fff;border:1px solid #e1e6ed;border-radius:14px}
.tools{display:grid;grid-template-columns:minmax(320px,1fr) 170px 170px 80px;gap:9px;padding:12px;margin-bottom:12px;align-items:end}
.search-box span{display:block;font-size:12px;font-weight:800;margin:0 0 6px 3px}.search-box input{font-size:16px;font-weight:700}
.distribution-bar{background:#fff8e8;border:1px solid #f1d58f;border-radius:12px;padding:12px 14px;margin-bottom:12px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.distribution-bar b{margin-right:8px}.distribution-bar span{color:#806b37;font-size:13px}.distribution-actions{display:flex;gap:8px}.distribution-actions select{min-width:240px}
.table-panel{overflow:hidden}.table-head{padding:14px 16px;border-bottom:1px solid #edf0f4}.table-head b{font-size:16px}.table-head span{margin-left:8px;color:#7a8390;font-size:12px}
.table-wrap{overflow:auto;max-height:calc(100vh - 315px)}table{width:100%;border-collapse:separate;border-spacing:0;min-width:1670px}
th,td{padding:11px 12px;border-bottom:1px solid #edf0f4;text-align:left;font-size:13px;vertical-align:middle}
th{position:sticky;top:0;background:#f8fafc;z-index:2;color:#596272;font-size:12px;white-space:nowrap}tbody tr:hover td{background:#fbfcfd}
.check-col{width:42px;text-align:center}.name-cell{font-weight:900;font-size:14px;white-space:nowrap}.phone-cell,.rrn-cell{font-weight:800;white-space:nowrap}.rrn-cell{letter-spacing:.3px}
.address-cell{max-width:250px;min-width:220px}.memo-cell{max-width:260px;min-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pill{display:inline-block;padding:5px 8px;border-radius:999px;background:#eef1f5;font-size:12px;font-weight:800;white-space:nowrap}.assign-pill{background:#eaf3ff;color:#245a9a}.unassigned{background:#fff1dd;color:#9a5a00}
.row-actions{display:flex;gap:6px;white-space:nowrap}.row-actions .btn{padding:7px 9px;font-size:12px}
.empty{padding:45px;text-align:center;color:#7a8390}.msg{color:#b42318;font-size:12px;margin-top:10px;white-space:pre-wrap}.app-msg{margin-left:2px}
dialog{border:0;border-radius:16px;padding:0;box-shadow:0 28px 90px rgba(0,0,0,.28);width:min(760px,calc(100% - 24px))}
dialog::backdrop{background:rgba(15,23,42,.55)}.modal{padding:22px}.small-modal{max-width:470px;margin:auto}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #edf0f4;padding-bottom:14px;margin-bottom:14px}
.modal-head h2{margin:0}.modal-head p{margin:5px 0 0}.icon-btn{border:1px solid #d8dde5;background:#fff;border-radius:8px;padding:7px 10px;cursor:pointer}.muted{color:#747d8b}
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.info-grid>div{background:#f7f9fb;border-radius:10px;padding:11px 12px;min-width:0}.info-grid .full{grid-column:1/-1}
.info-grid span{display:block;color:#747d8b;font-size:11px;margin-bottom:5px}.info-grid b{font-size:13px;word-break:break-word}.rrn-text{font-size:16px!important;letter-spacing:.5px}
.edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.memo{min-height:110px;resize:vertical}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.modal-actions.left{justify-content:flex-start}
.status-pill{display:inline-block;padding:6px 9px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap;border:1px solid transparent}
.st-new{background:#eef2f7;color:#4b5563}.st-uncontacted{background:#f3f4f6;color:#374151}.st-contacted{background:#e8f7ee;color:#137333}.st-recall{background:#fff7dc;color:#8a5a00}
.st-absent{background:#ffe8e8;color:#b42318;border-color:#ffc9c9}.st-consult{background:#e9f2ff;color:#175cd3}.st-consent{background:#eee9ff;color:#6941c6}.st-checked{background:#e8f4ff;color:#026aa2}
.st-contracting{background:#fff1d6;color:#a15c00}.st-contracted{background:#dff7e8;color:#087443;border-color:#b8e9c9}.st-rejected{background:#ffdede;color:#b42318;border-color:#ffbcbc}.st-closed{background:#eceff3;color:#596273}
.call-pill{display:inline-block;padding:5px 8px;border-radius:8px;font-size:12px;font-weight:900;white-space:nowrap}.call-no{background:#f1f3f5;color:#5f6670}.call-yes{background:#e6f6ec;color:#137333}.call-absent{background:#ffe5e5;color:#b42318}
.row-status-select{min-width:125px;border:1px solid #d6dbe3;border-radius:8px;padding:7px 8px;background:#fff;font-size:12px;font-weight:800}
.employee-panel{padding:0;overflow:hidden}.employee-head{padding:18px 18px 14px;border-bottom:1px solid #edf0f4}.employee-head h2{margin:0;font-size:20px}.employee-head p{margin:5px 0 0;color:#747d8b;font-size:13px}
.employee-table-wrap{overflow:auto}.employee-table{min-width:1250px}.employee-table td,.employee-table th{text-align:center}.employee-table td:first-child,.employee-table th:first-child{text-align:left}
.emp-name{font-weight:900}.emp-email{font-size:12px;color:#697382}.count-bad{color:#b42318;font-weight:900}.count-good{color:#087443;font-weight:900}
.account-active{display:inline-block;padding:5px 8px;border-radius:999px;background:#e4f7eb;color:#087443;font-size:12px;font-weight:900}.account-blocked{display:inline-block;padding:5px 8px;border-radius:999px;background:#ffe5e5;color:#b42318;font-size:12px;font-weight:900}
@media(max-width:1050px){.app{grid-template-columns:1fr}.sidebar{height:auto;position:static;display:block}.sidebar nav{display:flex;flex-wrap:wrap}.side-bottom{margin-top:12px}.main{padding:12px}.stats{grid-template-columns:repeat(3,1fr)}.tools{grid-template-columns:1fr 1fr}.search-box{grid-column:1/-1}.distribution-bar{align-items:flex-start;flex-direction:column}}

/* v9 - 상담메모 목록 직접 입력 */
.memo-cell{min-width:260px;max-width:320px;white-space:normal!important;overflow:visible!important}
.inline-memo-wrap{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:7px;align-items:stretch}
.inline-memo{
  width:100%;
  min-width:190px;
  min-height:66px;
  resize:vertical;
  border:1px solid #cfd5df;
  border-radius:9px;
  padding:9px 10px;
  background:#fff;
  color:#14171f;
  outline:none;
  line-height:1.4;
}
.inline-memo:focus{border-color:#1f2937;box-shadow:0 0 0 3px rgba(31,41,55,.08)}
.memo-save-btn{align-self:stretch;white-space:nowrap;padding:8px 10px}
.memo-save-btn.saved{background:#087443;border-color:#087443;color:#fff}
textarea:disabled,.inline-memo:disabled{opacity:1;background:#f5f5f5;color:#14171f}

.pending-badge{display:inline-block;padding:5px 8px;border-radius:999px;background:#fff4d6;color:#936200;font-size:12px;font-weight:900}
.blocked-badge{display:inline-block;padding:5px 8px;border-radius:999px;background:#ffe5e5;color:#b42318;font-size:12px;font-weight:900}
.active-badge{display:inline-block;padding:5px 8px;border-radius:999px;background:#e4f7eb;color:#087443;font-size:12px;font-weight:900}
.role-leader{display:inline-block;padding:5px 8px;border-radius:999px;background:#e8efff;color:#3448a1;font-size:12px;font-weight:900}
.role-employee{display:inline-block;padding:5px 8px;border-radius:999px;background:#f0f2f5;color:#4b5563;font-size:12px;font-weight:900}
.emp-actions{display:flex;flex-wrap:wrap;gap:5px;justify-content:center}
.emp-actions .btn{padding:7px 8px;font-size:11px}
.team-select{min-width:145px;border:1px solid #d6dbe3;border-radius:8px;padding:7px 8px;background:#fff;font-size:12px}

/* v11 - 가입 승인 알림 */
.employee-nav{display:flex!important;align-items:center;justify-content:space-between;gap:8px}
.pending-nav-badge{
  min-width:22px;height:22px;padding:0 6px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:#d92d20;color:#fff;font-size:11px;font-weight:900;
}
.pending-approval-banner{
  margin-bottom:12px;padding:13px 15px;border:1px solid #f1b4b0;
  background:#fff1f0;border-radius:12px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.pending-approval-banner b{font-size:15px;color:#9f1d15;margin-right:8px}
.pending-approval-banner span{font-size:13px;color:#7a3833}

/* v12 - 팀장용 DB 구분
   메인관리자 화면에는 영향 없음.
   팀장 화면에서만 팀원에게 재배포한 건을 다른 배경으로 표시 */
.leader-delegated-row td{
  background:#f1f6ff !important;
}
.leader-delegated-row:hover td{
  background:#e8f1ff !important;
}
.leader-own-row td{
  background:#ffffff;
}
.delegated-pill{
  background:#dbe9ff;
  color:#2456a6;
}
.leader-row-mark,
.leader-own-mark{
  display:inline-block;
  margin-left:6px;
  padding:4px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
}
.leader-row-mark{
  background:#315fa8;
  color:#fff;
}
.leader-own-mark{
  background:#edf7ef;
  color:#087443;
}


/* ===========================
   v15 명확한 UI / 상태 / 메신저
   =========================== */
.nav-btn{
  transition:background .12s ease, box-shadow .12s ease, transform .06s ease;
}
.nav-btn.active{
  background:#ffffff!important;
  color:#111827!important;
  box-shadow:inset 5px 0 0 #2563eb, 0 3px 14px rgba(0,0,0,.25)!important;
  font-weight:900!important;
}
.nav-btn:active,.btn:active,.stat-card:active,.chat-room:active{
  transform:translateY(1px);
}
.nav-count{
  min-width:22px;height:22px;padding:0 6px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:#d92d20;color:#fff;font-size:11px;font-weight:900;
  float:right;
}

.stats{grid-template-columns:repeat(5,1fr)}
.stat-card.active{
  background:#111827!important;
  color:#fff!important;
  border-color:#111827!important;
  box-shadow:0 4px 14px rgba(17,24,39,.22)!important;
}
.stat-card.active span,.stat-card.active b{color:#fff!important}

.contract-summary{
  display:flex;align-items:center;justify-content:space-between;
  background:#ecfdf3;border:1px solid #abefc6;border-radius:12px;
  padding:10px 14px;margin-bottom:12px;
}
.contract-summary span{font-size:13px;font-weight:800;color:#08633f}
.contract-summary b{font-size:20px;color:#087443}

.tools{
  grid-template-columns:minmax(280px,1fr) 180px 160px 160px 80px;
}
#employeeFilter{
  border:2px solid #7f8fa6;
  font-weight:900;
}

.distribution-actions{flex-wrap:wrap}
.recall-btn{
  background:#fff!important;
  color:#b42318!important;
  border:1px solid #e98e87!important;
  font-weight:900!important;
}
.recall-btn:hover{
  background:#b42318!important;
  color:#fff!important;
}
.rrn-list-hidden{
  display:inline-block;
  padding:4px 6px;
  background:#eef1f5;
  color:#667085;
  border-radius:6px;
  font-size:11px;
  white-space:nowrap;
}
.contract-money{color:#087443;font-size:14px}

/* 상태별 행 전체 색 */
.row-new td{background:#fff!important}
.row-nocall td{background:#fff8d9!important}
.row-contact td{background:#edf9f1!important}
.row-recall td{background:#fff2c7!important}
.row-absent td{background:#ffe8e8!important}
.row-consult td{background:#edf4ff!important}
.row-contracting td{background:#fff0db!important}
.row-contracted td{background:#dcfce7!important}
.row-rejected td{background:#fee2e2!important}
.row-closed td{background:#eceff3!important}
tbody tr:hover td{filter:brightness(.985)}

.confirm-modal{max-width:430px;margin:auto}
.confirm-modal h2{margin:0 0 10px}
.confirm-modal p{margin:0;color:#596273;line-height:1.55}

/* 메신저 */
.messenger-panel{
  height:calc(100vh - 110px);
  min-height:560px;
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  background:#fff;
  border:1px solid #e1e6ed;
  border-radius:14px;
  overflow:hidden;
}
.chat-side{
  border-right:1px solid #e7ebf0;
  background:#f8fafc;
  overflow:auto;
}
.chat-side-title{
  position:sticky;top:0;z-index:2;
  padding:15px 16px;
  font-weight:900;
  background:#f8fafc;
  border-bottom:1px solid #e7ebf0;
}
.chat-rooms{display:grid;padding:8px}
.chat-room{
  width:100%;
  border:0;
  background:transparent;
  border-radius:10px;
  padding:11px 10px;
  cursor:pointer;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.chat-room:hover{background:#eef3f9}
.chat-room.active{
  background:#111827;
  color:#fff;
}
.chat-room span{min-width:0}
.chat-room b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-room small{display:block;margin-top:3px;color:#7a8390}
.chat-room.active small{color:#cbd5e1}
.chat-room em{
  min-width:22px;height:22px;padding:0 6px;border-radius:999px;
  background:#d92d20;color:#fff;font-style:normal;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:900;
}
.chat-main{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;min-width:0}
.chat-head{
  padding:14px 16px;
  border-bottom:1px solid #e7ebf0;
}
.chat-head b{display:block;font-size:16px}
.chat-head span{display:block;color:#7a8390;font-size:12px;margin-top:3px}
.chat-messages{
  overflow:auto;
  padding:18px;
  background:#f5f7fa;
}
.chat-empty{color:#8a93a1;text-align:center;padding:40px 15px}
.chat-bubble-wrap{max-width:72%;margin-bottom:14px}
.chat-bubble-wrap.mine{margin-left:auto;text-align:right}
.chat-name{font-size:11px;color:#7a8390;margin-bottom:4px}
.chat-bubble{
  display:inline-block;
  background:#fff;
  border:1px solid #e0e5ec;
  border-radius:14px;
  padding:10px 12px;
  text-align:left;
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.45;
}
.chat-bubble-wrap.mine .chat-bubble{
  background:#111827;
  color:#fff;
  border-color:#111827;
}
.chat-time{font-size:10px;color:#9aa2ae;margin-top:4px}
.chat-compose{
  display:grid;
  grid-template-columns:minmax(0,1fr) 90px;
  gap:8px;
  padding:12px;
  border-top:1px solid #e7ebf0;
}
.chat-compose textarea{
  width:100%;
  min-height:64px;
  max-height:140px;
  resize:vertical;
  border:1px solid #ccd2dc;
  border-radius:10px;
  padding:10px;
  outline:none;
}
.chat-compose textarea:focus{
  border-color:#111827;
  box-shadow:0 0 0 3px rgba(17,24,39,.08);
}

@media(max-width:1100px){
  .tools{grid-template-columns:1fr 1fr}
  .search-box{grid-column:1/-1}
  .messenger-panel{grid-template-columns:220px minmax(0,1fr)}
}
@media(max-width:760px){
  .stats{grid-template-columns:repeat(2,1fr)}
  .messenger-panel{grid-template-columns:1fr;height:auto;min-height:640px}
  .chat-side{max-height:220px;border-right:0;border-bottom:1px solid #e7ebf0}
  .chat-main{min-height:520px}
}


/* v17 컴퓨터 푸시 알림 */
.notify-btn{
  margin-bottom:6px;
  background:#fff;
  color:#172033;
  border:1px solid #cbd5e1;
  font-weight:900;
}
.notify-btn.on{
  background:#dcfce7!important;
  color:#087443!important;
  border-color:#86efac!important;
}
.notify-state{
  min-height:28px;
  margin:0 2px 8px;
  color:#9ca3af;
  font-size:10px;
  line-height:1.35;
}


/* v18 설치형 앱 */
.install-app-btn{
  margin-bottom:6px;
  background:#eef4ff;
  color:#194185;
  border:1px solid #b2ccff;
  font-weight:900;
}
.install-app-btn:hover{
  background:#dbe9ff;
}
.install-app-btn.installed{
  background:#dcfce7!important;
  color:#087443!important;
  border-color:#86efac!important;
}
.install-guide{
  color:#344054;
  line-height:1.65;
}
.install-guide p{
  margin:7px 0;
}
@media(display-mode:standalone){
  body{
    overscroll-behavior:none;
  }
}
