/* Adedokun International Schools — admin CMS styles */
:root {
  --green: #0e5a41; --green-dark: #0a4431; --green-50: #e7f0ec; --sun: #ffc83d; --paper: #f3efe6; --paper-2: #ebe5d8;
  --ink: #0c1410; --muted: #5b675f; --line: #e3ded2; --white: #fff; --danger: #b42318; --ok: #067647;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px; --shadow: 0 1px 2px rgba(12,20,16,.05), 0 6px 20px -10px rgba(12,20,16,.2);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: #f7f5f0; }
a { color: var(--green); }
img { max-width: 100%; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0; }
.h4 { font-size: 1rem; margin: 0 0 14px; }
em { font-family: "Instrument Serif", Georgia, serif; font-style: italic; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -60px; left: 12px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 999; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--green); font-weight: 700; margin: 0 0 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid transparent; background: var(--green); color: #fff; font: 600 .92rem var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--green-dark); color: #fff; }
.btn svg { width: 15px; height: 15px; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn--sun { background: var(--sun); color: var(--ink); }
.btn--sun:hover { background: #ffd466; color: var(--ink); }
.btn--danger { background: #fff; color: var(--danger); border-color: #f1c9c4; }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { min-height: 32px; padding: 4px 12px; font-size: .84rem; }
.btn--block { width: 100%; }
.btn.is-loading { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row--tight { gap: 6px; margin-top: 6px; }
.btn-row form, .w-actions form { display: inline; margin: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }

/* layout */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--green-dark); color: #fff; overflow-y: auto; padding: 18px 12px 40px; z-index: 50; transition: transform .25s; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 10px 18px; font-weight: 800; font-size: 1.15rem; }
.sidebar__brand em { color: var(--sun); font-weight: 400; }
.sidebar__brand img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.sidebar__group { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 18px 12px 6px; font-weight: 700; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; }
.sidebar a svg { width: 17px; height: 17px; opacity: .8; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.is-active { background: rgba(255,200,61,.14); color: var(--sun); }
.badge { margin-left: auto; background: var(--sun); color: var(--ink); border-radius: 999px; font-size: .72rem; padding: 1px 8px; }
.admin-main { margin-left: 250px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 10px 28px; background: rgba(247,245,240,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__session { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.topbar__session .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__right form { margin: 0; }
.topbar__user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.2; }
.topbar__user small { display: block; color: var(--muted); font-size: .76rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--sun); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.topbar__menu { display: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--green); color: #fff; cursor: pointer; }
.topbar__menu span, .topbar__menu span::before, .topbar__menu span::after { display: block; width: 18px; height: 2px; background: #fff; margin: 0 auto; position: relative; }
.topbar__menu span::before, .topbar__menu span::after { content: ""; position: absolute; left: 0; }
.topbar__menu span::before { top: -6px; } .topbar__menu span::after { top: 6px; }
.admin-content { padding: 28px; max-width: 1280px; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .admin-main { margin-left: 0; }
  .topbar__menu { display: block; }
  .topbar__session, .topbar__user span { display: none; }
  .admin-content { padding: 18px 14px; }
}

/* page head + panels */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.crumbs { margin: 0 0 4px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel--flush { padding: 0; overflow-x: auto; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.edit-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .edit-layout { grid-template-columns: 1fr 300px; } .edit-side { position: sticky; top: 76px; } }
.stack { display: grid; gap: 10px; }
.form-narrow { max-width: 620px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, #f7f5f0 30%); }
.danger-zone { margin: 8px 0 40px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; }
.tabs a:hover { border-color: var(--green); }

/* stat cards */
.stat-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.stat-card { display: flex; flex-direction: column; padding: 20px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card__n { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-card__l { font-weight: 600; margin-top: 6px; }
.stat-card small { color: var(--muted); }
.stat-card.is-hot { background: var(--green); color: #fff; border-color: var(--green); }
.stat-card.is-hot .stat-card__n { color: var(--sun); }
.stat-card.is-hot small { color: rgba(255,255,255,.7); }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.activity li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #fbfaf7; }
.table tbody tr:hover { background: #fcfbf8; }
.table tr.is-new td { background: #fffaea; }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--green); text-decoration: underline; }
.w-actions { text-align: right; white-space: nowrap; width: 1%; }
.w-handle { width: 32px; }
.handle { cursor: grab; color: var(--muted); user-select: none; letter-spacing: -2px; font-weight: 700; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; display: block; background: var(--paper); }
.thumb--empty { display: block; }
.empty-row { text-align: center; color: var(--muted); padding: 32px !important; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.pill--on, .pill--published, .pill--open, .pill--closed { background: #e7f6ee; color: var(--ok); }
.pill--new, .pill--scheduled { background: #fff1c7; color: #8a5a00; }
.pill--contacted { background: #e6effc; color: #1f4fa3; }
.pill--draft { background: #f1efe9; }
.pill--remote { background: var(--sun); color: var(--ink); position: absolute; top: 6px; left: 6px; }
tr.dragging, li.dragging { opacity: .5; }
.drop-before { box-shadow: inset 0 3px 0 var(--sun); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg a { padding: 7px 14px; text-decoration: none; color: var(--ink); font-size: .86rem; }
.seg a.is-on { background: var(--green); color: #fff; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }

/* forms */
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.fld { margin-bottom: 16px; }
.fld > label, .fld legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.fld .req { color: var(--danger); }
.help { margin: 5px 0 0; font-size: .82rem; color: var(--muted); }
.err { margin: 5px 0 0; font-size: .84rem; color: var(--danger); font-weight: 600; }
.has-error .input { border-color: var(--danger); }
.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: 400 .95rem var(--font); color: var(--ink); }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,90,65,.15); }
.input--sm { min-height: 32px; padding: 4px 8px; font-size: .84rem; }
textarea.input { resize: vertical; min-height: 90px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input[type="checkbox"] { position: absolute; opacity: 0; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: #d6d1c4; position: relative; transition: background-color .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--sun); outline-offset: 2px; }

/* image field */
.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-field__preview { width: 120px; height: 84px; border-radius: 10px; background: var(--paper) repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,.03) 8px 16px); overflow: hidden; flex: none; border: 1px solid var(--line); }
.img-field__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-field__controls { flex: 1; min-width: 0; }
.img-field__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.img-field__btns label { cursor: pointer; }

/* rich text editor */
.rte { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.rte:focus-within { border-color: var(--green); }
.rte__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #fbfaf7; position: sticky; top: 60px; z-index: 2; }
.rte__bar button { border: 0; background: transparent; padding: 6px 9px; border-radius: 8px; cursor: pointer; font: 600 .82rem var(--font); color: var(--ink); }
.rte__bar button:hover, .rte__bar button.is-on { background: var(--green-50); color: var(--green-dark); }
.rte__area { min-height: 200px; max-height: 560px; overflow-y: auto; padding: 14px 16px; outline: none; }
.rte__area:empty::before { content: "Start writing…"; color: var(--muted); }
.rte__area h2 { font-size: 1.4rem; margin: 1em 0 .4em; } .rte__area h3 { font-size: 1.15rem; margin: 1em 0 .4em; }
.rte__area blockquote { border-left: 4px solid var(--sun); margin: 1em 0; padding-left: 1em; font-style: italic; }
.rte__area img { max-width: 100%; border-radius: 8px; }
.rte__source { display: none; border: 0; border-radius: 0; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; min-height: 240px; }
.rte.is-source .rte__area { display: none; }
.rte.is-source .rte__source { display: block; }
.no-js .rte__area { display: none; } .no-js .rte__source { display: block; }

/* block list + repeater */
.block-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.block-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.block-item.is-off { opacity: .55; }
.block-item form { margin: 0; }
.block-item__type { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--green-50); color: var(--green-dark); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.block-item__label { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.block-item__label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repeater__item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fcfbf8; }
.repeater__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.repeater__head strong { margin-right: auto; }

/* media */
.dropzone { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; background: #fff; margin-bottom: 16px; }
.dropzone.is-over { border-color: var(--green); background: var(--green-50); }
.dropzone__label { flex: 1; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 240px; }
.media-admin { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.media-admin li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.media-admin li.is-confirm { outline: 3px solid var(--danger); }
.media-admin__thumb { position: relative; display: block; aspect-ratio: 4/3; background: var(--paper); }
.media-admin__thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-admin__meta { padding: 10px; display: grid; gap: 6px; }
.file-icon { display: grid; place-items: center; height: 100%; font-weight: 800; color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(12,20,16,.6); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__box { background: #fff; border-radius: 18px; width: min(1000px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin-right: auto; }
.modal__head .input { max-width: 240px; }
.modal__body { overflow-y: auto; padding: 16px; }
.media-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.media-grid button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 4/3; background: var(--paper); position: relative; }
.media-grid button:hover, .media-grid button:focus-visible { border-color: var(--green); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-admin-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.album-admin { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.album-admin img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.album-admin span { padding: 12px; display: flex; flex-direction: column; }
.photo-admin { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo-admin li { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: grab; }
.photo-admin img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-admin form { margin: 0; padding: 0 8px 8px; }
.photo-admin__caption { display: flex; gap: 6px; padding: 8px !important; }

.details { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; }
@media (max-width: 640px) { .details { grid-template-columns: 1fr; } .details dd { margin-bottom: 8px; } }

/* alerts */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert ul { margin: 6px 0 0; }
.alert--success { background: #e7f6ee; color: var(--ok); border: 1px solid #b7e4c7; }
.alert--error { background: #fdecea; color: var(--danger); border: 1px solid #f5c2bc; }
.alert--info { background: #fff6dc; color: #6b4e00; border: 1px solid #f3dd9b; }

.pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 16px 0; }
.pagination a { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; }
.pagination a.is-current { background: var(--green); color: #fff; border-color: var(--green); }

/* auth + installer */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: var(--green-dark) radial-gradient(circle at 80% 10%, rgba(255,200,61,.25), transparent 40%); padding: 20px; }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card { background: #fff; border-radius: 22px; padding: 32px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 800; margin-bottom: 24px; }
.auth-brand img { width: 52px; height: 52px; object-fit: contain; }
.auth-brand small { display: block; font-weight: 500; color: var(--muted); }
.auth-links { margin: 16px 0 0; text-align: center; font-size: .9rem; }
.auth-foot { text-align: center; color: rgba(255,255,255,.7); font-size: .85rem; }
.auth-foot a { color: var(--sun); }
.install-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; flex-wrap: wrap; }
.install-steps li { counter-increment: s; font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.install-steps li::before { content: counter(s) ". "; }
.install-steps li.is-current { background: var(--green); color: #fff; }
.check-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.check-list li { padding: 8px 12px; border-radius: 10px; background: #e7f6ee; color: var(--ok); }
.check-list li.fail { background: #fdecea; color: var(--danger); }
.check-list small { color: var(--muted); display: block; }
.auth-body .field { margin-bottom: 14px; }
.auth-body .field label { display: block; font-weight: 600; margin-bottom: 6px; }
.auth-body .field input { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--line); font: inherit; }
.auth-body .form-grid { gap: 0 14px; }
.auth-body .full { grid-column: 1 / -1; }
.auth-body .hint { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
