/* =========================================================
   NaumCare 영업지원 웹 - 공통 스타일
   (모바일 앱 naum-sales의 로그인/홈 디자인 토큰을 그대로 사용)
   ========================================================= */
:root{
  --navy:#172554;        /* 앱 홈 히어로 */
  --navy-ink:#102a56;    /* 앱 로그인 브랜드 글자 */
  --pri:#2563eb;         /* 앱 확인 버튼 */
  --pri-strong:#1f4f99;  /* 앱 로그인 버튼 */
  --pri-soft:#eff6ff;
  --bg:#eef2f7;
  --card:#ffffff;
  --text:#0f172a;
  --text-2:#334155;
  --mut:#64748b;
  --mut-2:#94a3b8;
  --br:#e2e8f0;
  --br-input:#d8dee9;
  --input-bg:#fbfdff;
  --soft:#f8fafc;
  --green:#16a34a;
  --green-soft:#ecfdf5;
  --red:#ef4444;
  --red-soft:#fef2f2;
  --amber:#b45309;
  --amber-soft:#fff7ed;
  --r-xl:26px;
  --r-lg:24px;
  --r-md:16px;
  --r-sm:12px;
  --shadow:0 8px 24px rgba(15,23,42,.07);
  --shadow-lg:0 14px 32px rgba(15,23,42,.12);
}

*{box-sizing:border-box}
html,body{margin:0}
body{
  font-family:"Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "맑은 고딕", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit; text-decoration:none}
button{font-family:inherit}

/* ---------- 히어로(상단 남색 영역) ---------- */
.hero{
  position:relative;
  overflow:hidden;
  background:var(--navy);
  color:#fff;
  border-bottom-left-radius:34px;
  border-bottom-right-radius:34px;
  padding:22px 0 84px;
}
.hero::before,
.hero::after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}
.hero::before{
  width:300px; height:300px;
  top:-110px; right:-70px;
  background:rgba(59,130,246,.32);
}
.hero::after{
  width:210px; height:210px;
  bottom:-80px; left:-50px;
  background:rgba(14,165,233,.20);
}
.hero-inner{
  position:relative;
  z-index:1;
  margin:0 auto;
  padding:0 24px;
}
.hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.hero-hello{font-size:13px; color:rgba(255,255,255,.72)}
.hero-user{font-size:20px; font-weight:900; letter-spacing:-.2px}
.hero-actions{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.hero-actions form{margin:0}
.hero-title{
  margin-top:26px;
  font-size:30px;
  font-weight:900;
  letter-spacing:-.4px;
}
.hero-sub{
  margin-top:8px;
  font-size:14px;
  color:rgba(255,255,255,.76);
}

/* ---------- 본문 ---------- */
.page{
  position:relative;
  z-index:2;
  margin:-56px auto 48px;
  padding:0 24px;
}
.w-sm{max-width:980px}
.w-lg{max-width:1560px}

.card{
  background:var(--card);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow);
  padding:22px;
}
.card + .card{margin-top:16px}
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:4px 10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.card-title{font-size:17px; font-weight:900; color:var(--text)}
.card-hint{font-size:12px; font-weight:700; color:var(--mut)}

.muted{color:var(--mut); font-size:12px; line-height:1.5}
.nowrap{white-space:nowrap}
.preline{white-space:pre-wrap; line-height:1.55}

/* ---------- 버튼 ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:44px;
  padding:0 16px;
  border:1px solid transparent;
  border-radius:14px;
  background:var(--pri);
  color:#fff;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
  transition:opacity .15s, background-color .15s, border-color .15s;
}
.btn:hover{opacity:.9}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn-strong{background:var(--pri-strong)}
.btn-success{background:var(--green)}
.btn-danger{background:var(--red)}
.btn-light{background:#fff; color:var(--text-2); border-color:var(--br-input)}
.btn-light:hover{background:var(--soft); opacity:1}
.btn-sm{height:34px; padding:0 12px; border-radius:10px; font-size:13px}

/* 히어로 안의 반투명 버튼 (앱 로그아웃 버튼과 동일) */
.btn-glass{
  height:38px;
  padding:0 14px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.22);
  color:#fff;
  font-size:13px;
}
.btn-glass:hover{background:rgba(255,255,255,.24); opacity:1}
.btn-white{
  height:38px;
  padding:0 16px;
  border-radius:999px;
  background:#fff;
  color:var(--navy);
  font-size:13px;
  font-weight:900;
}

/* ---------- 입력 ---------- */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="email"],
select,
textarea{
  height:44px;
  padding:0 14px;
  border:1px solid var(--br-input);
  border-radius:var(--r-sm);
  background:var(--input-bg);
  color:var(--text);
  font-family:inherit;
  font-size:14px;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
}
textarea{height:auto; padding:12px 14px; line-height:1.55}
input::placeholder, textarea::placeholder{color:var(--mut-2)}
input:focus, select:focus, textarea:focus{
  border-color:var(--pri);
  box-shadow:0 0 0 3px rgba(37,99,235,.14);
  background:#fff;
}
input[readonly]{background:var(--soft); color:var(--text-2)}
input[readonly]:focus{box-shadow:none; border-color:var(--br-input)}

.label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:800;
  color:#374151;
}

/* ---------- 표 ---------- */
.table-wrap{
  overflow-x:auto;
  border:1px solid var(--br);
  border-radius:var(--r-md);
}
table.tbl{width:100%; border-collapse:collapse; table-layout:fixed}
.tbl th{
  background:var(--soft);
  color:var(--mut);
  font-size:12px;
  font-weight:800;
  text-align:left;
  padding:12px 12px;
  border-bottom:1px solid var(--br);
  white-space:nowrap;
}
.tbl td{
  padding:14px 12px;
  border-bottom:1px solid #edf1f6;
  vertical-align:top;
  text-align:left;
  word-break:break-word;
  color:var(--text-2);
}
.tbl tbody tr:last-child td{border-bottom:none}
.tbl td.muted{font-size:12px}
.tbl tbody tr.empty-row td{text-align:center; padding:36px 12px; color:var(--mut)}

/* ---------- 알약(배지) ---------- */
.pill{
  display:inline-flex;
  align-items:center;
  height:24px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
  background:var(--pri-soft);
  color:var(--pri);
}
.pill-green{background:var(--green-soft); color:var(--green)}
.pill-amber{background:var(--amber-soft); color:var(--amber)}
.pill-gray{background:#f1f5f9; color:var(--mut)}

/* ---------- 페이지네이션 ---------- */
.pager{display:flex; gap:6px; align-items:center; justify-content:center; margin-top:18px; flex-wrap:wrap}
.pagebtn{
  min-width:38px;
  height:38px;
  padding:0 10px;
  border:1px solid var(--br);
  border-radius:12px;
  background:#fff;
  color:var(--text-2);
  font-weight:800;
  cursor:pointer;
}
.pagebtn:hover{border-color:var(--pri); color:var(--pri)}
.pagebtn.active{background:var(--pri); border-color:var(--pri); color:#fff}
.pagebtn[disabled]{opacity:.4; cursor:not-allowed; background:var(--soft); color:var(--mut-2); border-color:var(--br)}

/* ---------- 모달 공통 ---------- */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.58);
  display:none;
  align-items:center;
  justify-content:center;
  padding:22px;
  z-index:1000;
}
.sheet{
  width:100%;
  background:#fff;
  border-radius:var(--r-xl);
  box-shadow:0 24px 60px rgba(15,23,42,.3);
  padding:22px;
}
.sheet-head{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:16px;
}
.sheet-icon{
  width:48px; height:48px;
  border-radius:16px;
  background:var(--pri-soft);
  display:flex; align-items:center; justify-content:center;
  font-size:22px;
  flex:0 0 auto;
}
.sheet-label{font-size:12px; font-weight:800; color:var(--pri)}
.sheet-title{font-size:19px; font-weight:900; color:var(--text)}
.sheet-close{margin-left:auto}

@media (max-width:720px){
  .hero{padding-bottom:76px}
  .hero-inner, .page{padding:0 16px}
  .hero-title{font-size:24px; margin-top:18px}
  .card{padding:18px; border-radius:20px}
}

/* ---------- 첨부파일 (assets/attach.js) ---------- */
/* 끌어다 놓기 영역 */
.att-drop{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  padding:24px 16px; border:1.5px dashed #cbd5e1; border-radius:var(--r-md);
  background:var(--soft); cursor:pointer; text-align:center; transition:border-color .15s, background-color .15s;
}
.att-drop:hover, .att-drop.over{border-color:var(--pri); background:var(--pri-soft)}
.att-drop-ico{width:48px; height:48px; border-radius:14px; background:#fff; color:var(--pri); display:flex; align-items:center; justify-content:center; box-shadow:0 1px 3px rgba(15,23,42,.08)}
.att-drop-t{font-size:14px; font-weight:800; color:var(--text)}
.att-drop-t u{color:var(--pri); text-decoration:none}
.att-drop-s{font-size:12px; color:var(--mut)}
.att-errs{margin-top:8px; padding:10px 12px; border-radius:10px; background:var(--red-soft); font-size:12px; font-weight:700; color:#b91c1c; line-height:1.6}
.att-errs:empty{display:none}

/* 목록: 한 줄 = 파일 하나, 칸 고정 → 버튼이 세로로 정렬됨 */
.att-list{border:1px solid var(--br); border-radius:14px; background:#fff; overflow:hidden}
.att-list:empty{display:none}
.att-picker-gap, .att-pending:not(:empty){margin-top:10px}
.att-row{
  display:grid;
  grid-template-columns:40px minmax(0,1fr) 72px 132px 168px;
  align-items:center; gap:14px;
  padding:10px 14px; border-bottom:1px solid #edf1f6; min-height:62px;
}
.att-row:last-child{border-bottom:none}
.att-row:hover{background:#fafbfd}
.att-row.pending{background:#fcfdff}
.att-vis{width:40px; height:40px; display:flex; align-items:center; justify-content:center}
.att-svg{display:block}
.att-thumb{width:40px; height:40px; object-fit:cover; border-radius:8px; border:1px solid var(--br); display:block}
.att-name-cell{display:flex; flex-direction:column; min-width:0}
.att-name{font-size:14px; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block}
a.att-name:hover{color:var(--pri); text-decoration:underline}
.att-sub{display:none; font-size:11px; color:var(--mut); margin-top:2px}
.att-size{font-size:12px; color:var(--mut); text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap}
.att-when{font-size:12px; color:var(--mut); white-space:nowrap; font-variant-numeric:tabular-nums}
.att-tag{display:inline-flex; align-items:center; height:22px; padding:0 8px; border-radius:999px; background:var(--pri-soft); color:var(--pri); font-size:11px; font-weight:800}
.att-acts{display:flex; justify-content:flex-end; gap:6px}
.att-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:80px; height:32px; border-radius:8px; border:1px solid var(--br-input);
  background:#fff; color:var(--text-2); font-size:12px; font-weight:800;
  cursor:pointer; font-family:inherit; white-space:nowrap; transition:all .15s;
}
.att-btn:hover{border-color:var(--pri); color:var(--pri)}
.att-btn.ghost{visibility:hidden}
.att-btn.danger{border-color:#fecaca; color:#dc2626}
.att-btn.danger:hover{border-color:var(--red); background:var(--red); color:#fff}
/* 삭제 칸이 없는 보기 전용 목록은 버튼 칸을 줄임 */
.att-list:not(.with-del) .att-row{grid-template-columns:40px minmax(0,1fr) 72px 132px 80px}

.att-empty{font-size:13px; color:var(--mut); padding:6px 0}
.att-progress{height:6px; border-radius:999px; background:var(--soft); overflow:hidden; margin-top:10px; display:none}
.att-progress.on{display:block}
.att-progress i{display:block; height:100%; width:0; background:var(--pri); transition:width .2s}

@media (max-width:720px){
  .att-row, .att-list:not(.with-del) .att-row{grid-template-columns:40px minmax(0,1fr) auto; gap:10px}
  .att-size, .att-when{display:none}
  .att-sub{display:block}
  .att-btn{width:auto; padding:0 10px}
  .att-btn.ghost{display:none}
}
