/*
 * AlgoAtWork Academy LMS - admin styles (course builder, lesson / quiz editors, submissions,
 * analytics, instructors, LMS settings). Built on the site tokens in site.css / platform.css.
 */

/* ---- helpers added by the foundation for admin/lms-settings.php ---- */
.lms-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.lms-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--grey-40, #9CA0A8); }
.lms-status--ok::before { background: var(--success, #2E7D4F); }
.lms-status--warn::before { background: var(--orange, #EC7D2A); }
.lms-status--bad::before { background: var(--danger, #C2402A); }
.lms-secret-state { font-size: 12px; color: var(--grey-60, #6B7079); }
.lms-test-result { margin-top: 10px; font-size: 14px; }
.lms-two-col, .lma-two-col { display: grid; gap: 18px; }
@media (min-width: 760px) { .lms-two-col, .lma-two-col { grid-template-columns: 1fr 1fr; } }

/* ---- sidebar: section labels, mobile scroller ---- */
.admin-side__label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-40); padding: 16px 12px 4px; }
@media (max-width: 900px) {
  .admin-side { flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 4px; -webkit-overflow-scrolling: touch; }
  .admin-side__title { display: none; }
  .admin-side a { flex: none; white-space: nowrap; }
  .admin-side__label { flex: none; padding: 0 2px 0 12px; border-left: 1px solid var(--border); margin-left: 8px; }
}

/* ---- shared bits ---- */
.admin-main input[type=radio], .admin-main input[type=checkbox] { width: 18px; height: 18px; padding: 0; border: 0; box-shadow: none; flex: none; accent-color: var(--orange); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.badge--soft { background: var(--orange-soft); color: var(--orange-press); }
.badge--dark { background: var(--greyblack); color: #fff; }
.badge--bone { background: var(--bone); color: var(--grey-80); border: 1px solid var(--border); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; } }
.lma-gap { margin-bottom: 14px; }
.lma-gap-top { margin-top: 14px; }
.lma-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; border-radius: 999px; background: var(--grey-10); color: var(--grey-80); }
.chip.is-active .lma-count { background: rgba(255,255,255,.22); color: #fff; }
.lma-star { color: var(--orange); }
.lma-hidden-form { display: none; }
.lma-form { max-width: 980px; display: grid; gap: 0; }
.lma-form > .admin-card + .admin-card, .lma-form > * + * { margin-top: 18px; }
.lma-empty { text-align: center; padding: 40px 22px; display: grid; gap: 6px; justify-items: center; color: var(--grey-60); }
.lma-empty svg { width: 34px; height: 34px; color: var(--grey-40); }
.lma-empty p { margin: 0; max-width: 460px; }
.admin-main select, .admin-main input[type=search] { font-family: inherit; }
.lma-inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.lma-inline-form--grow { margin-top: 0; }
.lma-inline-form--grow input[type=text], .lma-inline-form--grow input[type=email] { flex: 1 1 260px; }
.lma-inline-form select, .lma-inline-form input[type=text], .lma-inline-form input[type=email], .lma-additem select, .lma-additem input, .lma-search select, .lma-search input {
  padding: 9px 12px; font: inherit; font-size: 14px; color: var(--greyblack); background: var(--paper); border: 1px solid var(--border-2); border-radius: 10px; min-width: 0;
}
.lma-inline-form select:focus, .lma-inline-form input:focus, .lma-additem select:focus, .lma-additem input:focus, .lma-search select:focus, .lma-search input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(236,125,42,.35); }
.lma-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--greyblack); text-transform: none; letter-spacing: 0; cursor: pointer; }
.lma-check input { margin-top: 4px; accent-color: var(--orange); flex: none; }
.lma-check .field__hint { font-weight: 400; }
.field > label.lma-check { text-transform: none; letter-spacing: 0; font-size: 14px; }
.lma-checks { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lma-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bone); }
.lma-linkbtn { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--orange); cursor: pointer; border-radius: 6px; }
.lma-linkbtn:hover { text-decoration: underline; }
.lma-linkbtn.danger, .lma-pop summary.danger { color: var(--danger); }
.lma-iconbtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 15px; line-height: 1; color: var(--grey-80); background: var(--paper); border: 1px solid var(--border-2); border-radius: 8px; cursor: pointer; padding: 0; }
.lma-iconbtn:hover:not(:disabled) { border-color: var(--greyblack); color: var(--greyblack); background: var(--grey-05); }
.lma-iconbtn:disabled { opacity: .35; cursor: default; }
.lma-iconbtn--danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.lma-note { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--paper); font-size: 14px; color: var(--grey-80); }
.lma-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--grey-60); }
.lma-note--warn { background: var(--orange-soft); border-color: rgba(236,125,42,.35); }
.lma-note--warn svg { color: var(--orange-press); }
.lma-note a { text-decoration: underline; }
.lma-savebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bone) 70%, rgba(246,244,239,0)); z-index: 5; }
.lma-savebar--inline { position: static; background: none; padding: 4px 0 0; }
.lma-savebar--side { position: static; background: none; padding: 0; }
.lma-head-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lma-totals { font-size: 13.5px; color: var(--grey-60); }
.lma-totals strong { color: var(--greyblack); }
.lma-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- course sub-navigation ---- */
.lma-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-top: -8px; }
.lma-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--grey-60); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lma-tabs a:hover { color: var(--greyblack); }
.lma-tabs a.is-active { color: var(--orange-press); border-bottom-color: var(--orange); }
.lma-tabs svg { width: 16px; height: 16px; }

/* ---- courses list ---- */
.lma-filterbar { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: space-between; align-items: center; }
.lma-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lma-search input[type=search] { width: 220px; max-width: 100%; }
.lma-course-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.lma-thumb { width: 72px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; background: var(--grey-05); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--grey-40); }
.lma-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lma-thumb svg { width: 18px; height: 18px; }
.lma-title-link { font-weight: 600; color: var(--greyblack); }
.lma-title-link:hover { color: var(--orange); }
.lma-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; background: var(--orange-soft); color: var(--orange-press); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.lma-avatar img { width: 100%; height: 100%; object-fit: cover; }
table.lma-courses { min-width: 980px; }

/* ---- list editors (course settings, downloads) ---- */
.lma-list { display: grid; gap: 8px; }
.lma-list__row { display: flex; gap: 8px; align-items: flex-start; }
.lma-list__row > input[type=text], .lma-list__row > .lma-faq { flex: 1; min-width: 0; }
.lma-list__btns { display: inline-flex; gap: 4px; flex: none; }
.lma-list__row input[type=text], .lma-faq input, .lma-faq textarea, .lma-res input[type=text] {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--greyblack); background: var(--paper); border: 1px solid var(--border-2); border-radius: 10px;
}
.lma-list__row input:focus, .lma-faq textarea:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(236,125,42,.35); }
.lma-faq { display: grid; gap: 6px; }
.lma-faq textarea { min-height: 64px; resize: vertical; }
.lma-addrow { align-self: flex-start; justify-self: start; margin-top: 8px; }
.lma-res { flex-wrap: wrap; }
.lma-res > input[type=text]:first-child { flex: 1 1 160px; }
.lma-res > input[type=text]:nth-child(2) { flex: 2 1 220px; }
.lma-res > input[type=file] { flex: 1 1 100%; font-size: 12.5px; color: var(--grey-60); }

/* ---- image picker ---- */
.lma-picker { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; align-items: start; }
.lma-picker__frame { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--bone); border: 1px dashed var(--border-2); display: flex; }
.lma-picker__frame img { width: 100%; height: 100%; object-fit: cover; }
.lma-picker__frame img[hidden], .lma-picker__empty[hidden] { display: none; }
.lma-picker__empty { margin: auto; padding: 16px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--grey-60); font-size: 13px; }
.lma-picker__empty svg { width: 28px; height: 28px; color: var(--grey-40); }
.lma-picker__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lma-picker--round { grid-template-columns: 140px 1fr; }
.lma-picker--round .lma-picker__frame { aspect-ratio: 1; border-radius: 50%; }
@media (max-width: 720px) { .lma-picker { grid-template-columns: 1fr; } .lma-picker--round { grid-template-columns: 120px 1fr; } }

.lma-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(17,19,24,.62); display: flex; align-items: center; justify-content: center; padding: clamp(0px, 3vw, 28px); }
.lma-modal[hidden] { display: none; }
html.lma-modal-open { overflow: hidden; }
.lma-modal__panel { background: var(--paper); width: min(860px, 100%); max-height: 100%; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.lma-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.lma-modal__head h3 { margin: 0; font-size: 18px; }
.lma-modal__close { font-size: 28px; line-height: 1; background: none; border: 0; color: var(--grey-60); cursor: pointer; padding: 0 4px; }
.lma-modal__body { padding: 18px 20px 22px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.lma-modal__sub { margin: 6px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--grey-60); }
.lma-modal__status { margin: 0; min-height: 20px; font-size: 13.5px; color: var(--grey-80); }
.lma-modal__status.is-error { color: var(--danger); }
.lma-drop { border: 2px dashed var(--border-2); border-radius: 14px; padding: 22px 16px; display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer; background: var(--bone); font-size: 13px; color: var(--grey-60); }
.lma-drop:hover { border-color: var(--orange); background: var(--orange-soft); }
.lma-drop svg { width: 28px; height: 28px; color: var(--orange); }
.lma-drop strong { color: var(--greyblack); font-size: 14px; }
.lma-modal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.lma-modal__item { position: relative; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bone); aspect-ratio: 4/3; }
.lma-modal__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lma-modal__item span { position: absolute; left: 6px; bottom: 6px; font: 600 10.5px var(--mono); color: #fff; background: rgba(17,19,24,.6); padding: 2px 6px; border-radius: 5px; }
.lma-modal__item:hover { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(236,125,42,.35); }

/* ---- people list (course instructors) ---- */
.lma-people { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.lma-people li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bone); }
.lma-people__main { flex: 1; min-width: 0; font-size: 14px; }
.lma-people__main .field__hint { display: block; }
.lma-people .lma-linkbtn { margin-left: auto; }

/* ---- builder ---- */
.lma-module { background: var(--paper); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.lma-module + .lma-module { margin-top: 16px; }
.lma-module.is-flash, .lma-item.is-flash { animation: lmsFlash .7s ease; }
@keyframes lmsFlash { from { background: var(--orange-soft); } to { background: transparent; } }
.lma-module__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--grey-05); border-bottom: 1px solid var(--border); }
.lma-module__toggle { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--paper); border: 1px solid var(--border-2); border-radius: 8px; cursor: pointer; color: var(--grey-80); }
.lma-module__toggle[hidden] { display: none; }
.lma-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px,-2px); transition: transform .2s; }
.lma-module.is-collapsed .lma-chev { transform: rotate(-45deg); }
.lma-module.is-collapsed .lma-module__body { display: none; }
.lma-module.is-collapsed .lma-module__head { border-bottom: 0; }
.lma-module__title { flex: 1; min-width: 0; }
.lma-module__num { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.lma-module__title h3 { margin: 2px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.lma-module__sum { margin: 4px 0 0; font-size: 13px; color: var(--grey-60); }
.lma-module__meta { font-size: 12.5px; font-weight: 600; color: var(--grey-60); white-space: nowrap; }
.lma-module__actions { display: flex; gap: 6px; }
.lma-module__actions form { margin: 0; }
.lma-items { list-style: none; margin: 0; padding: 0; }
.lma-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lma-item:hover { background: #FBFAF7; }
.lma-item__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--grey-05); color: var(--grey-80); border: 1px solid var(--border); }
.lma-item__icon svg { width: 18px; height: 18px; }
.lma-item__icon--video { background: #EEF2FB; color: #3457A6; border-color: #D5DEF3; }
.lma-item__icon--quiz { background: var(--orange-soft); color: var(--orange-press); border-color: rgba(236,125,42,.3); }
.lma-item__icon--assignment { background: #F1ECF8; color: #6A43A6; border-color: #DDD2EE; }
.lma-item__icon--resource { background: #EAF4EE; color: var(--success); border-color: #CFE5D7; }
.lma-item__main { flex: 1; min-width: 0; }
.lma-item__title { font-weight: 600; font-size: 15px; color: var(--greyblack); overflow-wrap: anywhere; }
.lma-item__title:hover { color: var(--orange); }
.lma-item__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--grey-60); margin-top: 3px; }
.lma-item__meta .badge { font-size: 11px; padding: 2px 8px; }
.lma-type { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.lma-item__actions { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: flex-end; }
.lma-item__actions form { margin: 0; }
.lma-move { display: inline-flex; align-items: center; gap: 4px; }
.lma-move select { padding: 5px 8px; font: inherit; font-size: 12.5px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--paper); max-width: 150px; }
.lma-module__empty { margin: 0; padding: 14px 16px 0; }
.lma-additem { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; align-items: center; }
.lma-additem input { flex: 1 1 200px; }
.lma-module__foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 16px 14px; align-items: flex-start; }
.lma-pop summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--grey-60); list-style: none; padding: 4px 0; }
.lma-pop summary::-webkit-details-marker { display: none; }
.lma-pop summary:hover { color: var(--greyblack); }
.lma-pop[open] summary { color: var(--greyblack); }
.lma-pop__form { display: grid; gap: 10px; margin-top: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bone); width: min(420px, 100%); }
.lma-pop__form select { padding: 9px 12px; font: inherit; border: 1px solid var(--border-2); border-radius: 10px; background: var(--paper); }
@media (max-width: 720px) {
  .lma-item { flex-wrap: wrap; align-items: flex-start; }
  .lma-item__main { flex: 1 1 calc(100% - 60px); }
  .lma-item__actions { flex: 1 1 100%; justify-content: flex-start; padding-left: 48px; }
  .lma-module__head { flex-wrap: wrap; }
  .lma-module__meta { order: 3; }
}

/* ---- lesson editor ---- */
.lma-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.lma-editor-main { display: grid; gap: 18px; min-width: 0; }
.lma-editor-main > .admin-card + .admin-card, .lma-editor-main > * + * { margin-top: 0; }
.lma-editor-side { position: sticky; top: 90px; display: grid; gap: 14px; }
.lma-editor-side .admin-card + .admin-card { margin-top: 0; }
@media (max-width: 960px) { .lma-editor-layout { grid-template-columns: 1fr; } .lma-editor-side { position: static; order: -1; } }

.lma-rte { border: 1px solid var(--border-2); border-radius: 12px; background: var(--paper); overflow: hidden; }
.lma-rte:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(236,125,42,.35); }
.lma-rte__toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--grey-05); border-bottom: 1px solid var(--border); }
.lma-rte__toolbar[hidden] { display: none; }
.lma-rte__toolbar button { min-width: 34px; height: 32px; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--grey-80); background: var(--paper); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.lma-rte__toolbar button:hover { border-color: var(--greyblack); color: var(--greyblack); }
.lma-rte__toolbar button.is-on { background: var(--greyblack); color: #fff; border-color: var(--greyblack); }
.lma-rte__area { min-height: 280px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; outline: none; font-size: 15.5px; line-height: 1.7; color: var(--greyblack); }
.lma-rte__area[hidden], .lma-rte__source[hidden] { display: none; }
.lma-rte__area:empty::before { content: "Start writing\2026"; color: var(--grey-40); }
.lma-rte__area h2, .lma-prose h2 { font-size: 22px; margin: 22px 0 8px; }
.lma-rte__area h3, .lma-prose h3 { font-size: 18px; margin: 18px 0 6px; }
.lma-rte__area p, .lma-prose p { margin: 0 0 12px; color: var(--greyblack); }
.lma-rte__area ul, .lma-rte__area ol, .lma-prose ul, .lma-prose ol { margin: 0 0 12px; padding-left: 24px; }
.lma-rte__area a, .lma-prose a { color: var(--orange-press); text-decoration: underline; }
.lma-rte__area blockquote, .lma-prose blockquote { margin: 0 0 12px; padding: 4px 16px; border-left: 3px solid var(--orange); color: var(--grey-80); background: var(--bone); }
.lma-rte__area code, .lma-prose code { font-family: var(--mono); font-size: .9em; background: var(--grey-05); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); }
.lma-rte__area pre, .lma-prose pre { font-family: var(--mono); font-size: 13.5px; background: var(--ink); color: #F3F4F6; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 0 0 12px; }
.lma-rte__area img, .lma-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.lma-rte__source { display: block; width: 100%; border: 0; border-radius: 0; font-family: var(--mono) !important; font-size: 13px; line-height: 1.6; padding: 14px 16px; min-height: 280px; resize: vertical; }
.lma-rte__source:focus { box-shadow: none !important; }

.lma-videobox { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bone); }
.lma-videopane { display: grid; gap: 12px; }
.lma-videopane[hidden] { display: none; }
.lma-upload { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--border-2); border-radius: 12px; background: var(--paper); }
.lma-upload__drop { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lma-upload__drop input[type=file] { flex: 1 1 220px; font-size: 13px; min-width: 0; }
.lma-progress { height: 10px; border-radius: 999px; background: var(--grey-10); overflow: hidden; }
.lma-progress[hidden] { display: none; }
.lma-progress__fill { display: block; height: 100%; background: var(--orange); border-radius: inherit; transition: width .25s ease; }
.lma-upload__status { margin: 0; min-height: 20px; font-size: 13.5px; color: var(--grey-80); }
.lma-upload__status.is-ok { color: var(--success); font-weight: 600; }
.lma-upload__status.is-err { color: var(--danger); }
.lma-quizcard p { margin-bottom: 14px; }

/* ---- quiz editor ---- */
.lma-bank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.lma-bank-head h3 { margin: 0 0 8px; }
.lma-qlist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.lma-q { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.lma-q.is-editing { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(236,125,42,.2); }
.lma-q__main { flex: 1; min-width: 0; }
.lma-q__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lma-q__n { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--greyblack); color: #fff; font-size: 12px; font-weight: 700; }
.lma-q__prompt { margin: 8px 0 6px; font-weight: 500; color: var(--greyblack); overflow-wrap: anywhere; }
.lma-q__opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--grey-80); }
.lma-q__opts li { padding-left: 22px; position: relative; }
.lma-q__opts li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--grey-40); }
.lma-q__opts li.is-correct { color: var(--success); font-weight: 600; }
.lma-q__opts li.is-correct::before { background: var(--success); border-color: var(--success); }
.lma-q__ans { margin: 0; font-size: 13.5px; color: var(--grey-80); }
.lma-q__actions { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: flex-end; flex: none; max-width: 190px; }
.lma-q__actions form { margin: 0; }
.lma-addq { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); }
.lma-addq__label { font-size: 13px; font-weight: 600; color: var(--grey-60); }
.lma-addq .chip { padding: 6px 14px; }
.lma-qform { border-color: var(--orange); }
.lma-opts { display: grid; gap: 8px; }
.lma-opt { display: flex; align-items: center; gap: 10px; }
.lma-opt > input[type=text] { flex: 1; min-width: 0; }
.lma-opt > input[type=radio], .lma-opt > input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.lma-opt button[hidden] { display: none; }
.lma-opts .lma-opt input[type=text] { padding: 10px 12px; font: inherit; font-size: 14px; border: 1px solid var(--border-2); border-radius: 10px; }
.lma-opt input[type=text]:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 0 3px rgba(236,125,42,.35); }
@media (max-width: 720px) { .lma-q { flex-wrap: wrap; } .lma-q__actions { max-width: none; justify-content: flex-start; flex: 1 1 100%; } }
.lma-result { padding: 14px 18px; border-radius: 12px; font-size: 15px; border: 1px solid var(--border); background: var(--paper); }
.lma-result.is-pass { background: var(--success-soft); border-color: rgba(46,125,79,.35); color: var(--success); }
.lma-result.is-fail { background: var(--danger-soft); border-color: rgba(194,64,42,.3); color: var(--danger); }
.lma-preview { display: grid; gap: 14px; justify-items: start; max-width: 780px; }
.lma-preview .admin-card { width: 100%; margin: 0; border: 1px solid var(--border); }
.lma-pq { margin: 0; min-inline-size: 0; display: grid; gap: 4px; }
.lma-pq.is-right { border-color: rgba(46,125,79,.5) !important; background: #F6FBF8; }
.lma-pq.is-wrong { border-color: rgba(194,64,42,.45) !important; background: #FDF7F5; }
.lma-pq__head { display: flex; justify-content: space-between; margin: 0; }
.lma-pq__n { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.lma-pq__prompt { font-size: 16px; font-weight: 500; color: var(--greyblack); margin: 4px 0 10px; }
.lma-pq__opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; font-size: 14.5px; }
.lma-pq__opt:hover { border-color: var(--border-2); background: var(--grey-05); }
.lma-pq__opt input { margin-top: 4px; accent-color: var(--orange); }
.lma-pq .field input[type=text] { padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; font: inherit; max-width: 360px; }
.lma-pq__why { margin: 8px 0 0; font-size: 13.5px; color: var(--grey-80); }
.lma-tick { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--success); }

/* ---- submissions ---- */
.lma-two-col--wide { align-items: start; }
@media (min-width: 960px) { .lma-two-col--wide { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); } }
.lma-two-col--wide .admin-card + .admin-card { margin-top: 0; }
.lma-sub-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.lma-sub-meta > div { flex: 1; min-width: 200px; }
.lma-quote { padding: 14px 16px; border-left: 3px solid var(--orange); background: var(--bone); border-radius: 0 10px 10px 0; margin-bottom: 14px; overflow-wrap: anywhere; font-size: 15px; }
.lma-brief { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--bone); }
.lma-brief summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.lma-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.lma-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.lma-radio { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border-2); border-radius: 999px; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: pointer; background: var(--paper); color: var(--greyblack); }
.lma-radio:has(input:checked) { background: var(--greyblack); border-color: var(--greyblack); color: #fff; }
.lma-radio input { accent-color: var(--orange); }
.lma-gradeform { display: grid; gap: 14px; }

/* ---- analytics ---- */
.lma-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.lma-chart { overflow-x: auto; }
.lma-bars { width: 100%; min-width: 520px; height: auto; display: block; }
.lma-bars rect { fill: var(--orange); }
.lma-bars g:hover rect { fill: var(--orange-press); }
.lma-bars__axis { stroke: var(--grey-20); stroke-width: 1; }
.lma-bars text { font-family: var(--font); fill: var(--grey-60); }
.lma-bars__tick, .lma-bars__lbl { font-size: 10.5px; }
.lma-bars__val { font-size: 11px; font-weight: 700; fill: var(--greyblack) !important; }
.lma-funnel td { vertical-align: middle; }
.lma-funnel__bar { white-space: nowrap; min-width: 150px; }
.lma-meter { display: inline-block; width: 96px; height: 8px; border-radius: 999px; background: var(--grey-10); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.lma-meter span { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.lma-meter__pct { font-size: 12.5px; font-weight: 600; color: var(--grey-80); }
.lma-dropoff { font-weight: 600; color: var(--grey-80); }
.lma-dropoff--high { color: var(--danger); }
.lma-type-ico { width: 15px; height: 15px; vertical-align: -2px; color: var(--grey-60); }
table.lma-funnel { min-width: 640px; }

/* ---- overflow guards (phones) ---- */
.form-grid > *, .field, .lma-form > *, .lma-editor-main, .lma-editor-main > * { min-width: 0; }
.admin-main .field input:not([type=radio]):not([type=checkbox]), .admin-main .field select, .admin-main .field textarea { min-width: 0; max-width: 100%; width: 100%; }
@media (max-width: 720px) { .form-grid--2 { grid-template-columns: 1fr; } .lma-list__btns { flex-direction: column; } .lma-picker__frame { max-width: 100%; } }

/* ---- 390px polish: grid children may shrink, long unbroken titles wrap, filter forms fit ---- */
.grid > *, .stat-grid > *, .admin-main .grid--2 > * { min-width: 0; }
.admin-card, .admin-head > div { min-width: 0; max-width: 100%; }
.admin-main h1, .admin-main h2, .admin-main h3, .admin-main .lma-title-link, .admin-card strong, .admin-card td { overflow-wrap: anywhere; }
.lma-filterbar { min-width: 0; max-width: 100%; }
.lma-search { max-width: 100%; min-width: 0; }
.lma-search select { max-width: 100%; }
@media (max-width: 560px) { .lma-search { width: 100%; } .lma-search select, .lma-search input[type=search] { flex: 1 1 100%; width: 100%; } }
.table-wrap { max-width: 100%; }
/* icon library blocked / offline: show the item type as text instead of an empty icon box */
.no-lucide .lma-item__icon { width: auto; min-width: 34px; padding: 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.no-lucide .lma-item__icon::after { content: attr(data-type); }

/* enquiry conversation + tracking */
.enq-thread{display:flex; flex-direction:column; gap:12px}
.enq-msg{border:1px solid var(--border); border-left:4px solid var(--orange); border-radius:12px; padding:12px 16px; background:var(--paper)}
.enq-msg__head{display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:14px}
.enq-msg__subj{font-weight:600; margin:6px 0 4px; font-size:14px}
.enq-msg__body{font-size:14px; line-height:1.6; color:var(--grey-80)}
.enq-stats{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 18px}
.enq-stats div{background:var(--paper); border:1px solid var(--border); border-radius:14px; padding:14px 16px}
.enq-stats b{display:block; font-size:24px; line-height:1.1}
.enq-stats span{font-size:12.5px; color:var(--grey-60)}
.enq-stats .is-warn b{color:var(--danger)}
.enq-wait{font-size:12px; font-weight:600}
.enq-wait--late{color:var(--danger)}
@media (max-width:800px){ .enq-stats{grid-template-columns:repeat(2,minmax(0,1fr))} }
.imp-table td,.imp-table th{font-size:13.5px}
.imp-pill{display:inline-block; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:999px; background:var(--grey-10); color:var(--grey-80)}
.imp-pill--new{background:#E4F3EA; color:#2E7D4F}
.imp-pill--existing{background:#E6EEFB; color:#2B5CB8}
.imp-pill--already,.imp-pill--duplicate{background:var(--grey-10); color:var(--grey-60)}
.imp-pill--invalid,.imp-pill--error{background:#FBE7E4; color:#B3261E}
.imp-pill--enrolled{background:#E4F3EA; color:#2E7D4F}
.enq-msg--in{border-left-color:#2B5CB8; background:#F4F7FD}
.enq-msg__files{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}.enq-msg__files a{padding:6px 10px; border:1px solid var(--border-2); border-radius:9px; font-size:13px; font-weight:600}
.imp-pill--ok{background:#E4F3EA; color:#2E7D4F}
.imp-pill--warn{background:#FFF1E2; color:#B85810}
/* mailing */
.spam-score{display:flex; align-items:center; gap:14px; margin-bottom:12px}
.spam-score__n{font:700 34px/1 var(--font-display,inherit); color:#2E7D4F}
.spam-score__n.is-mid{color:#B85810} .spam-score__n.is-low{color:#B3261E}
.spam-list{list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:13.5px}
.spam-list li{display:flex; gap:8px; align-items:flex-start}
.spam-list li::before{content:'✓'; color:#2E7D4F; font-weight:700; width:14px; flex:none}
.spam-list li.is-warn::before{content:'!'; color:#B85810}
.spam-list li.is-bad::before{content:'✕'; color:#B3261E}
.camp-grid{display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:20px; align-items:start}
@media (max-width:1100px){ .camp-grid{grid-template-columns:1fr} }
.camp-progress{height:10px; background:var(--grey-10); border-radius:99px; overflow:hidden; margin:10px 0}
.camp-progress span{display:block; height:100%; background:var(--orange); width:0; transition:width .4s}
.camp-preview{width:100%; height:560px; border:1px solid var(--border); border-radius:12px; background:#F6F4EF}
