@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:#f6f8fc;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --shadow:0 14px 40px rgba(15,23,42,.12);
  --primary:#052b63;
  --primary2:#0a4a8f;
  --danger:#ef4444;
  --ok:#16a34a;
  --font:"Pretendard",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",sans-serif;
}

*{box-sizing:border-box}
body{margin:0; font-family:var(--font); color:var(--ink); background:var(--bg2);}
a{color:inherit; text-decoration:none}
.req{color:var(--danger); font-weight:500; margin-left:4px}
.t-right{text-align:right}

/* ===== Topbar ===== */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:#052b63;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.topbar__inner{
  max-width:1500px;
  margin:0 auto;
  padding:14px 18px;
  display:grid;
  grid-template-columns: 140px 1fr 180px;
  align-items:center;
  gap:10px;
}
.brand{
  color:#fff;
  font-weight:bold;
  letter-spacing:.6px;
  font-size:30px;
}

/* nav 중앙정렬 */
.nav{
  display:flex;
  gap:30px;
  align-items:center;
  justify-content:center;
}
.nav__item{
  color:rgba(255,255,255,.82);
  font-weight:500;
  padding:10px 6px;
  position:relative;
}
.nav__item:hover{color:#fff}
.nav__item.is-active{
  color:#fff;
}
.nav__item.is-active::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:2px;
  height:2px;
  background:#fff;
  border-radius:999px;
}

/* user dropdown */
.user{position:relative; justify-self:end;}
.user__btn{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:#fff;
  font-weight:1000;
  cursor:pointer;
}
.user__btn:hover{background:rgba(255,255,255,.07)}
.user__menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:180px;
  padding:8px;
  border-radius:14px;
  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 10px;
  border-radius:10px;
  font-weight:1000;
  cursor:pointer;
  text-align:left;
}
.user__menuItem:hover{background:#f1f5f9}

/* ===== Layout ===== */
.wrap{max-width:1500px; margin:80px auto 60px; padding:0 18px;}

/* ===== 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:#052b63;
}
.stat__num{
  font-size:26px;
  font-weight:500;
  margin-bottom:6px;
}
.stat__label{font-size:12px; color:var(--muted); font-weight:400}

/* ===== 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}
.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:1100px}
.tbl--users td{white-space:nowrap}
.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)}
.c-no{width:70px}
.c-id{width:120px}
.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-act{width:90px; text-align:right}

.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:#ef4444; color:#ef4444; background:#fff}
.badge--ending .dot{background:#ef4444}
/* 마감 - 검은색 */
.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}

.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{
  font-weight:500;
  color:#052b63;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
}
.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:90vh;
  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:bold}
.modal__desc{font-size:12px; color:var(--muted); font-weight:900; 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;
}
.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:1100}
.inp,.sel{
  width:100%;
  height:40px;
  padding:0 12px;
  border-radius:0;
  border:1px solid var(--line);
  background:#fff;
  outline:none;
  font-weight:900;
}
.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:#052b63;
  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:bold; font-size:16px; margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid #e5e7eb}
.pop__msg{font-weight:400; color:#334155; line-height:1.55}
.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:bold}
.side__body{padding:14px 16px; overflow:auto; display:flex; 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:900;
  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;
}
.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: 1024px){
  .topbar__inner{grid-template-columns:110px 1fr 150px}
  .nav{gap:18px}
  .nav__item{font-size:13px; padding:8px 4px}
}

@media (max-width: 860px){
  .topbar__inner{grid-template-columns:40px 1fr 50px; padding:10px 12px}
  .hamburger{display:flex}
  .brand{text-align:center; font-size:24px}
  .userIcon{display:block}
  .userName-text{display:none}
  .user__chev{display:none}
  .user__btn{padding:8px; border:none; background:transparent}
  
  /* Sidebar Nav */
  .nav{
    position:fixed;
    left:0; top:0; bottom:0;
    width:260px;
    background:#052b63;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    padding:60px 16px 24px;
    gap:0;
    z-index:45;
    transform:translateX(-100%);
    transition:transform 0.25s ease;
  }
  .nav.is-open{transform:translateX(0)}
  .nav__item{
    padding:14px 16px;
    font-size:15px;
    border-radius:8px;
  }
  .nav__item.is-active::after{display:none}
  .nav__item.is-active{background:rgba(255,255,255,0.1)}
  .nav__item:hover{background:rgba(255,255,255,0.06)}
  
  /* Layout */
  .wrap{margin-top:20px; padding:0 12px}
  .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{width:100%}
  
  /* 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}
  
  /* 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){
  .topbar__inner{padding:8px 10px}
  .brand{font-size:20px}
  .wrap{padding:0 8px; margin-top:16px}
  .statCard{padding:12px 10px 8px}
  .statGrid{grid-template-columns:repeat(2, 1fr)}
  .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}
}
