:root {
  --bg: #eef2f8;
  --bg2: #f9fbff;
  --card: #ffffff;
  --ink: #111b2a;
  --muted: #5a6a81;
  --border: rgba(14, 25, 42, 0.12);
  --shadow: 0 8px 20px rgba(14, 25, 42, 0.08);
  --accent: #2d6cdf;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", "Noto Sans", ui-sans-serif, system-ui, -apple-system, Roboto, Ubuntu, Cantarell, sans-serif;
  margin: 0;
  background: radial-gradient(1200px 500px at 10% -10%, #dfe9ff 0%, transparent 65%), linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  color: var(--ink);
  line-height: 1.45;
}
.wrap { max-width: 1360px; margin: 0 auto; padding: 18px 18px 48px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1f8f57;
}
.brand-text {
  font-weight: 600;
  letter-spacing: 0.2px;
}
.topbar-actions { display: inline-flex; gap: 8px; }
.ui-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
body.ui-compact .wrap { padding: 12px 12px 28px; }
body.ui-compact h2 { margin: 12px 0 4px 0; font-size: 20px; }
body.ui-compact .card { padding: 9px; border-radius: 12px; }
body.ui-compact nav { padding: 8px 10px; gap: 6px; }
body.ui-compact nav a { padding: 5px 8px; }
body.ui-compact th,
body.ui-compact td { padding: 6px 8px; font-size: 13px; }
body.ui-compact .btn,
body.ui-compact button { padding: 6px 8px; }
body.ui-compact .pill,
body.ui-compact .pill2 { padding: 4px 8px; }
body.ui-compact .muted2 { font-size: 12px; }

.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2200;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 20px));
}
.toast {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(10, 16, 26, 0.18);
  padding: 8px 10px;
  font-size: 13px;
  animation: toast-in .16s ease-out;
}
.toast.info { border-left-color: var(--accent); }
.toast.success { border-left-color: #1f8f57; }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.role-pill.admin {
  color: #166d43;
  border-color: rgba(22, 109, 67, 0.25);
  background: rgba(22, 109, 67, 0.08);
}
.role-pill.moderator {
  color: #8a5c00;
  border-color: rgba(138, 92, 0, 0.25);
  background: rgba(138, 92, 0, 0.10);
}
.global-search {
  position: relative;
  min-width: 340px;
}
#global-search-input {
  width: 100%;
  padding: 8px 10px;
}
.global-search-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 34px rgba(10, 16, 26, 0.20);
  overflow: hidden;
  max-height: min(58vh, 460px);
  overflow-y: auto;
}
.global-search-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 10px;
  color: var(--ink);
  border-bottom: 1px solid rgba(15, 25, 40, 0.07);
  cursor: pointer;
}
.global-search-item:last-child {
  border-bottom: none;
}
.global-search-item:hover,
.global-search-item.is-active {
  background: rgba(45, 108, 223, 0.08);
}
.global-search-kind {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
}
.global-search-main {
  min-width: 0;
  flex: 1 1 auto;
}
.global-search-title-link {
  text-decoration: none;
  color: inherit;
}
.global-search-title {
  font-size: 13px;
  color: var(--ink);
}
.global-search-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}
.global-search-actions {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.global-search-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.global-search-act:hover {
  background: rgba(45, 108, 223, 0.08);
  border-color: rgba(45, 108, 223, 0.35);
}
.global-search-act.danger {
  color: var(--danger);
}
.instance-bar { padding:12px 14px; margin:0 0 12px 0; background:#f2f6ff; border:1px solid #c8d7ff; border-radius: 16px; box-shadow: 0 8px 18px rgba(45,108,223,0.08); }
.instance-bar-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.instance-switch { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.pill { display:inline-flex; align-items:center; padding:5px 11px; border-radius:999px; border: 1px solid var(--border); background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; }
.pill:hover { background: rgba(45, 108, 223, 0.08); border-color: rgba(45, 108, 223, 0.35); }
.pill.active { background: rgba(45, 108, 223, 0.12); border-color: rgba(45, 108, 223, 0.55); color: var(--accent); font-weight: 600; }
.pill-add { width: 34px; min-width: 34px; justify-content: center; padding: 5px 0; font-weight: 700; color: var(--accent); background: rgba(45, 108, 223, 0.08); border-color: rgba(45, 108, 223, 0.28); }
.pill-add:hover { background: rgba(45, 108, 223, 0.14); }
nav { position: sticky; top: 8px; z-index: 25; display:flex; flex-wrap:nowrap; overflow-x:auto; gap:8px; padding: 10px 12px; background: rgba(255,255,255,0.88); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
nav::-webkit-scrollbar { height: 10px; }
nav::-webkit-scrollbar-thumb { background: rgba(15, 25, 40, 0.18); border-radius: 999px; }
nav a { flex: 0 0 auto; color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 10px; }
nav a:hover { background: rgba(45, 108, 223, 0.10); }
nav a.active { background: rgba(45, 108, 223, 0.14); color: var(--accent); font-weight: 600; }
.main-nav .nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid rgba(14, 25, 42, 0.12);
}
.main-nav .nav-group:last-child {
  border-right: none;
  padding-right: 0;
}
.nav-group-title {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(14, 25, 42, 0.12);
  background: rgba(15, 25, 40, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
body.ui-simple nav a[data-simple="0"] { display: none; }
body.ui-simple nav a.active[data-simple="0"] {
  display: inline-flex;
  border: 1px dashed rgba(45, 108, 223, 0.45);
}
h2 { margin: 16px 0 6px 0; font-size: 24px; letter-spacing: 0.1px; }
table { border-collapse: collapse; margin-top: 12px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
th, td { border-bottom: 1px solid var(--border); padding: 9px 11px; vertical-align: top; }
th { text-align: left; font-size: 13px; color: var(--muted); background: rgba(15, 25, 40, 0.03); position: sticky; top: 0; z-index: 1; }
tr:nth-child(even) td { background: rgba(15, 25, 40, 0.012); }
tr:hover td { background: rgba(45, 108, 223, 0.05); }
.error { color: var(--danger); }
.muted { color: var(--muted); }
.hint { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; margin-left:6px; border-radius:999px; border: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1; cursor: help; user-select: none; }
.hint:hover { background: rgba(45, 108, 223, 0.10); border-color: rgba(45, 108, 223, 0.4); color: var(--accent); }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-start; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:7px 10px; border-radius:10px; border:1px solid var(--border); background:#fff; color: var(--ink); text-decoration:none; cursor:pointer; transition: all .14s ease; }
.btn:hover { border-color: rgba(45, 108, 223, 0.4); background: rgba(45, 108, 223, 0.06); }
.btn.danger { color: var(--danger); }
.btn.primary { background: rgba(45,108,223,0.10); border-color: rgba(45,108,223,0.35); }
.btn.mini { padding:6px 8px; font-size:12px; }
.pill2 { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border-radius:999px; border:1px solid var(--border); background:#fff; color: var(--ink); }
.pill2.active { background: rgba(45, 108, 223, 0.12); border-color: rgba(45, 108, 223, 0.45); color: var(--accent); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.muted2 { color: var(--muted); font-size: 13px; }
button { cursor: pointer; border-radius: 10px; border: 1px solid var(--border); background: #fff; padding: 7px 10px; transition: all .14s ease; }
button:hover { border-color: rgba(45, 108, 223, 0.4); background: rgba(45,108,223,0.06); }
input, select, textarea { border-radius: 10px; border: 1px solid var(--border); padding: 8px 11px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(45,108,223,0.55); box-shadow: 0 0 0 3px rgba(45,108,223,0.14); }
details { border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.72); padding: 8px 10px; }
details + details { margin-top: 8px; }
summary { cursor: pointer; user-select: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background: rgba(15,25,40,0.06); border:1px solid rgba(15,25,40,0.12); border-radius: 8px; padding: 1px 5px; }
pre { background: #f4f7fc; border:1px solid var(--border); border-radius: 10px; padding: 10px; overflow: auto; }
ul.flash-list { list-style: none; margin: 10px 0 0 0; padding: 0; display: grid; gap: 8px; }
ul.flash-list li { border: 1px solid var(--border); border-left: 4px solid #6b7a90; border-radius: 10px; background: #fff; padding: 8px 10px; }
ul.flash-list li.info { border-left-color: var(--accent); }
ul.flash-list li.error { border-left-color: var(--danger); color: var(--ink); }
ul.flash-list li.success { border-left-color: #1f8f57; }
a { color: var(--accent); }

.quick-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.quick-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 26, 0.35);
  backdrop-filter: blur(2px);
}
.quick-panel {
  position: relative;
  width: min(760px, calc(100vw - 20px));
  margin: 9vh auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 28px 50px rgba(10, 16, 26, 0.28);
  overflow: hidden;
}
.instance-create-panel { width: min(720px, calc(100vw - 20px)); }
.instance-create-head { align-items: flex-start; }
.instance-create-form { display:grid; gap:12px; padding: 14px; }
.instance-create-form label { display:grid; gap:6px; }
.instance-create-form input { width:100%; }
.instance-create-inline-check { display:flex; align-items:center; gap:8px; font-weight:600; }
.instance-create-inline-check input { width:auto; margin:0; }
.instance-create-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-start; padding-top:4px; }
.quick-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
#quick-open-input {
  flex: 1;
  font-size: 15px;
}
.quick-list {
  max-height: 55vh;
  overflow: auto;
  padding: 8px;
}
.quick-item {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.quick-item:hover,
.quick-item.active {
  background: rgba(45, 108, 223, 0.08);
  border-color: rgba(45, 108, 223, 0.22);
}
.quick-foot {
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 12px;
}
.user-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
}
.user-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 26, 0.35);
  backdrop-filter: blur(2px);
}
.user-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(460px, calc(100vw - 14px));
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(10, 16, 26, 0.22);
  display: flex;
  flex-direction: column;
}
.user-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.user-drawer-body {
  padding: 12px;
  overflow: auto;
}
.user-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.user-drawer-grid > div {
  background: rgba(15, 25, 40, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
.user-drawer-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .wrap { padding: 12px 10px 32px; }
  h2 { font-size: 21px; }
  nav { top: 4px; }
  .main-nav .nav-group { padding-right: 8px; }
  .nav-group-title { font-size: 10px; padding: 3px 6px; }
  .topbar { margin-bottom: 10px; }
  .brand-text { font-size: 14px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .ui-mode-badge { order: 5; }
  .global-search { min-width: 220px; }
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.dash-widget-config {
  margin-top: 12px;
}
.dash-widget-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-widget-panel {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-widget-panel label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.kpi {
  min-width: 0;
}
.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.dash-block {
  flex: 1;
  min-width: 320px;
}
.dash-title {
  margin: 0 0 8px 0;
}
.dash-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}
.dash-lines p,
.dash-block p {
  margin: 6px 0;
}
.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
#dash-quick-action-result {
  min-height: 18px;
  margin-bottom: 8px;
}
.inline-form {
  display: inline-block;
  margin-right: 8px;
}
.dash-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}
.compact-table {
  margin-top: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 25, 40, 0.04);
  font-size: 12px;
  font-weight: 600;
}
.badge.ok {
  color: #166d43;
  border-color: rgba(22, 109, 67, 0.25);
  background: rgba(22, 109, 67, 0.1);
}
.badge.warn {
  color: #8a5c00;
  border-color: rgba(138, 92, 0, 0.25);
  background: rgba(138, 92, 0, 0.1);
}
.mod-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(560px, 1.55fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}
.mod-list {
  min-width: 0;
}
.mod-table {
  margin-top: 0;
}
.js-mod-row {
  cursor: pointer;
}
.js-mod-row.is-selected td {
  background: rgba(45, 108, 223, 0.11) !important;
}
.mod-side {
  position: sticky;
  top: 86px;
}
.mod-side-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.mod-meta-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mod-meta-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 25, 40, 0.03);
  padding: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mod-reason-block {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 25, 40, 0.03);
  padding: 8px;
}
.mod-side-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mod-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
}
[data-live-root-page].is-loading {
  opacity: 0.62;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
@media (max-width: 1200px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mod-layout {
    grid-template-columns: 1fr;
  }
  .mod-side {
    position: static;
  }
}
@media (max-width: 680px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
  .mod-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin shell redesign */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 50;
  padding: 10px 12px;
  border: 1px solid rgba(14, 25, 42, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
}
.brand {
  padding: 10px 14px;
  border-radius: 14px;
}
.topbar-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}
.admin-sidebar {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
  align-self: start;
}
.admin-main {
  min-width: 0;
}
.instance-bar-sidebar {
  margin: 0;
  border-radius: 20px;
  background:
    radial-gradient(200px 120px at top right, rgba(45, 108, 223, 0.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 16px 30px rgba(45, 108, 223, 0.10);
}
.admin-shell .main-nav {
  position: static;
  top: auto;
  display: grid;
  gap: 12px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}
.admin-shell .main-nav .nav-group {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(14, 25, 42, 0.10);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(247,250,255,0.98) 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  border-right: 1px solid rgba(14, 25, 42, 0.10);
}
.admin-shell .main-nav .nav-group:last-child {
  padding-right: 12px;
}
.admin-shell .main-nav .nav-group-title {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #51627a;
}
.admin-shell .main-nav .nav-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--ink);
}
.admin-shell .main-nav .nav-item:hover {
  background: rgba(45, 108, 223, 0.08);
  border-color: rgba(45, 108, 223, 0.12);
}
.admin-shell .main-nav .nav-item.active {
  background: linear-gradient(180deg, rgba(45, 108, 223, 0.18) 0%, rgba(45, 108, 223, 0.10) 100%);
  border-color: rgba(45, 108, 223, 0.30);
  color: #1748a1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.admin-sidecard {
  padding: 14px 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(220px 160px at top right, rgba(20, 184, 166, 0.16), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f5fbfb 100%);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}
.admin-sidecard-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #5d6d83;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-sidecard-title {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #102033;
}
.admin-sidecard-text {
  margin: 8px 0 0;
  color: #4c607a;
  line-height: 1.55;
}
.admin-sidecard-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.admin-hint-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: #29405f;
  font-size: 12px;
  font-weight: 600;
}
.page-masthead {
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(260px 180px at top right, rgba(45, 108, 223, 0.16), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 20px 34px rgba(45, 108, 223, 0.10);
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #4f647f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.page-masthead-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-top: 12px;
}
.page-heading-block {
  min-width: 0;
}
.page-heading-block h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
}
.page-summary {
  margin: 8px 0 0;
  max-width: 860px;
  color: #50637d;
  font-size: 15px;
  line-height: 1.6;
}
.page-masthead-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-outline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.page-outline-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.92);
  color: #29405f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.page-outline-chip:hover {
  border-color: rgba(45, 108, 223, 0.28);
  background: rgba(45, 108, 223, 0.10);
}
.page-outline-chip-sub {
  opacity: 0.88;
  padding-inline: 10px;
  font-size: 12px;
}
.page-content {
  margin-top: 14px;
}
.page-relations {
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(220px 150px at top right, rgba(20, 184, 166, 0.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.07);
}
.page-relations-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.page-relations-head h3 {
  margin: 10px 0 0;
  font-size: 22px;
  line-height: 1.15;
}
.page-relations-summary {
  max-width: 500px;
  color: #546880;
  line-height: 1.55;
}
.page-relations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.page-relation-card {
  display: block;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
  color: var(--ink);
  text-decoration: none;
}
.page-relation-card:hover {
  border-color: rgba(45, 108, 223, 0.24);
  background: rgba(45, 108, 223, 0.06);
}
.page-relation-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(45, 108, 223, 0.10);
  color: #1d4aa7;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-relation-title {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #102033;
}
.page-relation-text {
  margin-top: 8px;
  color: #52667f;
  line-height: 1.55;
}
.page-content > *:first-child {
  margin-top: 0 !important;
}
.page-content h3 {
  scroll-margin-top: 96px;
}
.page-content details[id] {
  scroll-margin-top: 96px;
}
.page-content table {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}
.page-content .card,
.page-content details,
.page-content table,
.page-content .instance-bar {
  border-radius: 18px;
}
@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }
  .admin-shell .main-nav {
    position: sticky;
    top: 4px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  .admin-shell .main-nav .nav-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px 0 0;
    border: none;
    border-right: 1px solid rgba(14, 25, 42, 0.12);
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .admin-shell .main-nav .nav-group:last-child {
    border-right: none;
    padding-right: 0;
  }
  .admin-shell .main-nav .nav-item {
    min-height: 34px;
    padding: 6px 10px;
  }
  .page-masthead-row {
    flex-direction: column;
  }
  .page-relations {
    padding: 16px 14px;
  }
  .page-relations-head h3 {
    font-size: 20px;
  }
}
@media (max-width: 740px) {
  .topbar {
    top: 6px;
    padding: 10px;
  }
  .global-search {
    min-width: 100%;
  }
  .page-heading-block h2 {
    font-size: 24px;
  }
  .page-summary {
    font-size: 14px;
  }
}

.admin-workflow {
  margin: 14px 0 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(260px 180px at top right, rgba(45, 108, 223, 0.12), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
}
.admin-workflow-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.admin-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #5a6d87;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-workflow-head h3 {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.15;
}
.admin-workflow-note {
  max-width: 420px;
  color: #52667f;
  line-height: 1.55;
}
.admin-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.workflow-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}
.workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(45, 108, 223, 0.12);
  color: #1748a1;
  font-size: 12px;
  font-weight: 800;
}
.workflow-title {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 800;
  color: #102033;
}
.workflow-text {
  margin-top: 8px;
  color: #50637d;
  line-height: 1.55;
}
.workflow-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.workflow-actions a,
.workflow-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.workflow-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.workflow-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: #29405f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.workflow-chip:hover {
  background: rgba(45, 108, 223, 0.08);
  border-color: rgba(45, 108, 223, 0.24);
}
.admin-inline-guide {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-inline-guide .pill2 {
  background: rgba(255,255,255,0.92);
}
.admin-content-block {
  margin: 12px 0 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}
.admin-content-block h3,
.admin-content-block h4 {
  margin-top: 0;
}
.admin-block-meta {
  color: #5b6e87;
  line-height: 1.55;
}
@media (max-width: 740px) {
  .admin-workflow {
    padding: 16px 14px;
  }
  .admin-workflow-head h3 {
    font-size: 22px;
  }
}
