/* 운영 콘솔 — 테마 토큰(sonmat.css) 위에 얹는 관리 화면 스타일 */
body.sm-admin { padding-bottom: 0; }
.ad-top { position: sticky; top: 0; z-index: 30; background: var(--ink); color: var(--bg); border-bottom: 2px solid var(--accent); }
.ad-top__inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 16px; min-height: 52px; flex-wrap: wrap; }
.ad-brand { color: var(--bg); text-decoration: none; font-weight: 900; font-size: 16px; white-space: nowrap; }
.ad-brand span { color: var(--accent); font-family: var(--font-num); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; }
.ad-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-right: auto; }
.ad-nav a { color: var(--bg); text-decoration: none; font-size: 14px; font-weight: 600; padding: 14px 12px; opacity: .8; border-bottom: 3px solid transparent; }
.ad-nav a:hover { opacity: 1; color: var(--bg); }
.ad-nav a.on { opacity: 1; border-bottom-color: var(--accent); }
.ad-user { font-size: 13px; display: flex; gap: 12px; align-items: center; color: var(--bg); opacity: .9; }
.ad-user a { color: #ffc4b8; text-decoration: none; }
.ad-main { max-width: 1400px; margin: 0 auto; padding: 24px 16px 48px; }
.ad-main--wide { max-width: none; }
.ad-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--rule-strong); }
.ad-head h1 { font-size: 26px; letter-spacing: -0.02em; }
.ad-head p { font-size: 13px; color: var(--ink-3); }
.ad-foot { max-width: 1400px; margin: 0 auto; padding: 16px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule); }

/* 카드 / 통계 */
.ad-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 20px; }
.ad-stat { background: var(--surface); padding: 14px 16px; border-top: 2px solid var(--ink); }
.ad-stat__label { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.ad-stat__val { font-family: var(--font-num); font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.ad-stat__sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.ad-stat--accent { border-top-color: var(--accent); }
.ad-stat--accent .ad-stat__val { color: var(--accent); }
.ad-card { background: var(--bg); border: 1px solid var(--rule); padding: 16px; margin-bottom: 16px; }
.ad-card h2 { font-size: 16px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.ad-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* 툴바 / 필터 */
.ad-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.ad-toolbar form { display: contents; }
.ad-toolbar .grow { flex: 1 1 200px; }
.ad-toolbar .right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ad-filter { display: inline-flex; border: 1px solid var(--rule); }
.ad-filter a { padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; border-right: 1px solid var(--rule); white-space: nowrap; }
.ad-filter a:last-child { border-right: 0; }
.ad-filter a.on { background: var(--ink); color: var(--bg); }
.ad-filter a .n { font-family: var(--font-num); color: var(--ink-3); margin-left: 4px; }
.ad-filter a.on .n { color: #ffc4b8; }

/* 폼 요소 */
.ad-input, .ad-select, .ad-textarea { min-height: 40px; padding: 7px 10px; border: 1px solid var(--rule); background: var(--bg); font-size: 14px; }
.ad-textarea { min-height: 96px; width: 100%; resize: vertical; }
.ad-input:focus, .ad-select:focus, .ad-textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 7px 14px; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); text-decoration: none; cursor: pointer; white-space: nowrap; }
.ad-btn:hover { background: var(--surface); color: var(--ink); }
.ad-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.ad-btn--primary:hover { background: var(--accent-hover); color: var(--bg); }
.ad-btn--dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ad-btn--dark:hover { background: #000; color: var(--bg); }
.ad-btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.ad-btn--lg { min-height: 56px; padding: 12px 24px; font-size: 18px; }
.ad-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ad-form { display: grid; gap: 12px; max-width: 720px; }
.ad-form label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.ad-form .row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ad-form .ad-input, .ad-form .ad-select { width: 100%; }

/* 테이블 */
.ad-table-wrap { overflow-x: auto; border-top: 2px solid var(--rule-strong); }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th, .ad-table td { padding: 10px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.ad-table th { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; white-space: nowrap; background: var(--bg); }
.ad-table th a { color: inherit; text-decoration: none; }
.ad-table tbody tr:hover { background: var(--surface); }
.ad-table .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.ad-table .r { text-align: right; }
.ad-table .c { text-align: center; }
.ad-table .nowrap { white-space: nowrap; }
.ad-table a.lnk { color: var(--ink); font-weight: 700; text-decoration: none; }
.ad-table a.lnk:hover { color: var(--accent); }
.ad-empty { padding: 40px; text-align: center; color: var(--ink-3); }

/* 상태 태그 */
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; letter-spacing: .02em; white-space: nowrap; }
.tag--received { background: var(--surface); color: var(--ink-2); }
.tag--passed { background: #fff2ef; color: #7c1405; }
.tag--final { background: var(--accent); color: var(--bg); }
.tag--failed { background: #e6e4e4; color: #7d7979; text-decoration: line-through; }
.tag--withdrawn { background: #e6e4e4; color: #9b9797; }
.tag--ok { background: #e5f4ea; color: #1b5e33; }
.tag--warn { background: #fff4d6; color: #7a4d00; }
.tag--off { background: var(--surface); color: var(--ink-3); }

/* 메시지 */
.ad-msg { padding: 12px 14px; margin-bottom: 16px; border-left: 4px solid var(--ink); background: var(--surface); font-size: 14px; }
.ad-msg--ok { border-left-color: #1b5e33; background: #e5f4ea; }
.ad-msg--err { border-left-color: var(--accent); background: #fff2ef; }

/* 상세 정의 목록 */
.ad-dl { display: grid; grid-template-columns: 120px 1fr; gap: 0; border-top: 2px solid var(--rule-strong); font-size: 14px; }
.ad-dl dt { padding: 10px 0; color: var(--ink-3); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--rule); }
.ad-dl dd { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ad-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.ad-photos a { display: block; aspect-ratio: 4/3; background: var(--surface); overflow: hidden; }
.ad-photos img { width: 100%; height: 100%; object-fit: cover; }

/* 로그인 */
.ad-login { max-width: 400px; margin: 48px auto; padding: 24px; border: 1px solid var(--rule); background: var(--bg); }
.ad-login h1 { font-size: 22px; margin-bottom: 4px; }
.ad-login p { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }

/* 페이지네이션 (그누보드 .pg_wrap 재사용) */
.ad-main .pg_wrap { justify-content: flex-start; }

/* 운영 홈 타임라인 */
.ad-timeline { display: grid; gap: 2px; background: var(--rule); border: 2px solid var(--rule); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ad-timeline a { background: var(--bg); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.ad-timeline a:hover { background: var(--surface); }
.ad-timeline .no { font-family: var(--font-num); font-size: 12px; color: var(--accent); font-weight: 700; }
.ad-timeline .t { font-size: 18px; font-weight: 800; }
.ad-timeline .d { font-size: 13px; color: var(--ink-3); margin-top: auto; }

@media (max-width: 720px) {
  .ad-nav a { padding: 10px 8px; font-size: 13px; }
  .ad-dl { grid-template-columns: 1fr; }
  .ad-dl dt { border-bottom: 0; padding-bottom: 0; }
}
@media print {
  .ad-top, .ad-foot, .no-print { display: none !important; }
  .ad-main { max-width: none; padding: 0; }
}
