/* =====================================================================
   Question Bank — app styles layered on the Admiro (EduNova) theme.
   Theme tokens used: --theme-default (#308e87), --theme-secondary (#f39159)
   ===================================================================== */

@font-face {
  font-family: 'Kalpurush';
  src: url('../../fonts/Kalpurush.ttf') format('truetype');
  font-display: swap;
}

:root {
  --qb-primary: var(--theme-default, #308e87);
  --qb-primary-dark: #236b65;
  --qb-primary-soft: rgba(48, 142, 135, .09);
  --qb-accent: var(--theme-secondary, #f39159);
  --qb-border: #e6ecec;
  --qb-muted: #7a8a89;
  --qb-radius: 12px;
  --qb-bn: 'Kalpurush', 'Hind Siliguri', 'Nunito Sans', sans-serif;
}

.bn, .q-content, .paper-sheet { font-family: var(--qb-bn); }

/* ---------- Page header (matches EduNova content-header-section) ---------- */
.qb-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }
.qb-page-head h3 { margin: 0; font-weight: 700; }
.qb-page-head .breadcrumb { margin: 4px 0 0; background: none; padding: 0; font-size: 13px; }
.qb-page-head .qb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-save-gradient, .btn-back-gradient, .btn-reset-gradient, .btn-cancel-gradient { white-space: nowrap; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }

/* ---------- Cards / stat tiles ---------- */
.qb-stat { border: none; border-radius: 16px; overflow: hidden; position: relative; }
.qb-stat .card-body { display: flex; align-items: center; gap: 14px; padding: 20px; }
.qb-stat .qb-stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.qb-stat .qb-stat-val { font-size: 26px; font-weight: 800; line-height: 1.1; }
.qb-stat .qb-stat-lbl { color: var(--qb-muted); font-size: 13px; font-weight: 600; }
.qb-stat.t-teal   .qb-stat-icon { background: rgba(48,142,135,.12); color: #308e87; }
.qb-stat.t-orange .qb-stat-icon { background: rgba(243,145,89,.14); color: #e2763a; }
.qb-stat.t-blue   .qb-stat-icon { background: rgba(64,118,232,.12); color: #4076e8; }
.qb-stat.t-purple .qb-stat-icon { background: rgba(140,90,220,.12); color: #8c5adc; }
.qb-stat.t-red    .qb-stat-icon { background: rgba(232,80,80,.12);  color: #d94848; }
.qb-stat::after { content: ''; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .04; }

.card .card-header.qb-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--qb-border); background: transparent; }
.card .card-header.qb-card-head h5 { margin: 0; font-weight: 700; font-size: 16px; }

/* ---------- Toolbars & filters ---------- */
.qb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.qb-toolbar .form-control, .qb-toolbar .form-select { width: auto; min-width: 150px; height: 38px; font-size: 13.5px; }
.qb-toolbar .qb-search { min-width: 220px; }
.qb-toolbar .qb-spacer { flex: 1; }

/* ---------- Tables ---------- */
.qb-table-wrap { overflow-x: auto; }
.content-table td, .content-table th { vertical-align: middle; }
.content-table .qb-num { width: 56px; text-align: center; color: var(--qb-muted); }
.qb-empty { text-align: center; padding: 38px 10px; color: var(--qb-muted); }
.qb-empty i { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
.qb-sort-input { width: 64px; height: 30px; padding: 2px 6px; text-align: center; font-size: 13px; }
.qb-row-actions { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.qb-icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--qb-border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: #4b5b5a; cursor: pointer; transition: all .15s; padding: 0; }
.qb-icon-btn:hover { background: var(--qb-primary); color: #fff; border-color: var(--qb-primary); }
.qb-icon-btn.danger:hover { background: #e05252; border-color: #e05252; }
.qb-icon-btn[disabled] { opacity: .4; pointer-events: none; }

/* status pill toggle */
.qb-switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.qb-switch input { opacity: 0; width: 0; height: 0; }
.qb-switch span { position: absolute; inset: 0; cursor: pointer; background: #cfd8d8; border-radius: 22px; transition: .2s; }
.qb-switch span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.qb-switch input:checked + span { background: var(--qb-primary); }
.qb-switch input:checked + span::before { transform: translateX(18px); }
.qb-switch input:disabled + span { cursor: not-allowed; opacity: .6; }

/* pagination */
.qb-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--qb-muted); }
.qb-pager .pagination { margin: 0; }
.qb-pager .page-link { color: var(--qb-primary); border-radius: 8px !important; margin: 0 2px; border-color: var(--qb-border); min-width: 34px; text-align: center; }
.qb-pager .page-item.active .page-link { background: var(--qb-primary); border-color: var(--qb-primary); color: #fff; }

/* ---------- Badges ---------- */
.qb-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.qb-badge.creative { background: #e7f0ff; color: #2f62d6; }
.qb-badge.mcq      { background: #e3f5f3; color: #1f7a73; }
.qb-badge.short    { background: #fff1e6; color: #c7642a; }
.qb-badge.model    { background: #f1e9ff; color: #7a46d0; }
.qb-badge.ok       { background: #e3f5ea; color: #1d8a4b; }
.qb-badge.warn     { background: #fff6dd; color: #a87700; }
.qb-badge.bad      { background: #fde8e8; color: #c43c3c; }
.qb-badge.muted    { background: #eef1f1; color: #687877; }
.qb-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f2f5f5; color: #566665; font-size: 11.5px; margin: 2px 3px 2px 0; }

/* ---------- Forms ---------- */
.qb-form-section { border: 1px solid var(--qb-border); border-radius: var(--qb-radius); padding: 18px; margin-bottom: 16px; background: #fff; }
.qb-form-section > h6 { font-weight: 700; margin-bottom: 14px; color: var(--qb-primary-dark); display: flex; align-items: center; gap: 8px; }
.form-label .req { color: #e05252; }
.qb-help { font-size: 12px; color: var(--qb-muted); margin-top: 4px; }

/* multi-check dropdown (boards / years) */
.qb-ms { position: relative; }
.qb-ms-toggle { text-align: left; display: flex; justify-content: space-between; align-items: center; cursor: pointer; overflow: hidden; white-space: nowrap; }
.qb-ms-toggle span:first-child { overflow: hidden; text-overflow: ellipsis; }
.qb-ms-panel { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--qb-border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; padding: 6px; }
.qb-ms.open .qb-ms-panel { display: block; }
.qb-ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; margin: 0; }
.qb-ms-item:hover { background: var(--qb-primary-soft); }
.qb-ms-item.all { border-bottom: 1px dashed var(--qb-border); font-weight: 700; }

/* question type picker */
.qb-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.qb-type-card { border: 1.5px solid var(--qb-border); border-radius: 12px; padding: 12px; cursor: pointer; transition: all .15s; background: #fff; display: flex; gap: 10px; align-items: center; }
.qb-type-card:hover { border-color: var(--qb-primary); }
.qb-type-card.active { border-color: var(--qb-primary); background: var(--qb-primary-soft); box-shadow: 0 0 0 3px rgba(48,142,135,.12); }
.qb-type-card .ico { width: 36px; height: 36px; border-radius: 10px; background: #f2f6f6; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--qb-primary); font-size: 14px; flex-shrink: 0; }
.qb-type-card.active .ico { background: var(--qb-primary); color: #fff; }
.qb-type-card b { display: block; font-size: 13.5px; }
.qb-type-card small { color: var(--qb-muted); font-size: 11.5px; }

/* editor field */
.qb-field { margin-bottom: 14px; }
.qb-field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; gap: 8px; }
.qb-field-head .form-label { margin: 0; font-weight: 700; }
.qb-rte-toggle { font-size: 11.5px; color: var(--qb-muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; margin: 0; }
.qb-rte-toggle input { accent-color: var(--qb-primary); }
textarea.qb-rte { min-height: 80px; font-family: var(--qb-bn); font-size: 15px; resize: vertical; }
textarea.qb-rte.tall { min-height: 120px; }
.qb-optional-toggle { font-size: 12px; padding: 2px 10px; border-radius: 6px; border: 1px dashed var(--qb-primary); background: transparent; color: var(--qb-primary); margin-right: 6px; margin-bottom: 8px; }
.qb-optional-toggle.on { border-style: solid; background: var(--qb-primary-soft); }
.qb-part { border-left: 3px solid var(--qb-primary); padding: 4px 0 2px 14px; margin-bottom: 18px; }
.qb-part-title { font-weight: 800; color: var(--qb-primary-dark); margin-bottom: 8px; }
.qb-part-title small { color: var(--qb-muted); font-weight: 600; }

/* choice rows with answer picker */
.qb-choice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.qb-choice-lbl { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--qb-border); display: flex; align-items: center; justify-content: center; font-weight: 800; cursor: pointer; flex-shrink: 0; transition: all .15s; font-family: var(--qb-bn); background: #fff; }
.qb-choice-lbl:hover { border-color: var(--qb-primary); }
.qb-choice-lbl.correct { background: #1d8a4b; border-color: #1d8a4b; color: #fff; }
.qb-choice .qb-field { flex: 1; margin-bottom: 0; }
.qb-answer-hint { font-size: 12px; color: var(--qb-muted); margin-bottom: 8px; }

/* recently added list */
.qb-added-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--qb-border); }
.qb-added-row:last-child { border-bottom: none; }
.qb-added-row .body { flex: 1; min-width: 0; font-size: 13.5px; }
.qb-added-row .meta { font-size: 11.5px; color: var(--qb-muted); margin-top: 3px; }

/* ---------- Question rendering (previews, admin list) ---------- */
.q-content { font-size: 15px; line-height: 1.65; color: #1f2928; }
.q-content p { margin: 0 0 4px; }
.q-content img { max-width: 100%; height: auto; }
.q-content table { border-collapse: collapse; margin: 6px 0; }
.q-content table td, .q-content table th { border: 1px solid #bbb; padding: 4px 8px; }
.q-content .pfv-parts { margin-top: 6px; padding-left: 14px; }
.q-content .pfv-part { margin: 3px 0; }
.q-content .pfv-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 18px; margin-top: 6px; padding-left: 14px; }
.q-content .pfv-choices .is-ans { color: #1d8a4b; font-weight: 700; }
.q-content .pfv-block { border-left: 2px solid var(--qb-border); padding-left: 10px; margin-top: 8px; }
.q-content .pfv-block-label { font-size: 12px; font-weight: 700; color: var(--qb-muted); text-transform: uppercase; letter-spacing: .4px; }
.q-content .pfv-ans { background: #f0fbf5; border-left: 3px solid #1d8a4b; padding: 4px 10px; margin: 4px 0 6px 14px; font-size: .92em; }
.q-content .pfv-ans em { font-style: normal; font-weight: 700; color: #1d8a4b; margin-right: 4px; }
.latex-inline { vertical-align: middle; white-space: nowrap; }
.latex-block { display: block; text-align: center; margin: 6px 0; }
.katex { font-size: 1.05em; }
.qb-q-preview-cell { max-width: 520px; }
.qb-q-preview-cell .q-content { font-size: 14px; }

/* ---------- Teacher: subject cards ---------- */
.qb-subject-card { border-radius: 14px; border: 1px solid var(--qb-border); background: #fff; padding: 16px; height: 100%; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.qb-subject-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.07); transform: translateY(-2px); }
.qb-subject-card .ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.qb-subject-card h6 { margin: 0; font-weight: 700; }
.qb-subject-card .meta { font-size: 12px; color: var(--qb-muted); }
.qb-subject-card .counts { display: flex; gap: 6px; flex-wrap: wrap; }
.qb-subject-card .foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qb-subject-card.selected { border-color: var(--qb-primary); box-shadow: 0 0 0 3px rgba(48,142,135,.15); }

.qb-select-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1040; background: #1f2d2c; color: #fff; border-radius: 14px; padding: 10px 12px 10px 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.qb-select-bar b { color: #ffd3b8; }

/* ---------- Generator (3-pane) ---------- */
.gen-shell { --gen-left-w: 300px; --gen-right-w: 290px; display: grid; grid-template-columns: var(--gen-left-w) 6px minmax(0, 1fr) 6px var(--gen-right-w); gap: 0; align-items: start; margin-top: 14px; }
.gen-rail { background: #fff; border: 1px solid var(--qb-border); border-radius: var(--qb-radius); padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; font-size: 13px; }
.gen-rail.disabled { opacity: .55; }
.gen-rail.disabled::before { content: 'Turn Edit ON to change design options'; display: block; background: #fff6dd; color: #8a6400; font-size: 12px; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; }
.gen-resize { cursor: col-resize; align-self: stretch; border-radius: 4px; margin: 0 1px; transition: background .15s; }
.gen-resize:hover, .gen-resize.dragging { background: var(--qb-primary); opacity: .4; }
.gen-center { min-width: 0; padding: 0 10px; }
.gen-sec-title { font-size: 11.5px; font-weight: 800; color: var(--qb-primary-dark); text-transform: uppercase; letter-spacing: .4px; margin: 14px 0 8px; }
.gen-sec-title:first-child { margin-top: 0; }
.gen-rail .form-label { font-size: 12px; font-weight: 700; margin: 8px 0 3px; color: #4b5b5a; }
.gen-rail .form-control, .gen-rail .form-select { font-size: 13px; padding: 5px 9px; height: 34px; }
.gen-acc { border: 1px solid var(--qb-border); border-radius: 10px; margin-top: 10px; }
.gen-acc > summary { cursor: pointer; padding: 9px 12px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; color: #2b3a39; }
.gen-acc > summary::after { content: '▾'; color: var(--qb-muted); }
.gen-acc[open] > summary::after { content: '▴'; }
.gen-acc > summary::-webkit-details-marker { display: none; }
.gen-acc-body { padding: 0 12px 12px; }
.gen-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.gen-pill { border: 1px solid var(--qb-border); background: #fff; border-radius: 20px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer; color: #4b5b5a; font-family: var(--qb-bn); }
.gen-pill.active { background: var(--qb-primary); border-color: var(--qb-primary); color: #fff; }
.gen-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.gen-count { background: #f6f9f9; border-radius: 10px; padding: 8px 10px; }
.gen-count b { display: block; font-size: 18px; color: var(--qb-primary-dark); }
.gen-count span { font-size: 11px; color: var(--qb-muted); font-weight: 700; }
.gen-toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; margin: 0; cursor: pointer; font-size: 13px; }
.gen-toggle input { accent-color: var(--qb-primary); width: 16px; height: 16px; }
.num-stepper { display: flex; align-items: stretch; border: 1px solid #dfe5e5; border-radius: 8px; overflow: hidden; }
.num-stepper button { border: none; background: #f2f6f6; width: 30px; font-weight: 800; color: #4b5b5a; }
.num-stepper button:hover { background: var(--qb-primary); color: #fff; }
.num-stepper input { border: none; width: 100%; min-width: 0; text-align: center; font-size: 13px; padding: 4px; outline: none; }
.gen-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.gen-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.gen-mode { display: inline-flex; background: #eef3f3; border-radius: 10px; padding: 3px; }
.gen-mode button { border: none; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: #4b5b5a; }
.gen-mode button.active { background: #fff; color: var(--qb-primary-dark); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* picker list */
.pick-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; background: #fff; border: 1px solid var(--qb-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.pick-list { background: #fff; border: 1px solid var(--qb-border); border-radius: 12px; padding: 6px 10px; min-height: 300px; }
.pick-ch-head { font-weight: 800; color: var(--qb-primary-dark); padding: 10px 4px 4px; border-bottom: 1px dashed var(--qb-border); font-size: 13.5px; }
.pick-sch-head { font-weight: 700; color: var(--qb-muted); padding: 6px 4px 2px 14px; font-size: 12.5px; }
.pick-row { display: flex; gap: 10px; padding: 9px 6px; border-radius: 10px; cursor: pointer; transition: background .12s; border: 1.5px solid transparent; }
.pick-row:hover { background: #f6faf9; }
.pick-row.checked { background: var(--qb-primary-soft); border-color: rgba(48,142,135,.35); }
.pick-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #c6d2d1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-size: 13px; font-weight: 800; margin-top: 2px; }
.pick-row.checked .pick-check { background: var(--qb-primary); border-color: var(--qb-primary); }
.pick-body { flex: 1; min-width: 0; font-family: var(--qb-bn); font-size: 14.5px; }
.pick-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.pick-expand { border: none; background: none; color: var(--qb-primary); font-size: 12px; font-weight: 700; padding: 0; }
.pick-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; max-width: 150px; }
.pick-full { margin-top: 6px; padding: 8px 10px; background: #fff; border: 1px solid var(--qb-border); border-radius: 8px; }

/* paper sheet (screen) */
.paper-wrap { overflow-x: auto; padding-bottom: 20px; }
.paper-sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; border: 1px solid #dfe5e5; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.08); position: relative; overflow: hidden; color: #111; line-height: 1.55; }
.paper-sheet.landscape { width: 297mm; min-height: 210mm; }
.paper-sheet.size-Legal { min-height: 356mm; width: 216mm; }
.paper-sheet.size-Letter { min-height: 279mm; width: 216mm; }
.paper-sheet .watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; color: rgba(0,0,0,.05); transform: rotate(-30deg); pointer-events: none; user-select: none; z-index: 0; }
.paper-empty { text-align: center; padding: 120px 20px; color: var(--qb-muted); font-family: 'Nunito Sans', sans-serif; }
.paper-empty i { font-size: 46px; display: block; margin-bottom: 10px; opacity: .4; }
.paper-header-wrap { position: relative; }
.paper-header { text-align: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid #333; }
.paper-header h1 { font-weight: 800; line-height: 1.2; margin: 0; font-family: var(--qb-bn); }
.paper-header h2 { font-weight: 700; margin: 4px 0 0; color: #333; font-family: var(--qb-bn); }
.paper-header .addr { color: #444; margin-top: 2px; }
.paper-metabox { position: absolute; top: 0; right: 0; font-size: .82rem; line-height: 1.35; min-width: 120px; text-align: right; }
.paper-subj-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: .95rem; }
.paper-subj-row .psr-marks, .paper-subj-row .psr-duration { white-space: nowrap; font-size: .85rem; }
.paper-subj-row .psr-subj { flex: 1; text-align: center; }
.paper-section { font-weight: 700; text-align: center; padding: 5px 12px; margin: 14px 0 8px; border-radius: 3px; }
.paper-instructions { font-size: .88em; padding: 6px 10px; background: #fffae5; border-left: 3px solid #d4a017; margin-bottom: 12px; }
.paper-student { display: flex; gap: 24px; margin-bottom: 12px; font-size: .9em; flex-wrap: wrap; }
.paper-chapters { text-align: center; font-size: .88em; color: #444; margin: -4px 0 10px; }
.paper-cols { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.paper-cols.cols-1 { grid-template-columns: 1fr; }
.paper-cols.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.q-card { padding: 2px 4px; border: 1.5px dashed transparent; border-radius: 4px; break-inside: avoid; position: relative; }
.paper-sheet.editing .q-card { cursor: grab; }
.paper-sheet.editing .q-card:hover { border-color: rgba(48,142,135,.5); background: rgba(48,142,135,.03); }
.q-card.dragging { opacity: .4; }
.q-card.drag-over { border-color: var(--qb-primary); background: var(--qb-primary-soft); }
.q-num { font-weight: 800; margin-right: 6px; }
.q-stem { display: block; }
.q-stem p, .cq-part p, .mcq-choices p, .q-sub p { display: inline; margin: 0; }
.q-stem .katex-display { display: inline-block; margin: 2px 0; }
.cq-part { display: flex; gap: 6px; }
.cq-part > span:nth-child(2) { flex: 1; }
.mcq-choices { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; padding-left: 18px; }
.mcq-choices .is-ans { font-weight: 800; color: #0f6b4a; }
.mark-badge { display: inline-block; padding: 0 4px; font-weight: 800; font-size: .85em; min-width: 20px; text-align: center; }
.q-stem .mark-badge { float: right; }
.ans-block { background: #f0fdf4; border-left: 3px solid #16a085; padding: 3px 8px; margin: 3px 0; font-size: .88em; color: #065f46; }
.ans-block em { color: #117a64; font-style: normal; font-weight: 700; margin-right: 4px; }
.q-heading-label { font-weight: 700; font-size: .92em; margin-bottom: 3px; min-height: 1.2em; }
.paper-sheet.editing .q-heading-label:empty::before { content: 'প্রশ্নের শিরোনাম (ঐচ্ছিক)…'; color: #aaa; font-weight: 400; font-style: italic; }
.q-actions { position: absolute; right: 2px; top: 2px; display: none; gap: 4px; z-index: 2; }
.paper-sheet.editing .q-card:hover .q-actions { display: inline-flex; }
.q-actions button { border: 1px solid #ccd6d5; background: #fff; border-radius: 6px; width: 24px; height: 24px; font-size: 12px; line-height: 1; padding: 0; }
.q-actions button:hover { background: var(--qb-primary); color: #fff; border-color: var(--qb-primary); }
.paper-sheet [contenteditable]:focus { outline: 1px dashed var(--qb-primary); background: #fffef4; }
.paper-sheet > *:not(.watermark) { position: relative; z-index: 1; }

/* ---------- Login / register (Admiro login-card + hero) ---------- */
.qb-hero { min-height: 100vh; background: linear-gradient(150deg, #236b65 0%, #308e87 55%, #3fa79f 100%); color: #fff; padding: 60px 64px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.qb-hero::before, .qb-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); }
.qb-hero::before { width: 420px; height: 420px; right: -120px; top: -120px; }
.qb-hero::after { width: 300px; height: 300px; left: -100px; bottom: -110px; }
.qb-hero h1 { font-size: 34px; font-weight: 800; color: #fff; margin: 26px 0 8px; }
.qb-hero p.lead { color: rgba(255,255,255,.85); font-size: 16px; max-width: 520px; }
.qb-hero-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 16px; max-width: 540px; position: relative; z-index: 1; }
.qb-hero-list li { display: flex; gap: 14px; align-items: flex-start; }
.qb-hero-list .hi { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.qb-hero-list b { display: block; font-size: 15.5px; }
.qb-hero-list span { color: rgba(255,255,255,.78); font-size: 13.5px; font-family: var(--qb-bn); }
@media (max-width: 1199px) { .qb-hero-col { display: none; } }
.login-card .login-main { width: 470px; max-width: 100%; }
.qb-auth-tabs { display: flex; background: #f1f5f5; border-radius: 10px; padding: 4px; margin: 18px 0 6px; }
.qb-auth-tabs button { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 8px; font-weight: 700; color: #5d6d6c; }
.qb-auth-tabs button.active { background: #fff; color: var(--qb-primary-dark); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.qb-auth-alert { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 12px 0 0; display: none; }
.qb-auth-alert.err { background: #fdecec; color: #b13a3a; display: block; }
.qb-auth-alert.ok { background: #e6f6ee; color: #1d7a46; display: block; }
.qb-switch-link { text-align: center; margin-top: 16px; font-size: 13.5px; }

/* ---------- Misc ---------- */
.qb-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--qb-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.qb-kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.qb-kv dt { color: var(--qb-muted); font-weight: 600; }
.qb-kv dd { margin: 0; }
.qb-perm-table th, .qb-perm-table td { text-align: center; }
.qb-perm-table td:first-child, .qb-perm-table th:first-child { text-align: left; }
.qb-perm-table .is-parent td { background: #f6f9f9; font-weight: 700; }
.qb-perm-table input { accent-color: var(--qb-primary); width: 17px; height: 17px; }
.page-body { min-height: calc(100vh - 60px); }
.qb-loading { text-align: center; padding: 50px 10px; color: var(--qb-muted); }
.swal2-container { z-index: 20000 !important; }
.modal { z-index: 1065; }
.tox-tinymce-aux { z-index: 20010 !important; }

/* sidebar: active link highlight for hash routes */
.page-sidebar .sidebar-submenu li a.qb-active { color: var(--qb-primary) !important; font-weight: 700; }
.page-sidebar .sidebar-list > a.sidebar-link.qb-active { background: var(--qb-primary-soft); }

/* ---------- Dark mode (Admiro body.dark-only) ---------- */
body.dark-only .qb-form-section, body.dark-only .gen-rail, body.dark-only .pick-head, body.dark-only .pick-list,
body.dark-only .qb-subject-card, body.dark-only .qb-type-card, body.dark-only .qb-icon-btn, body.dark-only .qb-ms-panel { background: #1d1e26; border-color: #374558; color: #e2e2e2; }
body.dark-only .q-content, body.dark-only .pick-body { color: #e2e2e2; }
body.dark-only .gen-count { background: #262932; }
body.dark-only .paper-sheet { color: #111; } /* the paper always stays white */

/* ---------- Responsive ---------- */
@media (max-width: 1300px) {
  .gen-shell { grid-template-columns: var(--gen-left-w) 6px minmax(0, 1fr); }
  .gen-shell > .gen-resize.right { display: none; }
  .gen-shell > .gen-rail.right { grid-column: 1 / -1; position: static; max-height: none; margin-top: 14px; }
}
@media (max-width: 991px) {
  .gen-shell { grid-template-columns: 1fr; }
  .gen-shell > .gen-resize { display: none; }
  .gen-rail { position: static; max-height: none; }
  .gen-center { padding: 14px 0; }
  .qb-kv { grid-template-columns: 1fr; }
}
.qb-choice textarea.qb-rte { min-height: 46px; }
.gen-toolbar .btn { white-space: nowrap; }
.gen-toolbar { row-gap: 8px; }
