/* 북클래스 관리자 화면 */
:root {
  --green: #005f3d; --green-dark: #004d31; --green-deep: #003b25; --green-lt: #eaf4ef; --green-md: #c2dfd1; --green-mid: #2d8a62;
  --yellow: #F5C84C; --yellow-ink: #3d2e00; --beige: #ECE7DA; --beige-ink: #5e594f;
  --text: #111; --sub: #555; --border: #e4e4e0; --bg: #f7f8f6; --danger: #b42318;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: 15px; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ad-muted { color: var(--sub); font-size: 14px; }
.ad-small { font-size: 12px; }
.ad-green { color: var(--green); font-weight: 700; font-size: 14px; }
.ad-help { font-size: 12px; color: var(--sub); }
.ad-req { font-size: 12px; color: var(--danger); font-weight: 400; }

/* 로그인 */
.ad-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ad-login-box { width: min(400px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.ad-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--green); }
.ad-brand-light { color: #fff; font-size: 17px; }
.ad-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
.ad-dot-yellow { background: var(--yellow); }
.ad-linkbtn { background: none; border: 0; color: var(--sub); font-size: 13px; text-decoration: underline; cursor: pointer; min-height: 36px; }

/* 상단 */
.ad-top { background: var(--green-deep); color: #fff; }
.ad-top-inner { max-width: 1360px; margin: 0 auto; padding: 0 24px; min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ad-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ad-tab { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--green-md); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ad-tab[aria-selected="true"] { background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; }
.ad-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: var(--yellow-ink); font-size: 12px; font-weight: 800; text-align: center; }
.ad-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--green-md); flex-wrap: wrap; }
.ad-toplink { color: #fff; }
.ad-demo { background: #fdf1d6; color: #5c4400; font-size: 14px; padding: 10px 24px; text-align: center; }

/* 본문 */
.ad-main { max-width: 1360px; margin: 0 auto; padding: 28px 24px 60px; display: flex; flex-direction: column; gap: 18px; }
.ad-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.ad-head h1 { font-size: 24px; font-weight: 800; }
.ad-filterbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.ad-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d6d6d0; background: #fff; color: #333; cursor: pointer; font-size: 14px; }
.ad-chip[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
.ad-chip-warn[aria-pressed="false"] { border-color: #e8cf8f; color: #7a4d00; }
.ad-select, .ad-input { min-height: 40px; padding: 0 12px; border: 1px solid #d6d6d0; border-radius: 8px; background: #fff; font-size: 14px; }
.ad-input { width: 220px; }

.ad-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ad-tablebox { flex: 999 1 640px; min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.ad-tablebox.ad-narrow { flex: none; max-width: 640px; width: 100%; }
.ad-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.ad-narrow .ad-table { min-width: 0; }
.ad-table th { background: #f1f2ee; text-align: left; color: #444; font-weight: 700; padding: 12px 14px; white-space: nowrap; }
.ad-table td { padding: 12px 14px; border-top: 1px solid #eeeeea; vertical-align: middle; }
.ad-table tbody tr { cursor: pointer; }
.ad-table tbody tr:hover { background: #fafaf8; }
.ad-table tbody tr.is-selected { background: var(--green-lt); box-shadow: inset 4px 0 0 var(--green); }
.ad-table tbody tr.is-new td:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #185fa5; margin-right: 6px; vertical-align: middle; }
.ad-table .ad-empty { text-align: center; color: var(--sub); padding: 28px; cursor: default; }
.ad-nowrap { white-space: nowrap; }
.ad-b { font-weight: 700; }

.ad-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.p-open { background: var(--green); color: #fff; }
.p-wait { background: var(--yellow); color: var(--yellow-ink); }
.p-closed { background: var(--beige); color: var(--beige-ink); }
.p-review { background: #fbebeb; color: var(--danger); margin-left: 6px; }
.p-new { background: #e7f1fb; color: #185fa5; }
.p-talk { background: #f9eeda; color: #7a4d00; }
.p-reg { background: #e5f4e4; color: #1F5C3E; }
.p-cancel { background: #f0efec; color: var(--beige-ink); }
.t-free { background: #fff; color: #185fa5; border: 1px solid #b5cfee; }
.t-wait { background: #fff; color: #7a4d00; border: 1px solid #e8cf8f; }
.t-class { background: #fff; color: var(--green); border: 1px solid var(--green-md); }
.ad-off { color: var(--sub); }

/* 오른쪽 패널 */
.ad-panel { flex: 1 1 360px; min-width: 0; max-width: 460px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.ad-panel h2 { font-size: 19px; font-weight: 800; }
.ad-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-review { background: #fbebeb; color: #8a1c13; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.ad-field { display: flex; flex-direction: column; gap: 6px; border: 0; min-width: 0; }
.ad-field > label, .ad-field > legend, .ad-label { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.ad-field input, .ad-field select, .ad-field textarea { min-height: 44px; padding: 0 12px; border: 1px solid #d6d6d0; border-radius: 8px; background: #fff; width: 100%; }
.ad-field textarea { padding: 10px 12px; resize: vertical; font-size: 14px; }
.ad-field input:disabled { background: var(--bg); color: #999; }
.ad-row2 { display: flex; gap: 12px; }
.ad-row2 > * { flex: 1 1 0; }
.ad-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-pills label, .ad-seg label { position: relative; }
.ad-pills input, .ad-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ad-pills span { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #d6d6d0; border-radius: 8px; font-size: 14px; }
.ad-pills input:checked + span { border-color: var(--green); background: var(--green-lt); color: var(--green); font-weight: 700; }
.ad-seg { display: grid; gap: 6px; }
.ad-seg-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ad-seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-seg span { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid #d6d6d0; border-radius: 8px; font-size: 14px; font-weight: 700; background: #fff; }
.ad-seg-7 input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.ad-seg-3 input[value="모집 중"]:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.ad-seg-3 input[value="대기 접수"]:checked + span { background: var(--yellow); color: var(--yellow-ink); border-color: #d9a92a; }
.ad-seg-3 input[value="마감"]:checked + span { background: var(--beige); color: #3f3b34; border: 2px solid var(--beige-ink); }
.ad-pills input:focus-visible + span, .ad-seg input:focus-visible + span { outline: 2px solid #185fa5; outline-offset: 2px; }
.ad-closedbox { background: #f7f6f2; border-radius: 10px; padding: 14px; }
.ad-radio { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.ad-radio input { width: 18px; height: 18px; accent-color: var(--green); }
.ad-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; cursor: pointer; }
.ad-switch input { width: 22px; height: 22px; accent-color: var(--green); flex: 0 0 auto; }
.ad-dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.ad-dl dt { color: var(--sub); }
.ad-dl dd { word-break: break-all; white-space: pre-line; }
.ad-steps { display: flex; flex-direction: column; gap: 8px; }
.ad-step { border-radius: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid #eeeeea; display: flex; flex-direction: column; gap: 8px; }
.ad-step-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ad-step-title { background: none; border: 0; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; min-height: 36px; flex: 1; }
.ad-step pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: #333; background: #fff; border-radius: 8px; padding: 10px; border: 1px solid #eeeeea; }
.ad-step.is-open { background: var(--green-lt); border-color: var(--green-md); }

.ad-actions { display: flex; gap: 8px; margin-top: 4px; }
.ad-grow { flex: 1 1 auto; }
.ad-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ad-btn:disabled { opacity: 0.6; cursor: wait; }
.ad-btn-lg { min-height: 52px; font-size: 16px; font-weight: 800; }
.ad-btn-primary { background: var(--green); color: #fff; }
.ad-btn-primary:hover { background: var(--green-dark); }
.ad-btn-ghost { background: transparent; border: 1px solid var(--green-mid); color: #fff; min-height: 36px; font-size: 13px; font-weight: 400; }
.ad-btn-ghost-dark { background: #fff; border: 1px solid #d6d6d0; color: #333; }
.ad-btn-danger { background: #fff; border: 1px solid #e7b4b0; color: var(--danger); }
.ad-btn-copy { min-height: 36px; padding: 0 12px; border: 1px solid var(--green-md); border-radius: 8px; background: #fff; color: var(--green); font-size: 13px; font-weight: 700; cursor: pointer; }
.ad-error { background: #fbebeb; color: #8a1c13; border-radius: 8px; padding: 10px 12px; font-size: 14px; }

.ad-tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.ad-tpl { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ad-tpl textarea { min-height: 160px; padding: 10px 12px; border: 1px solid #d6d6d0; border-radius: 8px; font-size: 14px; resize: vertical; width: 100%; }
.ad-tpl input { min-height: 40px; padding: 0 12px; border: 1px solid #d6d6d0; border-radius: 8px; width: 100%; font-weight: 700; }
.ad-tpl-foot { display: flex; justify-content: flex-end; }

.ad-inline-form { display: flex; gap: 8px; flex-wrap: wrap; }

.ad-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; visibility: hidden; transition: all 0.25s ease; z-index: 50; }
.ad-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .ad-panel { position: static; max-height: none; max-width: none; flex-basis: 100%; }
  .ad-input { width: 100%; }
}

/* 역할별 표시 */
body.is-operator [data-admin-only] { display: none !important; }
body:not(.is-operator) [data-operator-only] { display: none !important; }
.ad-op-note { margin: 10px 0 16px; }
.ad-linkdanger { background: none; border: 0; color: #b42318; font: inherit; font-size: 13px; cursor: pointer; min-height: 44px; padding: 0 8px; }

/* 로고 (시안 적용) */
.ad-logo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.ad-logo-sm { width: 32px; height: 32px; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
body { word-break: keep-all; }

/* ── 반 관리: 시간표 보기 ── */
.ad-view { display: inline-flex; background: #fff; border: 1px solid #d6d6d0; border-radius: 10px; padding: 3px; gap: 2px; }
.ad-view-btn { min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: #444; font-weight: 600; cursor: pointer; }
.ad-view-btn[aria-pressed="true"] { background: var(--green); color: #fff; font-weight: 700; }
.ad-ttwrap { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.ad-tt-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--sub); }
.ad-tt-legend .ad-pill { margin-right: 4px; }
.ad-tt-grade { display: flex; flex-direction: column; gap: 10px; }
.ad-tt-title { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 800; }
.ad-tt-title span { font-size: 13px; font-weight: 500; color: var(--sub); }
.ad-tt-scroll { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.ad-tt { min-width: 860px; display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
.ad-tt-h { padding: 10px 8px; text-align: center; font-size: 13px; font-weight: 800; background: var(--green-lt); color: var(--green); border-bottom: 1px solid var(--border); }
.ad-tt-h.is-sat { background: #eaf0f8; color: #185fa5; }
.ad-tt-h.is-sun { background: #fbebeb; color: var(--danger); }
.ad-tt-h.is-corner { background: #fff; color: var(--sub); font-weight: 700; text-align: left; }
.ad-tt-time { padding: 10px 8px; font-size: 14px; font-weight: 800; border-bottom: 1px solid #f0efea; }
.ad-tt-cell { padding: 6px; min-height: 64px; border-left: 1px solid #f0efea; border-bottom: 1px solid #f0efea; display: flex; flex-direction: column; gap: 6px; }
.ad-tt-card {
  width: 100%; text-align: left; border-radius: 8px; padding: 8px; border: 1px solid; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.4; background: #fff;
}
.ad-tt-card.st-open { background: #eaf4ef; border-color: #c2dfd1; }
.ad-tt-card.st-wait { background: #fffbef; border-color: #f0dca0; }
.ad-tt-card.st-closed { background: #f5f3ee; border-color: #e4e4e0; }
.ad-tt-card.is-hidden { opacity: 0.55; border-style: dashed; }
.ad-tt-card.is-selected { outline: 2px solid var(--green); outline-offset: 1px; }
.ad-tt-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.ad-tt-top { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ad-tt-top .ad-pill { font-size: 11px; padding: 1px 8px; }
.ad-tt-top .p-review { margin-left: 0; }
.ad-tt-teacher { font-weight: 700; color: #222; }
.ad-tt-teacher.is-none { color: #999; font-weight: 500; }
.ad-tt-seats { color: var(--sub); }
.ad-tt-seats b { color: var(--green); }
.ad-tt-seats b.is-full { color: var(--danger); }
.ad-tt-add {
  flex: 1; min-height: 44px; border: 1px dashed transparent; border-radius: 8px; background: transparent;
  color: transparent; font-size: 18px; cursor: pointer;
}
.ad-tt-cell:hover .ad-tt-add, .ad-tt-add:focus-visible { border-color: #c2dfd1; color: var(--green); background: #fafcfb; }
.ad-tt-empty { padding: 20px; background: #fff; border: 1px dashed var(--border); border-radius: 12px; color: var(--sub); font-size: 14px; }
