/* Admin section + shared helpers added with it (tabs, list rows, matrix, banners). Uses theme tokens only. */
.tab-link { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tab-link:hover { color: var(--text); background: var(--hover); }
.tab-link.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }

.split-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-3 { grid-column: 1 / -1; }
.field.end { justify-content: flex-end; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form .field.grow { flex: 1 1 240px; }
.switch-list { display: flex; flex-direction: column; gap: 0; padding-top: 4px; padding-bottom: 4px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > p { margin: 0; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 220px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bad-text { color: var(--bad); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.link-btn.bad { color: var(--bad); }
textarea.input { height: auto; padding: 8px 12px; line-height: 1.45; resize: vertical; font-family: inherit; }
.area-sm { min-width: 220px; font-size: 12.5px; }
.tbl tr.row-off td { opacity: .55; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }

.log-row { border-bottom: 1px solid var(--border); }
.log-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.log-head:hover { background: var(--hover); }
.log-row > .sub { padding: 0 18px; }
.log-pre { margin: 6px 18px 12px; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; color: var(--text-2); }

.matrix-scroll { max-height: calc(100vh - 260px); overflow: auto; }
.matrix th, .matrix td { border-right: 1px solid var(--border); }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); vertical-align: bottom; }
.matrix .matrix-k { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 280px; max-width: 360px; }
.matrix thead .matrix-k { z-index: 3; }
.matrix td.matrix-k { display: table-cell; }
.matrix td.matrix-k .strong { display: block; }
.matrix td.matrix-k .sub { display: block; margin-top: 2px; line-height: 1.35; }
.matrix-role { text-align: center !important; min-width: 128px; }
.matrix-role > span { display: block; }
.matrix-c { text-align: center; }
.matrix-c .select { min-width: 112px; }
.matrix-group td { background: var(--panel) !important; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); position: sticky; left: 0; }
.cb { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.cb:disabled { cursor: not-allowed; opacity: .6; }

.banner { display: flex; align-items: center; gap: 12px; padding: 8px 28px; font-size: 13px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.banner form { margin: 0 0 0 auto; }
.banner.announce { background: var(--accent-soft); color: var(--text); }
.banner.preview { background: var(--pending-bg); color: var(--pending); font-weight: 600; }

@media (max-width: 900px) {
  .split-2, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .banner { padding: 8px 16px; }
}
.filters .input.search { width: 300px; max-width: 100%; }
