/* =================================================================
   네버스탑 오피스 · 관리자 페이지 스타일
   ================================================================= */

/* ── Layout ── */
.ap-body{
  font-family:'Pretendard',-apple-system,sans-serif;
  background:#F4F6FA;
  color:#0E1A2B;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

.ap-bar{
  position:sticky;top:0;z-index:40;
  background:#0E1A2B;color:#fff;
  height:54px;display:flex;align-items:center;
  padding:0 18px;gap:16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.ap-bar-logo{
  display:flex;align-items:center;gap:7px;
  font-weight:800;font-size:16px;letter-spacing:-.02em;
  text-decoration:none;color:#fff;
}
.ap-bar-logo .mark{width:22px;height:22px;color:#9FC0FF}
.ap-bar-logo b{color:#9FC0FF}
.ap-bar-grow{flex:1}
.ap-bar-nav{display:flex;align-items:center;gap:2px}
.ap-bar-link{
  font-size:13.5px;font-weight:600;color:rgba(255,255,255,.6);
  padding:6px 10px;border-radius:8px;text-decoration:none;
  transition:.15s;white-space:nowrap;
}
.ap-bar-link:hover{background:rgba(255,255,255,.1);color:#fff}
.ap-bar-link.active{color:#fff;background:rgba(255,255,255,.12)}
.ap-bar-user{
  display:flex;align-items:center;gap:8px;
  font-size:13px;color:rgba(255,255,255,.6);padding-left:12px;
  border-left:1px solid rgba(255,255,255,.12);
}
.ap-bar-user a{
  font-size:12px;color:rgba(255,255,255,.4);text-decoration:none;
  padding:5px 9px;border-radius:7px;border:1px solid rgba(255,255,255,.12);
}
.ap-bar-user a:hover{background:rgba(255,255,255,.08);color:#fff}

.ap-wrap{max-width:980px;margin:0 auto;padding:28px 18px 80px}
.ap-wrap-wide{max-width:1200px;margin:0 auto;padding:28px 18px 80px}

/* ── Page header ── */
.ap-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:12px;flex-wrap:wrap}
.ap-head h1{font-size:22px;font-weight:800;letter-spacing:-.03em}
.ap-head .sub{font-size:13px;color:#5B6878;margin-top:3px}

/* ── Cards ── */
.ap-card{
  background:#fff;border:1px solid #E4E9F0;
  border-radius:14px;padding:20px 22px;
  margin-bottom:16px;
}
.ap-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.ap-card-title{font-size:15px;font-weight:800;letter-spacing:-.02em}

/* ── Stats grid ── */
.ap-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:22px}
@media(max-width:700px){.ap-stats{grid-template-columns:repeat(2,1fr)}}
.ap-stat{
  background:#fff;border:1px solid #E4E9F0;border-radius:12px;
  padding:16px 18px;
}
.ap-stat .label{font-size:12px;color:#5B6878;font-weight:600;margin-bottom:6px}
.ap-stat .value{font-size:26px;font-weight:800;letter-spacing:-.03em;font-family:'IBM Plex Mono',monospace}
.ap-stat .value small{font-size:14px;font-weight:600;color:#5B6878;font-family:'Pretendard',-apple-system,sans-serif}
.ap-stat .badge-new{font-size:11px;font-weight:700;color:#067647;background:#E9FBF1;padding:2px 7px;border-radius:6px;margin-top:6px;display:inline-block}

/* ── Tables ── */
.ap-table-wrap{overflow-x:auto}
.ap-table{width:100%;border-collapse:collapse;font-size:13.5px}
.ap-table th{
  background:#F4F6FA;font-size:11.5px;font-weight:700;
  color:#5B6878;letter-spacing:.04em;text-transform:uppercase;
  padding:10px 14px;text-align:left;border-bottom:1px solid #E4E9F0;
  white-space:nowrap;
}
.ap-table td{
  padding:13px 14px;border-bottom:1px solid #EEF1F6;
  vertical-align:middle;
}
.ap-table tr:last-child td{border-bottom:none}
.ap-table tr:hover td{background:#FAFBFD}
.ap-table .td-img{width:52px}
.ap-thumb{
  width:44px;height:44px;border-radius:8px;
  background:linear-gradient(180deg,#FAFBFD,#EEF2F8);
  border:1px solid #E4E9F0;
  display:grid;place-items:center;overflow:hidden;
}
.ap-thumb img{width:100%;height:100%;object-fit:contain}
.ap-thumb svg{max-height:34px;width:auto}
.td-name{font-weight:700;font-size:14px;letter-spacing:-.01em}
.td-meta{font-size:11.5px;color:#5B6878;margin-top:2px;font-family:'IBM Plex Mono',monospace}
.td-acts{white-space:nowrap;text-align:right}

/* ── Buttons ── */
.ap-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer;border:none;
  padding:9px 14px;border-radius:9px;transition:.15s;text-decoration:none;white-space:nowrap;
}
.ap-btn svg{width:15px;height:15px}
.ap-btn-primary{background:#155EEF;color:#fff;box-shadow:0 4px 12px rgba(21,94,239,.22)}
.ap-btn-primary:hover{background:#0B3FB5}
.ap-btn-ghost{background:#F4F6FA;color:#0E1A2B;border:1px solid #E4E9F0}
.ap-btn-ghost:hover{background:#E9EDF3}
.ap-btn-danger{background:#FEF3F2;color:#D92D20;border:1px solid #FECDCA}
.ap-btn-danger:hover{background:#FEE4E2}
.ap-btn-sm{padding:6px 10px;font-size:12px;border-radius:7px}
.ap-btn-sm svg{width:13px;height:13px}
.ap-btn-icon{width:32px;height:32px;padding:0;border-radius:8px;border:1px solid #E4E9F0;background:#fff;color:#5B6878;display:inline-grid;place-items:center}
.ap-btn-icon:hover{background:#F4F6FA;color:#0E1A2B}
.ap-btn-icon.danger:hover{background:#FEF3F2;color:#D92D20;border-color:#FECDCA}
.ap-btn-icon svg{width:15px;height:15px}

/* ── Status badges ── */
.st-badge{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:3px 9px;border-radius:6px;letter-spacing:-.01em}
.st-new{background:#E7F0FF;color:#1450C8}
.st-confirmed{background:#E9FBF1;color:#067647}
.st-done{background:#F4F6FA;color:#5B6878}
.st-spam{background:#FEF3F2;color:#D92D20}
.st-active{background:#E9FBF1;color:#067647}
.st-inactive{background:#FFF4DC;color:#9A5B00}

/* ── Tabs ── */
.ap-tabs{display:flex;gap:0;border-bottom:2px solid #E4E9F0;margin-bottom:20px}
.ap-tab{
  padding:10px 16px;font-size:13.5px;font-weight:700;
  border:none;background:none;cursor:pointer;
  border-bottom:2px solid transparent;color:#5B6878;
  margin-bottom:-2px;display:flex;align-items:center;gap:6px;
  transition:.12s;
}
.ap-tab:hover{color:#0E1A2B}
.ap-tab.active{border-bottom-color:#155EEF;color:#155EEF}
.ap-tab .cnt{
  font-size:11.5px;font-weight:600;
  background:#F4F6FA;color:#5B6878;
  padding:2px 7px;border-radius:10px;transition:.12s;
}
.ap-tab.active .cnt{background:#E7F0FF;color:#1450C8}

/* ── Flash messages ── */
.ap-flash{
  padding:12px 16px;border-radius:10px;margin-bottom:16px;
  font-size:13.5px;font-weight:600;
  display:flex;align-items:center;gap:9px;
}
.ap-flash svg{width:17px;height:17px;flex-shrink:0}
.ap-flash.success{background:#E9FBF1;color:#067647;border:1px solid #ABEFC6}
.ap-flash.error{background:#FEF3F2;color:#D92D20;border:1px solid #FECDCA}
.ap-flash.warning{background:#FFF4DC;color:#9A5B00;border:1px solid #FBE6B5}

/* ── Forms ── */
.ap-form{display:flex;flex-direction:column;gap:18px}
.ap-field{display:flex;flex-direction:column;gap:6px}
.ap-field label{font-size:12.5px;font-weight:700;color:#0E1A2B}
.ap-field label .req{color:#155EEF;margin-left:3px}
.ap-field label .hint{font-weight:500;color:#5B6878;margin-left:6px;font-size:11.5px}
.ap-input,.ap-select,.ap-textarea{
  height:46px;border:1px solid #E4E9F0;border-radius:10px;
  padding:0 13px;font-size:14px;font-family:inherit;
  color:#0E1A2B;outline:none;transition:.15s;background:#fff;
  width:100%;box-sizing:border-box;
}
.ap-textarea{height:auto;padding:11px 13px;resize:vertical;min-height:80px}
.ap-select{
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235B6878' stroke-width='2'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;
  padding-right:36px;
}
.ap-input:focus,.ap-select:focus,.ap-textarea:focus{
  border-color:#155EEF;box-shadow:0 0 0 3px #E7F0FF;
}
.ap-input.err{border-color:#F04438;box-shadow:0 0 0 3px #FEE4E2}
.ap-row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media(max-width:560px){.ap-row2{grid-template-columns:1fr}}
.ap-row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
@media(max-width:700px){.ap-row3{grid-template-columns:1fr 1fr}}
@media(max-width:400px){.ap-row3{grid-template-columns:1fr}}
.ap-row2>*,.ap-row3>*{min-width:0}
.ap-form-foot{display:flex;gap:10px;padding-top:4px}

/* ── Dynamic form rows (상품 요금·옵션) ── */
.ap-dyn-row{
  display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;
  padding:12px 14px;background:#F4F6FA;border-radius:10px;margin-bottom:8px;
}
.ap-dyn-row .ap-field{margin-bottom:0}
.ap-matrix-table .ap-input{
  height:38px;font-size:13px;padding:0 8px;text-align:right;
  font-family:'IBM Plex Mono',monospace;min-width:90px;
}
.ap-matrix-table td,.ap-matrix-table th{text-align:center}
.ap-matrix-table td:first-child,.ap-matrix-table th:first-child{text-align:left}

/* ── Image upload ── */
.ap-img-preview{
  width:120px;height:120px;border:1px solid #E4E9F0;
  border-radius:12px;background:linear-gradient(180deg,#FAFBFD,#EEF2F8);
  display:grid;place-items:center;overflow:hidden;margin:0 auto 12px;
}
.ap-img-preview img{width:100%;height:100%;object-fit:contain}
.ap-img-preview svg{max-height:90px;width:auto}
.ap-img-drop{
  display:block;
  border:2px dashed #E4E9F0;border-radius:12px;
  padding:20px;text-align:center;cursor:pointer;transition:.15s;
  background:#F4F6FA;
}
.ap-img-drop:hover{border-color:#155EEF;background:#E7F0FF}
.ap-img-drop svg{display:block;width:28px;height:28px;color:#5B6878;margin:0 auto 8px}
.ap-img-drop p{font-size:12.5px;color:#5B6878;line-height:1.5}

/* ── Search / filter bar ── */
.ap-filter-bar{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.ap-search{
  flex:1;min-width:180px;max-width:300px;
  display:flex;align-items:center;gap:8px;
  background:#fff;border:1px solid #E4E9F0;
  border-radius:10px;padding:0 12px;height:38px;
}
.ap-search input{flex:1;border:none;background:none;outline:none;font-size:14px}
.ap-search svg{width:15px;height:15px;color:#5B6878;flex-shrink:0}

/* ── Pagination ── */
.ap-page{display:flex;gap:6px;align-items:center;justify-content:center;padding-top:18px}
.ap-page a,.ap-page span{
  min-width:32px;height:32px;border-radius:8px;
  display:grid;place-items:center;
  font-size:13px;font-weight:600;text-decoration:none;
  border:1px solid #E4E9F0;background:#fff;color:#0E1A2B;transition:.12s;
}
.ap-page a:hover{border-color:#155EEF;color:#155EEF}
.ap-page .cur{background:#155EEF;border-color:#155EEF;color:#fff}
.ap-page .disabled{color:#BDC6D2;pointer-events:none}

/* ── Empty state ── */
.ap-empty{text-align:center;color:#5B6878;padding:50px 20px}
.ap-empty svg{width:44px;height:44px;color:#E4E9F0;margin:0 auto 14px;stroke-width:1.5}
.ap-empty b{display:block;color:#0E1A2B;font-size:15px;margin-bottom:4px}

/* ── Login page ── */
.ap-login-wrap{min-height:100vh;display:grid;place-items:center;background:#F4F6FA;padding:24px}
.ap-login-box{
  width:min(380px,100%);background:#fff;
  border:1px solid #E4E9F0;border-radius:18px;
  padding:32px 28px;text-align:center;
  box-shadow:0 1px 2px rgba(14,26,43,.06),0 8px 24px rgba(14,26,43,.06);
}
.ap-login-logo{
  display:flex;align-items:center;justify-content:center;gap:8px;
  font-weight:800;font-size:18px;letter-spacing:-.02em;
  margin-bottom:6px;text-decoration:none;color:#0E1A2B;
}
.ap-login-logo svg{width:26px;height:26px;color:#155EEF}
.ap-login-logo b{color:#155EEF}
.ap-login-box .sub{font-size:13px;color:#5B6878;margin-bottom:24px;line-height:1.5}
.ap-login-box .ap-field{text-align:left}
