.admin-body { background: #f4f1f9; }
.admin-header { height: 72px; background: var(--purple-deep); color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 52px); position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 22px rgba(22, 5, 49, .2); }
.brand-light { color: white; }
.brand-mark-light { background: #ffcf32; color: var(--purple-deep); box-shadow: 0 5px 0 #c89500; }
.admin-header-actions { display: flex; align-items: center; gap: 12px; }
.view-site { color: #d8c8ef; text-decoration: none; font-size: 13px; font-weight: 800; }
.ghost-button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: white; border-radius: 10px; padding: 9px 14px; font-weight: 800; }
.admin-main { min-height: calc(100vh - 72px); }
.login-view { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 30px 18px; background: radial-gradient(circle at 70% 15%, #e8ddff 0, transparent 34%), #f6f3fb; }
.login-card { width: min(470px, 100%); background: white; border-radius: 28px; padding: 42px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.login-card h1 { margin: 0; font-size: clamp(34px, 7vw, 48px); line-height: 1.05; letter-spacing: -2px; max-width: 390px; }
.login-card > p { color: var(--muted); line-height: 1.55; margin: 17px 0 27px; }
.login-card form { display: grid; gap: 17px; }
.login-card label, .field { display: grid; gap: 7px; color: #3e3451; font-size: 13px; font-weight: 850; }
input, textarea, select { width: 100%; border: 2px solid #e5e0ed; background: #fbfaff; border-radius: 11px; padding: 12px 13px; color: var(--ink); outline: none; transition: border .2s, box-shadow .2s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--purple-bright); box-shadow: 0 0 0 4px rgba(108,49,206,.1); }
.login-card small { display: block; color: var(--muted); margin-top: 20px; text-align: center; }
.login-art { position: absolute; right: 30px; top: 30px; display: flex; gap: 4px; transform: rotate(7deg); opacity: .13; }
.login-art span { font-size: 35px; font-weight: 950; }
.admin-primary, .secondary-button, .back-button { border: 0; border-radius: 11px; padding: 12px 17px; font-weight: 900; }
.admin-primary { color: white; background: var(--purple); box-shadow: 0 4px 0 var(--purple-deep); }
.admin-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.admin-primary:active { transform: translateY(3px); box-shadow: none; }
.admin-primary:disabled { opacity: .55; cursor: wait; }
.wide { width: 100%; }
.form-error { color: #b42318 !important; font-size: 13px; font-weight: 750; min-height: 0; margin: 0 !important; }
.form-error:empty { display: none; }

.dashboard-view { display: grid; grid-template-columns: 244px 1fr; min-height: calc(100vh - 72px); }
.admin-sidebar { background: #251143; color: white; padding: 35px 18px 24px; display: flex; flex-direction: column; justify-content: space-between; }
.sidebar-label { display: block; color: #8f76b6; font-size: 11px; text-transform: uppercase; font-weight: 900; letter-spacing: 1.3px; margin: 0 12px 12px; }
.nav-button { width: 100%; display: flex; gap: 12px; align-items: center; border: 0; background: transparent; color: #c9b8df; padding: 12px 13px; border-radius: 10px; font-weight: 800; text-align: left; margin-bottom: 5px; }
.nav-button span { font-size: 19px; width: 23px; text-align: center; }
.nav-button.active, .nav-button:hover { background: rgba(255,255,255,.1); color: white; }
.sidebar-tip { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); padding: 16px; border-radius: 14px; }
.sidebar-tip strong { color: #ffcf32; font-size: 12px; }
.sidebar-tip p { color: #b8a6ce; font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.admin-content { min-width: 0; }
.admin-panel { max-width: 1180px; padding: clamp(32px, 5vw, 64px); margin: 0 auto; }
.admin-title-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 35px; }
.admin-title-row .eyebrow { margin-bottom: 7px; }
.admin-title-row h1 { font-size: clamp(36px, 6vw, 58px); letter-spacing: -2.5px; margin: 0; }
.admin-title-row p { color: var(--muted); margin: 8px 0 0; }
.admin-quiz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-loading, .admin-empty { grid-column: 1 / -1; text-align: center; background: white; border-radius: 17px; padding: 45px; color: var(--muted); }
.admin-quiz-card { background: white; border: 1px solid #e9e4f0; border-radius: 18px; padding: 21px; display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; box-shadow: 0 7px 22px rgba(42, 24, 76, .06); }
.admin-card-color { width: 56px; height: 56px; border-radius: 15px; background: var(--purple-bright); display: grid; place-items: center; color: white; font-weight: 950; }
.admin-card-color.blue { background: var(--blue); }.admin-card-color.pink { background: var(--pink); }.admin-card-color.orange { background: var(--orange); }.admin-card-color.green { background: var(--green); }
.admin-card-copy { min-width: 0; }
.admin-card-copy h3 { margin: 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-card-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 5px; }
.status-dot.draft { background: #9b93a8; }
.card-menu { display: flex; gap: 7px; }
.edit-button, .delete-button { border: 1px solid #ded7e8; background: #faf9fc; border-radius: 9px; padding: 9px 11px; font-weight: 800; color: var(--ink); }
.delete-button { color: #b42318; }

.editor-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 27px; }
.back-button { background: transparent; color: var(--purple); padding-left: 0; }
.editor-actions { display: flex; align-items: center; gap: 20px; }
.publish-toggle { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 850; cursor: pointer; }
.publish-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.publish-toggle span { width: 42px; height: 23px; background: #aaa2b5; border-radius: 99px; position: relative; transition: background .2s; }
.publish-toggle span::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; background: white; border-radius: 50%; transition: transform .2s; }
.publish-toggle input:checked + span { background: var(--green); }
.publish-toggle input:checked + span::after { transform: translateX(19px); }
.editor-block { background: white; border: 1px solid #e8e2ef; border-radius: 18px; padding: 24px; box-shadow: 0 6px 18px rgba(42,24,76,.05); }
.intro-block { display: flex; flex-wrap: wrap; gap: 19px; }
.field.grow { flex: 1 1 400px; }.field.full { flex: 1 0 100%; }.intro-block > .field:not(.grow):not(.full) { flex: 0 1 190px; }
.question-list-heading { display: flex; justify-content: space-between; align-items: end; margin: 38px 3px 17px; }
.question-list-heading h2 { margin: 0 0 4px; font-size: 29px; }.question-list-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.secondary-button { color: var(--purple); background: #eae0fb; }
.question-list { display: grid; gap: 18px; }
.question-card { background: white; border: 1px solid #e5deed; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(42,24,76,.05); }
.question-card-header { padding: 17px 21px; background: #faf8fd; border-bottom: 1px solid #ebe6f1; display: flex; justify-content: space-between; align-items: center; }
.question-number { font-weight: 950; color: var(--purple); }
.remove-question { border: 0; background: transparent; color: #b42318; font-size: 13px; font-weight: 800; }
.question-card-body { padding: 22px; }
.answers-label { display: flex; justify-content: space-between; margin: 21px 0 9px; font-size: 12px; font-weight: 900; color: #554b66; text-transform: uppercase; letter-spacing: .7px; }
.answers-list { display: grid; gap: 9px; }
.answer-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; }
.answer-row input[type="radio"] { appearance: none; width: 21px; height: 21px; padding: 0; border-radius: 50%; border: 2px solid #b9afc7; display: grid; place-items: center; cursor: pointer; }
.answer-row input[type="radio"]::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--green); transform: scale(0); transition: transform .15s; }
.answer-row input[type="radio"]:checked { border-color: var(--green); }
.answer-row input[type="radio"]:checked::after { transform: scale(1); }
.remove-answer { width: 34px; height: 34px; border: 0; background: #f5f2f8; border-radius: 8px; color: #9e3150; font-weight: 900; }
.add-answer { border: 0; background: transparent; color: var(--purple); font-size: 13px; font-weight: 850; padding: 12px 0 0 38px; }
.save-bottom { display: block; margin: 25px 0 0 auto; }

.settings-card { max-width: 720px; background: white; border-radius: 20px; padding: 30px; border: 1px solid #e7e1ee; box-shadow: 0 8px 25px rgba(42,24,76,.06); }
.settings-icon { width: 48px; height: 48px; display: grid; place-items: center; color: white; background: var(--purple); border-radius: 14px; margin-bottom: 22px; }
.settings-divider { height: 1px; background: #ece7f1; margin: 28px 0; }
.settings-card h2 { margin: 0 0 5px; }.settings-card > p { color: var(--muted); margin: 0 0 18px; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.field small { color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .dashboard-view { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 10px 15px; flex-direction: row; position: sticky; top: 72px; z-index: 10; }
  .admin-sidebar > div:first-child { display: flex; gap: 5px; }
  .sidebar-label, .sidebar-tip { display: none; }
  .nav-button { margin: 0; width: auto; }
  .admin-panel { padding: 32px 22px; }
}
@media (max-width: 650px) {
  .view-site { display: none; }
  .login-card { padding: 31px 24px; }
  .admin-title-row { align-items: start; flex-direction: column; gap: 18px; }
  .admin-title-row .admin-primary { width: 100%; }
  .admin-quiz-grid { grid-template-columns: 1fr; }
  .admin-quiz-card { grid-template-columns: 48px 1fr; }.admin-card-color { width: 48px; height: 48px; }.card-menu { grid-column: 1 / -1; }.card-menu button { flex: 1; }
  .editor-header { align-items: start; flex-direction: column; gap: 15px; }.editor-actions { width: 100%; justify-content: space-between; }
  .question-list-heading { align-items: start; gap: 16px; }.question-list-heading p { display: none; }
  .settings-fields { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 24px 1fr 32px; gap: 7px; }
}
