.admin-body { min-width: 320px; background: #f3f6f4; }
.admin-topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.admin-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.admin-brand strong,.admin-brand small { display: block; }
.admin-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.admin-top-actions,.admin-toolbar,.admin-toolbar-group,.editor-actions { display: flex; align-items: center; gap: 8px; }
.admin-main { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.admin-login { width: min(440px, 100%); margin: 10vh auto 0; padding: 28px; }
.admin-login h1,.admin-login p { margin: 0; }
.admin-login h1 { font-size: 22px; }
.admin-login p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.admin-login form { display: grid; gap: 14px; margin-top: 22px; }
.admin-login label,.editor-field label { display: block; margin-bottom: 7px; color: #3f504e; font-size: 12px; font-weight: 700; }
.admin-login input,.admin-search,.editor-field input,.editor-field select,.editor-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.admin-login input,.admin-search,.editor-field input,.editor-field select { height: 42px; padding: 0 11px; }
.admin-dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.admin-dashboard-head h1,.admin-dashboard-head p { margin: 0; }
.admin-dashboard-head h1 { font-size: 26px; }
.admin-dashboard-head p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.admin-stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.admin-stat span,.admin-stat strong { display: block; }
.admin-stat span { color: var(--muted); font-size: 11px; }
.admin-stat strong { margin-top: 6px; font-size: 24px; }
.coverage-panel { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.coverage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.coverage-head h2,.coverage-head p { margin: 0; }
.coverage-head h2 { font-size: 15px; }
.coverage-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.coverage-total { display: grid; min-width: 62px; height: 34px; place-items: center; border-radius: 6px; background: var(--yellow-soft); color: #7d5d12; font-size: 13px; font-weight: 800; }
.coverage-total.complete { background: var(--green-soft); color: var(--green); }
.coverage-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.coverage-item { min-width: 0; padding: 10px; border: 1px solid var(--soft-line); border-radius: 6px; background: #fafcfb; color: var(--ink); text-align: left; cursor: pointer; }
.coverage-item:hover { border-color: var(--green); }
.coverage-item strong,.coverage-item span,.coverage-item small { display: block; }
.coverage-item strong { font-size: 12px; }
.coverage-item span { min-height: 30px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.coverage-item small { margin-top: 7px; color: var(--danger); font-size: 10px; font-weight: 700; }
.coverage-item.complete small { color: var(--green); }
.admin-toolbar { justify-content: space-between; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.admin-search { width: 260px; }
.admin-select { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.admin-file { display: none; }
.question-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; }
.question-table { width: 100%; border-collapse: collapse; }
.question-table th,.question-table td { padding: 12px 14px; border-bottom: 1px solid var(--soft-line); font-size: 12px; text-align: left; vertical-align: middle; }
.question-table th { color: var(--muted); background: #f9fbfa; font-size: 11px; }
.question-table tr:last-child td { border-bottom: 0; }
.question-title strong,.question-title span { display: block; }
.question-title span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.syllabus-cell strong,.syllabus-cell span { display: block; }
.syllabus-cell span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.status-badge.draft { background: var(--yellow-soft); color: #7d5d12; }
.status-badge.archived { background: #edf0ef; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.mini-button.danger { color: var(--danger); }
.admin-empty { padding: 54px 20px; color: var(--muted); text-align: center; }
.editor-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(20,35,33,.42); }
.editor-dialog { width: min(920px,100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 8px; background: white; box-shadow: 0 24px 80px rgba(20,35,33,.25); }
.editor-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); background: white; }
.editor-header h2 { margin: 0; font-size: 17px; }
.editor-body { padding: 20px; }
.editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.editor-field.full { grid-column: 1/-1; }
.editor-field textarea { min-height: 78px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.editor-section { grid-column: 1/-1; padding-top: 6px; }
.editor-section h3 { margin: 0 0 10px; font-size: 13px; }
.prompt-editor,.option-editor { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 8px; margin-bottom: 8px; padding: 10px; border: 1px solid var(--soft-line); border-radius: 7px; background: #fafcfb; }
.option-editor { grid-template-columns: 1fr 1fr 1fr 1fr; }
.prompt-editor input,.option-editor input { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 11px; }
.editor-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: white; }
.admin-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
@media(max-width:980px){.coverage-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.admin-topbar{padding:0 14px}.admin-main{width:min(100% - 20px,1220px);padding-top:18px}.admin-dashboard-head,.admin-toolbar{align-items:stretch;flex-direction:column}.admin-toolbar-group{flex-wrap:wrap}.admin-search,.admin-select{width:100%}.admin-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.coverage-head{align-items:flex-start}.coverage-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.question-table th:nth-child(3),.question-table td:nth-child(3){display:none}.prompt-editor,.option-editor,.editor-grid{grid-template-columns:1fr}.editor-field.full,.editor-section{grid-column:auto}.editor-dialog{max-height:calc(100vh - 16px)}.editor-backdrop{padding:8px}}
@media(max-width:390px){.admin-stats,.coverage-grid{grid-template-columns:1fr 1fr}.coverage-item span{min-height:44px}}
