@charset "utf-8";
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
:root{
  --bg:#ffffff;
  --bg2:#f5f1eb;
  --beige:#f5f1eb;
  --beige-deep:#ece5d6;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e5d9c2;
  --shadow:0 14px 40px rgba(15,23,42,.10);
  --primary:#005f57;
  --primary2:#007a70;
  --primary-dark:#004a44;
  --sidebar-w:240px;
  --danger:#ef4444;
  --ok:#16a34a;
  --font:"Pretendard",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0; padding:0; font-family:var(--font); color:var(--ink); background:var(--bg2); overflow-x:hidden; width:100%; max-width:100vw;}
a{color:inherit; text-decoration:none}
.req{color:var(--danger); font-weight:500; margin-left:4px}
.t-right{text-align:right}

/* ===== Sidebar ===== */
.sidebar{
  position:fixed;
  left:0; top:0; bottom:0;
  width:var(--sidebar-w);
  background:var(--primary);
  display:flex;
  flex-direction:column;
  z-index:50;
  box-shadow:2px 0 12px rgba(0,0,0,.04);
}
.sidebar__brand{
  color:#fff;
  font-weight:800;
  letter-spacing:4px;
  font-size:32px;
  text-align:center;
  padding:28px 16px 24px;
  border-bottom:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  user-select:none;
}
.sidebar__nav{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:16px 12px;
  overflow-y:auto;
}
.sidebar__nav .nav__item{
  display:block;
  color:rgba(255,255,255,.78);
  font-weight:500;
  font-size:14px;
  padding:12px 16px;
  border-radius:8px;
  position:relative;
  transition:background .15s, color .15s;
}
.sidebar__nav .nav__item:hover{
  color:#fff;
  background:rgba(255,255,255,.06);
}
.sidebar__nav .nav__item.is-active{
  color:var(--primary);
  background:var(--beige);
  font-weight:600;
}
.sidebar__nav .nav__sectionLabel{
  padding:4px 16px 2px;
  color:rgba(255,255,255,.48);
  font-size:11px;
  font-weight:600;
  line-height:1.3;
}
.sidebar__nav .nav__divider{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:8px 4px;
}
.sidebar__user{
  border-top:1px solid rgba(255,255,255,.08);
  padding:14px 12px;
}
.sidebar__user .user__btn{
  width:100%;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:#fff;
  font-weight:600;
  cursor:pointer;
}
.sidebar__user .user__btn:hover{background:rgba(255,255,255,.10)}
.sidebar__user .userIcon{display:block; flex-shrink:0}
.sidebar__user .userName-text{flex:1; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sidebar__user .user__chev{flex-shrink:0}

/* user dropdown (사이드바 하단에서 위로 팝업) */
.user{position:relative}
.user__menu{
  position:absolute;
  left:8px; right:8px;
  bottom:calc(100% + 8px);
  padding:6px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:var(--shadow);
  display:none;
}
.user.is-open .user__menu{display:block}
.user__menuItem{
  width:100%;
  border:0;
  background:#fff;
  padding:10px 12px;
  border-radius:8px;
  font-weight:500;
  font-size:14px;
  cursor:pointer;
  text-align:left;
  color:var(--ink);
}
.user__menuItem:hover{background:var(--beige)}

/* ===== Mobile Top Bar (only on mobile) ===== */
.mobileBar{
  display:none;
  position:sticky;
  top:0;
  z-index:48;
  background:var(--primary);
  padding:10px 14px;
  align-items:center;
  justify-content:space-between;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.mobileBar__brand{
  color:#fff;
  font-weight:800;
  letter-spacing:3px;
  font-size:22px;
}
.mobileBar__spacer{width:36px}

/* ===== Layout ===== */
.appBody{
  margin-left:var(--sidebar-w);
  min-height:100vh;
  background:var(--bg2);
}
.wrap{max-width:1500px; margin:24px auto 60px; padding:0 24px;}

/* ===== Stat card ===== */
.statCard{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px 18px 10px;
  box-shadow:0 8px 20px rgba(15,23,42,.06);
}
.statCard__title{font-weight:bold; margin-bottom:12px;}
.statGrid{
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:0;
  border-top:1px solid var(--line);
}
.statGrid--clickable{
  grid-template-columns:repeat(5, 1fr);
}
.stat{
  padding:14px 10px;
  text-align:center;
  border-right:1px solid var(--line);
}
.stat:last-child{border-right:0}
.stat--filter{
  cursor:pointer;
  transition:color 0.15s;
}
.stat--filter:hover .stat__num,
.stat--filter:hover .stat__label{
  color:var(--primary);
}
.stat__num{
  font-size:26px;
  font-weight:500;
  margin-bottom:6px;
}
.stat__label{font-size:12px; color:var(--muted); font-weight:400}

/* ===== VIP Dashboard ===== */
.vipDashboard{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.vipDashHero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding:8px 2px 2px;
}
.vipDashHero__eyebrow{
  color:var(--primary);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}
.vipDashHero__title{
  margin:4px 0 6px;
  font-size:30px;
  line-height:1.15;
  letter-spacing:0;
}
.vipDashHero__copy{
  margin:0;
  color:var(--muted);
  font-size:14px;
}
.vipDashHero__meta{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.vipDashHero__meta strong{
  color:var(--ink);
  font-size:13px;
}
.vipDashTop{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}
.vipDashGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}
.vipDashPanel{
  background:#fff;
  border:1px solid #dfe5ea;
  border-radius:8px;
  min-height:196px;
  padding:18px;
  box-shadow:0 8px 20px rgba(15,23,42,.06);
}
.vipDashPanel--wide{min-height:210px}
.vipDashPanel__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding-bottom:14px;
  border-bottom:1px solid #e8edf1;
}
.vipDashPanel__title{
  font-size:20px;
  font-weight:800;
  line-height:1.2;
}
.vipDashPanel__title--blue{color:#0b84ff}
.vipDashPanel__title--green{color:#22c55e}
.vipDashPanel__title--orange{color:#ff7a00}
.vipDashPanel__sub{
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
}
.vipMiniBtn{
  border:0;
  border-radius:6px;
  background:#0b84ff;
  color:#fff;
  padding:7px 11px;
  font-weight:700;
  font-size:12px;
  cursor:pointer;
}
.vipMiniBtn:hover{background:#006fe0}
.vipUserStatus{
  display:grid;
  grid-template-columns:180px minmax(0, 1fr);
  align-items:center;
  gap:30px;
  min-height:132px;
  padding:18px 10px 0;
}
.vipRing{
  --ring-color:#1d9bf0;
  width:132px;
  height:132px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:conic-gradient(var(--ring-color) 0 86%, #6f3fc9 86% 90%, #12b981 90% 94%, #f59e0b 94% 97%, #e5e7eb 97% 100%);
  position:relative;
  margin:0 auto;
}
.vipRing::after{
  content:"";
  position:absolute;
  inset:12px;
  border-radius:50%;
  background:#fff;
  border:3px solid #e8f4ff;
}
.vipRing__inner{
  position:relative;
  z-index:1;
  display:grid;
  place-items:center;
  color:#111827;
}
.vipRing__inner strong{
  font-size:15px;
  line-height:1.2;
}
.vipRing__inner span{
  margin-top:3px;
  font-size:17px;
  font-weight:800;
}
.vipRing--pink{--ring-color:#ec1d62}
.vipMetricLine{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  align-items:center;
}
.vipMetricLine--service{
  width:100%;
}
.vipMetricLine__item{
  min-height:70px;
  display:grid;
  place-items:center;
  border-left:1px solid #e5e7eb;
}
.vipMetricLine__item span{
  color:#1f2937;
  font-size:14px;
  font-weight:600;
}
.vipMetricLine__item strong{
  color:#f2294e;
  font-size:30px;
  line-height:1;
}
.vipSplitSummary span,
.vipDashStrip span{
  color:#374151;
  font-size:13px;
  font-weight:700;
}
.vipServiceMix{
  display:grid;
  grid-template-columns:170px minmax(0, 1fr);
  align-items:center;
  gap:24px;
  padding-top:28px;
}
.vipServiceMix--top{
  min-height:132px;
  padding:18px 10px 0;
}
.vipSplitSummary__grid div{
  min-height:70px;
  display:grid;
  place-items:center;
  border-left:1px solid #e5e7eb;
}
.vipSplitSummary strong{
  color:#f2294e;
  font-size:29px;
  line-height:1;
}
.vipSplitSummary{
  padding-top:22px;
  display:grid;
  grid-template-columns:120px minmax(0, 1fr);
  align-items:center;
  gap:16px;
}
.vipSplitSummary__main{
  display:grid;
  place-items:center;
}
.vipSplitSummary__main strong{
  margin-top:8px;
  color:#111827;
  font-size:24px;
}
.vipSplitSummary__grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.vipDashStrip{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
.vipDashStrip div{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:54px;
  padding:12px 16px;
  border-radius:8px;
  background:#fff;
  border:1px solid #dfe5ea;
}
.vipDashStrip strong{
  color:var(--primary);
  font-size:20px;
}
.vipDashClick{
  cursor:pointer;
  border-radius:6px;
  padding:4px 8px;
  transition:background .15s, color .15s, transform .15s;
}
.vipDashClick:hover{
  background:#fff1f2;
  color:#be123c;
  transform:translateY(-1px);
}

/* ===== List header ===== */
.listHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:18px 0 10px;
}
.hTitle{font-size:18px; font-weight:500}
.hSub{color:var(--muted); font-weight:400; margin-top:2px ;text-align: center;}
.listHead__right{display:flex; gap:10px; align-items:center}
.adsToolbar__actions{
  flex-wrap:wrap;
  justify-content:flex-end;
  min-width:0;
}
.adsToolbar__actions .hSub{
  min-width:42px;
  text-align:right;
}
.search{
  width:260px;
  height:40px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  outline:none;
  font-weight:900;
}
.search:focus{box-shadow:0 0 0 3px rgba(11,42,74,.12); border-color:rgba(11,42,74,.5)}

/* ===== Table ===== */
.tableCard{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:0;
  box-shadow:none;
  overflow:hidden;
}
.tableWrap{overflow:auto}
.tbl{
  width:100%;
  border-collapse:collapse;
  min-width:1200px;
}
.tbl--users{min-width:1240px}
.tbl--users td{white-space:nowrap}
.slotTypeSummary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:12px;
  font-weight:700;
  color:#374151;
}
.slotTypeSummary span{
  display:inline-block;
  min-width:34px;
  padding:3px 6px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
.tbl th, .tbl td{
  padding:10px 8px;
  border-bottom:1px solid #e5e7eb;
  border-right:1px solid #f0f0f0;
  font-size:12px;
  vertical-align:middle;
  text-align:center;
}
.tbl th:last-child, .tbl td:last-child{border-right:none}
.tbl th{
  background:#f9fafb;
  color:#374151;
  font-weight:600;
  text-align:center;
  position:sticky;
  top:0;
  z-index:2;
  border-bottom:2px solid #d1d5db;
}
.tbl td{font-weight:400; color:#1f2937}
.tbl tbody tr:hover{background:#f8fafc}
.tbl tbody tr:nth-child(even){background:#fafbfc}
.tbl tbody tr:nth-child(even):hover{background:#f3f4f6}
.c-chk{width:40px; text-align:center}
.c-chk input[type="checkbox"]{width:16px; height:16px; cursor:pointer; accent-color:var(--primary)}
.tbl--webkr-kind{min-width:1300px}
.c-slot-kind{width:92px; min-width:92px; white-space:nowrap}
.slotKindBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:66px;
  padding:3px 7px;
  border:1px solid #d7dde5;
  background:#f6f7f9;
  color:#4b5563;
  font-size:11px;
  font-weight:600;
  line-height:1.25;
}
.slotKindBadge--rank{border-color:#d7dde5; background:#f6f7f9; color:#4b5563}
.slotKindBadge--work{border-color:#c7d2fe; background:#eef2ff; color:#3730a3}
.c-no{width:70px}
.c-id{width:120px}
.ads-account-col{
  width:96px;
  max-width:96px;
  min-width:96px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.c-st{width:120px}
.c-key{width:160px}
.c-rank{width:110px}
.c-name{min-width:200px; white-space:normal; word-break:keep-all; line-height:1.4}
.c-mid,.c-cmid{width:140px}
.c-date{width:120px}
.c-overlap{width:96px;text-align:center}
.c-act{width:90px; text-align:right}

/* Sortable header */
.sortable{cursor:pointer;user-select:none;transition:background .15s}
.sortable:hover{background:#e5e7eb}
.sort-icon{font-size:10px;color:#6b7280;margin-left:4px;transition:transform .2s}

/* Table row animation */
.tbl tbody{transition:opacity .15s ease-out}
.tbl tbody.sorting{opacity:0.4}
.tbl tbody tr{animation:fadeIn .25s ease-out}
@keyframes fadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}

.badge{
  display:inline-flex; align-items:center; gap:4px;
  padding:4px 10px;
  border-radius:20px;
  border:1px solid #22c55e;
  background:#fff;
  color:#22c55e;
  font-weight:500;
  font-size:11px;
  white-space:nowrap;
}
.dot{
  width:8px; height:8px; border-radius:50%;
  background:#22c55e;
}
/* 정상 - 초록색 */
.badge--ok{border-color:#22c55e; color:#22c55e; background:#fff}
.badge--ok .dot{background:#22c55e}
/* 대기 - 파랑색 */
.badge--pending{border-color:#3b82f6; color:#3b82f6; background:#fff}
.badge--pending .dot{background:#3b82f6}
/* 마감예정 - 빨강색 */
.badge--ending{border-color:rgb(255,104,104); color:rgb(255,104,104); background:#fff}
.badge--ending .dot{background:rgb(255,104,104)}
/* 마감 - 검은색 */
.badge--done{border-color:#374151; color:#374151; background:#fff}
.badge--done .dot{background:#374151}
.badge--error{border-color:#ef4444; color:#ef4444; background:#fff}
.badge--error .dot{background:#ef4444}
.badge--sstore{border-color:#22c55e; color:#22c55e; background:#fff}
.badge--sstore .dot{background:#22c55e}
/* 진행상태(자동 처리) - 처리중=하늘, 환불/취소 처리중=주황, 완료/종료=회색 */
.badge--processing{border-color:#38bdf8; color:#0284c7; background:#fff}
.badge--processing .dot{background:#38bdf8}
.badge--refunding{border-color:#f59e0b; color:#b45309; background:#fff}
.badge--refunding .dot{background:#f59e0b}
.badge--muted{border-color:#cbd5e1; color:#64748b; background:#fff}
.badge--muted .dot{background:#94a3b8}
/* 처리중/오류 슬롯의 데이터 셀은 상태를 진행여부 열에만 두고 나머지는 흐린 대시로 비운다 */
.cellMuted{color:#cbd5e1; font-weight:400}
/* 모바일: N웹사이트관리 표는 진행여부·키워드·순위·사이트명을 우선 노출하고 저가치 열을 감춘다 */
@media (max-width: 680px){
  #pageAds .tbl .c-slot-kind,
  #pageAds .tbl .ads-manager-col,
  #pageAds .tbl .ads-agency-col,
  #pageAds .tbl .c-date,
  #pageAds .tbl .c-overlap,
  #pageAds .tbl .c-mid,
  #pageAds .tbl .c-cmid{ display:none !important; }
  #pageAds .tbl{ font-size:12px; }
  #pageAds .tbl th, #pageAds .tbl td{ padding-left:7px; padding-right:7px; }
}

.statCard__meta{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  min-width:0;
}
.nproBalanceStatus{
  display:inline-flex;
  align-items:baseline;
  gap:6px;
  color:#64748b;
  font-size:12px;
  line-height:1.3;
  white-space:nowrap;
}
.nproBalanceStatus[hidden]{display:none !important}
.nproBalanceStatus__label{font-weight:500}
.nproBalanceStatus__value{
  color:#334155;
  font-size:13px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.nproBalanceStatus__freshness{
  color:#b45309;
  font-size:10px;
  font-weight:600;
}
.nproBalanceStatus__freshness[hidden]{display:none !important}

.statusStack{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.automationState{
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:2px 7px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:10px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}
.automationState--received,
.automationState--processing{
  color:#075985;
  background:#e0f2fe;
  border-color:#bae6fd;
}
.automationState--ready{
  color:#166534;
  background:#dcfce7;
  border-color:#bbf7d0;
}
.automationState--cancelling,
.automationState--refunding,
.automationState--refund_checking{
  color:#92400e;
  background:#fef3c7;
  border-color:#fde68a;
}
.automationState--checking,
.automationState--review,
.automationState--refund_review{
  color:#991b1b;
  background:#fee2e2;
  border-color:#fecaca;
}
.automationState--cancelled,
.automationState--refunded,
.automationState--expired{
  color:#475569;
  background:#f1f5f9;
  border-color:#cbd5e1;
}
.automationNotice{
  margin-bottom:14px;
  padding:10px 12px;
  border:1px solid #bae6fd;
  border-radius:8px;
  color:#0c4a6e;
  background:#f0f9ff;
  font-size:12px;
  line-height:1.5;
}
.automationNotice--locked{
  border-color:#fde68a;
  color:#78350f;
  background:#fffbeb;
}
.nproSlotRef{
  display:inline-flex;
  align-items:center;
  max-width:118px;
  min-height:18px;
  padding:2px 7px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  color:#475569;
  background:#f8fafc;
  font-size:10px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.webkrOptions{
  margin:4px 0 14px;
  padding-top:14px;
  border-top:1px solid #e2e8f0;
}
.webkrOptions[hidden]{display:none !important}
.webkrOptions__period{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:14px;
  color:#475569;
  font-size:12px;
  line-height:1.45;
}
.webkrPeriodBadge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 9px;
  border:1px solid #c7d2fe;
  border-radius:999px;
  color:#3730a3;
  background:#eef2ff;
  font-size:11px;
  font-weight:700;
  line-height:1.2;
}
.productLink{
  color:#2563eb;
  text-decoration:none;
  cursor:pointer;
}
.productLink:hover{text-decoration:underline; color:#1d4ed8}
.userLink{
  color:#059669;
  cursor:pointer;
  font-weight:500;
}
.userLink:hover{text-decoration:underline; color:#047857}

.rankLink{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:2px 4px;
  border:0;
  background:transparent;
  font:inherit;
  font-weight:500;
  color:var(--primary);
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
}
.rankNow{white-space:nowrap}
.rankDelta{
  display:inline-block;
  margin-left:6px;
  font-size:10px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  vertical-align:middle;
}
.rankDelta--up{color:#ef4444}
.rankDelta--down{color:#2563eb}
.rankSyncState{
  display:inline-block;
  font-weight:700;
  text-decoration:none;
}
.rankLink:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.rankPrimaryLine{
  display:inline-flex;
  align-items:baseline;
  white-space:nowrap;
}
.rankLink--npro{
  flex-direction:row;
  flex-wrap:nowrap;
  gap:3px;
  white-space:nowrap;
}
.rankLink--npro .rankDelta{margin-left:0}
.rankLink--npro .rankPagePos{
  display:inline-block;
  margin-top:0;
}
.rankSyncState--processing{color:#2563eb}
.rankSyncState--error{color:#dc2626}
.rankPrevious{
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:10px;
  font-weight:500;
  text-decoration:none;
  white-space:nowrap;
}
.rankUpdatedAt{
  display:block;
  color:#64748b;
  font-size:9px;
  font-weight:500;
  line-height:1.25;
  text-decoration:none;
  white-space:nowrap;
}
.webRankBasisNotice{
  margin:10px 0 0;
  color:#64748b;
  font-size:12px;
  line-height:1.45;
}
.filterBtn{border:1px solid var(--line); background:#fff; color:#475569}
.filterBtn:hover{background:#f1f5f9}
.filterBtn.is-active{background:var(--primary); color:#fff; border-color:var(--primary)}
.rankLink:hover{color:#183a61}

.iconBtn{
  width:34px; height:34px;
  border-radius:0;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
}
.iconBtn:hover{background:#f8fafc}

/* ===== Buttons ===== */
.btn{
  height:40px;
  padding:0 14px;
  border-radius:0;
  border:1px solid var(--line);
  background:#fff;
  font-weight:1100;
  cursor:pointer;
}
.btn:hover{background:#f8fafc}
.btn--primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btn--primary:hover{background:var(--primary2)}
.btn--danger{
  background:var(--danger);
  border-color:var(--danger);
  color:#fff;
}
.btn--danger:hover{filter:brightness(.95) }
.btn--danger:hover {background:var(--danger);}
.btn--secondary{
  background:#64748b;
  border-color:#64748b;
  color:#fff;
}
.btn--secondary:hover{background:#475569}

/* ===== Center Modal ===== */
.modalOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:none;
  z-index:1000;
  align-items:center;
  justify-content:center;
}
.modalOverlay.is-open{display:flex}

.modal{
  width:min(560px, calc(100% - 28px));
  max-height:calc(100vh - 20px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:0;
  box-shadow:var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal--rank{width:min(620px, calc(100% - 28px))}
.modal__head{
  padding:16px 16px 12px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.modal__title{font-size:18px; font-weight:500}
.modal__desc{font-size:12px; color:var(--muted); font-weight:400; margin-top:4px}
.iconX{
  width:38px; height:38px;
  border-radius:0;
  border:1px solid var(--line);
  background:#f1f5f9;
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.modal__body{
  padding:14px 16px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:0;
}
.modal__foot{
  border-top:1px solid var(--line);
  padding:12px 16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  background:#fff;
}
.fGroup{display:flex; flex-direction:column; gap:6px}
.fGroup label{font-size:13px; font-weight:400}
.inp,.sel{
  width:100%;
  height:40px;
  padding:0 12px;
  border-radius:0;
  border:1px solid var(--line);
  background:#fff;
  outline:none;
  font-weight:400;
}
.inp:focus,.sel:focus{
  border-color:rgba(11,42,74,.5);
  box-shadow:0 0 0 3px rgba(11,42,74,.12);
}
.help{font-size:12px; color:var(--muted); font-weight:400}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px}

/* ===== Rank Calendar ===== */
.rank-calendar{
  width:100%;
}
.rank-calendar-header{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  text-align:center;
  font-size:14px;
  font-weight:600;
  margin-bottom:8px;
  padding-bottom:8px;
  border-bottom:1px solid #e5e7eb;
}
.rank-calendar-header span{color:#64748b}
.rank-calendar-header span:first-child{color:#dc2626}
.rank-calendar-header span:last-child{color:#2563eb}
.rank-calendar-grid{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:4px;
}
.rank-calendar-cell{
  text-align:center;
  padding:8px 4px;
  min-height:60px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.rank-calendar-cell .day{
  font-size:16px;
  font-weight:500;
  color:#1f2937;
}
.rank-calendar-cell.sunday .day{color:#dc2626}
.rank-calendar-cell.saturday .day{color:#2563eb}
.rank-calendar-cell.other-month .day{color:#cbd5e1}
.rank-calendar-cell .rank-badge{
  font-size:12px;
  padding:4px 8px;
  border-radius:4px;
  font-weight:600;
}
.rank-calendar-cell .rank-badge.has-rank{
  background:var(--primary);
  color:#fff;
}
.rank-calendar-cell .rank-badge.no-rank{
  background:#f1f5f9;
  color:#94a3b8;
}

/* ===== Rank mini table (legacy) ===== */
.rankTableCard{
  border:1px solid var(--line);
  border-radius:0;
  overflow:hidden;
}
.rankTableHead{
  padding:10px 12px;
  background:#f8fafc;
  font-weight:1100;
  border-bottom:1px solid var(--line);
}
.tbl--mini{min-width:auto}
.tbl--mini th,.tbl--mini td{padding:10px 10px}
.tbl--mini th{position:static}

/* ===== Pop overlay ===== */
.popOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:none;
  z-index:2000;
  align-items:center;
  justify-content:center;
}
.popOverlay.is-open{display:flex}
.pop{
  width:500px;
  max-height:90vh;
  overflow-y:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:0;
  box-shadow:var(--shadow);
  padding:16px 20px;
}
.pop__title{font-weight:500; font-size:16px; margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid #e5e7eb}
.pop__msg{
  font-weight:400;
  color:#334155;
  line-height:1.7;
  white-space:pre-line;
  word-break:keep-all;
}
.pop__actions{display:flex; justify-content:flex-end; gap:8px; margin-top:16px; padding-top:12px; border-top:1px solid #e5e7eb}

/* ===== Right profile side ===== */
.sideOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.35);
  display:none;
  z-index:1500;
}
.sideOverlay.is-open{display:block}
.side{
  position:fixed;
  right:-420px;
  top:0;
  height:100vh;
  width:400px;
  background:#fff;
  border-left:1px solid var(--line);
  box-shadow:var(--shadow);
  z-index:1600;
  display:flex;
  flex-direction:column;
  transition:right .2s ease;
}
.side.is-open{right:0}
.side__head{
  padding:16px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.side__title{font-weight:500}
.side__body{padding:14px 16px; overflow:auto; display:flex; flex:1; min-height:0; flex-direction:column; gap:12px}
.ta{
  width:100%;
  min-height:120px;
  padding:10px 12px;
  border-radius:0;
  border:1px solid var(--line);
  outline:none;
  font-weight:400;
  resize:vertical;
}
.ta:focus{border-color:rgba(11,42,74,.5); box-shadow:0 0 0 3px rgba(11,42,74,.12)}

#noticeContent{
  min-height:300px;
  font-size:15px;
  font-weight:400;
  line-height:1.8;
  color:#1e293b;
  background:#fafafa;
  padding:16px 18px;
}
#noticeContent:read-only{
  background:#f8fafc;
  border-color:#e2e8f0;
  cursor:default;
}
#noticeContent.notice-view-mode{
  min-height:400px;
  font-size:16px;
  line-height:2;
  border:none;
  background:#fff;
  padding:0;
}
.notice-meta{
  font-size:13px;
  color:#64748b;
  margin-top:4px;
}

.side__foot{
  border-top:1px solid var(--line);
  padding:12px 16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* ===== Login Screen ===== */
.loginScreen{
  position:fixed;
  inset:0;
  background:var(--bg2);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:3000;
}
.loginCard{
  width:min(400px, calc(100% - 32px));
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:32px 24px;
}
.loginTitle{
  font-size:32px;
  font-weight:bold;
  color:var(--primary);
  text-align:center;
  margin-bottom:4px;
}
.loginLogo{
  display:block;
  margin:0 auto 16px;
  max-width:100%;
  height:auto;
  max-height:80px;
}
.loginLogo--text{
  text-align:center;
  font-size:48px;
  font-weight:800;
  letter-spacing:8px;
  color:var(--primary);
  line-height:1;
  padding:8px 0 12px;
}
.loginSubtitle{
  font-size:14px;
  color:var(--muted);
  text-align:center;
  margin-top:0;
  margin-bottom:24px;
}
.loginCard .fGroup{
  margin-bottom:16px;
}

/* ===== Page Size Selector ===== */
.pageSizeBtn{
  padding:4px 10px;
  border:none;
  background:transparent;
  font-size:13px;
  color:#6b7280;
  cursor:pointer;
  transition:all 0.15s;
}
.pageSizeBtn:hover{
  color:var(--primary);
}
.pageSizeBtn.active{
  font-weight:600;
  color:var(--primary);
  text-decoration:underline;
}

/* ===== Pagination ===== */
.pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:2px;
  padding:0;
}
.page-btn{
  min-width:32px;
  height:32px;
  padding:0 8px;
  border:1px solid #e5e7eb;
  border-radius:0;
  background:#fff;
  font-size:13px;
  font-weight:500;
  color:#374151;
  cursor:pointer;
  transition:all 0.15s;
}
.page-btn:hover:not(.active):not(.disabled){
  background:#f3f4f6;
  border-color:#d1d5db;
}
.page-btn.active{
  background:#1f2937;
  border-color:#1f2937;
  color:#fff;
}
.page-btn.disabled{
  color:#d1d5db;
  cursor:not-allowed;
  background:#fafafa;
}
.page-ellipsis{
  padding:0 8px;
  color:#9ca3af;
  font-size:13px;
}
.pg-btn{
  min-width:32px;
  height:32px;
  padding:0 8px;
  border:1px solid #e5e7eb;
  border-radius:0;
  background:#fff;
  font-size:13px;
  font-weight:500;
  color:#374151;
  cursor:pointer;
  transition:all 0.15s;
}
.pg-btn:hover{
  background:#f3f4f6;
  border-color:#d1d5db;
}
.pg-btn--active{
  background:#1f2937;
  border-color:#1f2937;
  color:#fff;
}
.pg-btn--active:hover{
  background:#374151;
}

/* ===== Hamburger Button ===== */
.hamburger{
  display:none;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:36px;
  height:36px;
  padding:6px;
  border:none;
  background:transparent;
  cursor:pointer;
  gap:5px;
}
.hamburger span{
  display:block;
  width:22px;
  height:2px;
  background:#fff;
  border-radius:2px;
  transition:all 0.2s;
}
.hamburger.is-open span:nth-child(1){
  transform:rotate(45deg) translate(5px, 5px);
}
.hamburger.is-open span:nth-child(2){
  opacity:0;
}
.hamburger.is-open span:nth-child(3){
  transform:rotate(-45deg) translate(5px, -5px);
}

/* ===== Nav Overlay (Mobile) ===== */
.navOverlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:40;
}
.navOverlay.is-open{display:block}

/* ===== User Icon ===== */
.userIcon{display:none}

/* ===== Responsive - Desktop first ===== */
@media (max-width: 1180px){
  :root{--sidebar-w:210px}
  .sidebar__brand{font-size:28px}
  .vipDashTop,
  .vipDashGrid{
    grid-template-columns:1fr;
  }
  .vipDashPanel{min-height:auto}
  .vipUserStatus{
    grid-template-columns:150px minmax(0, 1fr);
    gap:18px;
  }
  .side{
    left:50%;
    right:auto;
    top:50%;
    width:min(560px, calc(100vw - 48px));
    height:auto;
    max-height:calc(100dvh - 48px);
    border:1px solid var(--line);
    transform:translate(-50%, calc(-50% + 12px)) scale(.98);
    opacity:0;
    pointer-events:none;
    transition:transform .2s ease, opacity .2s ease;
  }
  .side.is-open{
    right:auto;
    transform:translate(-50%, -50%) scale(1);
    opacity:1;
    pointer-events:auto;
  }
  .adsToolbar{
    display:grid;
    grid-template-columns:minmax(360px, 1fr) auto;
    align-items:start;
    gap:14px 16px;
  }
  .adsToolbar__search{
    min-width:0;
  }
  .adsToolbar__search .searchRow-mobile{
    width:100%;
  }
  .adsToolbar__search .search{
    max-width:none !important;
    min-width:0;
    flex:1;
  }
  .adsToolbar__actions{
    display:grid !important;
    grid-template-columns:auto auto auto;
    justify-content:end;
    align-items:center;
    gap:10px;
  }
  .adsToolbar__actions .hSub{
    grid-column:1 / -1;
    justify-self:center;
    text-align:center;
  }
  .adsToolbar__actions .btn{
    min-width:92px;
    white-space:nowrap;
  }
}

@media (max-width: 860px){
  /* 사이드바: 모바일에서는 슬라이드 인 */
  .sidebar{
    width:260px;
    transform:translateX(-100%);
    transition:transform 0.25s ease;
  }
  .sidebar.is-open{transform:translateX(0)}

  /* 모바일 상단 바 노출 */
  .mobileBar{display:flex}
  .hamburger{display:flex}

  /* 본문 영역: 사이드바 마진 제거 */
  .appBody{margin-left:0}

  /* Layout */
  .wrap{margin-top:16px; padding:0 12px}
  .vipDashHero{
    align-items:flex-start;
    flex-direction:column;
  }
  .vipDashHero__title{font-size:26px}
  .vipDashTop,
  .vipDashGrid,
  .vipDashStrip{
    grid-template-columns:1fr;
    gap:12px;
  }
  .vipDashPanel{
    padding:14px;
  }
  .vipUserStatus,
  .vipServiceMix,
  .vipSplitSummary{
    grid-template-columns:1fr;
  }
  .vipMetricLine,
  .vipSplitSummary__grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .vipRing{
    width:116px;
    height:116px;
  }
  .statGrid{grid-template-columns:repeat(3, 1fr); gap:8px}
  .stat__num{font-size:20px}
  .stat__label{font-size:11px}
  .listHead{flex-direction:column; gap:12px; align-items:stretch; padding:0}
  .listHead__left{flex-direction:column; align-items:flex-start; gap:4px}
  .listHead__right{flex-direction:column; gap:8px}
  .search{width:100%}
  .grid2{grid-template-columns:1fr}
  .side{
    left:0;
    right:auto;
    top:0;
    width:100vw;
    max-height:none;
    height:100dvh;
    border-left:0;
    border-right:0;
    transform:translateX(100%);
    opacity:1;
    pointer-events:none;
    transition:transform .2s ease;
  }
  .side.is-open{
    right:auto;
    transform:translateX(0);
    pointer-events:auto;
  }
  
  /* Buttons full width on mobile */
  .btn--full-mobile{width:100%}
  
  /* Search row inline on mobile */
  .searchRow-mobile{display:flex; gap:8px; width:100%}
  .searchRow-mobile .search{flex:1}
  .searchRow-mobile .btn{flex-shrink:0}
  .adsToolbar{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .adsToolbar__actions{
    display:grid !important;
    grid-template-columns:repeat(auto-fit, minmax(88px, 1fr));
    width:100%;
    justify-content:center;
    align-items:center;
    gap:8px;
  }
  .adsToolbar__actions .hSub{
    grid-column:1 / -1;
    justify-self:center;
    min-width:0;
    text-align:center;
  }
  .adsToolbar__actions .btn{
    min-width:0;
    min-height:38px;
    white-space:nowrap;
  }
  .adsToolbar__actions #btnApproveSelected{
    grid-column:auto;
    justify-self:center;
  }
  
  /* Edit history mobile */
  .ehSearchRow{flex-wrap:nowrap}
  .ehSearchRow .search{max-width:none !important; min-width:0}
  .ehMonthBtns{flex-wrap:wrap}
  
  /* Tables - Horizontal scroll */
  .tableWrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
  .tbl{min-width:1000px; font-size:12px}
  .tbl th, .tbl td{padding:8px 6px; white-space:nowrap}
  .tbl .c-name{min-width:180px; white-space:normal; word-break:keep-all}
  
  /* Forms */
  .fRow{flex-direction:column}
  .modal{max-width:95vw; margin:10px}
  .modal__body{padding:16px}
  
  /* Text sizes */
  .statCard__title{font-size:14px}
  .hTitle{font-size:16px}
  .hSub{font-size:13px; text-align:left}
  .btn{font-size:13px; padding:8px 14px}
  .fGroup label{font-size:13px}
  .inp, .ta, select{font-size:14px}
}

@media (max-width: 480px){
  .mobileBar{padding:8px 10px}
  .mobileBar__brand{font-size:20px}
  .wrap{padding:0 8px; margin-top:16px}
  .statCard{padding:12px 10px 8px}
  #pageAds .statCard__header{align-items:flex-start !important;flex-wrap:wrap;gap:8px}
  .statCard__meta{flex-wrap:wrap;gap:8px}
  .statGrid{grid-template-columns:repeat(3, 1fr)}
  .statGrid .stat:nth-child(4), .statGrid .stat:nth-child(5){grid-column:span 1}
  .stat__num{font-size:18px}
  .tbl{min-width:700px; font-size:11px}
  .modal{max-width:100vw; margin:0; border-radius:0}
  .modal__head{padding:14px 16px}
  .modal__body{padding:12px}
  .modal__foot{padding:12px 16px}
  .fGroup{margin-bottom:12px}
  .inp, .ta, select{padding:10px}
  .webkrOptions__period{align-items:flex-start;flex-direction:column;gap:6px}
  .listHead{flex-direction:column;gap:12px}
  .listHead__right{display:flex !important;flex-direction:row !important;flex-wrap:wrap !important;justify-content:center !important;width:100%;gap:6px !important}
  .listHead__right .btn{flex:0 0 auto !important;width:auto !important;padding:8px 12px;font-size:12px}
  .adsToolbar__actions{
    display:grid !important;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:8px !important;
    align-items:center;
    justify-content:stretch !important;
  }
  .adsToolbar__actions .hSub{
    grid-column:1 / -1;
    justify-self:center;
    min-width:0;
    font-size:13px;
    text-align:center;
  }
  .adsToolbar__actions .btn{
    width:100% !important;
    min-width:0;
    padding:9px 8px !important;
    font-size:12px !important;
  }
  .adsToolbar__actions #btnExportAds{
    grid-column:span 2;
  }
  .adsToolbar__actions #btnApproveSelected{
    grid-column:1 / -1;
  }
  .paginationRow{flex-direction:column !important;gap:12px !important;padding:12px !important}
  .paginationRow > div:first-child{display:none !important}
  .pagination-extras{flex-direction:row !important;justify-content:center !important;width:100%;gap:8px !important}
  .goto-page{display:flex !important}
  .goto-page span{font-size:11px}
  .goto-page input{width:50px !important;padding:4px 6px !important;font-size:12px !important}
  .page-size-select{display:block !important;width:100px !important;padding:4px 8px !important;font-size:11px !important}
  #adsPagination, #slotsPagination, #usersPagination{margin:0 auto}
}

@media (max-width: 480px){
  .adsToolbar__search .searchRow-mobile{
    gap:6px !important;
  }
  .adsToolbar__search #selectedCount{
    max-width:72px;
    overflow:hidden;
    text-overflow:ellipsis;
    padding:0 2px;
    font-size:12px !important;
  }
}

.rankNow{
  display:inline-block;
  font-weight:700;
  color:#111827;
}

.rankPagePos{
  display:block;
  margin-top:2px;
  font-size:11px;
  line-height:1.2;
  color:#64748b;
  white-space:nowrap;
}

/* ===== N웹사이트관리(테스트) — 관리자 전용 카나리 탭 ===== */
.npTestBanner{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-bottom:14px;
  padding:12px 16px;
  border:1px solid #f59e0b;
  border-left:4px solid #f59e0b;
  border-radius:8px;
  background:#fffbeb;
  color:#92400e;
}
.npTestBanner strong{ font-size:14px; font-weight:700; }
.npTestBanner span{ font-size:12px; color:#b45309; }
.npTestBadge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  background:#f59e0b;
  color:#fff;
  font-size:11px;
  font-weight:700;
  vertical-align:middle;
}
.npTestAddBar{
  padding:14px 16px;
  border-bottom:1px solid #e5e7eb;
  background:#f9fafb;
}
.npTestAddBar__title{ font-size:13px; font-weight:700; color:#374151; margin-bottom:8px; }
.npTestAddBar__fields{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.npTestField{ display:flex; flex-direction:column; gap:4px; font-size:12px; color:#6b7280; }
.npTestField span{ font-weight:600; }
