/* NexaCMS Developer Portal */
:root { --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f4f6fb; --card: #fff; --primary: #4338ca; --primary-soft: #eef2ff; --danger: #dc2626; --warning: #b45309; --success: #15803d; --info: #1d4ed8; --radius: 12px; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; }
h2 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
h3 { font-size: .9rem; margin-top: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .86rem; margin: 6px 0; }

.top { display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 58px; background: #111827; color: #fff; position: sticky; top: 0; z-index: 5; }
.top__brand { color: #fff; font-weight: 800; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.top__brand span, .login__brand > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 900; }
.top__nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top__nav a { color: #cbd5e1; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.top__nav a:hover { background: #1f2937; text-decoration: none; color: #fff; }
.top__nav a.is-active { background: #1f2937; color: #fff; font-weight: 700; }
.top__user { display: flex; align-items: center; gap: 10px; color: #cbd5e1; margin: 0; }
.top__user .btn { color: #e2e8f0; border-color: #374151; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .72rem; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 60px; }
.page-title { font-size: 1.45rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card--flush { padding: 0; overflow: hidden; }
.card--hl { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.card .pad { padding: 16px 20px 0; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2--wide { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.actions--left { justify-content: flex-start; }
.more { margin-left: auto; font-size: .85rem; font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); display: grid; gap: 4px; }
.stat:hover { text-decoration: none; border-color: #c7d2fe; }
.stat span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat strong { font-size: 1.8rem; }
.stat--hot strong { color: var(--danger); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #94a3b8; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: #3730a3; }
.btn--danger { background: #fff; border-color: #fca5a5; color: var(--danger); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 10px; font-size: .82rem; }
.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.form label, .row label { display: grid; gap: 4px; font-weight: 600; font-size: .86rem; margin-bottom: 12px; }
.form label small { font-weight: 400; color: var(--muted); }
.form textarea, .form input:not([type=checkbox]):not([type=radio]), .form select { width: 100%; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.inline label { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline input[type=number] { width: 80px; }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 4px; margin: 0 0 14px; }
.step legend { font-weight: 800; padding: 0 6px; display: flex; gap: 8px; align-items: center; }
.step legend span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; }
.steps { padding-left: 20px; display: grid; gap: 8px; margin: 0; }
.key { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; word-break: break-all; background: #f8fafc; }
.reissue { margin-top: 14px; }
.reissue summary { list-style: none; }
.reissue[open] summary { margin-bottom: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.table--compact td { padding: 6px 10px; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.is-unread td:first-child { box-shadow: inset 3px 0 var(--primary); }
.table tr.is-unread strong { color: var(--primary); }
.table tr.is-bad { background: #fef2f2; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.kv dt { color: var(--muted); font-size: .84rem; }
.kv dd { margin: 0; word-break: break-word; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #f1f5f9; color: #475569; white-space: nowrap; vertical-align: middle; }
.tag--success { background: #dcfce7; color: #166534; }
.tag--warning { background: #fef3c7; color: #92400e; }
.tag--danger { background: #fee2e2; color: #991b1b; }
.tag--info { background: #dbeafe; color: #1e40af; }
a.tag:hover { text-decoration: none; }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alerts__item { padding: 8px 12px; border-radius: 8px; border-left: 3px solid; background: #f8fafc; }
.alerts__item--danger { border-color: var(--danger); }
.alerts__item--warning { border-color: #f59e0b; }
.alerts__item--muted { border-color: #94a3b8; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs a.is-active { background: #fff; color: var(--ink); border: 1px solid var(--line); }

.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-width: 92%; }
.msg--developer { background: var(--primary-soft); border-color: #c7d2fe; margin-left: auto; }
.msg--note { background: #fffbeb; border-style: dashed; border-color: #fcd34d; max-width: 100%; }
.msg header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.msg__body { word-break: break-word; line-height: 1.6; }
.diag__btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.diag__btns form { margin: 0; }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 34px; margin-bottom: 8px; }
.spark__bar { flex: 1; max-width: 14px; height: 100%; border-radius: 3px; background: #cbd5e1; }
.spark__bar--ok { background: #4ade80; height: 60%; }
.spark__bar--warn { background: #fbbf24; height: 80%; }
.spark__bar--fail { background: #f87171; }
.report__meta { color: var(--muted); font-size: .86rem; }
.report__groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.report__group h3 { margin-top: 10px; }
.errors details { border-bottom: 1px solid #f1f5f9; padding: 6px 0; }
.errors summary { cursor: pointer; }
.errors pre { white-space: pre-wrap; font-size: .76rem; background: #f8fafc; padding: 8px; border-radius: 6px; }
.files { list-style: none; padding: 0; display: grid; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .8rem; }
.chip--off { opacity: .5; }

.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: min(380px, 100%); }
.login__brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.login__brand small { display: block; color: var(--muted); }

@media (max-width: 900px) {
    .grid-2, .grid-2--wide { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .top { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
    .top__nav { order: 3; width: 100%; }
    .wrap { padding: 16px; }
    .kv { grid-template-columns: 1fr; }
}
