/* Journal admin panel */
:root {
  --a-bg: #f3f4f6; --a-surface: #fff; --a-ink: #1b2027; --a-muted: #626b77; --a-line: #dfe2e7;
  --a-side: #18202b; --a-side-ink: #c9d0da; --a-primary: #1d4f91; --a-primary-d: #153b6e; --a-primary-l: #e8eff9;
  --a-danger: #b42318; --a-danger-l: #fdecea; --a-ok: #1e7a46; --a-ok-l: #e5f4eb; --a-warn: #8a5a00; --a-warn-l: #fdf3dc;
  --a-radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--a-bg); color: var(--a-ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--a-primary); }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 1px; }
code { font-size: .88em; background: #eef0f3; padding: .1em .35em; border-radius: 3px; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; }
hr { border: 0; border-top: 1px solid var(--a-line); margin: .4rem 0; }
.muted { color: var(--a-muted); }
.hint { color: var(--a-muted); font-size: .85rem; margin: .35rem 0 0; }
.nowrap { white-space: nowrap; }
.empty { color: var(--a-muted); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.js-only { display: none !important; }
.has-js .js-only { display: inline-flex !important; }

/* Shell */
.adm { display: flex; min-height: 100vh; }
.adm-side { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--a-side); color: var(--a-side-ink); display: flex; flex-direction: column; overflow-y: auto; z-index: 50; }
.adm-brand { display: block; padding: 1.3rem 1.2rem 1rem; text-decoration: none; }
.adm-journal { display: block; color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.25; }
.adm-sub { display: block; color: #8b96a5; font-size: .8rem; margin-top: .15rem; }
.adm-publish { display: block; margin: .3rem 1rem 1rem; padding: .65rem .8rem; background: var(--a-primary); color: #fff; text-align: center; font-weight: 600; border-radius: var(--a-radius); text-decoration: none; }
.adm-publish:hover { background: #2660ad; color: #fff; }
.adm-nav { display: flex; flex-direction: column; padding: 0 .6rem; flex: 1; }
.adm-nav a { display: flex; justify-content: space-between; align-items: center; padding: .48rem .7rem; border-radius: 5px; color: var(--a-side-ink); text-decoration: none; font-size: .92rem; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a.is-active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 #6ea8fe; }
.nav-badge { font-size: .72rem; background: rgba(255,255,255,.12); padding: .05rem .45rem; border-radius: 999px; }
.adm-group { margin: 1.1rem .7rem .3rem; font-size: .75rem; color: #7d8897; font-weight: 600; }
.adm-side-foot { padding: 1rem 1.3rem 1.3rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.adm-side-foot a, .linklike { color: var(--a-side-ink); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.adm-main { margin-left: 250px; flex: 1; min-width: 0; padding: 0 2rem 3rem; }
.adm-top { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 0 1.1rem; }
.adm-top h1 { margin: 0; font-size: 1.45rem; }
.adm-menu-btn { display: none; }
.adm-overlay { display: none; }
.adm-content { max-width: 1240px; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: var(--a-radius); margin-bottom: 1rem; border: 1px solid; max-width: 1240px; overflow-wrap: anywhere; }
.flash-success { background: var(--a-ok-l); border-color: #b6dfc6; color: #134e2e; }
.flash-error { background: var(--a-danger-l); border-color: #f4c7c2; color: #7a1a12; }
.flash-info { background: var(--a-primary-l); border-color: #c5d6ef; color: #173b67; }

/* Cards and grids */
.card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: 1.2rem 1.3rem; }
.card.flush { padding: 0; }
.card.has-error { border-color: #e9a59d; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.empty-card { text-align: center; padding: 2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-2.tight { gap: .8rem; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.grid-2 + .card, .card + .card, .grid-2-1 + .card { margin-top: 1.2rem; }
.grid-2 + .vol-card { margin-top: 1.2rem; }
.vol-card + .vol-card { margin-top: 1rem; }
.stack > .card + .card, .stack > section + section { margin-top: 0; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.narrow-card { max-width: 520px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 .9rem; min-width: 0; }
.field > span, .field > label, .field > legend { font-weight: 600; font-size: .88rem; }
.field small { font-weight: 400; color: var(--a-muted); margin-left: .25rem; }
.field.narrow { max-width: 360px; }
fieldset.field { border: 0; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .55rem .65rem; font: inherit; color: var(--a-ink); background: #fff; border: 1px solid #c9ced6; border-radius: 5px;
}
input:focus, select:focus, textarea:focus { border-color: var(--a-primary); outline: 2px solid var(--a-primary-l); }
input[type=file] { font: inherit; font-size: .88rem; }
textarea { resize: vertical; }
.has-error input, .has-error select, .has-error .rte-area { border-color: var(--a-danger); }
.field-error { color: var(--a-danger); font-size: .85rem; margin: .1rem 0 0; font-weight: 500; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .92rem; margin: .2rem 0; cursor: pointer; }
.check > input { width: auto; margin: .22rem 0 0; flex-shrink: 0; }
.check.check-wrap { flex-wrap: wrap; align-items: center; }
.check.check-wrap > input { margin-top: 0; }
.check-inline { align-self: end; margin-bottom: 1.3rem; }
.tiny-input { width: 4.5rem !important; padding: .25rem .4rem !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; border: 1px solid transparent; border-radius: 5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--a-primary); color: #fff; }
.btn-primary:hover { background: var(--a-primary-d); color: #fff; }
.btn-ghost { background: #fff; border-color: #c9ced6; color: var(--a-ink); }
.btn-ghost:hover { border-color: var(--a-primary); color: var(--a-primary); }
.btn-danger { background: #fff; border-color: #eab1aa; color: var(--a-danger); }
.btn-danger:hover { background: var(--a-danger); border-color: var(--a-danger); color: #fff; }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-block { width: 100%; }
.icon-btn { background: #fff; border: 1px solid #c9ced6; border-radius: 4px; width: 28px; height: 28px; font-size: .7rem; cursor: pointer; color: var(--a-muted); }
.icon-btn:hover { border-color: var(--a-primary); color: var(--a-primary); }
.icon-btn.danger:hover { border-color: var(--a-danger); color: var(--a-danger); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.row-actions form { margin: 0; }

/* Badges */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eceef1; color: var(--a-muted); }
.badge-published { background: var(--a-ok-l); color: var(--a-ok); }
.badge-unpublished { background: var(--a-warn-l); color: var(--a-warn); }

/* Dashboard */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat { display: flex; flex-direction: column; padding: 1rem 1.2rem; background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius); text-decoration: none; color: var(--a-ink); }
a.stat:hover { border-color: var(--a-primary); }
.stat strong { font-size: 1.6rem; line-height: 1.2; }
.stat span { color: var(--a-muted); font-size: .85rem; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { padding: .65rem 0; border-top: 1px solid var(--a-line); display: flex; flex-direction: column; gap: .2rem; }
.recent-list li:first-child { border-top: 0; }
.recent-title { font-weight: 600; text-decoration: none; color: var(--a-ink); }
.recent-title:hover { color: var(--a-primary); text-decoration: underline; }
.recent-meta { font-size: .83rem; color: var(--a-muted); display: flex; gap: .6rem; align-items: center; }
.big-line { font-size: 1.15rem; font-weight: 700; margin: 0; }

/* Article form */
.article-status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; padding: .7rem 1rem; background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius); }
.mono-link { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.form-side { position: sticky; top: 1rem; }
.form-actions { display: flex; flex-direction: column; gap: .5rem; }
.authors { counter-reset: author; display: flex; flex-direction: column; gap: .8rem; margin-bottom: .9rem; }
.author-row { counter-increment: author; border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: .8rem 1rem .2rem; background: #fafbfc; }
.author-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.author-num::before { content: "Author " counter(author); font-weight: 700; font-size: .88rem; }
.row-tools { display: flex; gap: .3rem; }
.current-file { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem .7rem; background: var(--a-primary-l); border-radius: 5px; margin-bottom: .8rem; font-size: .88rem; overflow-wrap: anywhere; }
.danger-zone { margin-top: 1.6rem; padding: 1rem 1.2rem; border: 1px solid #f0c4be; background: #fff; border-radius: var(--a-radius); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.danger-zone p { margin: 0; }

/* Rich text editor */
.rte textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid #c9ced6; border-bottom: 0; border-radius: 5px 5px 0 0; background: #f6f7f9; }
.rte-bar button { min-width: 30px; height: 28px; padding: 0 .45rem; border: 1px solid transparent; border-radius: 4px; background: none; font-family: inherit; font-size: .82rem; font-weight: 500; line-height: 1; color: var(--a-ink); cursor: pointer; }
.rte-bar button:hover { background: #fff; border-color: #c9ced6; }
.rte-bar button.is-on { background: var(--a-primary-l); border-color: #b9cbe6; color: var(--a-primary); }
.rte-bar .sep { width: 1px; margin: 3px 4px; background: #d5d9df; }
.rte-area { min-height: 160px; max-height: 520px; overflow-y: auto; padding: .7rem .8rem; border: 1px solid #c9ced6; border-radius: 0 0 5px 5px; background: #fff; line-height: 1.6; }
.rte-area:focus { outline: 2px solid var(--a-primary-l); border-color: var(--a-primary); }
.rte[data-mode=title] .rte-area { min-height: 0; font-size: 1.05rem; font-weight: 600; }
.rte[data-mode=inline] .rte-area { min-height: 200px; }
.rte-area p { margin: 0 0 .7em; }
.rte-area h2 { font-size: 1.2rem; margin: .8em 0 .4em; }
.rte-area h3 { font-size: 1.05rem; margin: .8em 0 .4em; }
.rte-area img { max-width: 100%; height: auto; }
.rte-area blockquote { margin: .5em 0; padding-left: .8em; border-left: 3px solid #c9ced6; color: var(--a-muted); }
.rte.source-mode textarea { border-radius: 0 0 5px 5px; }

/* Tabs, filters, tables */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--a-line); margin-bottom: 1rem; }
.tab { white-space: nowrap; padding: .6rem 1rem; text-decoration: none; color: var(--a-muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--a-ink); }
.tab.is-active { color: var(--a-primary); border-bottom-color: var(--a-primary); }
.tab-count { font-size: .78rem; background: #eceef1; padding: .05rem .45rem; border-radius: 999px; margin-left: .25rem; color: var(--a-muted); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; margin-bottom: .8rem; }
.filter-bar .field { margin: 0; min-width: 200px; }
.filter-bar .grow { flex: 1; }
.result-line { margin: 0 0 .8rem; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8rem; color: var(--a-muted); font-weight: 600; padding: .65rem .9rem; border-bottom: 1px solid var(--a-line); background: #fafbfc; }
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--a-line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.paper-cell { min-width: 280px; }
.paper-title { display: block; font-weight: 600; color: var(--a-ink); text-decoration: none; }
.paper-title:hover { color: var(--a-primary); text-decoration: underline; }
.paper-authors { display: block; color: var(--a-muted); font-size: .83rem; margin-top: .15rem; }
.paper-flags { display: flex; gap: .3rem; margin-top: .3rem; }
.flag { font-size: .7rem; padding: 0 .4rem; border-radius: 3px; background: var(--a-warn-l); color: var(--a-warn); }
.actions-col { width: 1%; }
.pagination ul { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.pagination a, .pagination span { display: block; padding: .3rem .7rem; border: 1px solid var(--a-line); border-radius: 4px; background: #fff; text-decoration: none; }
.pagination [aria-current] { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }
.pagination .gap { border: 0; background: none; }

/* Volumes and issues */
.issue-rows { display: flex; flex-direction: column; }
.issue-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .6rem 1rem; padding: .75rem 0; border-top: 1px solid var(--a-line); }
.issue-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.issue-count { font-size: .83rem; color: var(--a-muted); }
details.inline-edit { position: relative; }
details.inline-edit > summary { list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 1rem; background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius); box-shadow: 0 14px 30px rgba(16,24,40,.14); }
.inline-form.wide { width: 380px; }
.inline-form .field { margin-bottom: .7rem; }

/* Menu builder */
.menu-rows { display: flex; flex-direction: column; }
.menu-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .65rem .2rem; border-top: 1px solid var(--a-line); }
.menu-row:first-child { border-top: 0; }
.menu-row-main { display: flex; flex-direction: column; min-width: 0; }
.menu-row-main .muted { font-size: .83rem; overflow-wrap: anywhere; }
.menu-row.is-child { padding-left: 1.8rem; border-left: 3px solid var(--a-primary-l); margin-left: .6rem; }
.menu-row.is-dropdown .menu-row-main strong::after { content: " (dropdown)"; font-weight: 400; color: var(--a-muted); font-size: .85rem; }
.menu-empty-dropdown { margin: 0 0 .4rem 2.4rem; font-size: .82rem; }

/* Theme picker */
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-top: .9rem; }
.layout-card, .scheme-card { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: .8rem; border: 2px solid var(--a-line); border-radius: 8px; cursor: pointer; background: #fff; }
.layout-card:hover, .scheme-card:hover { border-color: #9fb6d8; }
.layout-card input, .scheme-card input { position: absolute; opacity: 0; }
.layout-card:has(input:checked), .scheme-card:has(input:checked) { border-color: var(--a-primary); box-shadow: 0 0 0 3px var(--a-primary-l); }
.layout-card:has(input:focus-visible), .scheme-card:has(input:focus-visible) { outline: 3px solid #f0b429; }
.layout-name { font-weight: 700; }
.layout-desc { font-size: .82rem; color: var(--a-muted); }
.lp { position: relative; display: grid; height: 110px; gap: 4px; padding: 6px; background: #eef0f3; border-radius: 5px; }
.lp i { display: block; background: #fff; border-radius: 2px; }
.lp-classic { grid-template: 26px 9px 1fr 10px / 1fr 30%; }
.lp-classic .lp-a { grid-column: 1 / -1; background: #1f3a5f; }
.lp-classic .lp-b { grid-column: 1 / -1; background: #c8d0db; }
.lp-classic .lp-e { grid-column: 1 / -1; background: #14263f; }
.lp-rail { grid-template: 1fr 1fr 10px / 28% 1fr 26%; }
.lp-rail .lp-a { grid-row: 1 / -1; background: #14263f; }
.lp-rail .lp-b { grid-row: 1 / 3; }
.lp-rail .lp-c { grid-row: 1 / 3; border-top: 3px solid #b8862b; }
.lp-rail .lp-d { display: none; }
.lp-rail .lp-e { grid-column: 2 / -1; background: #dde1e6; }
.lp-modern { grid-template: 10px 34px 1fr 10px / 1fr 30%; background: #fff; border: 1px solid #e3e6ea; }
.lp-modern .lp-a { grid-column: 1 / -1; background: #e3e6ea; }
.lp-modern .lp-b { grid-column: 1 / -1; background: #3b3b8f; border-radius: 4px; }
.lp-modern .lp-c { background: #f1f2f4; border-radius: 4px; }
.lp-modern .lp-d { background: #f1f2f4; border-radius: 4px; }
.lp-modern .lp-e { grid-column: 1 / -1; background: #28286a; }
.lp-editorial { grid-template: 24px 7px 1fr 8px / 28% 1fr; background: #fff; border: 1px solid #e3e6ea; }
.lp-editorial .lp-a { grid-column: 1 / -1; background: none; border-bottom: 3px double #7a1e2c; position: relative; }
.lp-editorial .lp-a::after { content: ""; position: absolute; left: 30%; right: 30%; top: 7px; height: 7px; background: #55131e; }
.lp-editorial .lp-b { grid-column: 1 / -1; background: none; border-bottom: 1px solid #7a1e2c; }
.lp-editorial .lp-c { background: #f4f4f4; border-right: 1px solid #ddd; }
.lp-editorial .lp-d { background: #f9f9f9; }
.lp-editorial .lp-e { grid-column: 1 / -1; background: none; border-top: 3px double #7a1e2c; }
.lp-portal { grid-template: 6px 20px 9px 1fr 10px / 30% 1fr; padding: 6px 14px; background-color: #e9f0e8; background-image: radial-gradient(rgba(0,0,0,.12) 1px, transparent 1px); background-size: 6px 6px; }
.lp-portal .lp-a { grid-column: 1 / -1; background: #1f3822; }
.lp-portal .lp-b { grid-column: 1 / -1; }
.lp-portal .lp-c { grid-column: 1 / -1; background: #2f5233; }
.lp-portal .lp-d { background: #f3f4f3; border-top: 4px solid #2f5233; }
.lp-portal .lp-e { background: #fff; }
.scheme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.scheme-card { flex-direction: row; align-items: center; gap: .7rem; padding: .6rem .8rem; font-size: .9rem; }
.swatch { display: flex; flex-shrink: 0; }
.swatch i { width: 22px; height: 30px; display: block; }
.swatch i:first-child { border-radius: 4px 0 0 4px; width: 30px; }
.swatch i:last-child { border-radius: 0 4px 4px 0; }

/* Sidebar, media, misc */
.switch-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.widget-card.is-hidden { opacity: .7; }
.widget-preview { max-height: 220px; overflow: auto; padding: .7rem .9rem; background: #fafbfc; border: 1px dashed var(--a-line); border-radius: 5px; font-size: .9rem; margin-bottom: .8rem; }
.widget-preview img { max-width: 100%; height: auto; }
.widget-preview p { margin: 0 0 .5em; }
details.block-edit > summary { list-style: none; display: inline-flex; }
details.block-edit > summary::-webkit-details-marker { display: none; }
details.block-edit[open] > summary { margin-bottom: 1rem; }
.img-preview { padding: .6rem; background: #f2f3f5 repeating-conic-gradient(#e7e9ec 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: 5px; margin-bottom: .4rem; }
.img-preview img { display: block; max-height: 90px; max-width: 100%; }
.img-preview.small img { max-height: 48px; }
.upload-card { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.upload-card .field { margin: 0; flex: 1; }
.media-grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.media-item { padding: .7rem; display: flex; flex-direction: column; gap: .3rem; }
.media-thumb { display: grid; place-items: center; height: 130px; background: #f2f3f5 repeating-conic-gradient(#e7e9ec 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: 4px; overflow: hidden; }
.media-thumb img { max-width: 100%; max-height: 130px; }
.media-name { margin: 0; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { margin: 0; font-size: .78rem; }
.index-state { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border-radius: 5px; margin-bottom: 1rem; }
.index-state.is-off { background: var(--a-ok-l); color: #134e2e; }
.index-state.is-on { background: var(--a-warn-l); color: #5c3c00; }
.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin-bottom: .4rem; }

/* Dashboard checklist, edit-page numbers, upload warnings */
.setup-card { margin-bottom: 1.2rem; border-left: 4px solid var(--a-primary); }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .4rem 1.5rem; counter-reset: step; }
.setup-list li { counter-increment: step; display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.setup-list li::before { content: counter(step); flex-shrink: 0; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--a-primary); color: var(--a-primary); font-size: .78rem; font-weight: 700; }
.setup-list li.is-done::before { content: "✓"; background: var(--a-ok); border-color: var(--a-ok); color: #fff; }
.setup-list li.is-done span { color: var(--a-muted); text-decoration: line-through; }
.setup-list a { font-weight: 600; }
.status-stats { margin-left: auto; font-size: .85rem; color: var(--a-muted); display: flex; gap: .3rem 1rem; flex-wrap: wrap; }
.status-stats strong { color: var(--a-ink); margin-right: .2rem; }
.file-warning { color: var(--a-danger); font-size: .85rem; font-weight: 500; margin: .3rem 0 0; }
.note-box { padding: .8rem 1rem; background: var(--a-primary-l); border-radius: 5px; font-size: .88rem; color: #173b67; }
.note-box p { margin: 0 0 .4rem; }
.note-box p:last-child { margin: 0; }

/* Import from OJS */
.has-js .no-js-only { display: none; }
.mt { margin-top: 1.4rem; }
.stepper { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; counter-reset: st; }
.stepper li { counter-increment: st; display: flex; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--a-line); font-size: .85rem; color: var(--a-muted); }
.stepper li::before { content: counter(st); display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #eceef1; font-weight: 700; font-size: .75rem; }
.stepper li.is-current { border-color: var(--a-primary); color: var(--a-primary); font-weight: 600; }
.stepper li.is-current::before { background: var(--a-primary); color: #fff; }
.stepper li.is-done::before { content: "✓"; background: var(--a-ok); color: #fff; }
.manual-fields { margin-top: .8rem; }
.encoding-card { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-top: 1.2rem; }
.encoding-card > div { flex: 1 1 260px; }
.encoding-card .field { margin: 0; min-width: 220px; }
.sample-list { display: flex; flex-direction: column; gap: .9rem; }
.sample { padding: .9rem 1rem; border: 1px solid var(--a-line); border-radius: var(--a-radius); background: #fafbfc; }
.sample h3 { margin: .2rem 0 .4rem; font-size: 1rem; }
.sample p { margin: .25rem 0; font-size: .88rem; }
.sample-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--a-muted); font-size: .8rem !important; }
.sample-abstract { color: #3d434b; }
.sample-pdf { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-weight: 600; }
.sample-pdf.is-ok { background: var(--a-ok-l); color: var(--a-ok); }
.sample-pdf.is-missing { background: var(--a-warn-l); color: var(--a-warn); }
.progress { height: 14px; background: #eceef1; border-radius: 7px; overflow: hidden; margin: .4rem 0 .6rem; }
.progress i { display: block; height: 100%; background: var(--a-primary); border-radius: 7px; transition: width .4s ease; }
.import-status { margin: 0 0 .8rem; color: var(--a-muted); font-size: .9rem; }
.log-list { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: .85rem; border: 1px solid var(--a-line); border-radius: 5px; }
.log-list.tall { max-height: 520px; }
.log-list li { padding: .45rem .7rem; border-bottom: 1px solid var(--a-line); overflow-wrap: anywhere; }
.log-list li:last-child { border-bottom: 0; }
.log-list .log-error { background: var(--a-danger-l); }
.log-list .log-warning { background: #fffbf0; }
.log-list .log-none { color: var(--a-muted); }

/* Old-link checker */
.link-check { margin-top: 1.2rem; }
.link-check-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.link-check-form input { flex: 1 1 320px; }
.link-result { margin-top: 1rem; padding: .8rem 1rem; border-radius: 6px; border: 1px solid; overflow-wrap: anywhere; }
.link-result p { margin: 0 0 .4rem; }
.link-result p:last-child { margin: 0; }
.link-result.is-ok { background: var(--a-ok-l); border-color: #b6dfc6; }
.link-result.is-bad { background: var(--a-danger-l); border-color: #f4c7c2; }
.link-host { padding-bottom: .5rem; border-bottom: 1px solid rgba(0,0,0,.08); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sign-in and setup */
.bare-card:has(.setup-checks) { max-width: 560px; }
.setup-checks { margin: 0 0 1.2rem; border: 1px solid var(--a-line); border-radius: 6px; padding: .6rem .8rem; font-size: .9rem; }
.setup-checks summary { cursor: pointer; font-weight: 600; }
.check-list.compact { margin: .7rem 0 .2rem; gap: .35rem; }
.check-list.compact .check-item { padding: .5rem .7rem; gap: .7rem; }
.check-list.compact .check-item p { font-size: .82rem; overflow-wrap: anywhere; }
.check-list.compact .check-state { width: 3.4rem; }
.bare-card .hint code { overflow-wrap: anywhere; }
.bare-logo { display: block; max-height: 64px; max-width: 220px; margin-bottom: 1rem; }
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; background: #e9ecf0; }
.bare-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 2rem; box-shadow: 0 20px 50px rgba(16,24,40,.08); }
.bare-journal { margin: 0; color: var(--a-muted); font-size: .9rem; }
.bare-card h1 { margin: .2rem 0 1.2rem; font-size: 1.4rem; }
.bare-card .field { margin: 0; }

/* Backups, country access, security */
.field-label { font-weight: 600; font-size: .88rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem 1.4rem; margin: 0 0 1rem; }
.facts dt { font-size: .8rem; color: var(--a-muted); }
.facts dd { margin: .1rem 0 0; font-weight: 600; }
.input-suffix { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.input-suffix input { width: 6rem; }
.geo-filter { margin-bottom: .5rem; }
.country-box { max-height: 330px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px; padding: .4rem; border: 1px solid #c9ced6; border-radius: 5px; background: #fff; }
.country-box.is-disabled { opacity: .45; }
.country-item { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 4px; font-size: .88rem; cursor: pointer; }
.country-item:hover { background: #f3f5f8; }
.country-item.is-on { background: var(--a-primary-l); font-weight: 600; }
.country-item input { width: auto; margin: 0; }
.country-item .cc { margin-left: auto; color: var(--a-muted); font-size: .72rem; font-weight: 400; }
.bar-col { width: 32%; }
.bar { display: block; height: 8px; background: #eceef1; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--a-primary); }
.check-list { list-style: none; margin: 1.2rem 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.check-item { display: flex; gap: 1rem; align-items: flex-start; padding: .8rem 1rem; background: #fff; border: 1px solid var(--a-line); border-left-width: 4px; border-radius: var(--a-radius); }
.check-item p { margin: .2rem 0 0; color: var(--a-muted); font-size: .9rem; }
.check-state { flex-shrink: 0; width: 4.6rem; font-size: .75rem; font-weight: 700; padding: .15rem .4rem; border-radius: 4px; text-align: center; }
.check-item.is-ok { border-left-color: var(--a-ok); } .is-ok .check-state { background: var(--a-ok-l); color: var(--a-ok); }
.check-item.is-warn { border-left-color: #c08a00; } .is-warn .check-state { background: var(--a-warn-l); color: var(--a-warn); }
.check-item.is-fail { border-left-color: var(--a-danger); } .is-fail .check-state { background: var(--a-danger-l); color: var(--a-danger); }
.check-item.is-tip { border-left-color: #6ea8fe; } .is-tip .check-state { background: var(--a-primary-l); color: var(--a-primary); }

@media (pointer: coarse) {
  .btn-sm { padding: .5rem .8rem; }
  .icon-btn { width: 38px; height: 38px; }
  .adm-nav a { padding: .65rem .7rem; }
}

/* Small screens */
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-side { position: static; }
  .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .adm-side { transform: translateX(-100%); transition: transform .2s ease; }
  .side-open .adm-side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side-open .adm-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .adm-main { margin-left: 0; padding: 0 1rem 2rem; }
  .adm-menu-btn { display: inline-flex; padding: .4rem .7rem; border: 1px solid #c9ced6; background: #fff; border-radius: 5px; font: inherit; font-weight: 600; cursor: pointer; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .inline-form, .inline-form.wide { position: static; width: 100%; margin-top: .5rem; box-shadow: none; }
  .adm-top { position: sticky; top: 0; z-index: 30; background: var(--a-bg); padding: .8rem 0; }
  .adm-top h1 { font-size: 1.2rem; }
  .card { padding: 1rem; }
  .filter-bar .field { min-width: 0; width: 100%; }
  .switch-card, .danger-zone { flex-direction: column; align-items: stretch; }
  .tabs { overflow-x: auto; }
}
@media (max-width: 680px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .8rem 1rem; border-bottom: 1px solid var(--a-line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--a-muted); font-size: .8rem; text-align: left; }
  .table-stack td.paper-cell, .table-stack td.actions-col { display: block; text-align: left; }
  .table-stack td.actions-col { padding-top: .6rem; }
  .table-stack .bar-col { display: none; }
  .paper-cell { min-width: 0; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 1.3rem; }
}
