/* Akinnto Works admin console — same midnight palette as the public site, system fonts for speed. */
:root {
  --bg: #070b14; --bg-2: #0b1222; --surface: #0e1628; --surface-2: #131d33;
  --line: rgba(148, 170, 214, .14); --line-strong: rgba(148, 170, 214, .28);
  --text: #f4f7fb; --muted: #9aa8c0; --dim: #6b7a95;
  --blue: #3b82f6; --cyan: #22d3ee; --grad: linear-gradient(100deg, #3b82f6, #22d3ee);
  --ok: #6ee7b7; --warn: #fcd34d; --err: #fca5a5;
  --f: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--f); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: -.02em; }
h2 { font-size: 17px; letter-spacing: -.01em; }
a { color: var(--cyan); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; white-space: nowrap; }
.row { display: flex; gap: 10px; margin-top: 12px; }

/* boot + auth */
.boot, .auth { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(700px 500px at 75% 20%, rgba(59, 130, 246, .2), transparent 60%), var(--bg); }
.boot__msg { color: var(--muted); }
.auth__card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 32px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); }
.auth__logo { filter: brightness(0) invert(1); width: 150px; height: auto; margin-bottom: 6px; }
.auth__status { color: var(--err); min-height: 1.5em; font-size: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: border-color .2s, opacity .2s, box-shadow .2s; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--primary { background: var(--grad); color: #04121f; }
.btn--primary:not([disabled]):hover { box-shadow: 0 8px 26px -8px rgba(34, 211, 238, .6); }
.btn--ghost { background: rgba(255, 255, 255, .03); border-color: var(--line-strong); }
.btn--ghost:not([disabled]):hover { border-color: var(--cyan); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--danger { color: var(--err); }
.linkbtn { background: none; border: 0; padding: 4px 6px; color: var(--cyan); cursor: pointer; font-size: 14px; }
.linkbtn:hover { text-decoration: underline; }
.icon { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; }
.icon:hover:not([disabled]) { border-color: var(--cyan); }
.icon[disabled] { opacity: .3; cursor: default; }
.icon--danger:hover { border-color: var(--err) !important; color: var(--err); }

/* pills */
.pill { display: inline-block; font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid; margin-left: 8px; white-space: nowrap; }
.pill--ok { color: var(--ok); border-color: rgba(110, 231, 183, .35); }
.pill--warn { color: var(--warn); border-color: rgba(252, 211, 77, .35); }
.pill--info { color: var(--cyan); border-color: rgba(34, 211, 238, .35); }
.pill--muted { color: var(--muted); border-color: var(--line-strong); }

/* shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100%; }
.side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side__brand img { filter: brightness(0) invert(1); width: 120px; height: auto; margin: 0 8px 4px; }
.side__label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 8px 14px; }
.side__link { text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 12px; color: var(--muted); cursor: pointer; font-weight: 500; }
.side__link:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side__link.is-on { background: rgba(59, 130, 246, .16); color: var(--text); box-shadow: inset 2px 0 0 var(--cyan); }
.side__foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.side__site { font-size: 13px; margin: 6px 0 2px; }
.side__foot .linkbtn { padding-left: 0; }
.main { padding: 24px 28px 60px; min-width: 0; }

/* top bar */
.bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.bar__info p { margin-top: 4px; max-width: 80ch; }
.bar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar__actions .pill { margin: 0 6px 0 0; }

/* section tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.is-on { color: #04121f; background: var(--grad); border-color: transparent; font-weight: 600; }

/* content editor */
.content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.content.with-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.editor { max-width: 860px; }
.editor__title { margin-bottom: 14px; }
.group { display: flex; flex-direction: column; gap: 14px; }
.sub { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; background: rgba(255, 255, 255, .015); }
.sub legend { padding: 0 6px; font-weight: 600; font-size: 14px; color: var(--cyan); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--dim); }
.field input, .field select, .field textarea, .line input, .msg textarea, .msg select, .table select, .json {
  width: 100%; background: rgba(7, 11, 20, .75); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; font-size: 14.5px;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .line input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .16); }
.check { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.check .field__hint { flex-basis: 100%; padding-left: 26px; }
.thumb { max-width: 220px; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; margin-top: 4px; }
.list { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.list > .btn { align-self: flex-start; }
.line { display: flex; gap: 8px; align-items: center; }
.line .item__controls { position: static; }
.item { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); position: relative; }
.item.is-hidden { opacity: .72; border-style: dashed; }
.item > summary { padding: 12px 130px 12px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary::before { content: "▸"; color: var(--cyan); margin-right: 8px; display: inline-block; transition: transform .2s; }
.item[open] > summary::before { transform: rotate(90deg); }
.item > .group { padding: 4px 16px 16px; }
.item__controls { position: absolute; right: 10px; top: 8px; display: flex; gap: 4px; }
.json { min-height: 60vh; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre; }
.json--read { max-height: 70vh; overflow: auto; margin: 0; }

/* preview */
.preview { position: sticky; top: 16px; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 5px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.is-on { background: rgba(59, 130, 246, .25); color: var(--text); }
.preview__stage { height: calc(100vh - 120px); display: flex; justify-content: center; background: #03060c; overflow: hidden; }
.preview__frame { border: 0; background: var(--bg); }
.preview--desktop .preview__frame { width: 1280px; height: 200%; transform: scale(.5); transform-origin: top center; flex: none; }
.preview--mobile .preview__frame { width: 390px; height: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table code { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); }
.table select { width: auto; padding: 5px 8px; }

/* cards / forms */
.card { margin-top: 22px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); max-width: 560px; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-grid .btn { align-self: flex-start; }

/* inbox */
.inbox { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.msg { border: 1px solid var(--line-strong); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.msg--new { border-color: rgba(34, 211, 238, .5); box-shadow: inset 3px 0 0 var(--cyan); }
.msg--spam, .msg--closed { opacity: .65; }
.msg__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.msg__meta { display: flex; align-items: center; gap: 8px; }
.msg__meta .pill { margin: 0; }
.msg__body { white-space: pre-wrap; margin: 12px 0; color: var(--text); }
.msg__foot { display: grid; grid-template-columns: 130px 1fr auto auto; gap: 8px; align-items: start; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(3, 6, 12, .7); display: grid; place-items: center; padding: 24px; z-index: 40; }
.modal__card { width: min(900px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 18px; }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; padding: 11px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); transform: translateY(12px); opacity: 0; transition: .3s; pointer-events: none; font-size: 14px; }
.toast.is-on { transform: none; opacity: 1; }
.toast--ok { border-color: rgba(110, 231, 183, .4); }
.toast--err { border-color: rgba(252, 165, 165, .5); color: var(--err); }

@media (max-width: 1100px) {
  .content.with-preview { grid-template-columns: 1fr; }
  .preview { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .side__label, .side__foot p { display: none; }
  .side__foot { margin: 0; padding: 0; border: 0; flex-direction: row; gap: 10px; }
  .main { padding: 18px 14px 50px; }
  .msg__foot { grid-template-columns: 1fr; }
  .item > summary { padding-right: 16px; padding-bottom: 46px; }
  .item__controls { top: auto; bottom: auto; margin-top: -40px; position: relative; right: auto; padding: 0 16px 8px; }
}

.modal__card--sm { width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px; }
.ask__text { font-size: 14px; }
.ask__input { width: 100%; background: rgba(7, 11, 20, .75); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; }
.row--end { justify-content: flex-end; }
