/* DESIGN admin — shadcn CSS tokens & component primitives
 * 비즈니스 톤: 중성 슬레이트 + accent. HSL 토큰으로 통일.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* shadcn slate */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --success: 142.1 76.2% 36.3%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 50%;
  --warning-foreground: 0 0% 100%;
  --info: 221 83% 53%;
  --info-foreground: 0 0% 100%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.625rem;
  --radius-xl: 0.75rem;

  /* layout */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --header-h: 56px;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { color: hsl(var(--foreground)); }
img, svg { display: block; max-width: 100%; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.grid { display: grid; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-fg    { color: hsl(var(--foreground)); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0 1rem; height: 2.25rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-sm  { height: 1.875rem; padding: 0 .75rem; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg  { height: 2.625rem; padding: 0 1.25rem; font-size: 14.5px; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 1.875rem; }

.btn-default     { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-default:hover { background: hsl(var(--primary) / 0.9); }
.btn-secondary   { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.btn-secondary:hover { background: hsl(var(--secondary) / 0.7); }
.btn-outline     { border-color: hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); }
.btn-outline:hover { background: hsl(var(--accent)); }
.btn-ghost       { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }
.btn-destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-destructive:hover { background: hsl(var(--destructive) / 0.9); }
.btn-link        { background: transparent; color: hsl(var(--info)); text-decoration: underline; height: auto; padding: 0; }

/* Input */
.input, .select, .textarea {
  display: block; width: 100%;
  height: 2.25rem; padding: 0 .75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: .5rem .75rem; min-height: 5rem; resize: vertical; line-height: 1.5; }
.select { padding-right: 2rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5rem center; background-size: 1rem; }
.input:focus, .select:focus, .textarea:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15); }
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground)); }
.input[disabled] { background: hsl(var(--muted)); cursor: not-allowed; }

.label { display: block; font-size: 12.5px; font-weight: 500; color: hsl(var(--foreground)); margin-bottom: .375rem; }
.help  { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: .375rem; }

.input-group { position: relative; }
.input-group .input-icon-left {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground)); pointer-events: none;
  display: flex; align-items: center;
}
.input-group .input { padding-left: 2.25rem; }
.input-group .input-action {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  background: transparent; border: 0; cursor: pointer;
  padding: .375rem; border-radius: var(--radius-sm);
}
.input-group .input-action:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

/* Card */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  color: hsl(var(--card-foreground));
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.card-header { padding: 1.25rem 1.5rem 0.5rem; }
.card-title  { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.card-desc   { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: .25rem; }
.card-content { padding: 1rem 1.5rem 1.25rem; }
.card-footer  { padding: 1rem 1.5rem 1.25rem; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: flex-end; gap: .5rem; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .125rem .5rem; min-height: 1.25rem;
  font-size: 11px; font-weight: 600; line-height: 1;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.badge-default     { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge-secondary   { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-outline     { border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.badge-success     { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); }
.badge-destructive { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.badge-warning     { background: hsl(var(--warning) / 0.15); color: hsl(38 92% 35%); }
.badge-info        { background: hsl(var(--info) / 0.12); color: hsl(var(--info)); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid hsl(var(--border)); }
.table thead th { background: hsl(var(--muted) / 0.6); color: hsl(var(--muted-foreground)); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: hsl(var(--accent) / 0.5); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: .25rem; justify-content: flex-end; }

/* Alert */
.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  font-size: 13px;
}
.alert-destructive { border-color: hsl(var(--destructive) / 0.5); background: hsl(var(--destructive) / 0.06); color: hsl(var(--destructive)); }
.alert-success     { border-color: hsl(var(--success) / 0.5); background: hsl(var(--success) / 0.06); color: hsl(var(--success)); }
.alert-warning     { border-color: hsl(var(--warning) / 0.5); background: hsl(var(--warning) / 0.08); color: hsl(38 92% 35%); }
.alert-info        { border-color: hsl(var(--info) / 0.5); background: hsl(var(--info) / 0.06); color: hsl(var(--info)); }

/* Dialog */
.dialog-backdrop {
  position: fixed; inset: 0;
  background: hsl(0 0% 0% / 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn .15s ease-out;
}
.dialog {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  animation: zoomIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: scale(1) } }

/* Toast */
.toast-host { position: fixed; right: 1rem; top: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: .75rem 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 13px;
  display: flex; gap: .5rem; align-items: flex-start;
  animation: slideInRight .2s ease-out;
}
.toast-success { border-color: hsl(var(--success) / 0.5); }
.toast-success .toast-icon { color: hsl(var(--success)); }
.toast-error   { border-color: hsl(var(--destructive) / 0.5); }
.toast-error .toast-icon { color: hsl(var(--destructive)); }
.toast-info    { border-color: hsl(var(--info) / 0.5); }
.toast-info .toast-icon { color: hsl(var(--info)); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20%) } to { opacity: 1; transform: translateX(0) } }

/* Pagination */
.pagination { display: flex; gap: .25rem; align-items: center; }
.pagination .pg-btn {
  min-width: 2rem; height: 2rem; padding: 0 .5rem;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  border-radius: var(--radius-sm); font-size: 12.5px;
  color: hsl(var(--foreground)); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination .pg-btn:hover { background: hsl(var(--accent)); }
.pagination .pg-btn[disabled] { opacity: .5; cursor: not-allowed; }
.pagination .pg-btn.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }

/* Layout: app shell (sidebar + header + main) */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  grid-area: sidebar;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .625rem;
  padding: 0 1rem;
  height: var(--header-h);
  border-bottom: 1px solid hsl(var(--border));
  font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  color: hsl(var(--foreground));
  flex-shrink: 0;
}
.sidebar-brand .brand-mark {
  width: 28px; height: 28px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand .brand-text { white-space: nowrap; overflow: hidden; }
.app[data-sidebar="collapsed"] .sidebar-brand .brand-text { display: none; }

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: .75rem .5rem;
  display: flex; flex-direction: column; gap: .125rem;
}
.nav-group-title {
  padding: .75rem .75rem .375rem;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.app[data-sidebar="collapsed"] .nav-group-title { opacity: 0; height: .5rem; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .75rem; min-height: 2.25rem;
  font-size: 13px; font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-sm);
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.nav-item.active { background: hsl(var(--accent)); color: hsl(var(--foreground)); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -.5rem; top: .375rem; bottom: .375rem;
  width: 3px; background: hsl(var(--primary)); border-radius: 0 2px 2px 0;
}
.nav-item .icon { color: currentColor; }
.app[data-sidebar="collapsed"] .nav-item .nav-label { display: none; }
.app[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: .5rem; }
.app[data-sidebar="collapsed"] .nav-item.active::before { left: 0; }

.sidebar-foot {
  padding: .5rem;
  border-top: 1px solid hsl(var(--border));
}

.header {
  grid-area: header;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 30;
}
.header-toggle { background: transparent; border: 0; cursor: pointer; padding: .375rem; border-radius: var(--radius-sm); color: hsl(var(--muted-foreground)); }
.header-toggle:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.header-title { font-size: 15px; font-weight: 700; color: hsl(var(--foreground)); }
.header-breadcrumb { font-size: 12.5px; color: hsl(var(--muted-foreground)); display: flex; gap: .375rem; align-items: center; }
.header-breadcrumb span:not(:last-child)::after { content: "›"; margin-left: .375rem; opacity: .6; }
.header-spacer { flex: 1; }
.header-user { position: relative; }
.header-user-trigger {
  display: flex; align-items: center; gap: .5rem;
  padding: .25rem .5rem .25rem .25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 9999px;
  background: hsl(var(--background));
  cursor: pointer;
  font-size: 13px; color: hsl(var(--foreground));
}
.header-user-trigger:hover { background: hsl(var(--accent)); }
.header-user-trigger .avatar {
  width: 1.75rem; height: 1.75rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.header-user-menu {
  position: absolute; right: 0; top: calc(100% + .5rem);
  min-width: 200px;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: .375rem;
  display: none;
  z-index: 40;
}
.header-user-menu[data-open="true"] { display: block; }
.header-user-menu a, .header-user-menu button {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; padding: .5rem .625rem;
  border: 0; background: transparent;
  font-size: 13px; color: inherit; cursor: pointer; text-align: left;
  border-radius: var(--radius-sm);
}
.header-user-menu a:hover, .header-user-menu button:hover { background: hsl(var(--accent)); }
.header-user-menu hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: .25rem 0; }

.main {
  grid-area: main;
  width: 100%;
  padding: 1.5rem;
  overflow-x: hidden;
}
.main > .page-head { margin-bottom: 1.25rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.main > .page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.main > .page-head .page-desc { color: hsl(var(--muted-foreground)); font-size: 13px; margin-top: .25rem; }
.main > .page-head .page-actions { display: flex; gap: .5rem; }

/* Stat card (dashboard) */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.25rem; }
.stat {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.stat .stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.stat .stat-label { font-size: 12.5px; color: hsl(var(--muted-foreground)); font-weight: 500; }
.stat .stat-icon {
  width: 2rem; height: 2rem; border-radius: var(--radius);
  background: hsl(var(--accent)); color: hsl(var(--foreground));
  display: inline-flex; align-items: center; justify-content: center;
}
.stat .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat .stat-sub   { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: .25rem; }
.stat .stat-sub.up   { color: hsl(var(--success)); }
.stat .stat-sub.down { color: hsl(var(--destructive)); }

/* ─────────────────────────────────────────────────────────────────
 * 레거시 호환층 — admin/system_settings.php, font_*.php, qa.php가
 * 사용하는 구 클래스명을 새 디자인 토큰으로 매핑.
 * 이 블록은 점진적으로 페이지가 새 클래스로 마이그레이션 되면 제거.
 * ───────────────────────────────────────────────────────────────── */

/* 폼 컨트롤: 클래스 없는 input/select/textarea도 .input과 동일하게 */
.main input[type="text"],
.main input[type="email"],
.main input[type="password"],
.main input[type="number"],
.main input[type="search"],
.main input[type="url"],
.main input[type="tel"],
.main input[type="date"],
.main input:not([type]),
.main select,
.main textarea {
  display: block; width: 100%;
  height: 2.25rem; padding: 0 .75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.main textarea { height: auto; padding: .5rem .75rem; min-height: 5rem; resize: vertical; line-height: 1.5; }
.main select { padding-right: 2rem; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center; background-size: 1rem; }
.main input:focus, .main select:focus, .main textarea:focus {
  border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
.main input::placeholder, .main textarea::placeholder { color: hsl(var(--muted-foreground)); }

/* 레거시 button 변형 */
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-danger  { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-danger:hover { background: hsl(var(--destructive) / 0.9); }

/* 레거시 카드/필드/그리드 */
.main .card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.main .card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 1rem; }

.field { display: block; margin-bottom: .25rem; }
.field > .label, .field > span.label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: hsl(var(--foreground)); margin-bottom: .375rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.form-row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 140px; margin-bottom: 0; }

.info-banner {
  background: hsl(var(--info) / 0.08);
  border: 1px solid hsl(var(--info) / 0.3);
  color: hsl(var(--info));
  padding: .75rem 1rem; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 1rem;
}
.info-banner a { color: inherit; text-decoration: underline; font-weight: 600; }

/* 레거시 테이블 (.tbl) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: .625rem .875rem; text-align: left; border-bottom: 1px solid hsl(var(--border)); }
.tbl thead th { background: hsl(var(--muted) / 0.6); color: hsl(var(--muted-foreground)); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tbl tbody tr:hover { background: hsl(var(--accent) / 0.5); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* 빈 상태 / 액션 */
.empty { padding: 2.5rem; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.row-actions { display: flex; gap: .375rem; justify-content: flex-end; }

/* QA 전용 (admin/qa.php) */
.main .header { background: transparent; border: 0; padding: 0; height: auto; position: static; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.main .header h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.nav-links { display: flex; gap: .25rem; }
.nav-link {
  padding: .375rem .75rem; font-size: 13px;
  color: hsl(var(--muted-foreground)); text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.nav-link:hover, .nav-link.active { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.main section {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.main section h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 1rem; color: hsl(var(--foreground)); }
.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}
.stat-card h3 {
  font-size: 11px; font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: .375rem;
}
.stat-card .num {
  font-size: 24px; font-weight: 800;
  color: hsl(var(--foreground)); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .num.good { color: hsl(var(--success)); }
.stat-card .num.warn { color: hsl(38 92% 35%); }
.stat-card .num.bad  { color: hsl(var(--destructive)); }
.stat-card .sub { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: .125rem; }
.uuid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.actions { display: flex; gap: .5rem; margin-top: 1rem; }

/* 레거시 grid (auto-fill) — 페이지가 .grid 단독으로 사용 */
.main section .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}

/* Mobile: sidebar becomes off-canvas */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,.08);
  }
  .app[data-sidebar="open"] .sidebar { transform: translateX(0); }
  .app[data-sidebar="open"]::after {
    content: ""; position: fixed; inset: 0;
    background: hsl(0 0% 0% / 0.4); z-index: 45;
  }
}
