* { box-sizing: border-box; }

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",sans-serif;
  background:#f3f6fb;
  color:#111827;
}

/* ========================= AUTH ========================= */
.authPage{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 16px;
}
.authCard{
  width:min(520px, 100%);
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(17,24,39,0.08);
  padding:18px 18px 16px;
}
.authHead{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.authLogo{
  width:44px;height:44px;
  display:flex;align-items:center;justify-content:center;
  background:#e9efff;border-radius:12px;
  font-size:20px;
}
.authTitle{ font-weight:900; font-size:18px; }
.authSub{ font-size:12px; color:#6b7280; margin-top:2px; }

.tabs{ display:flex; gap:10px; margin:12px 0 14px; }
.tab{
  flex:1;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
.tab.active{
  background:#eef2ff;
  border-color:#c7d2fe;
}

.field{ margin-top:14px; }
.field label{
  display:block;
  font-size:12px;
  color:#6b7280;
  margin-bottom:6px;
}
input, select{
  width:100%;
  padding:11px 12px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-size:14px;
  outline:none;
}
input:focus, select:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(147,197,253,0.35);
}

.btn{
  padding:11px 14px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-weight:800;
}
.btn.primary{ background:#2f5cff; border-color:#2f5cff; color:#fff; }
.btn.ghost{ background:#111827; border-color:#111827; color:#fff; }
.btn.danger{ background:#ef4444; border-color:#ef4444; color:#fff; }
.btn.block{ width:100%; margin-top:18px; }
.btn.small{ padding:8px 10px; border-radius:10px; font-size:13px; }
.btn.scan{ background:#111827; border-color:#111827; color:#fff; white-space:nowrap; }
.btn.sbToggle{ padding:8px 10px; border-radius:10px; }
.btn.hamburger{ padding:8px 10px; border-radius:10px; font-size:14px; }

.msg{ margin-top:10px; font-size:13px; }
.msg.ok{ color:#059669; }
.msg.bad{ color:#dc2626; }

.hint{ margin-top:12px; font-size:12px; color:#6b7280; line-height:1.45; }
.foot{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #f1f5f9;
  font-size:12px;
  color:#9ca3af;
  text-align:center;
}

/* ========================= APP SHELL ========================= */
.appShell{ display:flex; min-height:100vh; }

.sidebar{
  width:260px;
  background:#ffffff;
  border-right:1px solid #e5e7eb;
  display:flex;
  flex-direction:column;
  padding:14px 12px;
}
.sbTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.sbBrand{ display:flex; align-items:center; gap:10px; min-width:0; }
.sbLogo{
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  background:#e9efff;border-radius:12px;
  font-size:18px;
}
.sbText{ min-width:0; }
.sbTitle{ font-weight:900; font-size:14px; }
.sbSub{
  font-size:12px;
  color:#6b7280;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:150px;
}

.menu{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px 2px;
}
.menuItem{
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
  font-weight:800;
  color:#111827;
}
.menuItem:hover{ background:#f8fafc; }
.menuItem.active{ background:#111827; color:#fff; }

.menuSection{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #f1f5f9;
}
.menuLabel{
  font-size:11px;
  color:#9ca3af;
  margin:0 10px 8px;
  font-weight:800;
}

.sbBottom{ margin-top:auto; padding-top:10px; }

.content{ flex:1; padding:18px 18px 22px; }

.contentTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

/* ✅ 왼쪽(햄버거 + 타이틀) 묶음 */
.topLeft{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.contentTitle{ font-weight:900; font-size:18px; }
.contentActions{ display:flex; gap:10px; flex-wrap:wrap; }

.page{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(17,24,39,0.06);
  padding:16px;
}

.divider{ height:1px; background:#f1f5f9; margin:14px 0; }

.rowBetween{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.row{ display:flex; gap:10px; flex-wrap:wrap; }
.h2{ font-weight:900; font-size:16px; }

.hero{
  background:#0b1220;
  color:#e5e7eb;
  border-radius:16px;
  padding:16px;
}
.heroTitle{ font-weight:900; font-size:18px; }
.heroQuote{
  margin-top:8px;
  font-size:14px;
  line-height:1.5;
  color:#d1d5db;
}
.heroMeta{ margin-top:10px; font-size:12px; color:#9ca3af; }

.gridCards{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.cardBox{
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  background:#fff;
}
.cardLabel{ font-size:12px; color:#6b7280; font-weight:800; }
.cardValue{ margin-top:6px; font-size:16px; font-weight:900; }
.cardHint{ margin-top:4px; font-size:12px; color:#9ca3af; }
.notice{ margin-top:12px; font-size:13px; color:#6b7280; }

.grid2{ display:grid; grid-template-columns: 1.4fr 1fr; gap:12px; }

.inputRow{ display:flex; gap:10px; align-items:stretch; }
.inputRow input{ flex:1; }
.miniHint{ margin-top:8px; font-size:12px; color:#9ca3af; }

.tableWrap{
  margin-top:10px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:auto;
  max-height:520px;
}
.table{ width:100%; border-collapse:collapse; min-width:760px; }
.table thead th{
  position:sticky;
  top:0;
  background:#f8fafc;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
  padding:10px 12px;
  font-size:12px;
  color:#374151;
}
.table tbody td{
  border-bottom:1px solid #f1f5f9;
  padding:10px 12px;
  font-size:13px;
}
.table tbody tr:hover{ background:#f9fafb; }

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; }
.right{ text-align:right; }

.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  background:#eef2ff;
  color:#1f2a7a;
}

.inputSmall{ padding:9px 10px; border-radius:10px; border:1px solid #e5e7eb; }

/* key-value */
.kv{
  margin-top:10px;
  display:grid;
  grid-template-columns: 90px 1fr;
  gap:8px 10px;
  font-size:13px;
}
.k{ color:#6b7280; font-weight:800; }
.v{ color:#111827; font-weight:800; }

/* ========================= Scan Modal ========================= */
.modal{ position:fixed; inset:0; z-index:9999; }
.modalBack{ position:absolute; inset:0; background: rgba(0,0,0,0.45); }
.modalCard{
  position:relative;
  width:min(520px, calc(100% - 24px));
  margin:60px auto;
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  box-shadow:0 20px 60px rgba(0,0,0,0.25);
}
.modalTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid #f1f5f9;
}
.modalTitle{ font-weight:900; }
.modalBody{ padding:12px 14px 16px; }
.scanVideo{
  width:100%;
  height:320px;
  background:#0b1220;
  border-radius:12px;
  object-fit:cover;
}
.scanHelp{
  margin-top:10px;
  font-size:12px;
  color:#6b7280;
  line-height:1.45;
}

/* ========================= Ops extras ========================= */
.opsGrid{ display:grid; grid-template-columns: 1.1fr 1fr; gap:12px; }

/* Responsive */
@media (max-width: 980px){
  .gridCards{ grid-template-columns: 1fr; }
  .opsGrid{ grid-template-columns: 1fr; }
}
@media (max-width: 820px){
  .sidebar{ width:220px; }
  .grid2{ grid-template-columns: 1fr; }
  .scanVideo{ height:380px; }
}

/* ✅ 모바일: 사이드바는 overlay + 기본 collapsed, 상단 햄버거로 열기 */
@media (max-width: 680px){
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    z-index:50;
    transform: translateX(0);
    transition: transform .18s ease;
  }
  .sidebar.collapsed{ transform: translateX(-100%); }

  .content{ padding:14px; }

  /* 모바일에서도 타이틀이 너무 잘리지 않게 */
  .contentTitle{
    font-size:16px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width: calc(100vw - 170px);
  }
}
