/* Practima quiz admin — the look of Practima Hub: Inter, grey canvas, white cards, black pills. */
:root {
  --bg: #f4f4f5; --panel: #ffffff; --side: #fafafa; --ink: #111113; --ink-2: #3f3f46; --muted: #8a8a93;
  --line: #e7e7ea; --line-2: #d9d9de; --chip: #f1f1f3; --accent: #4f6ef7; --ok: #2fb57a; --warn: #d97706;
  --bad: #dc2626; --r: 12px; --r-s: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/1.45 Inter, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 12px; background: var(--side); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; font-weight: 600; font-size: 16px; text-decoration: none; }
.brand i { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 22px; height: 22px; }
.brand i b { border-radius: 3px; background: var(--ink); }
.brand i b:nth-child(2) { background: var(--accent); }
.nav a { display: block; padding: 8px 12px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; }
.nav a:hover { background: #f0f0f2; }
.nav a.on { background: #ececef; color: var(--ink); font-weight: 500; }
.side__foot { margin-top: auto; padding: 0 8px; font-size: 12px; color: var(--muted); }
.side__foot a { color: var(--muted); }
.main { padding: 28px 40px 120px; max-width: 1180px; width: 100%; }

/* ---------- headings, tabs, buttons ---------- */
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.head .sub { color: var(--muted); font-size: 13px; }
.head .grow { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c4c4cb; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: #2a2a2e; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--bad { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; }
.icon:hover { background: var(--chip); color: var(--ink); }
.icon:disabled { opacity: .3; cursor: default; background: transparent; }
.tabs { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tabs a { padding: 6px 14px; border-radius: 7px; text-decoration: none; color: var(--ink-2); }
.tabs a.on { background: var(--ink); color: #fff; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(160px, 1.1fr) 2fr 110px 24px; align-items: center; gap: 16px; padding: 16px 18px; text-decoration: none; }
.row:hover { border-color: var(--line-2); box-shadow: 0 1px 3px rgba(17, 17, 19, .04); }
.row__name { font-weight: 600; }
.row__meta { color: var(--muted); font-size: 13px; text-align: right; }
.row__go { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--chip); font-size: 12.5px; color: var(--ink-2); }
.chip--note { background: #eef1fe; color: #3550d6; }
.chip button { border: 0; padding: 0 0 0 2px; background: none; color: var(--muted); font-size: 14px; line-height: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- editor ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.box { padding: 18px 20px; }
.box + .box { margin-top: 12px; }
.lbl { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.inp { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: #fff; outline: none; }
textarea.inp { height: auto; min-height: 38px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.inp:disabled { background: var(--chip); color: var(--muted); }
.prodbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: #fff; }
.prodbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.prodbox input { flex: 1; min-width: 160px; height: 26px; border: 0; outline: none; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.q { padding: 16px 18px 18px; }
.q + .q { margin-top: 12px; }
.q__top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.q__no { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.q__slot { font-size: 12px; color: var(--muted); }
.q__top .grow { flex: 1; }
.q__img { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 10px; align-items: center; margin-top: 10px; }
.thumb { width: 64px; height: 44px; border-radius: 6px; background: var(--chip) center / cover no-repeat; border: 1px solid var(--line); }
.ans { margin-top: 12px; display: grid; gap: 6px; }
.ans__row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.ans__l { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.ans__ctl { display: flex; }
.add { margin-top: 8px; border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 500; }
.add:disabled { color: var(--muted); cursor: default; }
.addq { width: 100%; margin-top: 12px; height: 44px; border: 1px dashed var(--line-2); border-radius: var(--r); background: transparent; color: var(--ink-2); font-weight: 500; }
.addq:hover { border-color: #b9b9c1; background: #fafafa; }

/* ---------- live preview (the quiz's own look, simplified) ---------- */
.pv { position: sticky; top: 24px; }
.pv__frame { padding: 18px; border-radius: 26px; background: #e9e9eb; }
.pv__card { padding: 18px 16px 16px; border-radius: 22px; background: #fff; }
.pv__bar { display: flex; gap: 4px; margin-bottom: 14px; }
.pv__bar i { flex: 1; height: 4px; border-radius: 4px; background: #e3e5ea; }
.pv__bar i.on { background: var(--accent); }
.pv__img { height: 120px; margin-bottom: 12px; border-radius: 14px; background: #f1f2f4 center / cover no-repeat; }
.pv__q { margin: 0 0 12px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.pv__o { display: flex; gap: 10px; align-items: center; margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: #f4f5f7; font-size: 13px; }
.pv__o b { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: #fff; font-size: 11px; color: var(--muted); }
.pv__nav { display: flex; justify-content: space-between; margin-top: 10px; }
.pv__nav button { border: 0; background: none; color: var(--muted); font-size: 13px; }
.pv__chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #eef1fe; color: #3550d6; font-size: 11px; }
.pv__h { margin: 12px 0 8px; font-size: 22px; font-weight: 600; line-height: 1.2; }
.pv__lead { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: #5b5f6b; }
.pv__btn { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; white-space: pre; }

/* ---------- save bar, notices, modal ---------- */
.bar { position: fixed; left: 220px; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 40px; background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.bar[hidden] { display: none; }
.bar .grow { flex: 1; }
.bar .inp { max-width: 340px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.note { padding: 12px 14px; border-radius: var(--r-s); font-size: 13px; }
.note + .note { margin-top: 8px; }
.note--warn { background: #fff7e6; color: #8a5300; }
.note--bad { background: #fdecec; color: #9f1d1d; }
.note--ok { background: #e9f8f1; color: #11744a; }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.toast { position: fixed; left: 50%; bottom: 84px; z-index: 40; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(17, 17, 19, .35); }
.modal__box { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px; }
.modal__box h2 { margin: 0 0 10px; font-size: 18px; }
.modal__act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.hist { display: grid; grid-template-columns: 70px 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; }
.hist__rev { font-weight: 600; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.code { padding: 14px; border-radius: var(--r-s); background: #f7f7f8; font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---------- login ---------- */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login form { display: grid; gap: 12px; margin-top: 18px; }

@media (max-width: 1000px) {
  .ed { grid-template-columns: 1fr; }
  .pv { position: static; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .nav { display: flex; }
  .side__foot { margin: 0 0 0 auto; white-space: nowrap; }
  .main { padding: 20px 16px 140px; }
  .row { grid-template-columns: 1fr auto; }
  .row .chips { grid-column: 1 / -1; }
  .row__go { display: none; }
  .bar { left: 0; flex-wrap: wrap; padding: 10px 16px; }
  .hist { grid-template-columns: 50px minmax(0, 1fr) auto; }
  .hist .when { grid-column: 2; }
}
