/* Sora LMS Pro Pack: admin screens (Pro Pack, Certificates, designer). Matches Tutor's admin look. */
.sora-admin, .sora-editor { --a-brand: #3E64DE; --a-brand-soft: #EBF0FD; --a-ink: #212327; --a-text: #41454F; --a-muted: #5B616F; --a-line: #E3E5EA; --a-field: #C3C5CB; --a-bg: #F6F7F9; --a-surface: #fff; --a-danger: #D92D20; font-family: Inter, -apple-system, "Segoe UI", sans-serif; color: var(--a-text); }
.sora-admin { max-width: 1200px; padding: 24px 20px 48px 0; display: grid; gap: 20px; }
.sora-admin__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sora-admin h1 { margin: 0; font-size: 24px; font-weight: 600; color: var(--a-ink); }
.sora-admin__head p { margin: 4px 0 0; color: var(--a-muted); }
.sora-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--a-field); background: var(--a-surface); color: var(--a-ink); font: 500 14px Inter, sans-serif; text-decoration: none; cursor: pointer; }
.sora-btn:hover { border-color: var(--a-muted); color: var(--a-ink); }
.sora-btn:focus-visible { outline: 2px solid var(--a-brand); outline-offset: 2px; }
.sora-btn[disabled] { opacity: .5; cursor: default; }
.sora-btn--primary { background: var(--a-brand); border-color: var(--a-brand); color: #fff; }
.sora-btn--primary:hover { background: #2F55CF; border-color: #2F55CF; color: #fff; }
.sora-btn--danger { background: var(--a-danger); border-color: var(--a-danger); color: #fff; }
.sora-btn--danger-ghost { color: var(--a-danger); border-color: #F4C7C3; }
.sora-toast { justify-self: start; padding: 8px 14px; border-radius: 6px; background: #E7F6EC; color: #12804A; font-weight: 500; }

.sora-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sora-card { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-surface); cursor: pointer; }
.sora-card:hover { border-color: var(--a-field); }
.sora-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sora-card__top strong { font-size: 15px; color: var(--a-ink); font-weight: 600; }
.sora-card__desc { color: var(--a-muted); font-size: 13px; line-height: 1.5; }
.sora-switch { position: relative; width: 36px; height: 20px; flex: none; }
.sora-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sora-switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--a-field); transition: background .15s; pointer-events: none; }
.sora-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sora-switch input:checked + span { background: var(--a-brand); }
.sora-switch input:checked + span::after { transform: translateX(16px); }
.sora-switch input:focus-visible + span { outline: 2px solid var(--a-brand); outline-offset: 2px; }

.sora-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--a-line); }
.sora-tabs a { padding: 10px 14px; color: var(--a-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.sora-tabs a span { margin-left: 4px; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--a-bg); }
.sora-tabs a.is-active { color: var(--a-brand); border-bottom-color: var(--a-brand); }
.sora-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sora-tpl { border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-surface); overflow: hidden; display: grid; }
.sora-tpl__preview { display: block; position: relative; aspect-ratio: 1123 / 794; background: var(--a-bg); }
.sora-tpl__preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.sora-tpl__foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--a-line); }
.sora-tpl__foot strong { color: var(--a-ink); font-weight: 600; }
.sora-tpl__actions { display: flex; gap: 12px; }
.sora-tpl__actions a { color: var(--a-brand); text-decoration: none; }
.sora-link-danger { all: unset; cursor: pointer; color: var(--a-danger); }
.sora-tpl--new { place-items: center; align-content: center; gap: 8px; min-height: 220px; border-style: dashed; color: var(--a-brand); text-decoration: none; font-weight: 500; }
.sora-tpl--new span { font-size: 28px; }
.sora-confirm { position: fixed; inset: 0; z-index: 100000; background: rgba(16, 24, 40, .45); display: grid; place-items: center; }
.sora-confirm__box { background: #fff; border-radius: 12px; padding: 24px; width: min(420px, 90vw); display: grid; gap: 8px; }
.sora-confirm__box h2 { margin: 0; font-size: 18px; color: var(--a-ink); }
.sora-confirm__btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.sora-empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--a-field); border-radius: 10px; color: var(--a-muted); }
.sora-table-wrap { overflow-x: auto; border: 1px solid var(--a-line); border-radius: 10px; background: #fff; }
.sora-table { width: 100%; border-collapse: collapse; }
.sora-table th, .sora-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--a-line); font-size: 14px; }
.sora-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--a-muted); font-weight: 500; }
.sora-table tr:last-child td { border-bottom: 0; }
.sora-table__actions a { color: var(--a-brand); text-decoration: none; margin-right: 10px; }

/* Designer */
.sora-editor { margin-left: -20px; min-height: calc(100vh - 32px); background: var(--a-bg); display: grid; grid-template-rows: auto 1fr; }
.sora-editor__bar { position: sticky; top: 32px; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--a-line); }
.sora-icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--a-line); color: var(--a-ink); text-decoration: none; font-size: 18px; }
.sora-editor__title { height: 36px; min-width: 200px; border: 1px solid transparent !important; border-radius: 6px; padding: 0 10px; font: 600 16px Inter, sans-serif; color: var(--a-ink); background: transparent; box-shadow: none !important; }
.sora-editor__title:hover, .sora-editor__title:focus { border-color: var(--a-field) !important; background: #fff; }
.sora-editor__status { font-size: 13px; color: var(--a-muted); }
.sora-editor__status.is-ok { color: #12804A; }
.sora-editor__spacer { flex: 1; }
.sora-editor__body { display: grid; grid-template-columns: 270px minmax(0, 1fr) 290px; min-height: 0; }
.sora-editor__left, .sora-editor__right { background: #fff; padding: 16px; display: grid; align-content: start; gap: 22px; overflow: auto; max-height: calc(100vh - 100px); position: sticky; top: 100px; }
.sora-editor__left { border-right: 1px solid var(--a-line); }
.sora-editor__right { border-left: 1px solid var(--a-line); }
.sora-editor h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--a-muted); font-weight: 600; }
.sora-hint { margin: 0 0 8px; font-size: 12px; color: var(--a-muted); line-height: 1.5; }
.sora-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .sora-add button { font-size: 12px; padding: 8px 6px; }
.sora-add button, .sora-chips button { all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 10px; border: 1px solid var(--a-line); border-radius: 6px; font-size: 13px; color: var(--a-ink); text-align: center; background: #fff; }
.sora-add button:hover, .sora-chips button:hover { border-color: var(--a-brand); color: var(--a-brand); }
.sora-add button:focus-visible, .sora-chips button:focus-visible { outline: 2px solid var(--a-brand); }
.sora-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sora-chips button { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 4px 8px; background: var(--a-bg); }
.sora-layers { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.sora-layers li { display: flex; align-items: center; border-radius: 6px; }
.sora-layers li.is-active { background: var(--a-brand-soft); }
.sora-layers button { all: unset; cursor: pointer; flex: 1; padding: 7px 8px; font-size: 13px; color: var(--a-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sora-layers li.is-active button { color: var(--a-brand); }
.sora-layers .se-del { flex: none; width: 24px; text-align: center; color: var(--a-muted); opacity: 0; }
.sora-layers li:hover .se-del, .sora-layers .se-del:focus-visible { opacity: 1; }
.sora-editor__stage { padding: 24px; display: grid; align-content: start; gap: 12px; justify-items: center; min-width: 0; }
.sora-editor__canvas-wrap { position: relative; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px rgba(16, 24, 40, .12); border-radius: 4px; overflow: hidden; background: #fff; }
.sora-editor__canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; touch-action: none; outline: none; }
.sora-editor__canvas .se-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.sora-editor__canvas::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed var(--a-brand); opacity: 0; pointer-events: none; }
.sora-editor__canvas.show-guide::after { opacity: .8; }
.se-el { position: absolute; cursor: move; user-select: none; box-sizing: border-box; }
.se-el:hover { outline: 1px dashed rgba(62, 100, 222, .6); outline-offset: 2px; }
.se-el.is-selected { outline: 2px solid var(--a-brand); outline-offset: 2px; }
.se-handle { display: none; position: absolute; right: -9px; top: 50%; width: 10px; height: 26px; margin-top: -13px; border-radius: 4px; background: #fff; border: 2px solid var(--a-brand); cursor: ew-resize; }
.se-el.is-selected .se-handle { display: block; }
.se-qr { display: block; width: 100%; height: 100%; background: #fff; padding: 3px; box-sizing: border-box; }
.se-qr img { width: 100%; height: 100%; display: block; }
.se-img-empty { display: grid; place-items: center; height: 80px; border: 2px dashed #9AA3B2; color: #5B616F; font: 14px Inter, sans-serif; }
.se-field { display: grid; gap: 4px; font-size: 12px; color: var(--a-muted); margin-bottom: 10px; }
.se-field input, .se-field select, .se-field textarea { width: 100%; min-height: 36px; border: 1px solid var(--a-field); border-radius: 6px; padding: 6px 10px; font: 14px Inter, sans-serif; color: var(--a-text); box-sizing: border-box; }
.se-field input[type=color] { padding: 2px; height: 36px; }
.se-field textarea { resize: vertical; }
.se-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.se-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.se-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--a-field); border-radius: 6px; overflow: hidden; }
.se-seg button { all: unset; cursor: pointer; text-align: center; padding: 7px 0; font-size: 12px; color: var(--a-text); }
.se-seg button + button { border-left: 1px solid var(--a-field); }
.se-seg button.is-active { background: var(--a-brand-soft); color: var(--a-brand); }
.se-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 12px; }
.se-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.se-actions .sora-btn { height: 32px; padding: 0 10px; font-size: 12px; }
.sora-bgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sora-bg { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 4px; padding: 4px; border: 1px solid var(--a-line); border-radius: 8px; font-size: 12px; color: var(--a-text); text-align: center; }
.sora-bg img { width: 100%; aspect-ratio: 1123 / 794; object-fit: cover; border-radius: 4px; display: block; }
.sora-bg.is-active { border-color: var(--a-brand); box-shadow: 0 0 0 1px var(--a-brand); }
.sora-bg:focus-visible { outline: 2px solid var(--a-brand); }
.sora-bg--upload .plus { display: grid; place-items: center; aspect-ratio: 1123 / 794; border-radius: 4px; background: var(--a-bg); font-size: 22px; color: var(--a-brand); }
.sora-center { text-align: center; }
@media (max-width: 1100px) { .sora-editor__body { grid-template-columns: 220px minmax(0, 1fr); } .sora-editor__right { grid-column: 1 / -1; position: static; max-height: none; border-left: 0; border-top: 1px solid var(--a-line); } }

/* Elements toggled with the hidden attribute must stay hidden even when a class sets display. */
[class*="sora-"][hidden], .sora-admin [hidden] { display: none !important; }
