@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

/* Panel v2 — theme B: Paper & sage (sage-tinted sidebar, warm paper main, sage accents) */
:root {
  --pv2-bg: #2d3a35;
  --pv2-bg2: #24322e;
  --pv2-accent: #5c7a5c;
  --pv2-accent-hover: #6d8c6d;
  --pv2-accent-soft: #a7c4a0;
  --pv2-accent-glow: rgba(92, 122, 92, 0.28);
  --pv2-text: #f5f2eb;
  --pv2-muted: #9ca89f;
  --pv2-card: #fffcf9;
  --pv2-border: #ddd8cf;
  --pv2-main-bg: #f6f3ec;
  --pv2-body-text: #3d3a36;
  --sidebar-w: 232px;
  --pv2-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pv2-font-display: "Newsreader", "Georgia", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--pv2-font);
  font-size: 15px;
  color: var(--pv2-body-text);
  background: var(--pv2-main-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(124, 184, 124, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(45, 58, 53, 0.04) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
}

/* Login — auth background + card */
body.pv2-auth {
  min-height: 100vh;
  background: linear-gradient(155deg, #1a2420 0%, var(--pv2-bg) 42%, #1e2a26 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
body.pv2-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 28%, var(--pv2-accent-glow) 0%, transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(167, 196, 160, 0.08) 0%, transparent 38%);
  pointer-events: none;
}
.pv2-login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--pv2-card);
  border-radius: 16px;
  border: 1px solid rgba(221, 216, 207, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 24px 56px rgba(26, 36, 32, 0.35);
  padding: 2rem 2rem 1.75rem;
}
.pv2-login-card h1 {
  margin: 0 0 0.25rem;
  font-family: var(--pv2-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c2825;
  letter-spacing: -0.02em;
}
.pv2-login-card .pv2-sub { margin: 0 0 1.5rem; color: #57534e; font-size: 0.9rem; line-height: 1.45; }
.pv2-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, #3a4a44 0%, #24322e 100%);
  border: 1px solid rgba(167, 196, 160, 0.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--pv2-accent-soft);
  font-family: var(--pv2-font-display);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.pv2-form label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; color: #44403c; }
.pv2-form input[type="text"], .pv2-form input[type="password"] {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--pv2-border); border-radius: 10px; margin-bottom: 1rem;
  font-family: inherit; font-size: 0.95rem; background: #fff;
}
.pv2-form input:focus { outline: none; border-color: var(--pv2-accent); box-shadow: 0 0 0 3px var(--pv2-accent-glow); }
.pv2-btn {
  width: 100%; padding: 0.72rem 1rem; border: none; border-radius: 10px;
  background: linear-gradient(180deg, #7fa67f 0%, var(--pv2-accent) 100%);
  color: #f7faf7;
  font-weight: 700; cursor: pointer; font-size: 0.95rem; font-family: inherit;
  box-shadow: 0 2px 10px rgba(45, 70, 45, 0.28);
}
.pv2-btn:hover { background: linear-gradient(180deg, #8fb88f 0%, var(--pv2-accent-hover) 100%); color: #fff; }
.pv2-alert { padding: 0.65rem 0.85rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9rem; }
.pv2-alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Layout — sidebar + main */
.pv2-app { display: flex; min-height: 100vh; }
.pv2-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, var(--pv2-bg) 0%, var(--pv2-bg2) 100%);
  color: var(--pv2-text);
  padding: 1.35rem 0 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}
.pv2-sidebar-brand {
  padding: 0 1.25rem 1.1rem;
  font-family: var(--pv2-font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--pv2-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 0.85rem;
  line-height: 1.25;
}
.pv2-sidebar-brand span { color: var(--pv2-accent-soft); font-weight: 700; }
.pv2-nav a {
  display: block;
  padding: 0.52rem 1.15rem 0.52rem 1.25rem;
  color: var(--pv2-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.pv2-nav a:hover {
  color: var(--pv2-text);
  background: rgba(255, 255, 255, 0.05);
}
.pv2-nav a.active {
  color: var(--pv2-text);
  background: rgba(167, 196, 160, 0.15);
  border-left-color: var(--pv2-accent-soft);
}
.pv2-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv2-topbar {
  background: rgba(255, 252, 248, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pv2-border);
  padding: 0.9rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}
.pv2-topbar h2 {
  margin: 0;
  font-family: var(--pv2-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pv2-body-text);
  letter-spacing: -0.02em;
}
.pv2-user { font-size: 0.88rem; color: #5c5854; }
a.pv2-user-link {
  color: #3d5c3d;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  margin: -0.35rem -0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
a.pv2-user-link:hover {
  background: rgba(167, 196, 160, 0.2);
  border-color: rgba(92, 122, 92, 0.22);
  text-decoration: none;
  color: #2a4030;
}
.pv2-content { padding: 1.5rem 1.6rem 2rem; flex: 1; }
.pv2-panel {
  background: var(--pv2-card);
  border-radius: 14px;
  border: 1px solid var(--pv2-border);
  padding: 1.35rem 1.5rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(45, 58, 53, 0.05), 0 8px 22px rgba(45, 58, 53, 0.04);
}
.pv2-panel h3 {
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--pv2-body-text);
  letter-spacing: -0.01em;
}
.pv2-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pv2-table th, .pv2-table td { text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--pv2-border); }
.pv2-table th { color: #78716c; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pv2-drag-col { width: 2.25rem; padding-left: 0.35rem !important; padding-right: 0.35rem !important; }
.pv2-drag-cell { width: 2.25rem; text-align: center; vertical-align: middle; user-select: none; }
.pv2-drag-handle {
  display: inline-block;
  cursor: grab;
  color: #9aa3b8;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -0.15em;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
}
.pv2-drag-handle:hover { background: #f5f0e8; color: #44403c; }
.pv2-drag-handle:active { cursor: grabbing; }
.pv2-channel-row.pv2-row-dragging { opacity: 0.55; background: #f5f2eb !important; }
.pv2-drag-hint {
  display: inline-block;
  color: #78716c;
  font-weight: 600;
  letter-spacing: -0.12em;
  margin: 0 0.15rem;
}
.pv2-muted { color: #78716c; font-size: 0.9rem; }
.pv2-links a { color: #4a6b4a; text-decoration: none; font-weight: 600; }
.pv2-links a:hover { color: #2d4530; text-decoration: underline; }

.pv2-pill-ok, .pv2-pill-warn {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.pv2-pill-ok { background: #d4edda; color: #155724; }
.pv2-pill-warn { background: #fff3cd; color: #856404; }

.pv2-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.pv2-toolbar { align-items: center; gap: 0.65rem; }
.pv2-toolbar-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}
.pv2-toolbar-search input[type="search"],
.pv2-toolbar-search input[type="text"] {
  min-width: 12rem;
  max-width: 22rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--pv2-border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.pv2-toolbar-search input[type="search"]:focus,
.pv2-toolbar-search input[type="text"]:focus {
  outline: none;
  border-color: var(--pv2-accent);
  box-shadow: 0 0 0 3px var(--pv2-accent-glow);
}
.pv2-btn-sm {
  display: inline-block; padding: 0.45rem 0.85rem; border-radius: 8px; font-size: 0.88rem; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer; font-family: inherit;
}
.pv2-btn-primary {
  background: linear-gradient(180deg, #7fa67f 0%, var(--pv2-accent) 100%);
  color: #f7faf7;
  box-shadow: 0 2px 8px rgba(45, 70, 45, 0.22);
}
.pv2-btn-primary:hover {
  background: linear-gradient(180deg, #8fb88f 0%, var(--pv2-accent-hover) 100%);
  color: #fff;
}
.pv2-btn-ghost { background: #fff; color: #3d5c3d; border: 1px solid var(--pv2-border); font-weight: 600; }
.pv2-btn-ghost:hover { background: #eef5ee; border-color: rgba(92, 122, 92, 0.35); color: #2a4030; }
.pv2-btn-danger { background: #dc3545; color: #fff; }
.pv2-btn-danger:hover { background: #c82333; color: #fff; }

.pv2-form-grid label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: #44403c; }
.pv2-form-grid input[type="text"], .pv2-form-grid input[type="password"], .pv2-form-grid input[type="number"], .pv2-form-grid input[type="date"], .pv2-form-grid input[type="url"] {
  width: 100%; max-width: 420px; padding: 0.55rem 0.75rem; border: 1px solid var(--pv2-border); border-radius: 8px; margin-bottom: 1rem;
}
.pv2-form-grid textarea {
  width: 100%; max-width: 720px; min-height: 4.5rem; padding: 0.55rem 0.75rem; border: 1px solid var(--pv2-border); border-radius: 8px; margin-bottom: 1rem;
  font-family: ui-monospace, monospace; font-size: 0.88rem;
}
.pv2-form-grid input:focus,
.pv2-form-grid textarea:focus,
.pv2-form-grid select:focus {
  outline: none;
  border-color: var(--pv2-accent);
  box-shadow: 0 0 0 3px var(--pv2-accent-glow);
}
.pv2-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.35rem 1rem; margin: 0.5rem 0 1rem; }
.pv2-check-grid label { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; margin: 0; cursor: pointer; }
.pv2-inline-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.pv2-msg-ok { background: #d4edda; color: #155724; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.pv2-msg-err { background: #fde8e8; color: #c0392b; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.pv2-msg-warn { background: #fff3cd; color: #856404; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }

.pv2-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.pv2-stat {
  background: var(--pv2-card);
  border: 1px solid var(--pv2-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-align: center;
}
.pv2-stat b {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pv2-accent);
  line-height: 1.2;
}
.pv2-stat span { font-size: 0.82rem; color: #78716c; }

/* Dashboard — health / activity strip */
.pv2-dash-health {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}
.pv2-dash-health__item {
  flex: 1 1 120px;
  max-width: 200px;
  border-radius: 10px;
  border: 1px solid var(--pv2-border);
  padding: 0.65rem 0.85rem;
  background: var(--pv2-card);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pv2-dash-health__item--ok {
  border-color: rgba(92, 122, 92, 0.35);
  background: linear-gradient(180deg, #f4faf4 0%, var(--pv2-card) 100%);
}
.pv2-dash-health__item--bad {
  border-color: rgba(185, 80, 80, 0.35);
  background: linear-gradient(180deg, #fdf5f5 0%, var(--pv2-card) 100%);
}
.pv2-dash-health__item--neutral {
  background: #fafaf8;
}
.pv2-dash-health__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #78716c;
}
.pv2-dash-health__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pv2-body-text);
  font-variant-numeric: tabular-nums;
}
.pv2-dash-health__item--ok .pv2-dash-health__value { color: #3d5c3d; }
.pv2-dash-health__item--bad .pv2-dash-health__value { color: #9b2c2c; }

.pv2-dl { margin: 0; }
.pv2-dl dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.75rem;
}
.pv2-dl dt:first-child { margin-top: 0; }
.pv2-dl dd {
  margin: 0.35rem 0 0;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  word-break: break-all;
  line-height: 1.45;
}

.pv2-tvip-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}
.pv2-tvip-upload-box {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--pv2-border);
  border-radius: 8px;
  background: #faf9f7;
}
.pv2-tvip-upload-box h4 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.pv2-tvip-upload-box input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.82rem;
  margin: 0.35rem 0;
}
.pv2-tvip-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--pv2-border);
}
.pv2-form-grid select.pv2-tvip-pick {
  max-width: 420px;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--pv2-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Users — account / online badges */
.pv2-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pv2-badge-inline { margin-right: 0.35rem; vertical-align: middle; }
.pv2-badge-ok {
  background: #d4edda;
  color: #1e4620;
  border: 1px solid #c3e6cb;
}
.pv2-badge-off {
  background: #f5f5f4;
  color: #57534e;
  border: 1px solid #e7e5e4;
}
.pv2-badge-warn {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}
.pv2-badge-slot-over {
  background: #fde8e8;
  color: #9b2c2c;
  border: 1px solid #f5c6cb;
  font-weight: 700;
}
.pv2-badge-slot-multi {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  font-weight: 600;
}

/* Modal — max connections / admin alerts */
.pv2-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.pv2-modal {
  background: var(--pv2-card, #fff);
  border-radius: 14px;
  border: 1px solid var(--pv2-border, #e7e5e4);
  max-width: 460px;
  width: 100%;
  max-height: min(82vh, 540px);
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}
.pv2-modal__head {
  padding: 1rem 1.2rem 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pv2-body-text, #292524);
}
.pv2-modal__body {
  padding: 0.35rem 1.2rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #44403c;
}
.pv2-modal__list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.pv2-modal__list li {
  margin-bottom: 0.45rem;
}
.pv2-modal__foot {
  padding: 0 1.2rem 1.1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Admin — help strip / legend (themes: data-theme on .pv2-admin-help) */
.pv2-admin-help {
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--ch-help-border, rgba(92, 122, 92, 0.14));
  background: var(--ch-help-bg, linear-gradient(160deg, #faf9f6 0%, #f0f5f0 48%, #e8f0e8 100%));
  box-shadow: 0 1px 3px rgba(45, 58, 53, 0.05);
}
.pv2-admin-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem 1.25rem;
  align-items: start;
}
.pv2-admin-help-item--wide {
  grid-column: 1 / -1;
}
.pv2-admin-help-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ch-help-label, #3d5c3d);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}
.pv2-admin-help-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ch-help-text, #57534e);
}
.pv2-admin-help-text p {
  margin: 0 0 0.5rem;
}
.pv2-admin-help-text p:last-child {
  margin-bottom: 0;
}
.pv2-admin-help-text ul,
.pv2-admin-help-text ol {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}
.pv2-admin-help-text li {
  margin-bottom: 0.35rem;
}
.pv2-admin-help-text li:last-child {
  margin-bottom: 0;
}
.pv2-admin-help-text code {
  font-size: 0.8em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--ch-help-code-border, rgba(92, 122, 92, 0.2));
  color: var(--ch-help-code, #44403c);
}
.pv2-admin-help-text strong {
  color: var(--ch-help-strong, #292524);
  font-weight: 600;
}
.pv2-admin-help-text em {
  font-style: normal;
  font-weight: 600;
  color: var(--ch-help-em, #4a7c59);
}
.pv2-admin-help-text a {
  color: var(--ch-help-em, #4a7c59);
  font-weight: 600;
  text-decoration: none;
}
.pv2-admin-help-text a:hover {
  text-decoration: underline;
}
.pv2-help-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-right: 0.15rem;
}
.pv2-help-pill--panel {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.pv2-help-pill--stalker {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Theme: Indigo — cool violet labels */
.pv2-admin-help[data-theme="indigo"] {
  --ch-help-label: #4f46e5;
  --ch-help-text: #475569;
  --ch-help-strong: #1e293b;
  --ch-help-em: #4338ca;
  --ch-help-code: #334155;
  --ch-help-code-border: rgba(99, 102, 241, 0.22);
  --ch-help-border: rgba(99, 102, 241, 0.14);
  --ch-help-bg: linear-gradient(155deg, #fafaff 0%, #f1f0ff 45%, #eef2ff 100%);
}

/* Theme: Slate — neutral graphite, minimal tint */
.pv2-admin-help[data-theme="slate"] {
  --ch-help-label: #0f172a;
  --ch-help-text: #64748b;
  --ch-help-strong: #0f172a;
  --ch-help-em: #334155;
  --ch-help-code: #475569;
  --ch-help-code-border: rgba(100, 116, 139, 0.25);
  --ch-help-border: rgba(15, 23, 42, 0.08);
  --ch-help-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Theme: Emerald — teal accent on soft mint */
.pv2-admin-help[data-theme="emerald"] {
  --ch-help-label: #047857;
  --ch-help-text: #475569;
  --ch-help-strong: #064e3b;
  --ch-help-em: #059669;
  --ch-help-code: #334155;
  --ch-help-code-border: rgba(5, 150, 105, 0.2);
  --ch-help-border: rgba(5, 150, 105, 0.12);
  --ch-help-bg: linear-gradient(160deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafc 100%);
}

/* Global collapsible help — channel table (all admin pages) */
.pv2-global-info {
  margin: 0 0 1rem;
  border-radius: 12px;
  border: 1px solid rgba(92, 122, 92, 0.18);
  background: linear-gradient(180deg, #fafaf8 0%, #f4f6f3 100%);
  box-shadow: 0 1px 2px rgba(45, 58, 53, 0.06);
}
.pv2-global-info__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  user-select: none;
}
.pv2-global-info__summary::-webkit-details-marker { display: none; }
.pv2-global-info__summary::marker { content: ""; }
.pv2-global-info__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3d5c3d;
}
.pv2-global-info__hint {
  font-size: 0.82rem;
  color: #78716c;
}
.pv2-global-info__body {
  padding: 0 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pv2-global-info__topic {
  border-radius: 8px;
  border: 1px solid rgba(221, 216, 207, 0.9);
  background: rgba(255, 252, 249, 0.85);
  overflow: hidden;
}
.pv2-global-info__topic-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #44403c;
  background: rgba(246, 243, 236, 0.6);
}
.pv2-global-info__topic-summary::-webkit-details-marker { display: none; }
.pv2-global-info__topic-summary::marker { content: ""; }
.pv2-global-info__topic > .pv2-admin-help-text {
  padding: 0.55rem 0.75rem 0.65rem;
  border-top: 1px solid rgba(221, 216, 207, 0.65);
}
.pv2-global-info__topic--bare {
  padding: 0.55rem 0.75rem;
}

/* ---- Mobile navigation (checkbox + labels, no JS) ---- */
.pv2-nav-state {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pv2-sidebar-scrim {
  display: none;
}

.pv2-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.45rem;
  margin: 0;
  border: 1px solid var(--pv2-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(45, 58, 53, 0.06);
}

.pv2-menu-btn-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: #44403c;
  border-radius: 1px;
}

.pv2-sidebar-close {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--pv2-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.pv2-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.pv2-topbar-left h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-size: 14px;
  }

  body:has(#pv2-nav-open:checked) {
    overflow: hidden;
  }

  .pv2-menu-btn {
    display: inline-flex;
  }

  .pv2-sidebar-close {
    display: inline-flex;
  }

  .pv2-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-right: 1rem;
  }

  .pv2-sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(26, 36, 32, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  #pv2-nav-open:checked ~ .pv2-app .pv2-sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .pv2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    max-height: 100dvh;
    width: min(288px, 86vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    box-shadow: none;
  }

  #pv2-nav-open:checked ~ .pv2-app .pv2-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.22);
  }

  .pv2-main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .pv2-topbar {
    padding: 0.65rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .pv2-topbar h2 {
    font-size: 1.05rem;
  }

  .pv2-user,
  a.pv2-user-link {
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
  }

  .pv2-content {
    padding: 1rem max(1rem, env(safe-area-inset-left)) 1.5rem max(1rem, env(safe-area-inset-right));
  }

  .pv2-panel {
    padding: 1rem 1rem 1.1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .pv2-panel h3 {
    font-size: 0.92rem;
  }

  .pv2-table {
    font-size: 0.82rem;
  }

  .pv2-table th,
  .pv2-table td {
    padding: 0.45rem 0.5rem;
  }

  .pv2-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .pv2-stat {
    padding: 0.75rem 0.65rem;
  }

  .pv2-stat b {
    font-size: 1.35rem;
  }

  .pv2-dash-health__item {
    flex: 1 1 calc(50% - 0.35rem);
    max-width: none;
  }

  .pv2-dash-health__value {
    font-size: 1rem;
  }

  .pv2-actions.pv2-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pv2-toolbar-search {
    width: 100%;
  }

  .pv2-toolbar-search input[type="search"],
  .pv2-toolbar-search input[type="text"] {
    min-width: 0;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  .pv2-btn-sm {
    padding: 0.42rem 0.75rem;
    font-size: 0.84rem;
  }

  .pv2-form-grid input[type="text"],
  .pv2-form-grid input[type="password"],
  .pv2-form-grid input[type="number"],
  .pv2-form-grid input[type="date"],
  .pv2-form-grid input[type="url"],
  .pv2-form-grid textarea,
  .pv2-form-grid select {
    max-width: none;
  }

  .pv2-check-grid {
    grid-template-columns: 1fr;
  }

  .pv2-admin-help-grid {
    grid-template-columns: 1fr;
  }

  .pv2-tvip-upload-grid {
    grid-template-columns: 1fr;
  }

  body.pv2-auth {
    padding: 1rem max(1rem, env(safe-area-inset-left)) 1rem max(1rem, env(safe-area-inset-right));
    align-items: flex-start;
    padding-top: max(1.5rem, env(safe-area-inset-top));
  }

  .pv2-login-card {
    padding: 1.35rem 1.15rem 1.3rem;
    border-radius: 14px;
    max-width: 100%;
  }

  .pv2-login-card h1 {
    font-size: 1.28rem;
  }

  .pv2-login-card .pv2-sub {
    font-size: 0.86rem;
  }

  .pv2-form input[type="text"],
  .pv2-form input[type="password"] {
    font-size: 16px;
  }

  .pv2-btn {
    font-size: 16px;
    padding: 0.65rem 1rem;
  }
}
