@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ━━ STREAM SHIELD DESIGN SYSTEM ━━━━━━━━━━━━━━━
   Premium dark-mode SaaS admin panel
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --bg:          #111318;
  --bg2:         #161922;
  --card:        #1c2030;
  --card2:       #232839;
  --border:      rgba(255,255,255,0.08);
  --text:        #e4e8f0;
  --muted:       #7a8599;
  --accent:      #6366f1;
  --accent-h:    #5558e6;
  --green:       #10b981;
  --red:         #ef4444;
  --orange:      #f59e0b;
  --purple:      #8b5cf6;
  --pink:        #ec4899;
  --cyan:        #06b6d4;
  --yellow:      #eab308;
  --sidebar-w:   260px;
  --input:       #161922;

  /* ── Design tokens (added for centralized styling) ────────────────────── */
  /* Semantic color aliases — use these instead of hardcoding hex in pages. */
  --red-soft:    #fca5a5;   /* error/danger TEXT on dark */
  --green-soft:  #86efac;   /* success text on dark */
  --success:     #22c55e;   /* bright success (badges/dots) */
  --danger:      #ef4444;   /* = --red */
  --warning:     #f59e0b;   /* = --orange */
  --white:       #ffffff;

  /* Spacing scale (margins/padding/gaps) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 28px; --sp-7: 40px;
  /* Radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  /* Font sizes */
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 24px;
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.15), 0 0 0 1px rgba(255,255,255,.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.4);

  /* Aliases for names some pages use inline — keep them pointing at the tokens above. */
  --bg-sidebar:     #13161f;
  --bg-main:        var(--bg2);
  --text-primary:   var(--text);
  --text-secondary: var(--muted);
  --text-muted:     var(--muted);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* clip (not hidden): no sideways page scroll, yet no scroll container, so the sticky
   header and other sticky bars keep working. hidden stays as the fallback. */
html { overflow-x: hidden; overflow-x: clip; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden; overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── UTILITY CLASSES ───────────────────────────── */

/* Text sizes */
.text-xxs { font-size: 9px; }
.text-xs  { font-size: 10px; }
.text-s   { font-size: 11px; }
.text-sm  { font-size: 12px; }
.text-md  { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg  { font-size: 15px; }
.text-xl  { font-size: 16px; }
.text-2xl { font-size: 17px; }
.text-3xl { font-size: 18px; }
.text-4xl { font-size: 32px; }

/* Font weights */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* Colors */
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-orange  { color: var(--orange); }
.text-cyan    { color: var(--cyan); }
.text-purple  { color: var(--purple); }
.text-white   { color: #fff; }
.text-default { color: var(--text); }

/* Display */
.d-none    { display: none !important; }
[hidden]   { display: none !important; }
.d-inline  { display: inline; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline-flex { display: inline-flex; }

/* Flexbox */
.flex-center    { display: flex; align-items: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1; }
.flex-1-min     { flex: 1; min-width: 0; }
.flex-shrink-0  { flex-shrink: 0; }
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.gap-2  { gap: 2px; }
.gap-3  { gap: 3px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Margins */
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 1px; }
.mb-2  { margin-bottom: 2px; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-4  { margin-top: 4px; }
.mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.m-0   { margin: 0; }

/* Padding */
.p-0   { padding: 0; }
.p-sm  { padding: 16px 20px; }
.p-md  { padding: 24px; }
.p-20  { padding: 20px; }
.pb-0  { padding-bottom: 0; }
.pt-12 { padding-top: 12px; }

/* Text alignment */
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Text helpers */
.text-muted-sm  { font-size: 11px; color: var(--muted); }
.text-muted-xs  { font-size: 10px; color: var(--muted); }
.text-muted-md  { font-size: 12px; color: var(--muted); }
.text-muted-lg  { font-size: 13px; color: var(--muted); }
.text-success   { color: #4ade80; }
.text-error     { color: #f87171; }
.text-truncate  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-nowrap    { white-space: nowrap; }
.uppercase      { text-transform: uppercase; }
.tracking-wide  { letter-spacing: 0.4px; }
.no-decoration  { text-decoration: none; }

/* Opacity */
.opacity-30 { opacity: 0.3; }
.opacity-40 { opacity: 0.4; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.min-w-0 { min-width: 0; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Inline display */
.d-inline-block { display: inline-block; }

/* Border */
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-none   { border: none; }
.rounded-sm { border-radius: 4px; }
.rounded    { border-radius: 8px; }
.rounded-md { border-radius: 10px; }
.rounded-lg { border-radius: 12px; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Transition */
.transition { transition: all 0.15s; }

/* ── COMMON COMPONENT PATTERNS ───────────────── */

/* Section header used in settings tabs */
.section-title     { font-size: 13px; font-weight: 600; }
.section-subtitle  { font-size: 11px; color: var(--muted); }
.section-header    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Settings card (compact padding) */
.card-compact { padding: 16px 20px; margin-bottom: 12px; }
.card-compact-flush { padding: 16px 20px; }

/* Stat/info label (uppercase muted) */
.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Field label (small) */
.field-label { font-size: 11px; margin-bottom: 4px; }

/* Input compact */
.input-compact { padding: 8px 12px; }
.input-sm      { padding: 7px 12px; font-size: 12px; }
.input-mono    { font-family: monospace; font-size: 12px; padding: 8px 12px; }

/* Toggle switch (used in footer/settings) */
.toggle       { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* Social row (footer settings) */
.social-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.social-row:last-child { border-bottom: none; }
.social-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.social-icon-active {
  color: var(--accent);
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
}
.social-name { font-size: 12px; font-weight: 500; min-width: 80px; }
.social-url  { flex: 1; min-width: 0; }
.social-url input { font-size: 12px; padding: 7px 10px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state-lg {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }

/* Hint / code inline */
.code-inline {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Info box */
.info-box {
  font-size: 12px; color: var(--muted);
  line-height: 1.6;
  padding: 10px 14px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 8px;
}

/* Warning alert */
.alert-warning {
  padding: 8px 12px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.1);
  border-radius: 6px;
}

/* Icon container (small icon box) */
.icon-box-sm {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(99,102,241,0.1);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Slide-in panel (used for detail drawers) */
.slide-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 100vw;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.slide-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Poster / thumbnail card */
.poster-card {
  width: 170px; height: 245px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg);
}
.poster-badge {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(99,102,241,0.85);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600;
  color: #fff;
}

/* Nav icon size (used across sidebar and tables) */
.icon-sm { flex-shrink: 0; width: 13px; height: 13px; }

/* Tab bar (settings page) */
.tab-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab-btn  { padding: 6px 14px; font-size: 12px; }

/* Sub tab (inline tabs within a card) */
.sub-tab {
  flex: 1; text-align: center;
  padding: 8px;
  border-bottom: 2px solid var(--border);
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
  cursor: pointer;
}
.sub-tab-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* View-only notice alt */
.notice-box {
  padding: 12px 16px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

[x-cloak] { display: none !important; }

/* ── LAYOUT ─────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; overflow-x: hidden; overflow-x: clip; max-width: 100vw; }

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #13161f;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  /* top+bottom, not 100vh: on phones 100vh is taller than the visible screen while
     the browser toolbar shows, which hid the Task Queue / VPN buttons at the bottom. */
  top: 0; bottom: 0; left: 0;
  z-index: 1100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  height: 60px;
  box-sizing: border-box;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.sidebar-logo-img { max-height: 36px; width: auto; object-fit: contain; }
/* a wide uploaded logo shrinks into the sidebar (and leaves room for the drawer's ×) */
.sidebar-logo { min-width: 0; overflow: hidden; }
.sidebar-logo-img { flex: 0 1 auto; min-width: 0; max-width: 100%; object-position: left center; }
.sidebar-logo-text { font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.sidebar-logo-text span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}

.sidebar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { font-size: 11px; color: var(--muted); }

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-left: 2px solid transparent;
  margin-left: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.nav-item.active {
  background: rgba(99,102,241,0.1);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item.active::after {
  content: '';
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.8;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-footer .nav-item:hover { background: rgba(239,68,68,.08); color: var(--red); border-left-color: var(--red); }

/* ── VPN SIDEBAR WIDGET ─────────────────────── */
.vpn-sidebar-widget {
  padding: 4px 12px 6px;
  position: relative;
}

.vpn-sidebar-btn {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px; font-family: inherit; font-weight: 500;
  text-align: left;
  transition: border-color .2s, color .2s, background .2s;
}
.vpn-sidebar-btn:hover { border-color: rgba(99,102,241,0.3); color: var(--text); background: rgba(255,255,255,0.03); }
.vpn-sidebar-btn.vpn-is-connected { border-color: rgba(16,185,129,0.3); color: var(--text); }

.vpn-sidebar-icon { flex-shrink: 0; display: flex; align-items: center; }
.vpn-sidebar-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vpn-sidebar-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.vpn-sidebar-dot.dot-on  { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.vpn-sidebar-dot.dot-off { background: var(--muted); }

.vpn-sidebar-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 12px; right: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  z-index: 300;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  /* many tunnels / landscape phone: scroll inside instead of running off the top */
  max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px);
  overflow-y: auto; overscroll-behavior: contain;
}
.vpn-popup-header {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: 8px;
}
.vpn-popup-name  { font-weight: 600; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; margin-bottom: 3px; }
.vpn-popup-proxy { font-size: 11px; color: var(--muted); word-break: break-all; margin-bottom: 10px; }
@media (pointer: coarse) {
  .vpn-sidebar-btn { min-height: 40px; }
  .vpn-popup-link { padding: 10px 0; }
}

/* ── SEARCHABLE VPN SELECT ──────────────────── */
.vpn-sel-wrap { position: relative; min-width: 0; flex: 1 1 0; }

.vpn-sel-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  min-width: 0; max-width: 160px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.vpn-sel-btn:hover          { border-color: rgba(99,102,241,0.3); }
.vpn-sel-btn.vpn-sel-active { border-color: rgba(16,185,129,0.4); }
.vpn-sel-btn.vpn-sel-direct { border-color: rgba(6,182,212,0.4); color: var(--cyan); }

.vpn-sel-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 260px; width: 300px; max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 9999;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.vpn-sel-search {
  width: 100%; padding: 10px 12px;
  background: var(--card2); border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 12px; font-family: inherit; outline: none;
}
.vpn-sel-options { max-height: 200px; overflow-y: auto; }
.vpn-sel-opt {
  padding: 8px 12px; font-size: 12px; cursor: pointer; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
  transition: background 0.15s;
}
.vpn-sel-opt:hover { background: rgba(255,255,255,0.03); }
.vpn-sel-opt.vpn-sel-cur { color: var(--accent); font-weight: 600; }

/* ── MAIN ───────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden; overflow-x: clip;
  max-width: 100%;
}

.main-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(22,25,34,0.88);
}

.main-header h1 {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
  color: var(--text);
}

.header-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  flex: 0 1 260px; min-width: 150px;
  color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.06);
}

.header-search > svg { flex-shrink: 0; }
/* the field is the box itself: no second border/background/padding inside it */
.header-search input {
  -webkit-appearance: none; appearance: none;
  background: none; border: 0; box-shadow: none; border-radius: 0;
  padding: 0; margin: 0; height: 100%; min-height: 0; min-width: 0;
  color: var(--text); font-size: 13px; width: 100%; outline: none;
}
.header-search input:focus { box-shadow: none; border: 0; }
.header-search input::-webkit-search-cancel-button { cursor: pointer; }

.header-search input::placeholder { color: var(--muted); }

/* Update bell (was inline style + onmouseover) */
.header-bell {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 8px; position: relative;
  color: var(--text-muted); text-decoration: none; transition: background .15s, color .15s;
}
.header-bell:hover { background: var(--bg-sidebar); color: var(--text); }
.header-bell-dot { display: none; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #f85149; border: 2px solid var(--bg-main); }
@media (pointer: coarse) { .header-bell { width: 40px; height: 40px; } }
@media (max-width: 900px) { .header-search { flex-basis: 220px; } }
/* Phones: a long page title takes a second line instead of being cut short */
@media (max-width: 640px) {
  .main-header h1 { white-space: normal; overflow-wrap: break-word; line-height: 1.2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}

.main-content { padding: 28px 32px; flex: 1; width: 100%; min-width: 0; }

/* ── GLOBAL SITE FOOTER ────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 28px 32px;
  flex-shrink: 0;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.site-footer-left strong { color: var(--text); font-weight: 600; }
.site-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-footer-social {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all .15s;
}
.site-footer-social:hover {
  color: var(--accent);
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.2);
}
@media (pointer: coarse) { .site-footer-social { width: 40px; height: 40px; } }
.site-footer-ver {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--accent);
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.28);
  padding: 3px 10px;
  border-radius: 6px;
  margin-left: 6px;
}

/* ── FLASH ──────────────────────────────────── */
.flash {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent;
}
.flash.success {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.15);
  border-left: 3px solid var(--green);
  color: #6ee7b7;
}
.flash.error {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.15);
  border-left: 3px solid var(--red);
  color: #fca5a5;
}
.flash.info {
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.15);
  border-left: 3px solid var(--accent);
  color: #a5b4fc;
}

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.03);
  transition: border-color 0.2s;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

/* Card row: full-width cards, equally distributed when side-by-side */
.card-row {
  display: flex; gap: 12px; width: 100%;
  margin-bottom: 12px;
  align-items: stretch;
}
.card-row > .card {
  flex: 1; min-width: 0;
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .card-row { flex-direction: column; }
}

/* ── KPI CARDS ──────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  align-items: stretch;
}

.kpi-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  border-color: rgba(255,255,255,0.09);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px; border-radius: 0 0 12px 12px;
}
.kpi-card.blue::after   { background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.kpi-card.green::after  { background: linear-gradient(90deg, var(--green), #6ee7b7); }
.kpi-card.orange::after { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.kpi-card.purple::after { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.kpi-card.cyan::after   { background: linear-gradient(90deg, var(--cyan), #67e8f9); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.kpi-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.kpi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.kpi-icon.blue   { background: rgba(99,102,241,.1);  color: var(--accent); }
.kpi-icon.green  { background: rgba(16,185,129,.1);   color: var(--green); }
.kpi-icon.orange { background: rgba(245,158,11,.1);   color: var(--orange); }
.kpi-icon.purple { background: rgba(139,92,246,.1);   color: var(--purple); }
.kpi-icon.cyan   { background: rgba(6,182,212,.1);    color: var(--cyan); }

.kpi-value { font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.kpi-footer { font-size: 10px; color: var(--muted); }

/* ── CHARTS GRID ────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
}

.chart-wrap {
  position: relative; height: 200px;
  width: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

canvas { display: block; max-width: 100%; }

.donut-center {
  position: absolute; text-align: center; pointer-events: none;
}
.donut-center .val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.donut-center .lbl { font-size: 11px; color: var(--muted); }

.chart-legend {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 16px;
}

.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-item strong { display: block; font-size: 15px; font-weight: 600; margin-top: 1px; }
.legend-item span { color: var(--muted); font-size: 11px; }

/* ── GRID HELPERS ───────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; align-items: stretch; }
.gap-16 { gap: 16px; }

/* ── TABLES ─────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  display: block;
}
@media (max-width: 900px) {
  .table-wrap { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .col-hide-tablet { display: none; }
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { border-bottom: 1px solid var(--border); }

th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 500; color: var(--muted);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.15s;
}
tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
tbody tr:hover { background: rgba(255,255,255,0.04); }
/* Tablets: tighter tables (after the base rules above, which used to cancel it) */
@media (max-width: 900px) {
  table { font-size: 12px; }
  td, th { padding: 8px 10px; }
}

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-ok,
.badge-enabled,
.badge-success {
  background: rgba(16,185,129,.1);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.15);
}
.badge-off,
.badge-disabled,
.badge-error,
.badge-danger {
  background: rgba(239,68,68,.08);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.15);
}
.badge-warning, .badge-warn {
  background: rgba(234,179,8,.08);
  color: #fde68a;
  border: 1px solid rgba(234,179,8,.15);
}
.badge-info {
  background: rgba(99,102,241,.1);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.18);
}

/* ── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }
.form-section-divider { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; margin: 8px 0 14px; }
.panel-credit-box { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15); border-radius: 8px; }
.panel-credit-val { font-size: 14px; font-weight: 600; color: var(--accent); }

label {
  display: block;
  font-size: 12px; font-weight: 500; color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;   /* a width:auto select with a long option must never outgrow its box */
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

option {
  background: var(--card);
  color: var(--text);
}

option:hover, option:checked {
  background: var(--accent);
  color: #fff;
}

input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input[type="time"] { width: auto; }
input[readonly] { opacity: .6; cursor: default; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.checkbox-row input { margin: 0; }
.checkbox-row label { margin: 0; text-transform: none; font-size: 13px; color: var(--text); letter-spacing: 0; font-weight: 500; }

/* ── BUTTONS ────────────────────────────────── */
/* Structural base applies to ANY element carrying a button class — including
   <a> link-buttons — so a `.btn-secondary`/`.btn-warn`/etc. link is sized and
   styled identically to a real <button> (no stray underline, equal height).
   Kept at single-class specificity (0,1,0) so size modifiers like `.btn-sm`
   and the responsive breakpoints below still override the padding/font. */
button, .btn, .btn-secondary, .btn-warn, .btn-danger, .btn-success {
  border: none; border-radius: 8px;
  padding: 10px 20px; cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: inherit;
  line-height: 1.2;   /* fixed — else <a> buttons inherit body's 1.6 and render taller than <button> */
  text-decoration: none;
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  vertical-align: middle;
}

button:disabled, .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn, button.btn { background: var(--accent); color: #fff; }
.btn:hover, button.btn:hover {
  background: var(--accent-h);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.26);
}

.btn.btn-warn, .btn-warn {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(245,158,11,.25);
}
.btn.btn-warn:hover, .btn-warn:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  box-shadow: 0 4px 12px rgba(245,158,11,.35);
}

.btn-danger {
  background: rgba(239,68,68,.08);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.15);
}
.btn-danger:hover {
  background: rgba(239,68,68,.14);
  transform: scale(1.01);
}

.btn-success {
  background: rgba(16,185,129,.08);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,.15);
}
.btn-success:hover {
  background: rgba(16,185,129,.14);
  transform: scale(1.01);
}

.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ── ACTION STACK (legacy compat) ───────────── */
.action-stack { display: flex; flex-direction: column; gap: 6px; }
.action-stack form { margin: 0; }
.action-stack button { width: 100%; }
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.row > * { flex: 1; min-width: 140px; }

/* ── LOADING OVERLAY ────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
}
#loading-overlay.show { display: flex; }
#loading-text {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 20px 32px; border-radius: 14px;
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MISC ───────────────────────────────────── */
pre {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  font-size: 12px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word;
  color: #94a3b8;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

small, .muted { color: var(--muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-accent { color: var(--accent); }

/* .section-title defined in utility section (13px) — this was a duplicate, removed */

details summary { cursor: pointer; color: var(--muted); font-size: .85em; transition: color 0.15s; }
details summary:hover { color: var(--text); }
details pre { margin-top: 8px; }

/* ── PAGINATION ─────────────────────────────── */
.pagination {
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.page-link {
  padding: 7px 14px; border-radius: 999px;
  background: transparent; color: var(--muted);
  text-decoration: none; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
  transition: all .2s;
}
.page-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}
.page-link.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── SUPERADMIN BADGE / NAV ─────────────────── */
.badge-sa {
  background: rgba(245,158,11,.1);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.2);
}
.nav-item-sa { color: #fbbf24 !important; }
.nav-item-sa .nav-icon svg { stroke: #fbbf24; }
.nav-item-sa:hover,
.nav-item-sa.active { background: rgba(245,158,11,.08) !important; }
.nav-section-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* ── SUPERADMIN PAGE HEADER ─────────────────── */
.sa-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── ADMIN ACCOUNT ROWS ─────────────────────── */
.admin-row {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.admin-row:first-of-type { border-top: none; padding-top: 0; }
.admin-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── PERMISSION MATRIX ──────────────────────── */
.perm-matrix {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.perm-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
}
/* One .perm-group (header + collapsible body) per permission group */
.perm-group + .perm-group { border-top: 1px solid var(--border); }
.perm-group > .sa-perm-body { border-top: 1px solid var(--border); }
.perm-matrix-row {
  padding: 4px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background .15s;
}
.perm-matrix-row:last-child { border-bottom: none; }
.perm-matrix-row:hover { background: rgba(255,255,255,0.02); }
.perm-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  padding: 4px 0;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.perm-check-label input[type=checkbox] {
  accent-color: var(--green);
  width: 14px; height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.perm-check-label:has(input:checked) { color: var(--green); }
.perm-check-label:has(input:not(:checked)) span { color: var(--muted); }
@media (max-width: 640px) {
  .perm-matrix-row { padding: 6px 10px; }
}

/* ── PASSWORD FIELD HELPERS ─────────────────── */
.pw-wrap {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.pw-input {
  flex: 1;
  min-width: 0;
}
.pw-btns {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.pw-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 9px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s;
  line-height: 1;
  display: flex;
  align-items: center;
}
.pw-btn:hover { background: rgba(255,255,255,0.04); border-color: rgba(99,102,241,0.3); }
.pw-btn.copied { border-color: rgba(16,185,129,0.4); color: var(--green); }

/* ── PERMISSION GROUP TOGGLE ────────────────── */
.perm-group-toggle { cursor: pointer; }

/* ── VIEW-ONLY NOTICE ───────────────────────── */
.view-only-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.15);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #a5b4fc;
  margin-bottom: 16px;
}

/* ── CONNECTED USER CARDS ───────────────────── */
.cu-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.cu-card:hover { border-color: rgba(255,255,255,0.09); }
.cu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.cu-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 8em;
  min-width: 0;
}
.cu-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}
.cu-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.cu-route-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
/* a long VPN name gives way to the username: it truncates, or drops to its own line */
.cu-top { flex-wrap: wrap; }
.cu-route-badge { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Phones, tablets and touch screens (no hover tooltips): full names, no text below 11px */
@media (max-width: 900px), (pointer: coarse) {
  .cu-user { white-space: normal; overflow-wrap: anywhere; }
  .cu-meta, .cu-meta .text-xs, .cu-time, .cu-route-badge { font-size: 11px; }
}

/* Map + list layout and its small-screen stacking: see DASHBOARD (.cu-grid-layout) */

/* ── MODAL ──────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1; border-radius: 16px 16px 0 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.modal-close {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); cursor: pointer;
  font-size: 16px; width: 30px; height: 30px; padding: 0; display: flex;
  align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.modal-body { padding: 28px 28px 24px; }
.modal-body .form-group { margin-bottom: 20px; position: relative; }
.modal-body .form-group:last-child { margin-bottom: 0; }
/* :where() keeps this at element specificity, so component labels (checkbox chips,
   switches, checkbox rows) inside modals keep their own look. */
:where(.modal-body) label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px; }
.modal-body input, .modal-body select, .modal-body textarea { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); padding: 12px 16px; font-size: 14px; border-radius: 10px; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { background: rgba(255,255,255,0.05); border-color: rgba(99,102,241,0.5); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.modal-body input::placeholder { color: rgba(255,255,255,0.2); font-size: 13px; }
/* Full-width primary action in simple modals. MUST exclude size modifiers —
   otherwise this descendant selector (specificity 0,2,0) overrides .btn-sm/.btn-micro
   (0,1,0), oversizing footer Save buttons while .btn-secondary siblings stay small. */
.modal-body .btn:not(.btn-sm):not(.btn-micro):not(.btn-xs) { padding: 13px 20px; font-size: 14px; font-weight: 600; border-radius: 10px; margin-top: 8px; text-align: center; justify-content: center; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: center;
}

/* ── SHARE MODAL ─────────────────────────────── */
.share-modal-box { max-width: 480px; }
.share-modal-body { display: flex; flex-direction: column; gap: 16px; }
.share-group { display: block; }
.share-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); margin-bottom: 6px; display: block;
}
.share-field {
  display: flex !important; flex-direction: row !important;
  gap: 0 !important; align-items: stretch !important;
}
.share-input {
  flex: 1 1 0% !important; min-width: 0 !important;
  background: var(--input) !important; border: 1px solid var(--border) !important;
  border-right: none !important;
  border-radius: 8px 0 0 8px !important; padding: 10px 12px !important;
  font-family: 'Fira Code', Consolas, monospace !important;
  font-size: 13px !important; color: var(--text) !important;
  resize: none !important; outline: none !important;
}
.share-url { font-size: 11px !important; }
.share-textarea { line-height: 1.6; }
.share-copy {
  flex: 0 0 auto !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  width: 64px !important; padding: 0 !important;
  font-size: 11px !important; font-weight: 600 !important;
  letter-spacing: .3px;
  background: rgba(255,255,255,0.05) !important; color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 8px 8px 0 !important; cursor: pointer !important;
  transition: background .15s, color .15s;
}
.share-copy:hover {
  background: rgba(255,255,255,0.1) !important; color: var(--text) !important;
}
.share-modal-footer {
  padding: 16px 24px !important; border-top: 1px solid var(--border);
  display: flex !important; justify-content: center !important;
}
.share-close-btn {
  padding: 8px 32px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.04); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.share-close-btn:hover {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15);
}
/* Clients page share box: Close stays in view on short (landscape) screens */
#share-modal .share-modal-footer { position: sticky; bottom: 0; z-index: 1; background: var(--card); }
@media (pointer: coarse) { #share-modal .share-close-btn, #share-modal .share-input { min-height: 40px; } }

/* ── MAP LEGEND ─────────────────────────────── */
.map-legend {
  position: absolute; bottom: 10px; left: 10px; z-index: 999;
  background: rgba(10,12,16,.85);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  display: flex; gap: 12px; flex-wrap: wrap;
  backdrop-filter: blur(8px);
}
.map-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text); }
.map-legend-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); flex-shrink: 0; }
.map-legend-dot-vpn    { background: #22c55e; }
.map-legend-dot-proxy  { background: #f97316; }
.map-legend-dot-direct { background: #5b8ef0; }

/* ── LEAFLET MAP Z-INDEX FIX ────────────────── */
.leaflet-container { isolation: isolate; }
.leaflet-control-attribution { background: rgba(22,24,29,.75) !important; color: #8a93a6 !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #9fb0cc !important; }
#world-map { position: relative; z-index: 0; }
@media (pointer: coarse) { #world-map .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; } }

/* ── LEAFLET POPUP — dark theme ───────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(22, 28, 45, 0.95) !important;
  color: #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  backdrop-filter: blur(8px);
}
.leaflet-popup-content {
  margin: 10px 30px 10px 14px !important; /* right: clear of the × */
  font-size: 13px !important;
  line-height: 1.5 !important;
}
.leaflet-popup-content strong { overflow-wrap: anywhere; }
.cu-pop-route { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.08); font-weight: 500; }
@media (max-width: 900px), (pointer: coarse) { .cu-pop-route { font-size: 11px; } }
.leaflet-popup-tip {
  background: rgba(22, 28, 45, 0.95) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-top: none !important; border-right: none !important;
}
.leaflet-popup-close-button {
  color: #8892a4 !important;
  font-size: 18px !important;
  top: 4px !important;
  right: 6px !important;
}
.leaflet-popup-close-button:hover { color: #fff !important; }

/* ── CONTENT NAV GROUP ──────────────────────── */
.nav-group-toggle {
  width: 100%; text-align: left; background: none;
  border: none; border-left: 2px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 500;
  padding: 10px 12px; display: flex; align-items: center; gap: 12px;
  transition: all 0.2s;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.03); color: var(--text); }
/* A group parent (e.g. you're on a page inside it) highlights like a nav-item, but the
   chevron — not the dot — is its indicator, so suppress the ::after dot. */
.nav-group-toggle.active { color: var(--accent); border-left-color: var(--accent); background: rgba(99,102,241,0.1); }
.nav-group-toggle.active::after { display: none; }
.nav-chevron { margin-left: auto; }
.nav-chevron { transition: transform 0.2s; color: var(--muted); flex-shrink: 0; }
.nav-sub { padding-left: 16px; font-size: 12px; }
.nav-sub-wrap { padding-left: 8px; border-left: 2px solid var(--border); margin: 2px 12px 2px 18px; display: flex; flex-direction: column; gap: 1px; }
/* "Update available" dot on the Settings group icon */
.nav-update-dot { display: none; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: #f85149; border: 1px solid var(--bg-sidebar); }

/* ── MULTI-VPN WIDGET ───────────────────────── */
.vpn-connected-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 2px;
}
.vpn-popup-vpn-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border);
}
.vpn-popup-vpn-row:last-child { border-bottom: none; }

/* ── CONNECTED USERS FILTER BAR ─────────────── */
.cu-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 8px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
.cu-filter-bar input, .cu-filter-bar select {
  padding: 5px 8px; font-size: 11px; border-radius: 6px;
  background: var(--input); border: 1px solid var(--border); color: var(--text);
  height: 28px;
}
.cu-filter-bar input { flex: 1; min-width: 80px; }
.cu-filter-bar select { min-width: 90px; }
@media (pointer: coarse), (max-width: 640px) {
  .cu-filter-bar input, .cu-filter-bar select { height: auto; min-height: 40px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .cu-filter-bar input { flex: 1 1 200px; width: auto; }
  .cu-filter-bar select { flex: 0 1 170px; width: auto; }
}
@media (max-width: 640px) {
  .cu-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .cu-filter-bar input { grid-column: 1 / -1; }
  .cu-filter-bar input, .cu-filter-bar select { width: 100%; min-width: 0; }
}

/* ── VPN ASSIGNMENT TOOLTIP ─────────────────── */
.vpn-clients-wrap { position: relative; display: inline-flex; }
.vpn-clients-pill {
  cursor: pointer; position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; border-radius: 6px; padding: 4px 6px; margin: -4px -6px;
  font: inherit; font-weight: 400; color: inherit; white-space: nowrap;
}
.vpn-clients-pill:hover, .vpn-clients-pill[aria-expanded="true"] { background: rgba(255,255,255,.05); }
.vpn-clients-tooltip {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; min-width: 160px; max-width: 280px;
  font-size: 12px; line-height: 1.5; color: var(--text); z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  white-space: normal; word-break: break-word; text-align: left;
}
@media (pointer: coarse), (max-width: 640px) { .vpn-clients-pill { min-height: 36px; } }
@media (max-width: 640px) { .vpn-clients-tooltip.ss-sheet { padding: 14px 16px 16px; font-size: 14px; } }

/* ── CHANNEL LIST VIEW ──────────────────────── */
.channel-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.channel-list-row:hover { background: rgba(255,255,255,0.02); }
.channel-list-row:last-child { border-bottom: none; }
.channel-list-thumb {
  width: 48px; height: 36px; border-radius: 6px;
  object-fit: contain; background: rgba(0,0,0,0.3); padding: 3px; flex-shrink: 0;
}
.channel-list-placeholder {
  width: 48px; height: 36px; border-radius: 6px;
  background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.view-toggle-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted); cursor: pointer;
  padding: 5px 10px; font-size: 13px; display: flex; align-items: center;
  gap: 4px; transition: all .2s;
}
.view-toggle-btn:hover { border-color: rgba(255,255,255,0.12); color: var(--text); }
.view-toggle-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── SSL STATUS ALERT ───────────────────────── */
.ssl-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
  border-left: 3px solid transparent;
}
.ssl-alert.warning {
  background: rgba(234,179,8,.06);
  border: 1px solid rgba(234,179,8,.15);
  border-left: 3px solid var(--orange);
  color: #fde68a;
}
.ssl-alert.ok {
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.15);
  border-left: 3px solid var(--green);
  color: #6ee7b7;
}
.ssl-alert.error {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.15);
  border-left: 3px solid var(--red);
  color: #fca5a5;
}

/* ── VPN CONNECTED BANNER ───────────────────── */
.vpn-connected-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-radius: 10px; margin-bottom: 16px;
  background: rgba(16,185,129,.05); border: 1px solid rgba(16,185,129,.15);
  font-size: 13px;
}
.vpn-connected-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--green);
}
.vpn-connected-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
}

/* ── LIVE CHANNELS PAGE ────────────────────── */
.lv-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;gap:8px}
.lv-header-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;max-width:100%}
.lv-header-left select{width:auto;padding:7px 28px 7px 10px;font-size:12px;flex-shrink:0}
.lv-header-meta{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}
.lv-header-meta .lv-epg-badge{font-size:9px;font-weight:600;padding:2px 8px;border-radius:99px;background:rgba(139,92,246,.1);color:#c4b5fd;border:1px solid rgba(139,92,246,.18)}
.lv-tabs{display:flex;gap:2px;background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:9px;padding:3px}
.lv-tab{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;font-size:12px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:7px;transition:all .15s;white-space:nowrap}
.lv-tab:hover{color:var(--text);background:rgba(255,255,255,.04)}
.lv-tab.active{color:#fff;background:var(--accent);box-shadow:0 1px 4px rgba(99,102,241,.25)}
.lv-tab-badge{font-size:9px;background:rgba(239,68,68,.15);color:#fca5a5;padding:1px 6px;border-radius:99px;font-weight:600}
.lv-tab.active .lv-tab-badge{background:rgba(255,255,255,.2);color:#fff}
.lv-kpis{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.lv-kpi{flex:1;min-width:100px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;position:relative;overflow:hidden}
.lv-kpi::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:0 0 10px 10px}
.lv-kpi.blue::after{background:linear-gradient(90deg,var(--accent),var(--purple))}
.lv-kpi.green::after{background:linear-gradient(90deg,var(--green),#34d399)}
.lv-kpi.cyan::after{background:linear-gradient(90deg,var(--cyan),#22d3ee)}
.lv-kpi.orange::after{background:linear-gradient(90deg,var(--orange),#fbbf24)}
.lv-kpi.red::after{background:linear-gradient(90deg,var(--red),#f87171)}
.lv-kpi-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}
.lv-kpi-val{font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.lv-kpi-sub{font-size:10px;color:var(--muted);margin-top:1px}
.lv-browse{display:grid;grid-template-columns:30% 70%;gap:0;height:calc(100vh - 210px);min-height:460px}
.lv-rail{background:var(--card);border:1px solid var(--border);border-radius:12px 0 0 12px;display:flex;flex-direction:column;overflow:hidden;border-right:none}
.lv-rail-head{padding:10px;border-bottom:1px solid var(--border);flex-shrink:0}
.lv-rail-head input{width:100%;padding:7px 10px;font-size:11px;background:var(--bg);border-radius:6px}
.lv-rail-items{flex:1;overflow-y:auto;padding:4px 5px}
.lv-rail-sep{height:1px;background:var(--border);margin:4px 8px 6px}
.lv-rail-all{display:flex;align-items:center;gap:8px;width:100%;padding:9px 10px;font-size:12px;font-weight:600;background:rgba(255,255,255,.02);border:1px solid transparent;border-radius:8px;cursor:pointer;color:var(--text);text-align:left;font-family:inherit;transition:all .12s;margin-bottom:2px}
.lv-rail-all:hover{background:rgba(99,102,241,.05);border-color:rgba(99,102,241,.1)}
.lv-rail-all.active{background:linear-gradient(135deg,rgba(99,102,241,.1),rgba(139,92,246,.08));color:#a5b4fc;border-color:rgba(99,102,241,.2);box-shadow:0 1px 4px rgba(99,102,241,.1)}
.lv-rail-all-icon{width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,var(--accent),var(--purple));display:flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;box-shadow:0 1px 4px rgba(99,102,241,.2)}
.lv-rail-item{display:flex;align-items:center;gap:7px;width:100%;padding:6px 8px;font-size:12px;background:none;border:none;border-left:2px solid transparent;border-radius:0 6px 6px 0;cursor:pointer;color:var(--muted);text-align:left;font-family:inherit;transition:all .12s;margin-bottom:1px}
.lv-rail-item:hover{background:rgba(255,255,255,.035);color:var(--text)}
.lv-rail-item.active{background:rgba(99,102,241,.08);color:var(--accent);border-left-color:var(--accent);font-weight:500}
.lv-rail-dot{width:8px;height:8px;border-radius:3px;flex-shrink:0;opacity:.7;transition:opacity .12s}
.lv-rail-item:hover .lv-rail-dot{opacity:1}
.lv-rail-item.active .lv-rail-dot{opacity:1;box-shadow:0 0 6px currentColor}
.lv-rail-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lv-rail-count{font-size:10px;color:var(--muted);flex-shrink:0;background:rgba(255,255,255,.04);padding:1px 6px;border-radius:99px;min-width:22px;text-align:center;font-weight:400}
.lv-rail-item:hover .lv-rail-count{background:rgba(255,255,255,.07);color:var(--text)}
.lv-rail-item.active .lv-rail-count{background:rgba(99,102,241,.15);color:var(--accent);font-weight:500}
.lv-channels{background:var(--card);border:1px solid var(--border);border-radius:0 12px 12px 0;display:flex;flex-direction:column;overflow:hidden}
.lv-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border);flex-shrink:0;flex-wrap:wrap}
.lv-toolbar input{flex:1;max-width:260px;min-width:140px;padding:7px 10px;font-size:11px;background:var(--bg);border-radius:6px}
.lv-toolbar-meta{font-size:11px;color:var(--muted);margin-left:auto;white-space:nowrap}
.lv-epg-hint{display:none;flex:1 1 100%;font-size:11px;line-height:1.4;color:var(--muted)}   /* touch only: what the badge and row-dot tooltips say on desktop */
.lv-epg-hint a{color:var(--accent);text-decoration:none;font-weight:500}
.lv-epg-hint .lv-dot{display:inline-block;vertical-align:middle;margin:0 4px 1px 6px}
.lv-list-scroll{flex:1;overflow-y:auto}
.lv-section-hdr{display:flex;align-items:center;justify-content:space-between;padding:6px 14px;font-size:10px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;background:linear-gradient(rgba(0,0,0,.12),rgba(0,0,0,.12)) var(--card);border-bottom:1px solid rgba(255,255,255,.04);position:sticky;top:0;z-index:2}
.lv-section-cnt{font-weight:400;font-size:10px;opacity:.6;flex-shrink:0;white-space:nowrap;margin-left:8px}
.lv-row{display:flex;align-items:center;gap:10px;padding:6px 14px;border-bottom:1px solid rgba(255,255,255,.03);cursor:pointer;transition:background .1s}
.lv-row:hover{background:rgba(255,255,255,.025)}
.lv-row.selected{background:rgba(99,102,241,.06);box-shadow:inset 3px 0 0 var(--accent)}
.lv-row-logo{width:38px;height:28px;flex-shrink:0;background:rgba(0,0,0,.18);border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.lv-row-logo img{max-width:100%;max-height:100%;object-fit:contain}
.lv-row-logo-ph{font-size:11px;opacity:.2}
.lv-row-info{flex:0 0 150px;min-width:0}
.lv-row-name{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.lv-row-cat{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.lv-row-epg{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.lv-row-now{display:flex;align-items:center;gap:6px;min-width:0}
.lv-live-dot{width:6px;height:6px;border-radius:50%;background:var(--green);flex-shrink:0;box-shadow:0 0 6px rgba(16,185,129,.4);animation:lv-pulse 2s ease-in-out infinite}
@keyframes lv-pulse{0%,100%{opacity:1}50%{opacity:.4}}
.lv-row-now-title{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lv-row-progress{height:3px;background:rgba(255,255,255,.06);border-radius:2px;overflow:hidden;max-width:260px}
.lv-row-progress-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--purple));border-radius:2px;transition:width 30s linear}
.lv-row-no-epg{font-size:11px;color:var(--muted);opacity:.4;font-style:italic}
.lv-row-time{font-size:10px;color:var(--muted);flex-shrink:0;min-width:44px;text-align:right}
.lv-row-next{flex:0 0 130px;min-width:0}
.lv-row-next-label{font-size:9px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);opacity:.5;line-height:1.3}
.lv-row-next-title{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.lv-row-status{display:flex;gap:3px;flex-shrink:0}
.lv-dot{width:5px;height:5px;border-radius:50%}
.lv-dot.ok{background:var(--green)}
.lv-dot.warn{background:var(--orange);opacity:.45}
.lv-dot.err{background:var(--red);opacity:.45}
.lv-detail{position:fixed;top:0;right:0;bottom:0;width:380px;max-width:90vw;background:var(--card);border-left:1px solid var(--border);box-shadow:-12px 0 48px rgba(0,0,0,.4);z-index:1200;display:flex;flex-direction:column;overflow:hidden}
.lv-detail-head{padding:14px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.lv-detail-head h3{font-size:13px;font-weight:600;margin:0}
.lv-detail-close{background:rgba(255,255,255,.04);border:1px solid var(--border);border-radius:6px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);font-size:14px;font-family:inherit;transition:all .12s}
.lv-detail-close:hover{color:var(--text);background:rgba(255,255,255,.08)}
.lv-detail-body{flex:1;overflow-y:auto;padding:20px;overscroll-behavior:contain}
.lv-detail-logo{width:100%;height:80px;background:rgba(0,0,0,.12);border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:14px;overflow:hidden}
.lv-detail-logo img{max-height:56px;max-width:80%;object-fit:contain}
.lv-detail-name{font-size:16px;font-weight:600;margin-bottom:2px}
.lv-detail-cat{font-size:12px;color:var(--muted);margin-bottom:12px}
.lv-detail-badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.lv-detail-section{margin-bottom:18px}
.lv-detail-section-title{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:8px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.lv-sched-item{padding:8px 10px;border-radius:6px;margin-bottom:4px;display:flex;flex-direction:column;gap:3px;transition:background .1s}
.lv-sched-item.now{background:rgba(99,102,241,.06);border:1px solid rgba(99,102,241,.12)}
.lv-sched-item:not(.now){padding-left:10px;border-left:2px solid rgba(255,255,255,.04)}
.lv-sched-time{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px}
.lv-sched-live{font-size:9px;font-weight:700;color:var(--green);text-transform:uppercase;letter-spacing:.03em}
.lv-sched-title{font-size:13px;font-weight:500}
.lv-sched-meta{font-size:10px;color:var(--muted);margin-top:2px}
.lv-meta{display:flex;flex-direction:column;gap:8px}
.lv-meta-row{display:flex;justify-content:space-between;gap:8px;font-size:12px}
.lv-meta-label{color:var(--muted);flex-shrink:0}
.lv-meta-val{text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.lv-list-card{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}
.lv-filter-bar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border)}
.lv-filter-bar input,.lv-filter-bar select{padding:7px 10px;font-size:12px}
.lv-filter-bar input{flex:1;min-width:100px;max-width:200px}
.lv-filter-bar select{width:auto;padding-right:28px}
.lv-filter-meta{font-size:11px;color:var(--muted);margin-left:auto}
.lv-tbl{width:100%;border-collapse:collapse}
.lv-tbl th{padding:8px 12px;font-size:10px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap;background:rgba(0,0,0,.08)}
.lv-tbl td{padding:7px 12px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.03);vertical-align:middle}
.lv-tbl tbody tr:hover{background:rgba(255,255,255,.02)}
.lv-tbl-logo{width:36px;height:24px;object-fit:contain;background:rgba(0,0,0,.15);border-radius:3px;display:block}
.lv-tbl-logo-ph{width:36px;height:24px;background:rgba(0,0,0,.15);border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:10px;opacity:.2}
.lv-tbl-prog{display:inline-block;width:50px;height:3px;background:rgba(255,255,255,.06);border-radius:2px;overflow:hidden;vertical-align:middle;margin-left:4px}
.lv-tbl-prog-fill{height:100%;background:var(--accent);border-radius:2px}
.lv-tbl-now{display:flex;align-items:center;gap:4px;min-width:0}
.lv-tbl-now-dot{width:5px;height:5px;border-radius:50%;background:var(--green);flex-shrink:0;box-shadow:0 0 4px rgba(16,185,129,.3)}
.lv-tbl-now-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
.lv-tbl-next{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:140px}
.lv-tbl-sub{display:none}
.lv-review-kpis{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.lv-review-kpi{flex:1;min-width:90px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:10px 12px;text-align:center}
.lv-review-kpi-val{font-size:22px;font-weight:700;letter-spacing:-.02em}
.lv-review-kpi-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-top:2px}
.lv-epg-notice{display:flex;align-items:center;gap:8px;padding:8px 14px;background:rgba(245,158,11,.06);border:1px solid rgba(245,158,11,.12);border-radius:8px;font-size:12px;color:#fde68a;margin-bottom:12px}
.lv-epg-notice a{color:var(--accent);text-decoration:none;font-weight:500}
@media(max-width:1100px){.lv-row-next{display:none}.lv-row-info{flex:0 0 120px}.lv-tbl-now-title,.lv-tbl-next{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-width:none;overflow-wrap:break-word}}
/* Stacked (<=900px): the channel list flows with the page instead of a nested scroll box
   (a short landscape screen left it 0-10px tall); section headers stick under the top bar. */
@media(max-width:900px){.lv-browse{grid-template-columns:minmax(0,1fr);height:auto;min-height:0}.lv-rail{border-radius:12px 12px 0 0;border-right:1px solid var(--border);border-bottom:none}.lv-channels{border-radius:0 0 12px 12px;overflow:visible;overflow:clip}.lv-channels .lv-list-scroll{overflow:visible}.lv-section-hdr{top:60px}.lv-detail{width:320px}.lv-row-time{display:none}.lv-row-info{flex:0 1 220px}
  .lv-row-cat,.lv-section-hdr,.lv-section-cnt,.lv-tbl th,.lv-kpi-label,.lv-kpi-sub,.lv-review-kpi-label,.lv-tbl .badge-xxs,.lv-tbl-logo-ph,.lv-toolbar .uc-toolbar-actions .badge{font-size:11px}}
@media(max-width:640px){.lv-header{flex-direction:column;align-items:stretch}.lv-header-left select{width:100%;flex-shrink:1}.lv-tab{flex:1;justify-content:center}.lv-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:6px}.lv-kpi{min-width:0;padding:8px 10px}.lv-kpi-val{font-size:16px}.lv-row-epg{display:none}.lv-row-info{flex:1}.lv-toolbar input{flex:1 1 100%;max-width:none}.lv-toolbar-meta{margin-left:0}.lv-detail{width:100%;max-width:100vw}.lv-filter-bar{padding:10px 12px}.lv-filter-bar input{flex:1 1 100%;max-width:none}.lv-filter-bar select{flex:1 1 140px}.lv-tbl .col-hide-sm{display:none}.lv-tbl .col-w-80{width:1%;white-space:nowrap}.lv-tbl-sub{display:block;margin-top:2px;font-size:11px;color:var(--muted);line-height:1.35;overflow-wrap:anywhere}.lv-tbl .channel-no-prog{white-space:nowrap}.lv-tbl .lv-tbl-prog{display:none}}
@media(max-width:380px){.lv-section-hdr{top:52px}}
@media(pointer:coarse){.lv-tab{min-height:36px}.lv-header-left select,.lv-filter-bar input,.lv-filter-bar select{min-height:36px}.lv-detail-close{width:40px;height:40px;font-size:18px}.lv-epg-notice a{display:inline-block;padding:9px 0;margin:-9px 0}.lv-list-card ~ .pagination .page-link{display:inline-flex;align-items:center;justify-content:center;min-width:36px}.lv-toolbar .uc-toolbar-actions{gap:8px}.lv-epg-hint{display:block}.lv-epg-hint a{display:inline-block;padding:11px 0;margin:-11px 0}}

/* ── SERVICE PAGE ──────────────────────────── */
.svc-kpis{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.svc-kpi{flex:1;min-width:100px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;position:relative;overflow:hidden}
.svc-kpi::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:0 0 10px 10px}
.svc-kpi.blue::after{background:linear-gradient(90deg,var(--accent),var(--purple))}
.svc-kpi.green::after{background:linear-gradient(90deg,var(--green),#34d399)}
.svc-kpi.cyan::after{background:linear-gradient(90deg,var(--cyan),#22d3ee)}
.svc-kpi.purple::after{background:linear-gradient(90deg,var(--purple),#a78bfa)}
.svc-kpi.orange::after{background:linear-gradient(90deg,var(--orange),#fbbf24)}
.svc-kpi.red::after{background:linear-gradient(90deg,var(--red),#f87171)}
.svc-kpi-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}
.svc-kpi-val{font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.svc-kpi-sub{font-size:10px;color:var(--muted);margin-top:1px}
/* Row ⋮ menu: teleported to <body> and placed by ssPop (fixed; a bottom sheet on phones) */
.svc-action-menu{position:fixed;top:0;left:0;z-index:1300;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:4px 0;min-width:170px;box-shadow:0 8px 24px rgba(0,0,0,.6)}
.svc-menu-backdrop{position:fixed;inset:0;z-index:1200;background:transparent}
.svc-action-title{display:none;padding:8px 14px 10px;font-size:12px;font-weight:600;color:var(--muted);border-bottom:1px solid var(--border);margin-bottom:4px;overflow-wrap:anywhere}
.svc-action-menu.ss-sheet .svc-action-title{display:block}
.svc-action-item{display:block;width:100%;padding:7px 14px;font-size:12px;color:var(--text);text-align:left;background:none;border:none;cursor:pointer;white-space:nowrap;font-family:inherit;transition:background .1s}
.svc-action-item:hover{background:rgba(255,255,255,.04)}
.svc-action-item.danger{color:var(--red)}
.svc-action-item.danger:hover{background:rgba(239,68,68,.06)}
.svc-action-sep{border-top:1px solid var(--border);margin:4px 0}
.svc-action-menu form{margin:0}
a.svc-action-item{font-weight:600;line-height:1.2}
/* 3 + 3 KPI cards until all six fit on one row (5 + 1 left a lone full-width card) */
@media (max-width:760px){
  .svc-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .svc-kpi{min-width:0}
}
/* VPN lists (routing column + modal): a long tunnel name ends in "…" (full name in the tooltip);
   on touch screens, where there is no tooltip, it wraps instead of being cut at the edge */
.service-vpn-form .vpn-sel-opt > span:first-child,.vpn-sel-wrap-full .vpn-sel-opt > span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (pointer:coarse){
  .service-vpn-form .vpn-sel-opt,.vpn-sel-wrap-full .vpn-sel-opt{white-space:normal}
  .service-vpn-form .vpn-sel-opt > span:first-child,.vpn-sel-wrap-full .vpn-sel-opt > span:first-child{overflow:visible;overflow-wrap:anywhere}
}
@media (max-width:640px),(pointer:coarse){
  .svc-kpi-label,.svc-kpi-sub{font-size:11px}
  .svc-table .svc-panel-badge,.svc-table .svc-credits-label,.svc-table .service-egress-info,.svc-table .service-vpn-start-stop{font-size:11px}
}
@media (pointer:coarse){
  .svc-action-item{display:flex;align-items:center;justify-content:flex-start;min-height:44px;font-size:14px;padding:10px 16px}
  .svc-action-sep{margin:6px 0}
  .service-action-wrap .service-action-dots{min-width:40px;min-height:40px}
}

/* Services table. Phones: cards (table-cards; Routing and Health keep their label on top).
   Tablets / small laptops: the table scrolls sideways under the pinned ⋮ column, with
   edge shadows as the cue; tighter cells so it fits from ~1000px when the sidebar is a drawer. */
.svc-table-wrap{scroll-padding-inline-end:72px;
  background:
    linear-gradient(to right, var(--card) 30%, rgba(28,32,48,0)) left center / 32px 100% no-repeat local,
    linear-gradient(to left,  var(--card) 30%, rgba(28,32,48,0)) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%,    rgba(0,0,0,.55), rgba(0,0,0,0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.55), rgba(0,0,0,0)) right center / 12px 100% no-repeat scroll}
.svc-table > tbody > tr:nth-child(even) > td:last-child{background:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01)),var(--card)}
.svc-table > tbody > tr:hover > td:last-child{background:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04)),var(--card)}
.svc-table-wrap:not(.is-overflowing) > .svc-table > * > tr > :last-child{box-shadow:none}
@media (min-width:641px){
  .svc-table-wrap.is-overflowing > .svc-table > * > tr > :last-child{box-shadow:inset 1px 0 0 var(--border),-16px 0 16px -12px rgba(0,0,0,.9)}
}
@media (min-width:641px) and (max-width:1365px){
  .svc-table > thead > tr > th,.svc-table > tbody > tr > td{padding-left:8px;padding-right:8px}
  .svc-table .service-health-cell{min-width:0}
  /* Panel pill: the credits go under the panel name (and their label under the value when
     squeezed), so a long "Admin no credit limit" pill can't push Health under the pinned ⋮ */
  .svc-table .svc-panel-badge{min-width:0;flex-direction:column;align-items:flex-start;gap:3px}
  .svc-table .svc-panel-name{min-width:0}
  .svc-table .svc-panel-credits{align-self:stretch;flex-wrap:wrap;column-gap:3px;padding:3px 0 0;border-left:0;border-top:1px solid rgba(255,255,255,.18)}
}
@media (max-width:640px){
  .svc-table-wrap{background:none}
  /* several badges / buttons in one cell: packed to the right of the label, not spread out */
  table.table-cards.svc-table > tbody > tr > td{justify-content:flex-end;flex-wrap:wrap;column-gap:6px}
  table.table-cards.svc-table > tbody > tr > td::before{margin-right:auto;padding-right:6px}
  .svc-table > tbody > tr > td.td-primary .service-url{max-width:100%}
  .svc-table > tbody > tr > td.service-routing-cell-edit{min-width:0;padding-top:6px}
  .svc-table .service-routing-cell-edit .service-vpn-form{flex-wrap:nowrap}
  .svc-table .service-routing-cell-edit .vpn-sel-wrap{flex:1 1 auto;min-width:0}
  .svc-table .service-routing-cell-edit .vpn-sel-btn{max-width:none;min-height:40px}
  .svc-table .service-routing-cell-edit .vpn-sel-label-truncate-lg{max-width:none;flex:1;min-width:0;text-align:left;white-space:nowrap}
  .svc-table .service-routing-cell-edit .service-vpn-form > .btn-sm{flex-shrink:0;min-width:56px}
  .svc-table .service-vpn-controls{margin-top:8px;gap:8px}
  .svc-table .service-egress-info{max-width:100%;margin-top:8px}
  .svc-table .service-routing-cell-view{min-width:0}
  .svc-table .service-health-cell{min-width:0}
  .svc-table .service-health-cell .action-btns{flex-direction:row;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}
  .svc-table .svc-health-res{display:flex;flex-direction:column;align-items:flex-end;gap:2px;text-align:right}
  .svc-table .svc-panel-badge{min-width:0;text-align:left}
  .svc-table .svc-panel-name{min-width:0}
}
@media (pointer:coarse){
  /* no hover tooltip on touch screens: show the whole address instead of an ellipsis */
  .svc-table .service-url,.svc-table .service-egress-info{white-space:normal;overflow-wrap:break-word}
}
@media (max-width:640px) and (pointer:coarse){
  .svc-table .service-routing-cell-edit .service-vpn-form > .btn-sm{min-height:40px}
  .svc-table .service-vpn-start-stop{font-size:11px;padding:4px 12px}
  .svc-table .health-retest{min-height:36px;padding:4px 12px;font-size:11px}
  .svc-table td.td-primary .text-muted-sm a{display:inline-block;padding:10px 0}
}

/* ── CLIENT PAGE ───────────────────────────── */
.cl-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;margin-bottom:14px}
.cl-kpi{min-width:0;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;cursor:pointer;transition:all .15s;position:relative;overflow:hidden;text-decoration:none;display:flex;flex-direction:column;color:inherit}
.cl-kpi:hover{border-color:rgba(99,102,241,.2);background:rgba(99,102,241,.03)}
.cl-kpi.active{border-color:var(--accent);background:rgba(99,102,241,.08);box-shadow:0 0 0 1px var(--accent)}
.cl-kpi::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:0 0 10px 10px}
.cl-kpi.blue::after{background:linear-gradient(90deg,var(--accent),var(--purple))}
.cl-kpi.green::after{background:linear-gradient(90deg,var(--green),#34d399)}
.cl-kpi.red::after{background:linear-gradient(90deg,var(--red),#f87171)}
.cl-kpi.purple::after{background:linear-gradient(90deg,var(--purple),#a78bfa)}
.cl-kpi.cyan::after{background:linear-gradient(90deg,var(--cyan),#22d3ee)}
.cl-kpi.amber::after{background:linear-gradient(90deg,#f59e0b,#fbbf24)}
.cl-kpi-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}
.cl-kpi-val{font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2;margin-top:auto}
/* Bulk selection bar: floats at the bottom of the screen while rows are ticked, so its
   actions sit next to the list instead of above the filters (body.cl-bulk-on adds room). */
.cl-bulk-bar{display:none;align-items:center;gap:8px;padding:10px 16px;background:rgba(99,102,241,.06);border:1px solid rgba(99,102,241,.15);border-radius:10px;margin-bottom:12px;flex-wrap:wrap}
.cl-bulk-bar.visible{display:flex;position:fixed;z-index:150;left:calc(var(--sidebar-w) + 32px);right:32px;bottom:16px;bottom:calc(16px + env(safe-area-inset-bottom));margin:0;background:var(--card2);border-color:rgba(99,102,241,.4);box-shadow:0 12px 40px rgba(0,0,0,.55)}
body.cl-bulk-on{padding-bottom:calc(var(--cl-bulk-h,0px) + 24px)}
.cl-bulk-acts{display:contents}
.cl-bulk-count{background:var(--accent);color:#fff;font-size:11px;font-weight:700;padding:1px 8px;border-radius:10px}
.cl-bulk-sep{width:1px;height:18px;background:rgba(255,255,255,.06);margin:0 2px}
.cl-check{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}
.cl-selall{display:none}
.cl-reassign{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px 20px;margin-bottom:14px}
.cl-reassign-title{font-size:13px;font-weight:600;margin-bottom:12px;display:flex;align-items:center;gap:8px}
.cl-reassign-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.cl-reassign-row .form-group{margin-bottom:0;min-width:160px;flex:1}
.cl-reassign-row label{font-size:11px;color:var(--muted);margin-bottom:4px;display:block}
.cl-reassign-arrow{color:var(--muted);font-size:16px;align-self:center;padding-top:16px}
.cl-fold-btn{display:none}
.cl-sync{padding:14px 16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.cl-sync .cl-sync-title{margin:0;font-size:13px}
.cl-sync .cl-sync-select{min-width:160px}
.cl-sync-result{font-size:12px}
.cl-import{display:inline-flex;gap:6px;align-items:center}
.cl-import-file{font-size:12px;max-width:200px}
.cl-filter-main{display:contents}
.cl-filter-toggle{display:none}
.cl-pagination{display:flex;gap:4px;justify-content:center;margin-top:16px;flex-wrap:wrap}
.cl-page{padding:5px 10px;border-radius:6px;font-size:12px;background:var(--card);border:1px solid var(--border);color:var(--text);text-decoration:none;transition:all .12s}
.cl-page.active{background:var(--accent);border-color:var(--accent);color:#fff}
.cl-page:hover:not(.active){border-color:rgba(99,102,241,.3)}
/* Table: long usernames wrap (they set the column width), the ⋮ column stays pinned */
.cl-table td.cl-user{min-width:170px}
.cl-uname{overflow-wrap:anywhere}
.cl-via,.cl-chain{white-space:normal;width:max-content;max-width:min(240px,100%);border-radius:10px}
.cl-link{color:var(--accent)}
.cl-table .form-inline-wrap{gap:8px}
.cl-exp{display:inline-flex;flex-direction:column;align-items:flex-start}
/* Owner / Reseller: the Stream Shield reseller, and under it the panel account owning the line when it is another name */
.cl-owner-in{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.cl-owner-panel{overflow-wrap:anywhere}
.cl-owner-in > .cl-link + .cl-owner-panel{font-size:11.5px;opacity:.8}
.cl-tip-text{display:none}
/* Row ⋮ menu: as wide as its longest label (up to the screen), labels may wrap */
#cli-menu{width:max-content;min-width:190px;max-width:min(320px,calc(100vw - 16px))}
#cli-menu .ui-menu-item{white-space:normal;line-height:1.25}
/* VPN picker options: long names wrap instead of being cut at the edge */
.cl-table .vpn-sel-opt,#cl-vpn-picker .vpn-sel-opt{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
@media(min-width:641px){
  /* the pinned last cell follows the row's zebra / hover shade */
  .cl-table > tbody > tr:nth-child(even) > td:last-child,.cl-moves > tbody > tr:nth-child(even) > td:last-child{background:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01)) var(--card)}
  .cl-table > tbody > tr:hover > td:last-child,.cl-moves > tbody > tr:hover > td:last-child{background:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04)) var(--card)}
}
/* an empty-state row spans the whole table: it is not an actions cell, never pinned */
table.table-cards.table-sticky-actions.cl-moves > tbody > tr > td[colspan]{position:static;background:none;box-shadow:none}
/* Dialogs opened from the row menu */
.cl-modal-who{font-size:13px;color:var(--text-secondary);margin-bottom:16px}
.cl-modal-who strong{color:var(--text-primary)}
.cl-test-box{max-width:400px}
.cl-test-out{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:40px}
.cl-test-out .health-badge{font-size:12px;padding:5px 12px}
.cl-test-out .health-result-meta,.cl-test-out .health-result-warn{font-size:12px}
.cl-test-out .health-retest{font-size:16px;padding:6px 14px;margin-top:6px}
.cl-vpn-acts .btn-danger{padding:12px 20px;font-size:14px;border-radius:10px}
@media(max-width:1100px){.cl-bulk-bar.visible{left:16px;right:16px}}
@media(max-width:640px){
  .cl-kpis{grid-template-columns:repeat(auto-fit,minmax(72px,1fr));gap:6px}
  .cl-kpi{padding:8px 8px 10px}
  .cl-kpi-label{letter-spacing:0;line-height:1.3;overflow-wrap:anywhere}
  .cl-kpi-val{font-size:17px}
  .cl-sync{padding:0;gap:10px}
  .cl-sync .cl-sync-title{flex-basis:100%}
  .cl-sync .cl-sync-select{flex:1 1 0;min-width:0;max-width:none}
  /* Bulk Reassign is folded on phones; the whole title row toggles it */
  .cl-reassign{padding:10px 14px}
  .cl-reassign-title{position:relative;margin-bottom:0}
  .cl-reassign.is-open .cl-reassign-title{margin-bottom:12px}
  .cl-fold-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-left:auto;width:40px;height:40px;padding:0;background:transparent;border:1px solid var(--border);border-radius:8px;color:var(--muted)}
  .cl-fold-btn::after{content:'';position:absolute;inset:0}
  .cl-fold-btn svg{transition:transform .2s}
  .cl-reassign.is-open .cl-fold-btn svg{transform:rotate(180deg)}
  .cl-reassign:not(.is-open) .cl-reassign-form{display:none}
  .cl-reassign-arrow{display:none}
  .cl-reassign-row .form-group{flex-basis:100%}
  .cl-reassign .client-reassign-submit{padding-top:0;width:100%}
  .cl-reassign .client-reassign-submit .btn{width:100%}
  .cl-import{display:flex;flex:1 1 100%;min-width:0}
  .cl-import-file{flex:1 1 auto;min-width:0;max-width:none}
  /* Filters: the search stays, the rest folds behind "Filters (n)" */
  .cl-filter-main{display:flex;gap:8px;align-items:flex-end;grid-column:1/-1}
  .cl-filter-main .client-filter-search{flex:1 1 auto;min-width:0;max-width:none}
  .cl-filter-toggle{display:inline-flex;flex:0 0 auto;gap:6px;height:40px}
  .cl-filter-toggle svg{transition:transform .2s}
  .cl-filters.is-open .cl-filter-toggle svg{transform:rotate(180deg)}
  .cl-filter-n{background:var(--accent);color:#fff;font-size:11px;font-weight:700;line-height:1;padding:3px 7px;border-radius:10px}
  .cl-filters:not(.is-open) > .client-filter-select,.cl-filters:not(.is-open) > .cl-filter-btn{display:none}
  .cl-selall{display:flex;align-items:center;gap:10px;min-height:40px;margin:0 0 10px;padding:0 12px;font-size:13px;color:var(--muted);cursor:pointer}
  .cl-bulk-bar.visible{left:8px;right:8px;bottom:8px;bottom:calc(8px + env(safe-area-inset-bottom));padding:10px 12px}
  .cl-bulk-label{margin-right:auto}
  .cl-bulk-sep{display:none}
  .cl-bulk-bar .cl-bulk-selbtn{order:1}
  .cl-bulk-acts{display:flex;flex-wrap:wrap;gap:8px;order:2;flex-basis:100%}
  .cl-bulk-acts > button{flex:1 1 auto}
  table.table-cards.cl-moves > tbody > tr{display:flex;flex-direction:column}
  table.table-cards.cl-moves > tbody > tr > td.td-primary{order:-1;padding-right:0}
  .cl-moves .cl-moves-act form,.cl-moves .cl-moves-act .btn-secondary{width:100%}
  .cl-table .cl-exp{align-items:flex-end;text-align:right}
  /* the shared sticky-actions card rule makes every last cell absolute; here it is a normal row (Undo) */
  table.table-cards.table-sticky-actions.cl-moves > tbody > tr > td:last-child{position:static}
  #cli-menu{max-width:none}
}
@media(pointer:coarse){
  /* what mouse users get as a tooltip, printed small under the badge */
  .cl-tip-text{display:block;max-width:240px;margin-top:3px;font-size:11px;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
  .cl-exp .cl-tip-text{white-space:nowrap}
  .cl-table .cl-via{padding-top:6px;padding-bottom:6px}
  .cl-link{display:inline-block;padding:6px 0}
  .cl-pagination .cl-page{display:inline-flex;align-items:center;justify-content:center;min-width:36px}
  .cl-table .health-retest{min-width:36px}
  .cl-table .select-compact,.cl-sync .cl-sync-select{min-height:36px}
}

/* ── INLINE-STYLE REPLACEMENTS ─────────────── */

/* Shared tiny button (10px font, tight padding) */
.btn-tiny { font-size: 10px; padding: 4px 8px; }
.btn-micro { font-size: 10px; padding: 3px 7px; flex-shrink: 0; white-space: nowrap; }
.btn-micro-narrow { font-size: 10px; padding: 3px 5px; flex-shrink: 0; white-space: nowrap; }
.btn-filter { font-size: 11px; padding: 7px 14px; }
.btn-filter-sm { font-size: 11px; padding: 6px 12px; }

/* Badge text size overrides */
.badge-xs { font-size: 10px; }
.badge-xxs { font-size: 9px; }

/* Pagination ellipsis */
.page-ellipsis { padding: 5px 3px; color: var(--muted); }

/* Card header subtitle */
.card-title-sub { font-weight: 400; font-size: 13px; color: var(--muted); }

/* Inline form helpers */
.form-inline { display: flex; gap: 4px; align-items: center; }
.form-inline-wrap { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.form-inline-hidden { display: inline; }
.form-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }

/* Form group compacted (no bottom margin) */
.form-group-compact { margin-bottom: 0; }

/* Action button row */
.action-row { display: flex; gap: 4px; }

/* Table column widths */
.col-w-30 { width: 30px; }
.col-w-44 { width: 44px; }
.col-w-48 { width: 48px; }
.col-w-50 { width: 50px; }
.col-w-56 { width: 56px; }
.col-w-80 { width: 80px; }

/* Inline select compact */
.select-compact { width: auto; padding: 5px 8px; font-size: 11px; max-width: 130px; }
.select-filter { font-size: 12px; padding: 8px 10px; }
.input-filter { font-size: 12px; padding: 8px 10px; }

/* Client-specific filter groups */
.client-filter-search { flex: 1; min-width: 140px; max-width: 220px; }
.client-filter-select { min-width: 140px; max-width: 200px; }

/* Reassign submit alignment */
.client-reassign-submit { padding-top: 16px; }

/* Service table helpers */
.service-url { font-size: 11px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-name { font-size: 13px; }
.service-routing-cell-edit { min-width: 190px; }
.service-routing-cell-view { min-width: 120px; }
.service-vpn-controls { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.service-egress-info { font-size: 10px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.service-vpn-name { font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.service-routing-stack { display: flex; flex-direction: column; gap: 3px; }
.service-health-cell { min-width: 130px; }
.service-health-btn { font-size: 12px; padding: 6px 14px; white-space: nowrap; background: rgba(6,182,212,.12); color: var(--cyan); border: 1px solid rgba(6,182,212,.3); border-radius: 6px; font-weight: 600; }
/* Panel & Credits cell */
.svc-panel-cell { display: inline-flex; }
/* Panel badge now carries the credits inside it: [ XUIONE │ 45 credits ] */
.svc-panel-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 9px; border-radius: 5px; text-transform: uppercase; white-space: nowrap; box-sizing: border-box; min-width: 144px; }
.svc-panel-nxt      { background: rgba(168,85,247,.15); color: #c084fc; border: 1px solid rgba(168,85,247,.3); }
.svc-panel-xuione   { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
/* XUIOne-GhostX is a XUI.One mod — same blue pill as XUI.One. */
.svc-panel-xuione_ghostx { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.svc-panel-xui2     { background: rgba(6,182,212,.15);  color: #22d3ee; border: 1px solid rgba(6,182,212,.3); }
.svc-panel-1stream  { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.svc-panel-gold     { background: rgba(234,179,8,.16);  color: #facc15; border: 1px solid rgba(234,179,8,.38); }
.svc-panel-xm       { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.3); }
.svc-panel-brave    { background: rgba(244,63,94,.15);  color: #fb7185; border: 1px solid rgba(244,63,94,.32); }
.svc-panel-name { line-height: 1; min-width: 58px; }
/* credits section, divided from the panel name; hides itself when empty (error/no data) */
.svc-panel-credits { display: inline-flex; align-items: baseline; gap: 3px; padding-left: 7px; border-left: 1px solid rgba(255,255,255,.18); text-transform: none; }
.svc-panel-credits:empty { display: none; }
.svc-credits-value { font-size: 12px; font-weight: 700; line-height: 1; }
.svc-credits-label { font-size: 9px; color: var(--muted); letter-spacing: .3px; }
.svc-credits-ok  { color: #34d399; }
.svc-credits-med { color: #fbbf24; }
.svc-credits-low { color: #f87171; }
.svc-credits-loading { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--border); border-top-color: var(--muted); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.service-action-wrap { position: relative; display: inline-block; }
.service-action-dots { font-size: 16px; line-height: 1; padding: 2px 8px; }
.service-vpn-start-stop { font-size: 10px; padding: 2px 6px; }
.service-vpn-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* VPN select label truncation */
.vpn-sel-label-truncate { max-width: 90px; overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; }
.vpn-sel-label-truncate-lg { max-width: 110px; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Modal helpers (services.php) */
/* Service modal — fixed height so tabs never resize the dialog.
   Structure: modal-box.svc-modal > modal-header + form > svc-tabs > svc-tab-body > svc-tab-pane
   Note: there is NO .modal-body wrapper — form is a direct child of modal-box. */
.modal-box.svc-modal {
  max-width: 720px !important;
  height: 650px !important;
  max-height: 90vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
/* Tablet */
@media (max-width: 768px) {
  .modal-box.svc-modal {
    height: 92vh !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
  }
}
/* Mobile */
@media (max-width: 640px) {
  .modal-box.svc-modal {
    height: 95vh !important;
    max-height: 95vh !important;
    border-radius: 12px !important;
  }
  .modal-box.svc-modal > form .form-row {
    flex-direction: column;
    gap: 0;
  }
}
.modal-box.svc-modal > .modal-header {
  flex-shrink: 0;
}
.modal-box.svc-modal > form {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-box.svc-modal .svc-modal-footer {
  flex-shrink: 0;
}

.modal-box-wide { max-width: 760px; }
.form-label-hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.form-label-hint-sm { font-weight: 400; font-size: 11px; color: var(--muted); }
.form-checkbox-inline { width: auto; margin: 0; }
.form-checkbox-label { font-weight: 400; font-size: 12px; color: var(--muted); margin: 0; cursor: pointer; }
.form-checkbox-label-md { font-weight: 400; font-size: 13px; margin: 0; cursor: pointer; }
.form-toggle-row { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.form-vod-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.form-vod-row { display: flex; align-items: center; gap: 8px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.form-hint-sm { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* VPN modal selector layout */
.vpn-modal-row { display: flex; gap: 8px; align-items: center; }
.vpn-sel-wrap-full { flex: 1; }
.vpn-sel-btn-full { width: 100%; max-width: none; }
.vpn-sel-label-full { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.vpn-live-indicator { color: var(--green); font-size: 11px; }
.vpn-sel-no-results { color: var(--muted); cursor: default; }

/* Service card header row */
.card-header-actions { display: flex; align-items: center; gap: 8px; }

/* Client VPN labels */
.client-vpn-direct { color: var(--cyan); font-size: 11px; }
.client-vpn-override { color: var(--accent); font-size: 11px; }
.client-vpn-inherited { color: var(--muted); font-size: 11px; }

/* Health/test loading state */
.health-testing { font-size: 11px; color: var(--muted); }
.health-result-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }
.health-result-egress { font-size: 10px; color: var(--muted); margin-top: 3px; }
.health-result-warn { font-size: 10px; color: var(--yellow, #f5a623); margin-top: 3px; }
.health-retest { font-size: 10px; padding: 1px 5px; margin-top: 4px; }
.health-badge { font-size: 10px; white-space: nowrap; }

/* Channel page helpers */
.channel-empty-state { text-align: center; padding: 48px 20px; }
.channel-empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }
.channel-empty-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.channel-empty-sub { font-size: 12px; color: var(--muted); }
.channel-no-schedule { font-size: 12px; color: var(--muted); opacity: 0.45; font-style: italic; padding: 6px 0; }
.channel-detail-placeholder { font-size: 24px; opacity: 0.2; }
.channel-detail-action { width: 100%; justify-content: center; text-decoration: none; font-size: 12px; margin-top: 4px; }
.channel-browse-more { text-align: center; padding: 12px; }
.channel-progress-full { margin-top: 4px; max-width: 100%; }
.channel-no-prog { font-size: 11px; color: var(--muted); opacity: 0.4; font-style: italic; }
.channel-no-epg-dash { font-size: 11px; color: var(--muted); opacity: 0.3; }
.channel-time-left { font-size: 10px; color: var(--muted); }

/* Channel review KPI colored vals */
.channel-review-orange { color: var(--orange); }
.channel-review-cyan { color: var(--cyan); }
.channel-review-red { color: var(--red); }
.channel-review-green { color: var(--green); }

/* Channel table empty state */
.channel-table-empty { text-align: center; padding: 32px; }
.channel-table-empty-text { font-size: 13px; color: var(--muted); }

/* Channel badge fit */
.badge-fit { font-size: 10px; width: fit-content; }

/* EPG dot inline */
.lv-dot-inline { display: inline-block; vertical-align: middle; }

/* Channels: load more btn */
.channel-load-more-btn { font-size: 11px; }

/* Client bulk bar selected label */
.cl-bulk-label { font-size: 11px; color: var(--muted); }

/* ── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #111318 0%, #141824 40%, #171c2a 100%);
  padding: 24px;
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(99,102,241,0.04), transparent),
    radial-gradient(ellipse 500px 300px at 70% 80%, rgba(139,92,246,0.03), transparent);
  pointer-events: none;
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.login-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.login-logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.login-logo-text small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.login-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.login-card p { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card input { margin-top: 0; }
.login-full { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }

/* ── HAMBURGER ──────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}
.hamburger:hover { background: rgba(255,255,255,0.06); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .2s;
}
@media (pointer: coarse) { .hamburger { width: 40px; height: 40px; } }

/* ── SIDEBAR OVERLAY ────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1050;
}
#sidebar-overlay.show { display: block; }

/* ── BRANDING PAGE ─────────────────────────────── */
.brand-heading { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.brand-subtext { font-size: 12px; color: var(--muted); }
.brand-section { margin-bottom: 20px; }

/* .card.… beats the phone .card padding rules that come later in the file */
.card.brand-asset-card { padding: 0; margin-bottom: 12px; overflow: hidden; width: 100%; box-sizing: border-box; }
.brand-asset-preview {
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-asset-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.15s;
  flex-shrink: 0;
  position: relative;
}
.brand-asset-icon:hover { opacity: 0.85; }
.brand-asset-icon img { width: 100%; height: 100%; object-fit: contain; }

/* positioning context for the remove (×) button on the logo's corner */
.brand-asset-logo { position: relative; flex-shrink: 0; }
.brand-asset-remove {
  position: absolute; top: -6px; right: -6px; z-index: 1;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
  color: #fff; font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
/* touch: a 40px hit area that grows up and right only, so a tap on the logo itself still opens
   the file picker; the wider gap keeps it off the title field */
@media (pointer: coarse) {
  .brand-asset-remove::after { content: ''; position: absolute; inset: -20px -20px -2px -2px; }
  .brand-asset-preview { gap: 24px; }
}

.brand-title-input {
  background: transparent; border: none;
  color: var(--text);
  font-size: 17px; font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0; width: 100%;
  outline: none;
  font-family: inherit;
}
.brand-title-input:focus {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

.brand-asset-meta {
  padding: 8px 16px;
  display: flex; align-items: center;
  justify-content: space-between;
}
.brand-asset-meta-left {
  display: flex; align-items: center; gap: 8px;
}
.brand-format-badge {
  font-size: 11px; color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 500;
}
.brand-asset-meta .brand-desc { font-size: 11px; color: var(--muted); }
.brand-change-link {
  font-size: 11px; color: var(--accent);
  cursor: pointer; background: none; border: none;
  font-family: inherit;
}
.brand-change-link:hover { text-decoration: underline; }
@media (pointer: coarse) { .brand-change-link { min-height: 40px; } .brand-title-input { min-height: 40px; } }
@media (max-width: 640px) {
  .brand-asset-preview { padding: 22px 18px; }
  .brand-asset-meta { gap: 10px; padding: 8px 8px 8px 14px; }
  .brand-asset-meta-left { min-width: 0; align-items: flex-start; }
}

.brand-preview-card { padding: 14px 20px; margin-bottom: 12px; }
.brand-preview-label {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.brand-preview-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.brand-preview-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-preview-name { font-size: 13px; font-weight: 600; }
.brand-preview-sub { font-size: 11px; color: var(--muted); }

.brand-badge-card { padding: 14px 20px; margin-bottom: 12px; }
.brand-badge-row { display: flex; align-items: center; gap: 12px; }
.brand-badge-label { font-size: 11px; color: var(--muted); }
.brand-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center; gap: 8px;
}
.brand-badge-icon {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-badge-text { font-size: 12px; font-weight: 600; }
.brand-badge-img  { width: 18px; height: 18px; object-fit: contain; }
.brand-preview-icon-transparent { background: none; }

/* ── SETTINGS PAGE ─────────────────────────────── */
.settings-container { max-width: 100%; }
.settings-container .card { width: 100%; }

/* Performance tab */
.perf-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 16px; }
.perf-stat-card { background: var(--card-inner, rgba(255,255,255,.03)); border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center; }
.perf-stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.perf-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.perf-hint { font-size: 12px; color: var(--muted); padding: 0 16px 12px; line-height: 1.5; }
.perf-table { width: 100%; }
.perf-table code { font-size: 12px; color: var(--cyan); background: rgba(6,182,212,.08); padding: 2px 6px; border-radius: 4px; }
.perf-desc { font-size: 12px; color: var(--muted); }
.perf-val { font-weight: 600; font-size: 14px; }
.perf-val-rec { color: var(--green, #34d399); }
.perf-val-low { color: var(--orange, #fbbf24); }
.perf-val-high { color: var(--cyan, #22d3ee); }
.perf-action-bar { display: flex; align-items: center; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.perf-action-hint { font-size: 11px; color: var(--muted); }
/* Performance page */
.perf-page { display: flex; flex-direction: column; gap: 16px; }
.perf-page .card { margin-bottom: 0; }

.perf-live-card { overflow: hidden; }
.perf-live-grid { display: grid; grid-template-columns: 240px 1fr; gap: 0; padding: 20px 24px; }
.perf-live-gauge-wrap { display: flex; align-items: center; justify-content: center; }
.perf-gauge-svg { width: 200px; height: 120px; }
.perf-gauge-pct { font-size: 28px; font-weight: 700; }
.perf-gauge-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.perf-live-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; align-content: center; }
.perf-live-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.perf-live-sep { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.perf-live-label { font-size: 12px; color: var(--muted); }
.perf-live-value { font-size: 14px; font-weight: 600; color: var(--text); }
.perf-live-active { color: var(--cyan, #22d3ee); }
.perf-live-warn { color: var(--orange, #fbbf24); }
.perf-live-danger { color: var(--red, #f87171); }
.perf-live-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.perf-live-dot.dot-on { background: var(--green, #34d399); box-shadow: 0 0 6px rgba(52,211,153,.5); }
.perf-live-dot.dot-off { background: var(--muted); }
.perf-live-footer { border-top: 1px solid var(--border); }
.perf-failsafe-bar { display: flex; align-items: center; gap: 10px; padding: 12px 24px; font-size: 12px; color: var(--muted); transition: all .3s; }
.perf-failsafe-bar.perf-failsafe-on { background: rgba(248,113,113,.08); color: var(--red, #f87171); }
.perf-failsafe-icon { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: rgba(52,211,153,.12); color: var(--green, #34d399); }
.perf-failsafe-on .perf-failsafe-icon { background: rgba(248,113,113,.15); color: var(--red, #f87171); animation: pulse 1.5s infinite; }
.perf-failsafe-alert { font-weight: 600; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── Performance Monitor (pm-*) ───────────── */
.pm { display: flex; flex-direction: column; gap: 14px; }

/* Strip */
.pm-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: linear-gradient(135deg, rgba(99,102,241,.06) 0%, rgba(6,182,212,.04) 100%); border: 1px solid var(--border); border-radius: 10px; }
.pm-strip-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.pm-strip-left svg { color: var(--cyan); flex-shrink: 0; }
.pm-strip-host { color: var(--text); font-weight: 600; font-family: monospace; font-size: 12px; }
.pm-strip-sep { opacity: .3; }
.pm-strip-meta { font-family: monospace; font-size: 11px; }
.pm-strip-right { display: flex; align-items: center; gap: 10px; }
.pm-strip-up { font-size: 11px; color: var(--muted); }
.pm-strip-up b { color: var(--text); font-weight: 600; margin-left: 3px; }
.pm-strip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pm-dot-ok { background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,.5); }
.pm-dot-off { background: var(--muted); }

/* Health indicators */
.pm-health { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pm-health-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; transition: border-color .3s; min-width: 0; }
.pm-health-item.pm-h-warn { border-color: rgba(245,158,11,.25); }
.pm-health-item.pm-h-crit { border-color: rgba(239,68,68,.25); }
.pm-h-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.pm-h-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pm-h-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text); }
.pm-h-ring-conn { background: rgba(6,182,212,.08); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pm-h-conn { font-size: 14px; font-weight: 700; color: var(--cyan); }
.pm-h-info { display: flex; flex-direction: column; min-width: 0; }
.pm-h-title { font-size: 11px; font-weight: 600; color: var(--text); }
.pm-h-sub { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cards */
.pm-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pm-card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.pm-card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.pm-card-title svg { color: var(--cyan); flex-shrink: 0; }
.pm-card-sub { font-size: 11px; color: var(--muted); }
.pm-card-body { padding: 16px 20px; }
.pm-badge { font-family: monospace; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.pm-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.pm-empty { font-size: 12px; color: var(--muted); font-style: italic; padding: 8px 0; }

/* Color helpers */
.pm-c-cyan { color: var(--cyan) !important; }
.pm-c-green { color: var(--green) !important; }
.pm-c-orange { color: var(--orange) !important; }
.pm-c-red { color: var(--red) !important; }
.pm-c-muted { color: var(--muted) !important; font-weight: 400; }
.pm-mono { font-family: monospace; color: var(--muted); }

/* FPM section */
.pm-fpm-body { display: grid; grid-template-columns: 220px 1fr; gap: 0; padding: 16px 20px; }
.pm-fpm-gauge { display: flex; align-items: center; justify-content: center; }
.pm-fpm-gauge svg { width: 200px; height: 120px; }
.pm-gauge-pct { font-size: 30px; font-weight: 800; font-family: monospace; }
.pm-gauge-sub { font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.pm-fpm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; align-content: center; }
.pm-fpm-pair { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.03); font-size: 12px; }
.pm-fpm-pair span { color: var(--muted); }
.pm-fpm-pair b { color: var(--text); font-weight: 600; font-size: 13px; font-family: monospace; }
.pm-fpm-divider { grid-column: 1 / -1; height: 1px; background: var(--border); margin: 4px 0; }
.pm-failsafe { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.pm-failsafe-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.pm-failsafe-on { color: var(--red); font-weight: 600; }
.pm-failsafe-on .pm-failsafe-dot { background: var(--red); animation: pulse 1.5s infinite; }

/* Progress bars */
.pm-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; margin: 10px 0; }
.pm-bar-fill { height: 100%; border-radius: 3px; min-width: 2px; }
.pm-bar-stack { display: flex; height: 4px; border-radius: 2px; overflow: hidden; gap: 1px; margin: -4px 0 10px; }
.pm-bar-seg { height: 100%; transition: flex .8s ease; border-radius: 1px; }

/* CPU */
.pm-cpu-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pm-cpu-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10px; color: var(--muted); }
.pm-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.pm-legend b { color: var(--text); font-weight: 600; margin-left: 2px; }

/* Memory */
.pm-mem-head { font-size: 13px; color: var(--text); }
.pm-mem-head b { font-weight: 700; }
.pm-mem-head span { color: var(--muted); }
.pm-mem-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.pm-mem-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.pm-mem-row i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pm-mem-row b { color: var(--text); font-weight: 600; margin-left: auto; font-family: monospace; font-size: 11px; }

/* Network */
.pm-net-if { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.pm-net-if:first-child { padding-top: 0; }
.pm-net-if:last-child { border-bottom: none; padding-bottom: 0; }
.pm-net-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pm-net-name { font-size: 12px; font-weight: 600; color: var(--text); font-family: monospace; }
.pm-net-pkts { font-size: 10px; color: var(--muted); }
.pm-net-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pm-net-lane { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,.02); border-radius: 6px; }
.pm-net-tag { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: .3px; }
.pm-tag-rx { background: rgba(16,185,129,.12); color: var(--green); }
.pm-tag-tx { background: rgba(99,102,241,.12); color: var(--accent); }
.pm-net-speed { font-size: 12px; font-weight: 600; color: var(--text); font-family: monospace; white-space: nowrap; }
.pm-net-vol { font-size: 10px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.pm-net-err { font-size: 10px; color: var(--red); margin-top: 4px; }

/* Disk I/O */
.pm-disk-bar-wrap { margin-bottom: 12px; }
.pm-disk-label { font-size: 11px; color: var(--muted); }
.pm-disk-dev { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.pm-disk-dev:last-child { border-bottom: none; padding-bottom: 0; }
.pm-disk-head { font-size: 12px; font-weight: 600; color: var(--text); font-family: monospace; margin-bottom: 6px; }
.pm-disk-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pm-disk-lane { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.pm-disk-dir { font-size: 9px; font-weight: 700; color: var(--muted); min-width: 12px; }
.pm-disk-speed { font-weight: 600; color: var(--text); font-family: monospace; font-size: 11px; min-width: 80px; }
.pm-disk-ops { font-size: 10px; color: var(--muted); }

/* Processes table */
.pm-procs-body { padding: 0; overflow-x: auto; }
.pm-procs { width: 100%; border-collapse: collapse; font-size: 12px; }
.pm-procs th { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 12px; background: rgba(255,255,255,.02); }
.pm-procs td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.03); color: var(--text); position: relative; }
.pm-procs tr:last-child td { border-bottom: none; }
.pm-procs tr:hover td { background: rgba(255,255,255,.02); }
.pm-proc-bar { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 1px; transition: width .8s; }
.pm-proc-cmd { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 10px; color: var(--muted); cursor: pointer; }
.pm-proc-cmd.is-open { white-space: normal; word-break: break-all; }

/* Config tables */
.pm-config-table { width: 100%; border-collapse: collapse; }
.pm-config-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; background: rgba(255,255,255,.02); }
.pm-config-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.03); }
.pm-config-table tr:last-child td { border-bottom: none; }
.pm-config-table code { font-size: 12px; color: var(--cyan); background: rgba(6,182,212,.08); padding: 2px 6px; border-radius: 4px; }
.pm-td-desc { font-size: 12px; color: var(--muted); }
.pm-td-val { font-weight: 600; font-size: 14px; font-family: monospace; }

/* Status badges */
.pm-status-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 6px; }
.pm-status-ok { background: rgba(16,185,129,.12); color: var(--green); }
.pm-status-warn { background: rgba(245,158,11,.12); color: var(--orange); }
.pm-status-info { background: rgba(6,182,212,.12); color: var(--cyan); }
.pm-badge-xs { font-size: 10px; padding: 2px 8px; }
.pm-action-bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pm-action-hint { font-size: 11px; color: var(--muted); }

/* Health tiles: 5 in a row only where each gets its full width; otherwise 3 + 2 */
@media (min-width: 1101px) and (max-width: 1259px), (max-width: 979px) {
  .pm-health { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pm-health-item { grid-column: span 2; }
  .pm-health-item:nth-child(n+4) { grid-column: span 3; }
}
/* Half-width Network card too narrow for RX | TX side by side */
@media (min-width: 1101px) and (max-width: 1259px), (min-width: 901px) and (max-width: 979px) {
  .pm-net-lanes { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .pm-duo { grid-template-columns: minmax(0, 1fr); }
  .pm-fpm-body { grid-template-columns: 1fr; }
  .pm-fpm-gauge { margin-bottom: 8px; }
  .pm-strip { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .pm-health { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pm-health-item, .pm-health-item:nth-child(n+4) { grid-column: auto; padding: 12px; gap: 10px; }
  .pm-health-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pm-h-ring { width: 38px; height: 38px; }
  .pm-fpm-stats { grid-template-columns: 1fr; }
  .pm-net-lanes { grid-template-columns: 1fr; }
  .pm-card-head { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .pm-card-body { padding: 14px; }
  .pm-fpm-body { padding: 14px; }
  .pm-action-bar { padding: 12px 14px; }
  .pm-action-bar form, .pm-action-bar .btn { width: 100%; }
}
@media (pointer: coarse) { .pm-action-bar .btn { min-height: 40px; } }
/* Phones, tablets and touch screens: no text below 11px */
@media (max-width: 900px), (pointer: coarse) {
  .pm-h-pct, .pm-h-sub, .pm-gauge-sub, .pm-legend, .pm-net-pkts, .pm-net-tag, .pm-net-vol, .pm-net-err,
  .pm-disk-dir, .pm-disk-ops, .pm-procs th, .pm-proc-cmd, .pm-config-table th, .pm-badge-xs { font-size: 11px; }
  .pm-h-sub { white-space: normal; text-wrap: balance; } /* no hover tooltip here: wrap instead of "…" */
}
/* Phones: processes and settings tables become cards */
@media (max-width: 640px) {
  .pm-procs-body { overflow-x: visible; padding: 10px 12px 2px; }
  table.pm-procs.table-cards > tbody > tr { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.25fr) minmax(0, .85fr) minmax(0, .8fr) minmax(0, 1fr); column-gap: 6px; row-gap: 6px; }
  table.pm-procs.table-cards > tbody > tr > td { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px; min-height: 0; padding: 0 0 4px; text-align: left; font-size: 12px; border: 0; }
  table.pm-procs.table-cards > tbody > tr > td::before { max-width: none; white-space: nowrap; }
  table.pm-procs.table-cards > tbody > tr > td.pm-proc-cmd {
    order: -1; grid-column: 1 / -1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    max-width: none; white-space: normal; word-break: break-all; font-size: 11px; line-height: 1.45;
    padding: 0; margin-bottom: 4px; overflow: hidden; min-height: 32px;
  }
  table.pm-procs.table-cards > tbody > tr > td.pm-proc-cmd::before { content: none; }
  table.pm-procs.table-cards > tbody > tr > td.pm-proc-cmd.is-open { display: block; -webkit-line-clamp: unset; }
  table.pm-procs.table-cards > tbody > tr:hover td { background: none; }
  table.pm-procs.table-cards > tbody > tr > td.pm-proc-user > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.pm-config-table.table-cards > tbody > tr > td.td-primary { padding-right: 56px; }
  table.pm-config-table.table-cards > tbody > tr > td.td-full { font-size: 12px; padding-bottom: 6px; }
  table.pm-config-table.table-cards > tbody > tr > td.pm-td-status { position: absolute; top: 10px; right: 12px; width: auto; min-height: 0; padding: 0; }
  table.pm-config-table.table-cards > tbody > tr > td.pm-td-status::before { content: none; }
}

.settings-ssl-pre {
  max-height: 160px; overflow-y: auto;
  font-size: 11px; margin-bottom: 12px; padding: 10px;
}
.settings-ssl-pre-sm { font-size: 11px; padding: 8px 10px; }
.settings-copy-btn { padding: 3px 8px; font-size: 11px; }
.settings-ssl-btn { padding: 5px 12px; font-size: 11px; }

.settings-cf-textarea {
  width: 100%; font-family: monospace; font-size: 12px;
  padding: 10px 12px; line-height: 1.6;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); resize: vertical;
}
.settings-cf-rule-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  margin-bottom: 14px; font-size: 11px;
  font-family: monospace; line-height: 1.8; overflow-wrap: anywhere;
}
.settings-cf-guide-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  font-family: monospace; font-size: 11px;
  line-height: 1.8; margin-bottom: 14px; overflow-wrap: anywhere;
}
.settings-cf-alert-danger {
  padding: 8px 12px;
  background: rgba(239,68,68,.04);
  border: 1px solid rgba(239,68,68,.1);
  border-radius: 6px;
}
.settings-cf-alert-warning {
  padding: 8px 12px;
  background: rgba(245,158,11,.04);
  border: 1px solid rgba(245,158,11,.1);
  border-radius: 6px;
}
.settings-cf-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.settings-cf-select-narrow { max-width: 300px; }

.settings-2fa-stats { margin-top: 12px; display: flex; gap: 12px; }

.settings-social-warning { font-size: 9px; color: var(--orange); flex-shrink: 0; }
.settings-social-row-warn { border-color: rgba(245,158,11,.2); }
.settings-social-input-warn { border-color: rgba(245,158,11,.3); }

.settings-save-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

.settings-guide-section { margin-bottom: 14px; }
.settings-guide-alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

/* On/off rows: the text is part of the label, so tapping it toggles the switch */
.settings-switch { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; font-size: inherit; font-weight: 400; color: var(--text); cursor: pointer; }
.settings-switch .toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .settings-switch { min-height: 40px; } }
/* "Days" field + Save on one line (Save keeps its own width) */
.settings-inline-form { align-items: flex-end; flex-wrap: nowrap; }
.settings-inline-form > .form-group { flex: 0 1 200px; min-width: 0; width: auto; margin-bottom: 0; }
.settings-inline-form > .btn { flex: 0 0 auto; min-width: 0; width: auto; }
/* Section headers: badge + Save drop below the title when there is no room */
.settings-container .section-header { flex-wrap: wrap; gap: 8px 12px; }
.settings-container .section-header > :first-child { flex: 1 1 240px; min-width: 0; }
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .settings-cf-select-narrow { max-width: none; }
  /* stacked fields: the row gap is the spacing (.form-group's margin outranks .mb-0) */
  .settings-container .form-row > .form-group.mb-0 { margin-bottom: 0; }
}

/* ── DASHBOARD ─────────────────────────────── */
.kpi-sub { font-size: 12px; color: var(--muted); }
.card-flex { margin-bottom: 0; display: flex; flex-direction: column; }
.card-flush { margin-bottom: 20px; padding: 0; overflow: hidden; }
.card-header-flush { padding: 12px 16px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.map-bg { position: relative; background: #1a2035; }
.map-loading-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(22,24,29,.8); pointer-events: none; }
.user-list-panel { border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.user-list-scroll { flex: 1; overflow-y: auto; max-height: 320px; padding: 8px; }
.refresh-select { font-size: 11px; padding: 3px 6px; width: auto; border-radius: 6px; background: var(--card2); border: 1px solid var(--border); color: var(--text); }
.refresh-btn { background: var(--card2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 12px; font-family: inherit; }
.link-accent { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.db-refresh-label { margin: 0; font-weight: 400; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.mt-auto { margin-top: auto; }
.mt-2 { margin-top: 2px; }
.mt-20 { margin-top: 20px; }
.ml-4 { margin-left: 4px; }
/* Map + user list side by side; the map fills the row when the list is taller
   (no empty band under it). Stacked below 900px. */
.cu-grid-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 360px; }
.map-container { height: 100%; min-height: 360px; width: 100%; }
.items-stretch { align-items: stretch; }
.db-kpi-link { text-decoration: none; color: inherit; display: block; transition: transform .12s, border-color .15s; }
.db-kpi-link:hover { transform: translateY(-2px); }
.db-kpi-link:hover .kpi-card { border-color: rgba(99,102,241,.25); }
.db-attn { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.db-attn-item { flex: 1; min-width: 140px; padding: 10px 14px; border-radius: 10px; font-size: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid; text-decoration: none; }
.db-attn-ok { background: rgba(16,185,129,.04); border-color: rgba(16,185,129,.12); color: #6ee7b7; }
.db-attn-warn { background: rgba(245,158,11,.04); border-color: rgba(245,158,11,.12); color: #fde68a; }
.db-attn-err { background: rgba(239,68,68,.04); border-color: rgba(239,68,68,.12); color: #fca5a5; }
.db-attn-val { font-weight: 700; font-size: 16px; }
.db-health-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.db-health-pill { flex: 1; min-width: max-content; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 11px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.db-health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dyn-cron-link { color: var(--accent); font-size: 10px; margin-left: 4px; }

/* Trends: three compact columns at every width; the bar charts scale down */
.db-trends-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 4px 0; }
.db-trends-grid > * { min-width: 0; overflow-wrap: anywhere; }
.db-trend-days { width: 80px; }
.db-trend-sub { font-size: 10px; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 900px), (pointer: coarse) { .db-trend-sub { font-size: 11px; } }

/* KPI row: 6 cards never leave one alone on a second row */
@media (min-width: 641px) and (max-width: 900px) { .kpi-grid.db-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1101px) and (max-width: 1199px) { .kpi-grid.db-kpi-grid.db-kpi-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Service Cache & EPG table: fits at 1366; narrower screens scroll it with the
   actions column pinned (table-sticky-actions); phones get compact cards */
@media (min-width: 641px) and (max-width: 1339px) { .db-svc-table th { white-space: normal; } }
@media (min-width: 641px) {
  table.db-svc-table > tbody > tr:nth-child(even) > td:last-child { background: linear-gradient(rgba(255,255,255,.01), rgba(255,255,255,.01)) var(--card); }
  table.db-svc-table > tbody > tr:hover > td:last-child { background: linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)) var(--card); }
}
@media (min-width: 901px) { .db-svc-table th, .db-svc-table td { padding-left: 12px; padding-right: 12px; } }
@media (max-width: 640px) {
  table.db-svc-table.table-cards > tbody > tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 8px; row-gap: 6px; }
  table.db-svc-table.table-cards > tbody > tr > td { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 3px; min-height: 0; padding: 2px 0; text-align: left; }
  table.db-svc-table.table-cards > tbody > tr > td::before { max-width: none; line-height: 1.25; }
  table.db-svc-table.table-cards > tbody > tr > td.td-primary { grid-column: 1 / -1; padding: 2px 84px 8px 0; margin-bottom: 2px; }
  table.db-svc-table.table-cards > tbody > tr > td.db-svc-status { position: absolute; top: 9px; right: 12px; width: auto; padding: 0; }
  table.db-svc-table.table-cards > tbody > tr > td.db-svc-status::before { content: none; }
  table.db-svc-table.table-cards.table-sticky-actions > tbody > tr > td.td-full { position: static; grid-column: 1 / -1; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
  table.db-svc-table .action-btns { flex-direction: row; flex-wrap: wrap; gap: 8px; width: 100%; }
  table.db-svc-table .action-btns > button { flex: 1 1 0; min-height: 40px; justify-content: center; }
  .db-trends-grid { gap: 10px; }
  .db-trend-days { width: auto; }
}

/* Connected Users: stack the map above the list below 900px */
@media (max-width: 900px) {
  .cu-grid-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .user-list-panel { border-left: 0; border-top: 1px solid var(--border); }
  .user-list-scroll { max-height: 340px; }
  .map-container { height: 260px; min-height: 0; }
}
@media (max-width: 640px) { .map-container { height: 220px; } }
@media (max-width: 380px) { .map-container { height: 200px; } }

/* Touch and phones: comfortable header controls and card-header links */
@media (pointer: coarse), (max-width: 640px) {
  .refresh-select { min-height: 36px; }
  .refresh-btn { min-width: 40px; min-height: 40px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
  .link-accent { display: inline-flex; align-items: center; min-height: 36px; }
  .dyn-cron-link { display: inline-flex; align-items: center; min-height: 32px; font-size: 11px; }
}

/* ── DYNAMIC SYNC STATS CARD ────────────────── */
.dyn-stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
.dyn-services-col,
.dyn-history-col {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dyn-services-col { border-right: 1px solid var(--border); }
.dyn-col-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); margin-bottom: 2px;
}
.dyn-svc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dyn-svc-info { flex: 1; min-width: 0; }
.dyn-svc-name { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dyn-svc-meta { font-size: 10px; color: var(--muted); }
.dyn-svc-time { font-size: 10px; color: var(--muted); white-space: nowrap; flex-shrink: 0; font-family: monospace; }
.dyn-run-row {
  display: flex; align-items: flex-start; gap: 8px;
}
.dyn-run-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.dyn-run-info { flex: 1; min-width: 0; }
.dyn-run-msg { display: block; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dyn-run-time { font-size: 10px; color: var(--muted); }
.dyn-no-history { font-size: 12px; color: var(--muted); font-style: italic; }
.dyn-no-history a { color: var(--accent); }
.dyn-cron-status {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
/* Phones, tablets and touch screens (no hover tooltips): full names, no text below 11px */
@media (max-width: 900px), (pointer: coarse) {
  .dyn-svc-name, .dyn-run-msg { white-space: normal; overflow-wrap: anywhere; }
  .dyn-col-label, .dyn-svc-meta, .dyn-svc-time, .dyn-run-time, .dyn-cron-link { font-size: 11px; }
}
@media (max-width: 640px) {
  .dyn-stats-grid { grid-template-columns: minmax(0, 1fr); }
  .dyn-services-col { border-right: none; border-bottom: 1px solid var(--border); }
  .dyn-services-col, .dyn-history-col { padding: 14px 4px; }
}

/* ── PROFILE PAGE ──────────────────────────── */
.profile-avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 16px; }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-form { flex: 1; display: flex; flex-direction: column; }
/* phones: stacked fields evenly spaced (the groups' .mb-0 loses to .form-group's 18px) */
@media (max-width: 640px) { .profile-form .form-row { gap: 16px; } .profile-form .form-row > .form-group { margin-bottom: 0; } }
/* the password field shares its row with three helper buttons: when the card is too narrow
   for both columns it takes a row of its own instead of shrinking to "Enter passw…" */
@media (min-width: 641px) { .profile-form .profile-pw-group { min-width: 300px; } }
.label-hint { font-weight: 400; font-size: 11px; color: var(--muted); }

/* ── 2FA SECTION ───────────────────────────── */
.twofa-backup-box { padding: 12px 16px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.15); border-radius: 8px; margin-bottom: 16px; }
.twofa-backup-title { font-size: 13px; font-weight: 600; color: #fde68a; margin-bottom: 8px; }
.twofa-backup-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-bottom: 12px; }
@media (max-width: 480px) { .twofa-backup-grid { grid-template-columns: repeat(2,1fr); } }
.twofa-backup-code { background: var(--bg); padding: 6px 8px; border-radius: 4px; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: 1px; border: 1px solid var(--border); }
.twofa-qr-box { background: var(--bg); padding: 12px; border-radius: 10px; border: 1px solid var(--border); }
.twofa-manual-key { display: block; background: var(--bg); padding: 8px 12px; border-radius: 6px; font-size: 12px; word-break: break-all; border: 1px solid var(--border); margin-bottom: 16px; }
.twofa-code-input { letter-spacing: 3px; font-size: 16px; text-align: center; padding: 10px; }
.twofa-disable-input { letter-spacing: 2px; font-size: 14px; width: 140px; text-align: center; }
.twofa-verify-btn { padding: 10px 16px; }
.twofa-disable-btn { padding: 8px 14px; }
/* code field + its button on one row at the same height; the button wraps below when there is no room */
.twofa-form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.twofa-form-inline > .twofa-code-input { flex: 1 1 140px; width: auto; min-width: 0; }
.twofa-form-inline > .twofa-disable-input { flex: 0 1 140px; min-width: 0; }
.twofa-form-inline > button { flex: 0 0 auto; }
.twofa-forced-notice { margin-top: 8px; padding: 8px 12px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.12); border-radius: 6px; font-size: 11px; color: #fde68a; }
.twofa-required-alert { padding: 10px 14px; background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.12); border-radius: 8px; font-size: 12px; color: #fca5a5; margin-bottom: 14px; }
.twofa-step { font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.twofa-step-inline { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.twofa-setup-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.twofa-setup-detail { flex: 1; min-width: 200px; }
.attn-arrow { margin-left: auto; opacity: .5; }
.vpn-tooltip-header { font-weight: 600; margin-bottom: 4px; font-size: 10px; text-transform: uppercase; color: var(--muted); }

/* ── VPN PAGE ──────────────────────────────── */

/* Connected VPNs empty state */
.vpn-empty-state { padding: 24px 0; text-align: center; }
.vpn-empty-state-icon { opacity: .4; margin-bottom: 8px; }
.vpn-empty-state-text { color: var(--muted); font-size: 13px; margin: 0; }

/* Connected VPN cards grid */
.vpn-cards-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.vpn-card-item {
  flex: 1 1 280px; max-width: 400px; min-width: 0;
  background: var(--card2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
/* The badges move under the name when both don't fit on one line, so a long name is never squeezed */
.vpn-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vpn-card-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.vpn-card-flag { font-size: 22px; flex-shrink: 0; }
.vpn-card-name-wrap { min-width: 0; }
.vpn-card-name { display: block; font-size: 13px; overflow-wrap: anywhere; }
/* the stored name, shown when the tidied name differs (that one drops server numbers like #12) */
.vpn-card-raw { display: block; margin-top: 1px; font-size: 11px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.vpn-card-provider { display: block; font-size: 11px; color: var(--muted); }
.vpn-card-badges { flex-shrink: 0; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.vpn-card-test { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; border-radius: 6px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.vpn-card-test.ok { color: var(--green-soft); background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2); }
.vpn-card-test.fail { color: var(--red-soft); background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); }
.vpn-card-test-x { flex-shrink: 0; margin-left: auto; min-width: 28px; min-height: 28px; padding: 0; background: none; border: 0; border-radius: 6px; color: inherit; font-size: 18px; line-height: 1; opacity: .8; }
.vpn-card-test-x:hover { opacity: 1; background: rgba(255,255,255,.06); }
.vpn-card-proxy-box {
  font-size: 11px; font-family: monospace; color: var(--muted);
  background: var(--bg); border-radius: 6px; padding: 8px 10px; word-break: break-all;
}
.vpn-card-egress { margin-top: 3px; color: var(--cyan); }
.vpn-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vpn-card-btn { font-size: 11px; }

/* Fix Routing / Test IP inline buttons */
.vpn-btn-routing {
  background: var(--card2); border: 1px solid var(--orange, #f97316);
  color: var(--orange, #f97316); font-size: 11px;
}
.vpn-btn-test-ip {
  background: var(--card2); border: 1px solid var(--cyan);
  color: var(--cyan); font-size: 11px;
}

/* Log viewer pre block */
.vpn-log-pre {
  font-size: 11px; color: #cdd9e5; background: #1a1d23;
  padding: 16px; border-radius: 6px; overflow-x: auto;
  max-height: 420px; max-height: min(420px, 60vh, calc(100vh - 190px)); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
}
.vpn-log-card { scroll-margin-top: 76px; scroll-margin-bottom: 12px; }
.vpn-log-title { min-width: 0; overflow-wrap: anywhere; }

/* Add VPN modal source tabs row */
.vpn-source-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.vpn-modal .modal-body .modal-actions-sticky > .btn:not(.btn-sm) { margin-top: 0; }
/* a field reached with Tab scrolls clear of the sticky header and the sticky submit bar */
.vpn-modal { scroll-padding: 84px 0 76px; }

/* Bulk ZIP info box */
.vpn-bulk-info {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; margin-bottom: 16px; font-size: 12px; line-height: 1.7; color: var(--muted);
}

/* VPN table toolbar */
.vpn-toolbar { display: flex; gap: 6px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.vpn-search-input { flex: 1; min-width: 100px; max-width: 220px; }
.vpn-filter-select { width: auto; min-width: 0; flex-shrink: 0; padding-right: 24px; }
.vpn-filter-count { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.vpn-toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.vpn-selected-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vpn-check-all-m { display: none; align-items: center; gap: 8px; margin: 0; min-height: 36px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }

/* VPN table checkbox column */
.vpn-th-check { width: 36px; text-align: center; }

/* VPN table cells */
.vpn-td-provider { font-size: 12px; color: var(--muted); }
.vpn-proxy-val { font-size: 11px; color: var(--muted); font-family: monospace; }
/* an IPv6 exit address has no break points; let it wrap rather than push the actions out of the table */
.vpn-egress-ip { overflow-wrap: anywhere; }
.vpn-td-egress-active { margin-top: 3px; color: var(--cyan, #22d3ee); }
.vpn-td-egress-none { margin-top: 3px; color: var(--muted); }
.vpn-td-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vpn-td-restart { white-space: nowrap; }
.vpn-auto-restart-sel { font-size: 12px; padding: 2px 4px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.vpn-name-cell { display: flex; align-items: center; gap: 6px; }
.vpn-name-main { min-width: 0; }
/* a name with no spaces would otherwise set the column's minimum width and push the actions out */
.vpn-name-main > strong { overflow-wrap: anywhere; }
.vpn-flag { font-size: 20px; flex-shrink: 0; }
.vpn-badge-streaming { margin-left: 4px; vertical-align: middle; }
/* stored name under a tidied name that other profiles share */
.vpn-name-raw { margin-top: 2px; font-size: 11px; line-height: 1.4; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
/* Provider + last connected under the name: shown only where those columns are dropped (901–1339px) */
.vpn-name-meta { display: none; margin-top: 3px; font-size: 11px; line-height: 1.45; color: var(--muted); font-weight: 400; }
.vpn-name-meta > span { display: block; }

/* VPN overflow menu (3-dot dropdown). ssPop.place() fixes it to the viewport when it opens
   (a bottom sheet on phones); the absolute position is only the no-script fallback. */
.vpn-overflow-wrap { position: relative; display: inline-block; }
.vpn-overflow-dots { font-size: 16px; line-height: 1; padding: 2px 8px; }
.vpn-overflow-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; min-width: 160px; padding: 4px 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.vpn-overflow-menu.ss-pop { right: auto; }
.vpn-overflow-menu-title { display: none; }
/* Clear layer under the open menu (the ≤640px sheet dims the page with its own shadow). It takes
   the tap or click that dismisses the menu, so that can't also press another row's Start/Stop. */
.vpn-overflow-backdrop { position: fixed; inset: 0; z-index: 1299; }
.vpn-overflow-menu-item, .vpn-overflow-menu-link {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 38px; padding: 8px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
  color: var(--text); text-align: left; text-decoration: none; background: none; border: none; border-radius: 0;
  cursor: pointer; white-space: nowrap; transition: background .1s;
}
.vpn-overflow-menu-item:hover, .vpn-overflow-menu-link:hover { background: var(--card2); }
.vpn-overflow-menu-item.danger { color: var(--red); }
.vpn-overflow-menu-item.danger:hover { background: rgba(239,68,68,.08); }

/* VPN no-access dash */
.vpn-no-action { font-size: 12px; color: var(--muted); }

/* VPN error info, under the profile name: three lines in the table (hover or tap for the rest), whole on cards */
.vpn-error { margin-top: 6px; max-width: 280px; }
.vpn-error-text { font-size: 11px; line-height: 1.45; color: #e57373; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.vpn-error-text.open { display: block; overflow: visible; }
.vpn-error-log-link { font-size: 11px; color: #5b8ef0; text-decoration: none; margin-top: 3px; display: inline-block; }

/* VPN pagination bar */
.vpn-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.vpn-page-info { font-size: 12px; color: var(--muted); }
.vpn-page-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* How-to card */
.vpn-howto-header { cursor: pointer; user-select: none; }
.card-header.vpn-howto-header { flex-wrap: nowrap; gap: 12px; }
/* collapsed: no divider/gap under the title; the tap area reaches into the card padding */
.vpn-howto-header.is-collapsed { margin: -10px; padding: 10px; border-bottom: 0; border-radius: 8px; }
.vpn-howto-header:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.vpn-howto-chevron { transition: transform .2s; flex-shrink: 0; }
.vpn-howto-chevron.is-open { transform: rotate(180deg); }
.vpn-howto-body { font-size: 13px; line-height: 1.8; color: var(--text); padding-top: 4px; }
.vpn-howto-body a { color: #a5b4fc; text-decoration: underline; text-underline-offset: 2px; }
.vpn-howto-note { color: var(--muted); font-size: 12px; }

/* ── VPN page: tablets and phones ──
   Profiles become cards up to 900px. Phones use the shared .table-cards look (RESPONSIVE
   LAYER, ≤640px); 641–900px draws the same cards here, two per row when they fit. */
@media (min-width: 641px) and (max-width: 900px) {
  #vpnTable, #vpnTable > tbody > tr > td { display: block; width: 100%; box-sizing: border-box; }
  #vpnTable > thead { display: none; }
  #vpnTable > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
  #vpnTable > tbody > tr { position: relative; display: flex; flex-direction: column; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 8px; }
  #vpnTable > tbody > tr:hover { background: var(--card2); }
  #vpnTable > tbody > tr > td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; min-height: 28px; text-align: right; font-size: 13px; white-space: normal; word-break: break-word; }
  #vpnTable > tbody > tr > td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; text-align: left; }
  #vpnTable > tbody > tr > td[data-label=""]::before, #vpnTable > tbody > tr > td.td-primary::before, #vpnTable > tbody > tr > td.td-check::before { content: none; }
  #vpnTable > tbody > tr > td.td-primary { display: block; text-align: left; font-size: 14px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); min-height: 0; }
  #vpnTable > tbody > tr > td.td-check { position: absolute; top: 12px; left: 12px; width: auto; min-height: 0; padding: 0; }
  #vpnTable > tbody > tr:has(> td.td-check) > td.td-primary { padding-left: 30px; }
  .table-wrap:has(> #vpnTable) { overflow-x: visible; background: none; }
}
@media (max-width: 900px) {
  .vpn-check-all-m { display: inline-flex; margin-right: 8px; }
  #vpnTable > tbody > tr > td.td-primary { padding-right: 0; }
  #vpnTable > tbody > tr > td.vpn-td-actions { display: flex; justify-content: flex-end; margin-top: auto; padding: 8px 0 2px; border-top: 1px solid var(--border); }
  #vpnTable > tbody > tr > td.vpn-td-actions:has(.vpn-no-action) { display: none; }
  #vpnTable .action-btns { flex-direction: row; justify-content: flex-end; align-items: center; gap: 8px; }
  #vpnTable .vpn-start-btn, #vpnTable .vpn-stop-btn { min-width: 88px; }
  #vpnTable .vpn-error { max-width: none; }
  #vpnTable .vpn-error-text { display: block; overflow: visible; cursor: auto; }
  #vpnTable .vpn-auto-restart-sel { width: auto; }
  /* on the narrowest cards the address moves under its label instead of breaking mid-address */
  #vpnTable > tbody > tr > td.vpn-td-proxy { flex-wrap: wrap; row-gap: 2px; }
  #vpnTable .vpn-proxy-val { margin-left: auto; }
}
/* Table layouts keep Start/Stop and ⋮ on one row. The full table then needs ~925-965px, more than
   the card has below ~1340px (sidebar docked from 1101px), so 901–1339px moves Provider and
   Last Connected into the name cell and the actions stay in view. */
@media (min-width: 901px) {
  #vpnTable .action-btns { flex-wrap: nowrap; }
}
@media (min-width: 901px) and (max-width: 1339px) {
  #vpnTable .vpn-th-provider, #vpnTable .vpn-td-provider, #vpnTable .vpn-th-date, #vpnTable .vpn-td-date { display: none; }
  #vpnTable .vpn-name-meta { display: block; }
  #vpnTable > thead > tr > th, #vpnTable > tbody > tr > td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 640px) {
  /* five KPIs: 3 + 2 wider tiles instead of a row with an empty slot */
  .kpi-grid.vpn-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .vpn-kpi-grid > .kpi-card { grid-column: span 2; }
  .vpn-kpi-grid > .kpi-card:nth-child(n+4) { grid-column: span 3; }
  .vpn-toolbar { gap: 8px; }
  .vpn-search-input { flex: 1 1 100%; max-width: none; }
  .vpn-filter-select { flex: 1 1 calc(50% - 4px); }
  /* on its own line it may shrink, so the bulk buttons wrap instead of running past the card (320px) */
  .vpn-toolbar-right { flex-wrap: wrap; justify-content: flex-end; flex-shrink: 1; min-width: 0; }
  .vpn-card-item { flex-basis: 100%; max-width: none; padding: 12px; }
  .vpn-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vpn-card-actions button { width: 100%; }
  .vpn-log-pre { max-height: 60vh; max-height: 60dvh; padding: 12px; }
  .vpn-overflow-menu.ss-sheet { padding: 6px; }
  .vpn-overflow-menu.ss-sheet .vpn-overflow-menu-title { display: block; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
  .vpn-overflow-menu.ss-sheet .vpn-overflow-menu-item, .vpn-overflow-menu.ss-sheet .vpn-overflow-menu-link { display: flex; align-items: center; justify-content: flex-start; min-height: 44px; padding: 10px 12px; font-size: 14px; border-radius: 8px; }
}
/* The shared ≤380px block shrinks badges to 9px; keep the normal badge size on this page */
@media (max-width: 380px) {
  .vpn-kpi-grid ~ .card .badge { font-size: 10px; padding: 3px 8px; }
}
@media (max-width: 900px), (pointer: coarse) {
  .vpn-overflow-wrap > .vpn-overflow-dots { min-width: 40px; min-height: 40px; font-size: 18px; }
  .vpn-page-btns { gap: 6px; }
  .vpn-page-btns > button { min-width: 40px; }
  #vpnTable .vpn-start-btn, #vpnTable .vpn-stop-btn { min-height: 40px; }
  .vpn-auto-restart-sel { min-height: 36px; padding: 4px 8px; }
  .vpn-error-log-link { display: inline-flex; align-items: center; min-height: 32px; margin-top: 0; }
  .vpn-card-actions { gap: 8px; }
  .vpn-card-test-x { min-width: 40px; min-height: 40px; }
  .vpn-modal .modal-close { width: 40px; height: 40px; }
}

/* ── RESPONSIVE ─────────────────────────────── */

/* Large tablet / laptop */
@media (max-width: 1024px) {
  .main-content { padding: 20px 22px; }
  .charts-grid { grid-template-columns: 1fr 1.4fr; }
  .site-footer { padding: 14px 16px; }
}

/* Tablet / large phone: sidebar becomes a slide-in drawer */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.6); }
  .main-wrap { margin-left: 0; width: 100%; max-width: 100vw; }
  .charts-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .main-header { padding: 0 16px; gap: 12px; }
  .main-header h1 { font-size: 17px; }
  .chart-wrap { height: 220px; }
  .col-hide-tablet { display: none; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .modal-backdrop { padding: 16px; }
}

/* Mobile */
@media (max-width: 640px) {
  .main-content { padding: 12px; overflow-x: hidden; overflow-x: clip; width: 100%; max-width: 100vw; }
  .col-hide-mobile { display: none; }
  .header-search { display: none; }

  /* 5-column KPI row */
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .kpi-card { padding: 10px 5px 12px; border-radius: 10px; }
  .kpi-icon { display: none; }
  .kpi-top { justify-content: flex-start; }
  .kpi-label { font-size: 9px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .kpi-value { font-size: 15px; margin-top: 4px; }
  .kpi-footer { display: none; }

  .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; margin-bottom: 14px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .charts-grid { grid-template-columns: 1fr; gap: 12px; width: 100%; }
  .chart-wrap { height: 200px; width: 100%; }
  .chart-legend { grid-template-columns: 1fr 1fr; gap: 8px; }
  .action-btns { flex-direction: column; align-items: stretch; }
  .action-btns .btn { justify-content: center; }
  th, td { padding: 10px 8px; }
  .btn { padding: 8px 14px; }
  .form-row > * { min-width: 100%; flex: none; width: 100%; }
  .login-card { padding: 28px 20px; }
  .modal-backdrop { padding: 12px; }
  .modal-box { border-radius: 12px; max-height: 88vh; }
  .modal-body { padding: 16px; }
  .main-header h1 { font-size: 16px; }
  .pagination { gap: 4px; }
  .page-link { padding: 5px 9px; font-size: 11px; }
  /* VPN popup on mobile */
  .vpn-sidebar-popup { left: 8px; right: 8px; }
  /* Table: hide less critical columns */
  .col-hide-sm { display: none; }
}

/* Small mobile: further compaction */
@media (max-width: 480px) {
  .main-content { padding: 10px 8px; }
  .card { padding: 12px; }
  .card-header { gap: 6px; }
  th, td { padding: 8px 6px; font-size: 12px; }
  .kpi-value { font-size: 13px; }
  .kpi-label { font-size: 8px; }
  .main-header h1 { font-size: 15px; }
  /* Stack card-header buttons on very small phones */
  .card-header > div[style*="display:flex"] { flex-wrap: wrap; gap: 6px; }
}

/* Fold phones / extra-small */
@media (max-width: 380px) {
  :root { --sidebar-w: min(280px, 92vw); }
  .main-content { padding: 8px 6px; }
  .card { padding: 10px; border-radius: 10px; margin-bottom: 10px; }

  /* 3-column KPI (wraps to 2nd row) */
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .kpi-card { padding: 8px 3px 10px; border-radius: 8px; }
  .kpi-label { font-size: 8px; }
  .kpi-value { font-size: 12px; }

  .main-header { height: 52px; padding: 0 10px; gap: 8px; }
  .main-header h1 { font-size: 13px; }

  th, td { padding: 6px 4px; font-size: 11px; }
  .btn { padding: 7px 10px; font-size: 12px; }
  .badge { font-size: 9px; padding: 2px 5px; }

  /* Bottom-sheet style modal on tiny screens */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 16px 16px 0 0; max-height: 92vh; width: 100%; }

  .vpn-sidebar-popup { left: 4px; right: 4px; }
}

/* ━━ PAGE-SPECIFIC REFACTORED CLASSES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Shared: empty state card ──────────────────── */
.empty-card { text-align: center; padding: 48px 20px; }
.empty-card-sm { text-align: center; padding: 40px; }
.empty-card-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.3; }
.empty-card-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.empty-card-sub { font-size: 12px; color: var(--muted); }
.empty-filter { text-align: center; padding: 32px; }

/* ── Shared: poster badge overlay ──────────────── */
.poster-year-badge { position: absolute; bottom: 6px; left: 6px; background: rgba(99,102,241,.85); padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; color: #fff; }

/* ── Shared: smart tag ─────────────────────────── */
.smart-tag { font-size: 10px; font-weight: 400; background: rgba(99,102,241,.1); padding: 1px 7px; border-radius: 99px; color: #a5b4fc; vertical-align: middle; margin-left: 4px; }

/* ── Shared: filter/action button (compact) ────── */
.btn-filter { font-size: 11px; padding: 6px 12px; }
.btn-clear { text-decoration: none; font-size: 11px; }

/* ── Shared: pagination ellipsis ───────────────── */
.page-ellipsis { padding: 5px 3px; color: var(--muted); }
.page-ellipsis-lg { padding: 5px 4px; color: var(--muted); }

/* ── Shared: detail modal ──────────────────────── */
.detail-poster-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 32px; opacity: 0.15; }
.detail-rating { color: #f59e0b; }
.detail-src-badges { margin: 8px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.detail-src-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 5px; }
.detail-src-fb { background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.2); }
.detail-src-iptv { background: rgba(16,185,129,.1); color: #6ee7b7; border: 1px solid rgba(16,185,129,.15); }
.detail-src-ms { background: rgba(6,182,212,.1); color: #67e8f9; border: 1px solid rgba(6,182,212,.15); }
.detail-field-val { color: var(--text); }

/* ── Shared: featured card overrides ───────────── */
.card-featured { flex: 0 0 170px; }
.poster-featured { width: 170px; height: 245px; }

/* ── Shared: review KPI colors ─────────────────── */
.kpi-val-orange { color: var(--orange); }
.kpi-val-cyan { color: var(--cyan); }
.kpi-val-red { color: var(--red); }
.kpi-val-green { color: var(--green); }

/* ── Shared: table column widths ───────────────── */
.col-w-44 { width: 44px; }
.col-w-60 { width: 60px; }
.col-w-80 { width: 80px; }

/* ── Shared: review table cells ────────────────── */
.review-tbl-name { font-weight: 500; }
.review-tbl-cat { color: var(--muted); font-size: 11px; }
.review-tbl-badge { font-size: 9px; }
.review-tbl-year { font-size: 11px; color: var(--muted); }

/* ── Shared: media server filter buttons ───────── */
.btn-ms-filter { font-size: 11px; text-decoration: none; border-color: #4f46e5; color: #818cf8; }
.btn-ms-excl { font-size: 11px; text-decoration: none; border-color: #0ea5e9; color: #38bdf8; }

/* ── Categories page ───────────────────────────── */
.cat-select-btn { font-size: 11px; display: flex; align-items: center; gap: 4px; margin-left: auto; }
.cat-bulk-selected { font-size: 11px; color: var(--muted); }
.co-bulk-label { display: inline-flex; align-items: center; gap: 6px; }
.cat-bulk-btn { font-size: 10px; padding: 4px 8px; }
.cat-bulk-hide { font-size: 10px; padding: 4px 8px; color: #fca5a5; border-color: rgba(239,68,68,.2); }
.cat-bulk-show { font-size: 10px; padding: 4px 8px; color: #6ee7b7; border-color: rgba(16,185,129,.2); }

/* ── Library page ──────────────────────────────── */
.lib-service-card { margin-bottom: 16px; padding: 14px 18px; }
.lib-service-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.lib-service-select { min-width: 180px; max-width: 320px; padding: 7px 12px; background: var(--input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; }
.lib-btn-icon { vertical-align: -2px; margin-right: 3px; }
.lib-epg-status { font-size: 12px; color: var(--muted); display: none; }
.lib-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.lib-filter-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.lib-filter-group { min-width: 180px; }
.lib-filter-group-sm { min-width: 130px; max-width: 200px; }
.lib-filter-group-md { min-width: 160px; max-width: 280px; }
.lib-filter-flex-2 { flex: 2; }
.lib-filter-flex-1 { flex: 1; }
.lib-field-label { font-size: 11px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.lib-input { width: 100%; padding: 7px 12px; background: var(--input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; box-sizing: border-box; }
.lib-input-sm { padding: 7px 12px; background: var(--input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 12px; }
.lib-input-flex { flex: 1; padding: 7px 12px; background: var(--input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 12px; }
.lib-file-input { flex: 1; font-size: 12px; color: var(--text); }
.lib-btn-group { display: flex; gap: 6px; padding-bottom: 1px; }
.lib-search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.lib-search-input { flex: 1; padding: 8px 12px; background: var(--input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; }
.lib-badges-min { min-width: 120px; }
.lib-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.lib-panel-heading { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.lib-panel-section { margin-top: 10px; }
.lib-panel-tab-strip { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.lib-panel-sub { width: 100%; margin-top: 8px; }
.lib-panel-sub-form { display: flex; gap: 6px; }
.lib-panel-sub-form-upload { display: flex; gap: 6px; align-items: center; }
.lib-logo-search-results { margin-top: 8px; max-height: 200px; overflow-y: auto; }
.lib-logo-override-row { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255,255,255,0.02); border-radius: 8px; border: 1px solid var(--border); }
.lib-logo-override-img { max-height: 30px; max-width: 80px; object-fit: contain; background: var(--bg2); border-radius: 6px; padding: 3px; }
.lib-epg-info { margin-top: 10px; font-size: 12px; color: var(--muted); }
.lib-epg-code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.lib-epg-current { margin-top: 6px; font-size: 12px; }
.lib-epg-form { margin-top: 10px; }
.lib-epg-fields { display: flex; flex-direction: column; gap: 8px; }
.lib-repo-meta { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.lib-logo-repo-name { color: #4b5563; }
.lib-logo-search-error { font-size: 11px; color: #f87171; }
.lib-logo-no-results { font-size: 11px; color: #6b7280; grid-column: 1 / -1; }
.lib-logo-item-img { max-width: 64px; max-height: 40px; object-fit: contain; }
.lib-repo-meta { flex-wrap: wrap; justify-content: flex-end; }
/* Phones: search on its own line, the two filters side by side, the buttons last */
@media (max-width: 640px) {
  .lib-service-card { padding: 12px; }
  .lib-toolbar-left { min-width: 0; flex: 1 1 100%; }
  .lib-service-select { min-width: 0; max-width: none; flex: 1 1 auto; }
  .lib-filter-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
  .lib-filter-form > .lib-filter-group { grid-column: 1 / -1; }
  .lib-filter-form > div { min-width: 0; max-width: none; }
  .lib-filter-form > .lib-btn-group { grid-column: 1 / -1; }
  .lib-filter-form > .lib-btn-group > * { flex: 1 1 0; justify-content: center; }
  .lib-search-form { flex-wrap: wrap; }
  .lib-search-input { flex: 1 1 100%; }
  .lib-search-form > .btn, .lib-search-form > .btn-secondary { flex: 1 1 auto; }
  .lib-repo-meta { justify-content: flex-start; }
}

/* ━━ MOVIES PAGE (moved from movies.php <style>) ━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mv-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;gap:8px}
.mv-header-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mv-header-left select{width:auto;padding:7px 28px 7px 10px;font-size:12px;flex-shrink:0}
.mv-header-meta{font-size:12px;color:var(--muted)}
.mv-tabs{display:flex;gap:2px;background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:9px;padding:3px}
.mv-tab{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;font-size:12px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:7px;transition:all .15s;white-space:nowrap}
.mv-tab:hover{color:var(--text);background:rgba(255,255,255,.04)}
.mv-tab.active{color:#fff;background:var(--accent);box-shadow:0 1px 4px rgba(99,102,241,.25)}
.mv-tab-badge{font-size:9px;background:rgba(239,68,68,.15);color:#fca5a5;padding:1px 6px;border-radius:99px;font-weight:600}
.mv-tab.active .mv-tab-badge{background:rgba(255,255,255,.2);color:#fff}
.mv-kpis{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.mv-kpi{flex:1;min-width:100px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;position:relative;overflow:hidden}
.mv-kpi::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:0 0 10px 10px}
.mv-kpi.blue::after{background:linear-gradient(90deg,var(--accent),var(--purple))}
.mv-kpi.green::after{background:linear-gradient(90deg,var(--green),#34d399)}
.mv-kpi.purple::after{background:linear-gradient(90deg,var(--purple),#a78bfa)}
.mv-kpi.orange::after{background:linear-gradient(90deg,var(--orange),#fbbf24)}
.mv-kpi.red::after{background:linear-gradient(90deg,var(--red),#f87171)}
.mv-kpi-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}
.mv-kpi-val{font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.mv-kpi-sub{font-size:10px;color:var(--muted);margin-top:1px}
.mv-hero{position:relative;border-radius:16px;overflow:hidden;min-height:260px;margin-bottom:28px;display:flex;align-items:center}
.mv-hero-bg{position:absolute;inset:-20px;background-size:cover;background-position:center;filter:blur(50px) brightness(.25) saturate(1.4);transform:scale(1.3)}
.mv-hero-grad{position:absolute;inset:0;background:linear-gradient(135deg,rgba(26,16,64,.75),rgba(13,17,23,.85))}
.mv-hero-content{position:relative;z-index:2;display:flex;align-items:center;gap:28px;padding:36px 40px;width:100%}
.mv-hero-poster{width:160px;height:230px;flex-shrink:0;border-radius:10px;overflow:hidden;box-shadow:0 12px 40px rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.08)}
.mv-hero-poster img{width:100%;height:100%;object-fit:cover}
.mv-hero-info{flex:1;min-width:0}
.mv-hero-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border-radius:99px;background:rgba(99,102,241,.15);color:#a5b4fc;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-bottom:12px;border:1px solid rgba(99,102,241,.2)}
.mv-hero-title{font-size:28px;font-weight:800;letter-spacing:-.02em;line-height:1.2;margin-bottom:8px}
.mv-hero-meta{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);margin-bottom:12px;flex-wrap:wrap}
.mv-hero-stars{color:#f59e0b;letter-spacing:1px}
.mv-hero-plot{font-size:13px;color:rgba(228,232,240,.6);line-height:1.6;max-width:500px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.mv-section{margin-bottom:28px}
.mv-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.mv-section-title{font-size:15px;font-weight:700;letter-spacing:-.01em}
.mv-section-more{font-size:12px;color:var(--accent);text-decoration:none;font-weight:500;transition:color .15s}
.mv-section-more:hover{color:#818cf8}
.mv-rail{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.mv-rail::-webkit-scrollbar{height:4px}.mv-rail::-webkit-scrollbar-track{background:transparent}.mv-rail::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:4px}.mv-rail:hover::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15)}
.mv-card{flex:0 0 145px;scroll-snap-align:start;cursor:pointer;transition:transform .15s}
.mv-card:hover{transform:translateY(-4px);z-index:2}
.mv-card-poster{width:145px;height:210px;border-radius:8px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.06);transition:border-color .15s;position:relative}
.mv-card:hover .mv-card-poster{border-color:rgba(99,102,241,.3);box-shadow:0 8px 24px rgba(0,0,0,.4)}
.mv-card-poster img{width:100%;height:100%;object-fit:cover}
.mv-card-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:24px;opacity:.15}
.mv-card-body{padding:6px 2px 0}
.mv-card-title{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.mv-card-meta{font-size:10px;color:var(--muted);line-height:1.3}
.mv-card-meta .rating-star{color:#f59e0b;font-size:10px}
.mv-top10{flex:0 0 155px;display:flex;align-items:flex-end;position:relative;scroll-snap-align:start;cursor:pointer;transition:transform .15s}
.mv-top10:hover{transform:translateY(-4px)}
.mv-top10-rank{font-size:72px;font-weight:900;line-height:.75;color:transparent;-webkit-text-stroke:2px rgba(255,255,255,.12);letter-spacing:-.05em;position:absolute;bottom:0;left:-4px;z-index:1;pointer-events:none}
.mv-top10-poster{width:110px;height:160px;border-radius:8px;overflow:hidden;border:1px solid rgba(255,255,255,.06);margin-left:28px;position:relative;z-index:2;transition:border-color .15s}
.mv-top10:hover .mv-top10-poster{border-color:rgba(99,102,241,.3);box-shadow:0 8px 24px rgba(0,0,0,.4)}
.mv-top10-poster img{width:100%;height:100%;object-fit:cover}
.mv-top10-info{position:absolute;bottom:-24px;left:28px;right:0;z-index:3}
.mv-top10-title{font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}
.mv-top10-meta{font-size:10px;color:var(--muted)}
.mv-lib-card{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}
.mv-lib-filter{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border)}
.mv-lib-filter input,.mv-lib-filter select{padding:7px 10px;font-size:12px}
.mv-lib-filter input{flex:1;min-width:100px;max-width:200px}
.mv-lib-filter select{width:auto;padding-right:28px}
.mv-lib-filter-meta{font-size:11px;color:var(--muted);margin-left:auto}
.mv-lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;padding:16px}
.mv-lib-item{cursor:pointer;transition:transform .12s}
.mv-lib-item:hover{transform:translateY(-3px)}
.mv-lib-poster{width:100%;aspect-ratio:2/3;border-radius:6px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.05);transition:border-color .12s;position:relative}
.mv-lib-item:hover .mv-lib-poster{border-color:rgba(99,102,241,.25)}
.mv-lib-poster img{width:100%;height:100%;object-fit:cover}
.mv-lib-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:20px;opacity:.12}
.mv-lib-info{padding:5px 1px 0}
.mv-lib-name{font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.mv-lib-meta{font-size:10px;color:var(--muted);line-height:1.3}
.mv-review-kpis{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.mv-review-kpi{flex:1;min-width:90px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:10px 12px;text-align:center}
.mv-review-kpi-val{font-size:22px;font-weight:700;letter-spacing:-.02em}
.mv-review-kpi-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-top:2px}
.mv-tbl{width:100%;border-collapse:collapse}
.mv-tbl th{padding:8px 12px;font-size:10px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap;background:rgba(0,0,0,.08)}
.mv-tbl td{padding:7px 12px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.03);vertical-align:middle}
.mv-tbl tbody tr:hover{background:rgba(255,255,255,.02)}
.mv-tbl-poster{width:32px;height:46px;object-fit:cover;border-radius:3px;background:#111827;display:block}
.mv-tbl-poster-ph{width:32px;height:46px;background:#111827;border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:10px;opacity:.15}
.mv-detail-overlay{position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.5);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:20px}
.mv-detail{background:var(--card);border:1px solid var(--border);border-radius:16px;width:100%;max-width:640px;max-height:90vh;overflow-y:auto;box-shadow:0 32px 80px rgba(0,0,0,.6)}
.mv-detail-top{display:flex;gap:24px;padding:24px 28px;align-items:flex-start}
.mv-detail-poster{width:140px;height:210px;flex-shrink:0;border-radius:8px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.06)}
.mv-detail-poster img{width:100%;height:100%;object-fit:cover}
.mv-detail-info{flex:1;min-width:0}
.mv-detail-title{font-size:20px;font-weight:700;letter-spacing:-.01em;margin-bottom:6px}
.mv-detail-meta{display:flex;gap:8px;font-size:12px;color:var(--muted);margin-bottom:10px;flex-wrap:wrap}
.mv-detail-plot{font-size:13px;color:rgba(228,232,240,.7);line-height:1.6;margin-bottom:12px}
.mv-detail-fields{display:flex;flex-direction:column;gap:6px;font-size:12px}
.mv-detail-fields span{color:var(--muted)}
.mv-detail-close{position:absolute;top:16px;right:16px;background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);font-size:16px;font-family:inherit;transition:all .12s;z-index:2}
.mv-detail-close:hover{color:var(--text);background:rgba(255,255,255,.1)}
.mv-pagination{display:flex;gap:4px;justify-content:center;margin-top:16px;flex-wrap:wrap}
.mv-page{padding:5px 10px;border-radius:6px;font-size:12px;background:var(--card);border:1px solid var(--border);color:var(--text);text-decoration:none;transition:all .12s}
.mv-page.active{background:var(--accent);border-color:var(--accent);color:#fff}
.mv-page:hover:not(.active){border-color:rgba(99,102,241,.3)}
.mv-ms-badge{display:inline-block;font-size:9px;background:#4f46e5;color:#fff;padding:1px 6px;border-radius:3px;letter-spacing:.3px;white-space:nowrap}
.mv-src-tag{position:absolute;top:5px;left:5px;font-size:8px;font-weight:600;padding:2px 6px;border-radius:3px;letter-spacing:.3px;line-height:1.3;z-index:2;backdrop-filter:blur(4px)}
.mv-src-iptv{background:rgba(16,185,129,.8);color:#fff}
.mv-src-ms{background:rgba(6,182,212,.8);color:#fff}
.mv-src-fb{background:rgba(99,102,241,.85);color:#fff}
.rating-star{color:#f59e0b}
@media(max-width:900px){.mv-hero-content{flex-direction:column;align-items:flex-start;padding:24px}.mv-hero-poster{width:120px;height:175px}.mv-hero-title{font-size:22px}.mv-detail-top{flex-direction:column;align-items:center;text-align:center}}
@media(max-width:640px){.mv-kpis{gap:4px}.mv-kpi{min-width:0;padding:8px 10px}.mv-kpi-val{font-size:16px}.mv-hero-content{padding:20px}.mv-hero-poster{width:100px;height:145px}.mv-hero-title{font-size:18px}.mv-card{flex:0 0 120px}.mv-card-poster{width:120px;height:175px}.mv-lib-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px;padding:10px}.mv-tbl .col-hide-sm{display:none}}

/* ━━ SERIES PAGE (moved from series.php <style>) ━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.sv-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;gap:8px}.sv-header-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.sv-header-left select{width:auto;padding:7px 28px 7px 10px;font-size:12px}.sv-header-meta{font-size:12px;color:var(--muted)}
.sv-tabs{display:flex;gap:2px;background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:9px;padding:3px}.sv-tab{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;font-size:12px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:7px;transition:all .15s;white-space:nowrap}.sv-tab:hover{color:var(--text);background:rgba(255,255,255,.04)}.sv-tab.active{color:#fff;background:var(--accent);box-shadow:0 1px 4px rgba(99,102,241,.25)}.sv-tab-badge{font-size:9px;background:rgba(239,68,68,.15);color:#fca5a5;padding:1px 6px;border-radius:99px;font-weight:600}.sv-tab.active .sv-tab-badge{background:rgba(255,255,255,.2);color:#fff}
.sv-kpis{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}.sv-kpi{flex:1;min-width:100px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;position:relative;overflow:hidden}.sv-kpi::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:0 0 10px 10px}.sv-kpi.blue::after{background:linear-gradient(90deg,var(--accent),var(--purple))}.sv-kpi.green::after{background:linear-gradient(90deg,var(--green),#34d399)}.sv-kpi.purple::after{background:linear-gradient(90deg,var(--purple),#a78bfa)}.sv-kpi.orange::after{background:linear-gradient(90deg,var(--orange),#fbbf24)}.sv-kpi.red::after{background:linear-gradient(90deg,var(--red),#f87171)}.sv-kpi-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:2px}.sv-kpi-val{font-size:20px;font-weight:700;letter-spacing:-.02em;line-height:1.2}.sv-kpi-sub{font-size:10px;color:var(--muted);margin-top:1px}
.sv-section{margin-bottom:28px}.sv-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.sv-section-title{font-size:15px;font-weight:700;letter-spacing:-.01em}.sv-section-more{font-size:12px;color:var(--accent);text-decoration:none;font-weight:500}.sv-section-more:hover{color:#818cf8}
.sv-rail{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}.sv-rail::-webkit-scrollbar{height:4px}.sv-rail::-webkit-scrollbar-track{background:transparent}.sv-rail::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:4px}.sv-rail:hover::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15)}
.sv-card{flex:0 0 145px;scroll-snap-align:start;cursor:pointer;transition:transform .15s}.sv-card:hover{transform:translateY(-4px);z-index:2}.sv-card-poster{width:145px;height:210px;border-radius:8px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.06);transition:border-color .15s;position:relative}.sv-card:hover .sv-card-poster{border-color:rgba(99,102,241,.3);box-shadow:0 8px 24px rgba(0,0,0,.4)}.sv-card-poster img{width:100%;height:100%;object-fit:cover}.sv-card-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:24px;opacity:.15}.sv-card-body{padding:6px 2px 0}.sv-card-title{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}.sv-card-meta{font-size:10px;color:var(--muted);line-height:1.3}
.sv-src-tag{position:absolute;top:5px;left:5px;font-size:8px;font-weight:600;padding:2px 6px;border-radius:3px;letter-spacing:.3px;line-height:1.3;z-index:2;backdrop-filter:blur(4px)}.sv-src-iptv{background:rgba(16,185,129,.8);color:#fff}.sv-src-fb{background:rgba(99,102,241,.85);color:#fff}
.sv-lib-card{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}.sv-lib-filter{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border)}.sv-lib-filter input,.sv-lib-filter select{padding:7px 10px;font-size:12px}.sv-lib-filter input{flex:1;min-width:100px;max-width:200px}.sv-lib-filter select{width:auto;padding-right:28px}.sv-lib-filter-meta{font-size:11px;color:var(--muted);margin-left:auto}
.sv-lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;padding:16px}.sv-lib-item{cursor:pointer;transition:transform .12s}.sv-lib-item:hover{transform:translateY(-3px)}.sv-lib-poster{width:100%;aspect-ratio:2/3;border-radius:6px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.05);transition:border-color .12s;position:relative}.sv-lib-item:hover .sv-lib-poster{border-color:rgba(99,102,241,.25)}.sv-lib-poster img{width:100%;height:100%;object-fit:cover}.sv-lib-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:20px;opacity:.12}.sv-lib-info{padding:5px 1px 0}.sv-lib-name{font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}.sv-lib-meta{font-size:10px;color:var(--muted);line-height:1.3}
.sv-review-kpis{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}.sv-review-kpi{flex:1;min-width:90px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:10px 12px;text-align:center}.sv-review-kpi-val{font-size:22px;font-weight:700;letter-spacing:-.02em}.sv-review-kpi-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-top:2px}
.sv-tbl{width:100%;border-collapse:collapse}.sv-tbl th{padding:8px 12px;font-size:10px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap;background:rgba(0,0,0,.08)}.sv-tbl td{padding:7px 12px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.03);vertical-align:middle}.sv-tbl tbody tr:hover{background:rgba(255,255,255,.02)}.sv-tbl-poster{width:32px;height:46px;object-fit:cover;border-radius:3px;background:#111827;display:block}.sv-tbl-poster-ph{width:32px;height:46px;background:#111827;border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:10px;opacity:.15}
.sv-detail-overlay{position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.5);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:20px}.sv-detail{background:var(--card);border:1px solid var(--border);border-radius:16px;width:100%;max-width:640px;max-height:90vh;overflow-y:auto;box-shadow:0 32px 80px rgba(0,0,0,.6);position:relative}.sv-detail-top{display:flex;gap:24px;padding:24px 28px;align-items:flex-start}.sv-detail-poster{width:140px;height:210px;flex-shrink:0;border-radius:8px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.06)}.sv-detail-poster img{width:100%;height:100%;object-fit:cover}.sv-detail-info{flex:1;min-width:0}.sv-detail-title{font-size:20px;font-weight:700;letter-spacing:-.01em;margin-bottom:6px}.sv-detail-meta{display:flex;gap:8px;font-size:12px;color:var(--muted);margin-bottom:8px;flex-wrap:wrap}.sv-detail-plot{font-size:13px;color:rgba(228,232,240,.7);line-height:1.6;margin-bottom:12px}.sv-detail-fields{display:flex;flex-direction:column;gap:6px;font-size:12px}.sv-detail-fields span{color:var(--muted)}.sv-detail-close{position:absolute;top:16px;right:16px;background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:8px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);font-size:16px;font-family:inherit;transition:all .12s;z-index:2}.sv-detail-close:hover{color:var(--text);background:rgba(255,255,255,.1)}
.sv-pagination{display:flex;gap:4px;justify-content:center;margin-top:16px;flex-wrap:wrap}.sv-page{padding:5px 10px;border-radius:6px;font-size:12px;background:var(--card);border:1px solid var(--border);color:var(--text);text-decoration:none;transition:all .12s}.sv-page.active{background:var(--accent);border-color:var(--accent);color:#fff}.sv-page:hover:not(.active){border-color:rgba(99,102,241,.3)}
@media(max-width:900px){.sv-detail-top{flex-direction:column;align-items:center;text-align:center}}
@media(max-width:640px){.sv-kpis{gap:4px}.sv-kpi{min-width:0;padding:8px 10px}.sv-kpi-val{font-size:16px}.sv-card{flex:0 0 120px}.sv-card-poster{width:120px;height:175px}.sv-lib-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px;padding:10px}.sv-tbl .col-hide-sm{display:none}}

/* ━━ CATEGORIES PAGE (moved from categories.php <style>) ━━━━━━━━━━━━━━━━━━━ */
.co-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;gap:8px}
.co-header-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;max-width:100%}
.co-header-left select{width:auto;padding:7px 28px 7px 10px;font-size:12px}
.co-tabs{display:flex;gap:2px;background:rgba(255,255,255,.03);border:1px solid var(--border);border-radius:9px;padding:3px}
.co-tab{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;font-size:12px;font-weight:500;color:var(--muted);text-decoration:none;border-radius:7px;transition:all .15s;white-space:nowrap}
.co-tab:hover{color:var(--text);background:rgba(255,255,255,.04)}
.co-tab.active{color:#fff;background:var(--accent);box-shadow:0 1px 4px rgba(99,102,241,.25)}
.co-card{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden}
.co-toolbar{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.co-toolbar input[type=text]{flex:1;min-width:120px;max-width:240px;padding:7px 10px;font-size:12px}
.co-filter{display:flex;gap:2px;background:rgba(255,255,255,.03);border-radius:6px;padding:2px}
.co-filter-btn{padding:4px 10px;font-size:11px;font-weight:500;border:none;background:none;color:var(--muted);border-radius:5px;cursor:pointer;font-family:inherit;transition:all .12s}
.co-filter-btn:hover{color:var(--text)}
.co-filter-btn.active{background:rgba(255,255,255,.08);color:var(--text)}
.co-bulk{display:none;align-items:center;gap:6px;padding:8px 16px;background:rgba(99,102,241,.05);border-bottom:1px solid rgba(99,102,241,.12);flex-wrap:wrap}
.co-bulk.visible{display:flex}
.co-bulk-count{background:var(--accent);color:#fff;font-size:11px;font-weight:700;padding:1px 8px;border-radius:10px}
.co-bulk-sep{width:1px;height:18px;background:rgba(255,255,255,.06);margin:0 2px}
.co-src{font-size:10px;padding:1px 6px;border-radius:3px;flex-shrink:0;font-weight:500;letter-spacing:.02em}
.co-src-iptv{background:#374151;color:#9ca3af}
.co-src-tmdb{background:#1e3a5f;color:#60a5fa}
.co-src-media_server{background:#1a3a1a;color:#4ade80}
.co-list{list-style:none;margin:0;padding:8px 12px}
.co-item{display:flex;align-items:center;gap:10px;padding:9px 10px;background:var(--card);border:1px solid var(--border);border-radius:6px;margin-bottom:5px;cursor:default;user-select:none;transition:all .12s}
.co-item:hover{background:rgba(255,255,255,.025);border-color:rgba(255,255,255,.1)}
.co-item.hidden-cat{opacity:.4}
.co-item.hidden-cat .co-name{text-decoration:line-through;text-decoration-color:rgba(255,255,255,.15)}
.co-item.selected{background:rgba(99,102,241,.08);border-color:rgba(99,102,241,.2)}
.co-item.sortable-ghost{opacity:.15;background:rgba(99,102,241,.08)}
.co-item.sortable-chosen{background:var(--card);border-color:var(--accent);box-shadow:0 8px 24px rgba(0,0,0,.4);z-index:10}
.co-item.sortable-drag{opacity:0}
.co-drag{color:var(--muted);cursor:grab;flex-shrink:0;opacity:.5;transition:opacity .12s;width:20px;display:flex;align-items:center;justify-content:center;padding:4px 0}
.co-item:hover .co-drag{opacity:.8}
.co-drag:active{cursor:grabbing}
.co-arrows{display:flex;flex-direction:column;gap:1px;flex-shrink:0}
.co-arrow{width:22px;height:14px;display:flex;align-items:center;justify-content:center;border:none;background:rgba(255,255,255,.04);color:var(--muted);border-radius:3px;cursor:pointer;font-size:10px;font-family:inherit;transition:all .1s;padding:0}
.co-arrow:hover{background:rgba(99,102,241,.15);color:var(--accent)}
.co-check{width:16px;height:16px;cursor:pointer;flex-shrink:0;accent-color:var(--accent);display:none}
.co-name{flex:1;font-size:13px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.co-vis-btn{flex-shrink:0;display:flex;align-items:center;gap:4px;padding:3px 8px;font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:5px;background:rgba(255,255,255,.02);color:var(--muted);cursor:pointer;font-family:inherit;transition:all .12s}
.co-vis-btn:hover{border-color:rgba(255,255,255,.15);color:var(--text)}
.co-vis-btn.is-hidden{color:#fca5a5;border-color:rgba(239,68,68,.15);background:rgba(239,68,68,.03)}
.select-active .co-check{display:inline-block}
.select-active .co-drag{display:none}
.select-active .co-arrows{display:none}
.select-active .co-item{cursor:pointer}
.co-save{padding:12px 16px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.co-save-hint{font-size:11px;color:var(--muted)}
.co-empty{padding:24px;text-align:center;font-size:13px;color:var(--muted);display:none}
.co-prefix-input{width:60px;padding:2px 6px;font-size:11px;border:1px solid var(--border,#333);border-radius:4px;background:var(--bg-input,#1a1a2e);color:var(--text,#e0e0e0);text-align:center;flex-shrink:0;margin:0 4px}
/* Reseller Content page: category rename field + drag ghost */
.co-rename-input{flex:0 1 180px;min-width:110px;padding:5px 8px;font-size:12px;border:1px solid var(--border);border-radius:6px;background:var(--card2);color:var(--text);margin:0 4px}
.co-rename-input::placeholder{color:var(--muted);font-size:11px}
.co-ghost{opacity:.4}

/* Series detail — expandable seasons + episode list */
.ep-total{font-size:11px;color:var(--muted);font-weight:400}
.ep-loading{font-size:12px;color:var(--muted);padding:8px 0}
.ep-seasons{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.ep-season{border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--card2)}
.ep-season-hdr{width:100%;box-sizing:border-box;display:flex;align-items:center;gap:8px;padding:9px 11px;background:transparent;border:0;color:var(--text);font-size:13px;font-weight:600;cursor:pointer;text-align:left;transition:background .12s}
.ep-season-hdr:hover{background:var(--border)}
@media(pointer:coarse){.ep-season-hdr{min-height:40px}}
.ep-chevron{flex-shrink:0;transition:transform .15s;color:var(--muted)}
.ep-season-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ep-season-cnt{font-size:11px;color:var(--muted);font-weight:500;flex-shrink:0}
.ep-list{display:flex;flex-direction:column;border-top:1px solid var(--border);max-height:320px;overflow-y:auto}
.ep-row{display:flex;gap:10px;padding:7px 12px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.03)}
.ep-row:last-child{border-bottom:0}
.ep-num{flex-shrink:0;color:var(--accent);font-weight:600;font-variant-numeric:tabular-nums;min-width:26px}
.ep-title{color:var(--text);min-width:0}
.co-prefix-input::placeholder{color:var(--text-muted,#666);font-size:10px}

/* ── Dynamic category controls ── */
.co-filter-dynamic{color:var(--orange)!important;display:inline-flex;align-items:center;gap:4px}
.co-filter-dynamic.active{background:rgba(245,158,11,.1)!important;color:var(--orange)!important}
.co-item.is-dynamic{border-left:2px solid var(--orange)}
.co-sync-btn{flex-shrink:0;display:inline-flex;align-items:center;gap:4px;padding:3px 7px;font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:5px;background:rgba(255,255,255,.02);color:var(--muted);cursor:pointer;font-family:inherit;transition:all .12s}
.co-sync-btn:hover{border-color:rgba(245,158,11,.3);color:var(--orange)}
.co-sync-btn.is-dynamic{border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.07);color:var(--orange)}
.co-sync-label{line-height:1}
.co-sync-muted{opacity:.5}
.co-now-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:1px solid var(--border);border-radius:5px;background:rgba(255,255,255,.02);color:var(--muted);cursor:pointer;transition:all .12s}
.co-now-btn:hover{border-color:rgba(6,182,212,.35);color:var(--cyan);background:rgba(6,182,212,.06)}
.co-now-btn:disabled{opacity:.4;cursor:wait}
.co-bulk-dynamic{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;font-size:11px;font-weight:500;border:1px solid rgba(245,158,11,.3);border-radius:5px;background:rgba(245,158,11,.07);color:var(--orange);cursor:pointer;font-family:inherit;transition:all .12s}
.co-bulk-dynamic:hover{background:rgba(245,158,11,.12)}
.co-bulk-daily{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:5px;background:rgba(255,255,255,.02);color:var(--muted);cursor:pointer;font-family:inherit;transition:all .12s}
.co-bulk-daily:hover{color:var(--text);border-color:rgba(255,255,255,.15)}
@keyframes co-spin{to{transform:rotate(360deg)}}
/* Categories page on touch screens and phones */
.co-hint-touch,.co-legend,.co-sync-last{display:none}
.co-legend{padding:8px 16px;font-size:11px;line-height:1.45;color:var(--muted);border-bottom:1px solid var(--border)}
.co-legend b{color:var(--orange);font-weight:600}
.co-sync-last{align-items:center;font-size:11px;color:var(--muted);white-space:nowrap}
@media(pointer:coarse){.co-header-left select,.co-tab{min-height:36px}.co-hint-ptr{display:none}.co-hint-touch{display:inline}.co-legend{display:block}.co-sync-last{display:inline-flex}.co-item{flex-wrap:wrap;row-gap:8px}.co-name{flex:1 1 180px}.co-vis-btn,.co-now-btn{margin-left:auto}.co-now-btn + .co-vis-btn{margin-left:0}.co-toolbar input[type=text]{min-height:36px}.co-filter-btn{min-height:36px;padding:7px 12px}.co-arrows{flex-direction:row;gap:6px}.co-arrow{width:36px;height:36px;font-size:12px}.co-drag{width:28px;min-height:36px}.co-prefix-input{height:36px}.co-sync-btn,.co-vis-btn,.co-bulk-dynamic,.co-bulk-daily{min-height:36px;padding-left:10px;padding-right:10px}.co-now-btn{width:36px;height:36px}.co-check{width:20px;height:20px}}
/* <=1100px: Save Order stays at the bottom of the screen and the Select-mode bar under
   the top bar, so they are in reach after scrolling down a long list. */
@media(max-width:1100px){.co-card{overflow:visible;overflow:clip}.co-save{position:sticky;bottom:0;z-index:5;background:var(--card);border-radius:0 0 12px 12px;box-shadow:0 -8px 16px rgba(0,0,0,.25)}.co-bulk.visible{position:sticky;top:60px;z-index:6;background:linear-gradient(rgba(99,102,241,.05),rgba(99,102,241,.05)) var(--card)}}
@media(max-width:1100px){.co-item{scroll-margin-top:72px;scroll-margin-bottom:72px}}
@media(max-width:900px){.co-src,.cat-bulk-btn,.cat-bulk-hide,.cat-bulk-show{font-size:11px}}
/* Phones: the name gets line 1 next to the move controls; the per-row settings wrap to line 2 */
@media(max-width:640px){.co-header{flex-direction:column;align-items:stretch}.co-header-left select{width:100%}.co-tabs{align-self:stretch}.co-tab{flex:1;justify-content:center}
  .co-toolbar{padding:10px}.co-toolbar input[type=text]{flex:1 1 160px;max-width:none}.co-toolbar .cat-select-btn{order:1}.co-filter{order:2;flex:1 1 100%;flex-wrap:wrap}.co-filter-btn{padding-left:8px;padding-right:8px}.co-prefix-input::placeholder{font-size:12px}
  .co-list{padding:8px}.co-item{flex-wrap:wrap;column-gap:8px;row-gap:0;padding:8px 10px}.co-item::after{content:'';order:1;flex-basis:100%;height:0}
  .co-item > .co-prefix-input,.co-item > .co-src,.co-item > .co-sync-btn,.co-item > .co-sync-last,.co-item > .co-now-btn,.co-item > .co-vis-btn{order:2;margin-top:8px}
  .co-name{flex:1 1 0%;white-space:normal;overflow-wrap:anywhere;line-height:1.35}.co-prefix-input{margin:8px 0 0;width:84px}.co-vis-btn,.co-now-btn{margin-left:auto}.co-now-btn + .co-vis-btn{margin-left:0}
  .co-bulk{display:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:8px 10px}.co-bulk.visible{display:grid}.co-bulk-sep,.co-bulk-x{display:none}
  .co-bulk-label{grid-column:span 2;order:0}.co-bulk-all{order:1}.co-bulk-move{order:2}.co-bulk-set{order:3}
  .co-bulk .btn-sm,.co-bulk-dynamic,.co-bulk-daily{width:100%;min-width:0;justify-content:center;padding:6px 4px;font-size:12px}
  .co-save{padding:10px 12px;gap:10px}.co-save-hint{font-size:11px;line-height:1.35}}
/* Short landscape screens: the Select-mode bar stays sticky as one compact row (short labels) */
@media(max-width:1100px) and (max-height:500px){.co-bulk.visible{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;gap:5px;padding:6px 10px}.co-bulk-sep,.co-bulk-x{display:none}.co-bulk > *{order:0;flex-shrink:0}.co-bulk .btn-sm,.co-bulk-dynamic,.co-bulk-daily{width:auto;min-width:36px;justify-content:center;padding:6px 7px;font-size:11px}.co-save{padding:8px 12px}}
@media(max-width:380px){.co-bulk.visible{top:52px}}

/* ━━ LIBRARY PAGE (moved from library.php <style>) ━━━━━━━━━━━━━━━━━━━━━━━━━ */
.ch-row{display:flex;align-items:center;gap:14px;padding:10px 14px;border-bottom:1px solid var(--border);transition:background .15s;position:relative}
.ch-row:last-child{border-bottom:none}
.ch-row:hover{background:rgba(255,255,255,0.02)}
.ch-logo{width:44px;height:44px;object-fit:contain;background:var(--bg2);border-radius:8px;flex-shrink:0;border:1px solid var(--border);padding:3px}
.ch-logo-placeholder{width:44px;height:44px;background:var(--bg2);border-radius:8px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--muted);border:1px solid var(--border)}
.ch-info{flex:1;min-width:0}
.ch-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ch-cat{font-size:11px;color:var(--muted);margin-top:1px}
.ch-badges{display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.overflow-trigger{width:30px;height:30px;padding:0;border-radius:6px;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;color:var(--muted);cursor:pointer;transition:all .15s;flex-shrink:0;font-size:16px;line-height:1}
.overflow-trigger svg{flex-shrink:0}
.overflow-trigger:hover{background:rgba(255,255,255,0.06);border-color:var(--border);color:var(--text)}
.overflow-trigger.active{background:rgba(99,102,241,0.1);border-color:rgba(99,102,241,0.3);color:var(--accent)}
.overflow-menu{position:fixed;z-index:9999;background:var(--card2);border:1px solid var(--border);border-radius:10px;padding:4px;min-width:170px;box-shadow:0 8px 30px rgba(0,0,0,0.4);display:none}
.overflow-menu.show{display:block}
.overflow-menu-item{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;font-size:12px;font-weight:500;color:var(--text);cursor:pointer;transition:background .12s;border:none;background:none;width:100%;text-align:left;font-family:inherit}
.overflow-menu-item:hover{background:rgba(255,255,255,0.06)}
.overflow-menu-item svg{flex-shrink:0;opacity:0.5}
.overflow-menu-sep{height:1px;background:var(--border);margin:4px 8px}
.logo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:8px;margin-top:12px}
.logo-item{background:var(--bg2);border-radius:8px;padding:6px;text-align:center;cursor:pointer;border:2px solid transparent;transition:border-color .15s,box-shadow .15s}
.logo-item:hover{border-color:var(--accent);box-shadow:0 0 0 1px rgba(99,102,241,0.15)}
.logo-item img{max-width:64px;max-height:40px;object-fit:contain}
.logo-item .logo-name{font-size:10px;color:var(--muted);margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inline-panel{background:var(--bg2);border:1px solid var(--border);border-radius:10px;padding:18px;margin:4px 0 10px}
.inline-panel .form-row{margin-bottom:10px}
.epg-badge-auto{background:rgba(99,102,241,0.1);color:#a5b4fc;border:1px solid rgba(99,102,241,0.15)}
.epg-badge-manual{background:rgba(139,92,246,0.1);color:#c4b5fd;border:1px solid rgba(139,92,246,0.15)}
.epg-badge-none{background:rgba(239,68,68,0.08);color:#fca5a5;border:1px solid rgba(239,68,68,0.15)}
.filter-pills{display:flex;gap:6px;flex-wrap:wrap}
.filter-pill{padding:5px 14px;border-radius:999px;font-size:12px;font-weight:500;text-decoration:none;background:rgba(255,255,255,0.04);color:var(--muted);border:1px solid var(--border);transition:all .15s}
.filter-pill:hover{color:var(--text);border-color:rgba(255,255,255,0.12);background:rgba(255,255,255,0.06)}
.filter-pill.active{background:rgba(99,102,241,0.12);color:var(--accent);border-color:rgba(99,102,241,0.3)}
.lib-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:space-between}
.lib-toolbar-left{display:flex;align-items:center;gap:10px;flex:1;min-width:200px}
.lib-toolbar-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
/* Channel ⋮ menu: placed by ssPop (bottom sheet on phones); the backdrop takes outside taps */
.ch-row .overflow-menu-item{justify-content:flex-start;border-radius:6px}
.overflow-menu-title{display:none;padding:8px 12px 10px;margin-bottom:4px;border-bottom:1px solid var(--border);font-size:12px;font-weight:600;color:var(--muted);overflow-wrap:anywhere}
.overflow-menu.ss-sheet .overflow-menu-title{display:block}
.overflow-backdrop{display:none;position:fixed;inset:0;z-index:1200;background:transparent}
.overflow-backdrop.show{display:block}
.lib-panel-tab-strip .btn-secondary.lib-sub-tab-on{background:var(--accent);border-color:var(--accent);color:#fff}
@media (pointer:coarse){
  .overflow-trigger{width:40px;height:40px;border-color:var(--border)}
  .ch-row .overflow-menu-item{min-height:44px;font-size:14px}
  .filter-pill{display:inline-flex;align-items:center;min-height:36px}
  .lib-pagination .page-link{display:inline-flex;align-items:center;justify-content:center;min-width:36px}
  .lib-epg-fields .d-flex{gap:8px}
  .lib-service-select,.lib-input,.lib-input-sm,.lib-input-flex,.lib-search-input{min-height:40px}
  .lib-btn-group > .btn,.lib-btn-group > .btn-secondary,.lib-search-form > .btn,.lib-search-form > .btn-secondary{min-height:40px}
}
@media (max-width:640px),(pointer:coarse){
  .logo-item .logo-name{font-size:11px}
}
/* Phones: the channel name gets the first line (2 lines max, full name in the tooltip),
   the status badges a line of their own under it */
@media (max-width:640px){
  .ch-row{flex-wrap:wrap;gap:6px 12px;padding:10px 6px}
  .ch-info{flex:1 1 0}
  .ch-name{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.35}
  .ch-row > .overflow-trigger{order:2}
  .ch-badges.lib-badges-min{order:3;flex:1 1 100%;min-width:0;padding-left:56px}
  .inline-panel{padding:14px}
  .lib-panel-grid{grid-template-columns:minmax(0,1fr);gap:18px}
  .lib-panel-sub-form,.lib-panel-sub-form-upload{flex-wrap:wrap}
  .lib-panel-sub-form .lib-input-flex,.lib-panel-sub-form-upload .lib-file-input{flex:1 1 100%;min-width:0}
  .lib-panel-sub-form > .btn,.lib-panel-sub-form-upload > .btn{flex:1 1 auto}
  .lib-epg-fields .lib-input-sm{width:100%;min-width:0}
  .logo-item .logo-name{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
}
.help-toggle{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:var(--muted);padding:10px 0;border:none;background:none;font-family:inherit}
.help-toggle:hover{color:var(--text)}
.help-toggle svg{transition:transform .2s}
.help-toggle.open svg{transform:rotate(90deg)}

/* ━━ REFACTORED INLINE-STYLE CLASSES ━━━━━━━━━━━ */
.sidebar-logo-icon-img { object-fit: contain; padding: 4px; background: transparent; }
.tq-widget-wrap { position: relative; padding: 6px 8px; border-top: 1px solid var(--border); }
.ml-auto { margin-left: auto; }
.tq-active-count { color: #f59e0b; font-size: 11px; }
.tq-popup-empty { padding: 16px 14px; color: var(--muted, #64748b); font-size: 12px; text-align: center; }
.tq-item-icon { font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; }
.tq-spinner-sm { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(99,102,241,.3); border-top-color: #6366f1; border-radius: 50%; animation: taskSpin 1s linear infinite; vertical-align: middle; }
.tq-action-btn { background: none; border: 1px solid #374151; color: #cbd5e1; border-radius: 6px; font-size: 11px; font-weight: 600; padding: 0 10px; min-height: 30px; cursor: pointer; flex-shrink: 0; }
.tq-action-btn:hover { border-color: #7f1d1d; color: #f87171; background: rgba(239,68,68,.08); }
.tq-footer-btn { background: none; border: 1px solid var(--border, #374151); color: var(--muted, #64748b); border-radius: 6px; font-size: 11px; padding: 0 10px; min-height: 30px; cursor: pointer; flex: 1; }
.tq-footer-btn-danger { background: none; border: 1px solid #7f1d1d; color: #f87171; border-radius: 6px; font-size: 11px; padding: 0 10px; min-height: 30px; cursor: pointer; flex: 1; }
.btn-xs { font-size: 11px; padding: 4px 8px; }
.vpn-popup-link { display: block; text-align: center; font-size: 11px; color: var(--accent); margin-top: 8px; text-decoration: none; }
.vpn-popup-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 6px 0; }
.header-profile-wrap { position: relative; margin-left: auto; }
.header-profile-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; color: var(--text); font-family: inherit; font-size: 13px; font-weight: 500; transition: border-color .15s; }
.header-profile-btn:hover { border-color: var(--accent); }
.header-profile-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Admin header (bell, plus the search on Clients): a long account name is cut before the page
   title is. Each cap is the room left at that width (+ a desktop scrollbar); full name in the tooltip. */
.main-header-admin .header-profile-btn > span { max-width: calc(100vw - 820px); }
@media (max-width: 1100px) { .main-header-admin .header-profile-btn > span { max-width: calc(100vw - 620px); } }
@media (max-width: 900px) { .main-header-admin .header-profile-btn > span { max-width: calc(100vw - 540px); } }
.header-profile-avatar { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.header-profile-avatar-sa { background: rgba(245,158,11,.8); }
.header-profile-avatar-admin { background: linear-gradient(135deg, var(--accent), var(--cyan)); }
.header-profile-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 9999; overflow: hidden; }
.header-profile-info { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.header-profile-name { font-weight: 600; font-size: 13px; }
.header-profile-handle { font-size: 11px; color: var(--muted); }
.header-profile-role { margin-top: 4px; }
.header-profile-role .badge { font-size: 10px; }
.header-profile-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); text-decoration: none; font-size: 13px; transition: background .1s; }
.header-profile-item:hover { background: var(--card2); }
.header-profile-item-logout { color: var(--red); }
.header-profile-item-logout:hover { background: rgba(239,68,68,.08); }
.header-profile-divider { border-top: 1px solid var(--border); }
/* Sign-in pages: the message sits in the page flow above the card (it used to float
   over the card on phones and short screens). .login-page stacks it in a column. */
.flash-floating { position: relative; z-index: 2; align-self: center; max-width: min(100%, 520px); margin: 0 0 14px; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.login-2fa-wrap { margin-top: -8px; }
.login-2fa-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 14px; background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.15); border-radius: 8px; }
.login-2fa-notice-text { font-size: 12px; color: #a5b4fc; }
.login-totp-input { letter-spacing: 2px; font-size: 16px; }
.login-2fa-cancel { font-size: 11px; color: var(--muted); text-decoration: none; }
/* Login page styles (moved from login.php) */
.login-page { background: #0b0e14; background-image: radial-gradient(ellipse 900px 600px at 15% 25%,rgba(99,102,241,.07),transparent), radial-gradient(ellipse 700px 500px at 85% 75%,rgba(139,92,246,.05),transparent); padding: 20px; flex-direction: column; }
.login-page::before { display: none; }
.login-split { display: flex; width: 100%; max-width: 960px; min-height: 580px; border-radius: 24px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04), 0 0 80px rgba(99,102,241,.06); position: relative; z-index: 1; }
.login-hero { flex: 0 0 46%; background: linear-gradient(160deg,#4338ca 0%,#6d28d9 45%,#7c3aed 100%); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.lh-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lh-s1 { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.045); top: -100px; right: -90px; }
.lh-s2 { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.035); bottom: -60px; left: -50px; }
.lh-s3 { position: absolute; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.04); top: 55%; right: 15%; }
.lh-s4 { position: absolute; width: 140%; height: 1px; background: linear-gradient(90deg,transparent,rgba(255,255,255,.08),transparent); transform: rotate(-32deg); top: 28%; left: -20%; }
.lh-s5 { position: absolute; width: 140%; height: 1px; background: linear-gradient(90deg,transparent,rgba(255,255,255,.06),transparent); transform: rotate(-32deg); top: 58%; left: -20%; }
.lh-s6 { position: absolute; width: 50px; height: 50px; border-radius: 12px; border: 1px solid rgba(255,255,255,.06); transform: rotate(25deg); top: 18%; left: 65%; }
.lh-s7 { position: absolute; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.05); transform: rotate(40deg); bottom: 22%; right: 28%; }
.lh-wave { position: absolute; bottom: 0; left: 0; right: 0; height: 100px; pointer-events: none; }
.lh-wave svg { width: 100%; height: 100%; display: block; }
.login-hero-content { position: relative; z-index: 2; }
.login-hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); margin-bottom: 28px; letter-spacing: .01em; border: 1px solid rgba(255,255,255,.1); }
.login-hero-badge svg { opacity: .8; }
.login-hero-logo { max-width: 240px; height: auto; margin-bottom: 28px; }
.login-hero-content h1 { font-size: 38px; font-weight: 800; color: #fff; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 14px; }
.login-hero-content p { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.6; max-width: 300px; }
.lh-watermark { position: absolute; bottom: 30px; right: 32px; opacity: .06; z-index: 1; pointer-events: none; color: #fff; }
.lh-watermark svg { width: 100px; height: 100px; }
.login-form-panel { flex: 1; background: #161a26; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.lfp-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.lfp-brand-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg,var(--accent),var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; box-shadow: 0 4px 14px rgba(99,102,241,.3); }
.lfp-brand-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; padding: 4px; }
.lfp-brand-text { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.lfp-brand-text small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; letter-spacing: 0; }
.lfp-heading { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.lfp-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-field { margin-bottom: 18px; }
.login-field-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.login-field-wrap { position: relative; }
.login-field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #4a5268; pointer-events: none; transition: color .2s; }
.login-field-wrap input { width: 100%; padding: 13px 14px 13px 42px; font-size: 14px; font-family: inherit; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; transition: all .2s; outline: none; }
.login-field-wrap input::placeholder { color: rgba(122,133,153,.5); }
.login-field-wrap input:hover { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.055); }
.login-field-wrap input:focus { border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.04); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.login-field-wrap:focus-within .login-field-icon { color: var(--accent); }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 24px; margin-top: 2px; }
.login-remember input[type=checkbox] { width: 16px; height: 16px; border-radius: 4px; accent-color: var(--accent); cursor: pointer; }
.login-submit { width: 100%; padding: 13px 20px; font-size: 14px; font-weight: 600; font-family: inherit; color: #fff; background: linear-gradient(135deg,var(--accent),var(--purple)); border: none; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; box-shadow: 0 4px 16px rgba(99,102,241,.25); letter-spacing: .01em; }
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99,102,241,.35); filter: brightness(1.08); }
.login-submit:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(99,102,241,.2); }
.login-captcha { margin-bottom: 18px; max-width: 100%; }
.lfp-footer { margin-top: 28px; text-align: center; font-size: 11px; color: var(--muted); opacity: .35; }
@media(max-width:820px) { .login-split { flex-direction: column; max-width: 480px; min-height: auto; } .login-hero { flex: none; padding: 36px 32px 28px; } .login-hero-content h1 { font-size: 28px; } .lh-s1 { width: 200px; height: 200px; top: -60px; right: -60px; } .lh-s2 { width: 120px; height: 120px; bottom: -30px; left: -30px; } .lh-watermark { display: none; } .login-form-panel { padding: 36px 32px; } }
@media(max-width:480px) { .login-page { padding: 12px; } .login-split { border-radius: 18px; } .login-hero { padding: 28px 24px 20px; } .login-hero-content h1 { font-size: 24px; } .login-hero-content p { font-size: 13px; } .login-form-panel { padding: 28px 24px; } .lfp-heading { font-size: 19px; } }
/* 360px phones: room for the ~304px CAPTCHA widgets (narrower screens get the compact widget, src/captcha.php) */
@media(max-width:380px) { .login-hero { padding: 24px 16px 18px; } .login-form-panel { padding: 24px 16px; } }
@media(max-width:480px) { .login-totp-input { letter-spacing: 1px; } }
/* the placeholder is a phrase, not a code: no extra spacing where the field is narrow */
@media(max-width:480px), (max-height:500px) and (orientation:landscape) { .login-totp-input::placeholder { letter-spacing: 0; } }
@media(max-width:360px) { .login-totp-input::placeholder { font-size: 14px; } }
@media (pointer: coarse) { .login-2fa-cancel { display: inline-block; padding: 10px 12px; } .login-remember { padding: 6px 0; margin-bottom: 18px; } .login-field-wrap input { font-size: 16px; } }
/* Phones held sideways: welcome panel beside the form, not above it (the form started below the screen) */
@media (max-height: 500px) and (orientation: landscape) {
  .login-page { padding: 8px 12px; }
  .login-split { flex-direction: row; max-width: 960px; min-height: 0; border-radius: 18px; }
  .login-hero { flex: 0 0 36%; padding: 20px; }
  .login-hero-logo { max-width: 150px; margin-bottom: 12px; }
  .login-hero-content h1 { font-size: 22px; margin-bottom: 0; }
  .login-hero-content p, .lh-watermark { display: none; }
  .login-form-panel { padding: 18px 24px; }
  .lfp-heading { font-size: 18px; }
  .lfp-sub { margin-bottom: 12px; }
  .login-field { margin-bottom: 10px; }
  .login-field-wrap input { padding-top: 10px; padding-bottom: 10px; }
  .login-remember { margin-bottom: 12px; }
  .login-submit { padding-top: 11px; padding-bottom: 11px; }
  .lfp-footer { margin-top: 12px; }
  /* with an error message above the card: the message is compact and the subtitle makes room */
  .flash-floating { padding: 7px 12px; margin-bottom: 8px; font-size: 12px; }
  .flash-floating ~ .login-split .lfp-sub { display: none; }
  .flash-floating ~ .login-split .lfp-heading { margin-bottom: 12px; }
}
/* Very short screens (320px tall): no subtitle, and the field labels are left to the icons and placeholders */
@media (max-height: 340px) and (orientation: landscape) {
  .lfp-sub { display: none; }
  .lfp-heading { margin-bottom: 12px; }
  .login-field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
/* Task queue styles (moved from _layout_bottom.php) */
@keyframes taskSlideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes taskSpin { to { transform: rotate(360deg); } }
/* below modals (1000), the drawer (1050/1100) and side panels (1200+): a running task's toast must never cover their buttons */
#tq-toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 990; display: flex; flex-direction: column; gap: 8px; max-width: 340px; pointer-events: none; }
.tq-toast { background: #1e2533; border: 1px solid #374151; border-radius: 10px; padding: 10px 12px; color: #e5e7eb; font-size: 13px; display: flex; align-items: flex-start; gap: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: auto; animation: taskSlideIn .25s ease; }
.tq-spinner { width: 15px; height: 15px; border: 2px solid rgba(99,102,241,.3); border-top-color: #6366f1; border-radius: 50%; animation: taskSpin 1s linear infinite; flex-shrink: 0; margin-top: 2px; }
.tq-close { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 17px; padding: 0; line-height: 1; flex-shrink: 0; align-self: center; margin-left: 4px; min-width: 28px; min-height: 28px; }
.tq-close:hover { color: #e5e7eb; }
.tq-sidebar-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; background: none; border: none; color: var(--sidebar-text,#94a3b8); cursor: pointer; font-size: 13px; font-weight: 500; text-align: left; border-radius: 8px; transition: background .15s; }
.tq-sidebar-btn:hover { background: var(--sidebar-hover,rgba(255,255,255,.06)); }
.tq-sidebar-btn.tq-active { color: #f59e0b; }
.tq-badge { background: #f59e0b; color: #000; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.tq-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }
.tq-dot-on { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.tq-dot-off { background: #374151; }
/* Popup: header + footer fixed, the list scrolls; never taller than the screen (landscape phones) */
.tq-popup { position: absolute; bottom: calc(100% + 8px); left: 12px; right: 12px; background: var(--card,#1e2533); border: 1px solid var(--border,#374151); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 10000; overflow: hidden; display: flex; flex-direction: column; max-height: min(440px, calc(100vh - 130px)); max-height: min(440px, calc(100dvh - 130px)); }
.tq-popup-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tq-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border,#374151); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted,#64748b); flex-shrink: 0; }
.tq-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid rgba(55,65,81,.5); font-size: 12px; }
.tq-item:last-child { border-bottom: none; }
.tq-item-info { flex: 1; min-width: 0; }
.tq-item-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #818cf8; margin-bottom: 1px; }
.tq-item-label { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.tq-item-meta { font-size: 11px; color: var(--muted,#64748b); overflow-wrap: anywhere; }
.tq-item-status-run { color: #818cf8; }
.tq-item-status-ok { color: #4ade80; }
.tq-item-status-fail { color: #f87171; }
.tq-item-status-pend { color: #94a3b8; }
.tq-popup-footer { padding: 8px 14px; border-top: 1px solid var(--border,#374151); display: flex; gap: 8px; flex-shrink: 0; }
.tq-toast-body { flex: 1; min-width: 0; }
.tq-toast-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
/* long labels: two lines, then … (full text in the title tooltip) */
.tq-toast-label, .tq-toast-done-title { font-weight: 600; line-height: 1.35; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.tq-toast-meta { font-size: 11px; color: #6b7280; margin-top: 1px; }
.tq-toast-done-icon { font-size: 18px; flex-shrink: 0; margin-top: -1px; }
.tq-toast-done-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.tq-toast-error { font-size: 11px; color: #9ca3af; margin-top: 2px; white-space: normal; }
/* Touch: comfortable targets in the queue popup, the sidebar buttons and the toasts */
@media (pointer: coarse) {
  .tq-sidebar-btn { min-height: 40px; }
  .tq-action-btn, .tq-footer-btn, .tq-footer-btn-danger { min-height: 36px; }
  #tq-toast-container .tq-close { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; margin: -6px -6px -6px 0; }
}
/* ━━ PAGE-SPECIFIC CSS CLASSES ━━━━━━━━━━━━━━━━━━
   Extracted from inline styles in PHP templates.
   Imported by style.css or _layout_top.php.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── SYNC (.sy-) ───────────────────────────────── */
.sy-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.sy-kpi {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}
.sy-kpi.blue   { border-left: 3px solid var(--accent); }
.sy-kpi.green  { border-left: 3px solid var(--green); }
.sy-kpi.cyan   { border-left: 3px solid var(--cyan); }
.sy-kpi.orange { border-left: 3px solid var(--orange); }
.sy-kpi.red    { border-left: 3px solid var(--red); }
.sy-kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.4px; margin-bottom: 4px; }
.sy-kpi-val   { font-size: 22px; font-weight: 700; line-height: 1.2; }
.sy-kpi-sub   { font-size: 10px; color: var(--muted); margin-top: 2px; }
.sy-kpi-val-sm{font-size:14px}
.sy-twin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .sy-twin { grid-template-columns: 1fr; }
}
.sy-body { display: flex; flex-direction: column; flex: 1; }
.sy-spacer { flex: 1; }
.sy-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:14px;border-top:1px solid var(--border);margin-top:auto}
.sy-cron-details{flex:1}
.sy-cron-pre{margin-top:6px;font-size:10px;overflow-x:auto;color:var(--muted)}
.sy-alert{margin-bottom:10px;font-size:12px}
.sy-run-btns{display:flex;flex-direction:column;gap:8px}
.sy-run-btn{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px}
.sy-run-spinner{width:14px;height:14px;border-color:rgba(255,255,255,.3);border-top-color:#fff}
.sy-run-spinner-accent{width:14px;height:14px;border-color:rgba(255,255,255,.3);border-top-color:var(--accent)}
.sy-hint{font-size:11px;color:var(--muted);margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.sy-hint a{color:var(--accent)}
.sync-flow-hint{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 16px;margin-bottom:16px;border-radius:10px;background:rgba(99,102,241,.06);border:1px solid rgba(99,102,241,.12);font-size:12px}
.sync-flow-label{font-weight:600;color:var(--muted);margin-right:4px}
.sync-flow-step{padding:4px 10px;border-radius:6px;background:rgba(99,102,241,.1);color:var(--accent);font-weight:500;white-space:nowrap}
.sync-flow-step-active{background:rgba(99,102,241,.2);color:#a78bfa;font-weight:600;box-shadow:0 0 0 1px rgba(99,102,241,.3)}
.sync-flow-step-dim{opacity:.5}
.sync-flow-arrow{color:var(--muted);font-size:14px;opacity:.5}
.sy-svc-name{font-size:13px}
.sy-td-muted{font-size:11px;color:var(--muted);white-space:nowrap}
.sy-dash{opacity:.4}
.sy-status-dash{color:var(--muted);opacity:.4}
.sy-clear-form{display:inline}
.sy-clear-btn{font-size:10px;padding:3px 8px}
/* Service Health stays a table from 641px: the Clear Cache column is pinned
   (table-sticky-actions); its opaque cell keeps the row's zebra/hover tint */
@media (min-width:641px){
  table.sy-health-table>tbody>tr:nth-child(even)>td:last-child{background:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01)) var(--card)}
  table.sy-health-table>tbody>tr:hover>td:last-child{background:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04)) var(--card)}
}
@media (max-width:900px),(pointer:coarse){
  .sy-kpi-label,.sy-kpi-sub,.sy-cron-pre{font-size:11px}
}
@media (pointer:coarse),(max-width:640px){
  .sy-clear-btn{min-height:36px;font-size:12px;padding:6px 12px}
  .sy-run-btn{min-height:40px}
  .sy-summary{padding:10px 0}
  .sy-hint a,.sy-dyn-hint a{display:inline-block;padding:8px 3px;margin:-8px -3px}
}
@media (max-width:640px){
  /* KPI strip: 3 per row (2 when there are only 4 cards) */
  .sy-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .sy-kpis:has(>:nth-child(5)){grid-template-columns:repeat(3,minmax(0,1fr))}
  .sy-kpi{padding:12px 8px}
  .sy-kpi-val{font-size:20px}
  .sy-kpi-val-sm{font-size:14px}
  /* the two time pickers stay side by side */
  .form-row.sy-time-row{flex-wrap:nowrap}
  .form-row.sy-time-row>*{min-width:0;width:auto;flex:1 1 0}
  .sy-time-row input[type="time"]{width:100%}
  /* Service Health: compact cards, Clear Cache full width at the bottom */
  table.sy-health-table.table-cards>tbody>tr{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1.3fr) minmax(0,1fr);column-gap:8px;row-gap:6px}
  table.sy-health-table.table-cards>tbody>tr>td.sy-td-muted{white-space:nowrap}
  table.sy-health-table.table-cards>tbody>tr>td{flex-direction:column;align-items:flex-start;justify-content:space-between;gap:3px;min-height:0;padding:2px 0;text-align:left}
  table.sy-health-table.table-cards>tbody>tr>td::before{max-width:none;line-height:1.25}
  table.sy-health-table.table-cards>tbody>tr>td.td-primary{grid-column:1/-1;padding:2px 64px 8px 0;margin-bottom:2px}
  table.sy-health-table.table-cards>tbody>tr:has(>td.sy-td-status>.badge-warning)>td.td-primary{padding-right:148px}
  table.sy-health-table.table-cards>tbody>tr>td.sy-td-status{position:absolute;top:9px;right:12px;width:auto;padding:0}
  table.sy-health-table.table-cards>tbody>tr>td.sy-td-status::before{content:none}
  table.sy-health-table.table-cards.table-sticky-actions>tbody>tr>td.td-full{position:static;grid-column:1/-1;margin-top:4px;padding-top:10px;border-top:1px solid var(--border)}
  .sy-health-table .sy-clear-form{display:block;width:100%}
  .sy-health-table .sy-clear-btn{width:100%;min-height:40px;font-size:13px}
}

/* ── LOGS (.log-) ──────────────────────────────── */
.log-retention-bar{display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.log-retention-form{display:flex;align-items:center;gap:8px}
.log-retention-label{font-size:12px;color:var(--muted);margin:0;text-transform:none;letter-spacing:0;font-weight:500;white-space:nowrap}
.log-retention-input{width:80px;padding:6px 8px;font-size:12px}
.log-retention-suffix{font-size:12px;color:var(--muted)}
.log-clear-all-wrap{margin-left:auto;display:flex;gap:6px}
.log-tabs{display:flex;gap:4px;margin-bottom:16px;align-items:center;flex-wrap:wrap}
.log-tab-badge{font-size:10px;padding:1px 6px;margin-left:4px}
@media (max-width:900px),(pointer:coarse){.log-tab-badge{font-size:11px}}
.log-per-page-wrap{margin-left:auto;display:flex;align-items:center;gap:6px}
.log-per-page-label{font-size:12px;color:var(--muted);margin:0;text-transform:none;letter-spacing:0;font-weight:500}
.log-per-page-select{width:auto;min-width:0;padding:5px 24px 5px 8px;font-size:12px}
.log-header-actions{display:flex;gap:8px;align-items:center}
.log-loading{padding:20px;text-align:center;color:var(--muted)}
.log-empty{color:var(--muted);font-size:13px;padding:8px 0}
.log-td-timestamp{font-size:12px;color:var(--muted);white-space:nowrap}
.log-td-detail{font-size:12px;color:var(--muted);max-width:300px;overflow:hidden;text-overflow:ellipsis}
.log-td-ip{font-size:12px;color:var(--muted)}
.log-td-sync-msg{font-size:12px;color:var(--muted);max-width:300px;overflow:hidden;text-overflow:ellipsis}
.log-td-ua{font-size:11px;color:var(--muted);max-width:200px;overflow:hidden;text-overflow:ellipsis}
.log-td-client{min-width:8.5em;max-width:220px;overflow-wrap:anywhere}
.log-page-info{font-size:12px;color:var(--muted);margin-left:8px}
@media (pointer:coarse){
  .log-pagination .page-link{min-width:40px;min-height:40px;justify-content:center}
  .log-per-page-select,.log-retention-input{min-height:36px}
}
/* Phones and tablets (≤900px): each log row is a compact card — badges and time on
   top, the message across the full width, then small labelled details (Admin, IP, …) */
@media (max-width:640px){
  .log-retention-bar{gap:10px}
  .log-clear-all-wrap{margin-left:0}
  .log-tabs{gap:6px}
  .log-tabs>button{flex:1 1 auto;justify-content:center}
  .log-per-page-wrap{margin-left:auto}
  .log-pagination .page-link{min-width:40px;min-height:40px;justify-content:center}
  .log-page-info{flex-basis:100%;margin:4px 0 0}
}
@media (min-width:641px) and (max-width:900px){
  table.log-table.table-cards,table.log-table.table-cards>tbody{display:block;width:100%}
  table.log-table.table-cards>thead{display:none}
  table.log-table.table-cards>tbody>tr{position:relative;background:var(--card2);border:1px solid var(--border);border-radius:12px;margin-bottom:10px}
  .table-wrap:has(>table.log-table){overflow-x:visible;background:none}
}
@media (max-width:900px){
  table.log-table.table-cards>tbody>tr{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:10px 12px}
  table.log-table.table-cards>tbody>tr:hover{background:var(--card2)}
  table.log-table.table-cards>tbody>tr>td{display:block;width:auto;min-width:0;min-height:0;padding:0;border:0;text-align:left;font-size:12px;max-width:none;white-space:normal;overflow:visible;overflow-wrap:anywhere}
  table.log-table.table-cards>tbody>tr>td::before{content:none}
  table.log-table.table-cards>tbody>tr>td:empty{display:none}
  table.log-table.table-cards>tbody>tr>td.log-c-tag{order:1}
  table.log-table.table-cards>tbody>tr>td.log-c-lead{order:1;flex:1 1 auto;font-size:13px;font-weight:600;color:var(--text)}
  table.log-table.table-cards>tbody>tr>td.log-c-when{order:2;margin-left:auto;font-size:11px}
  table.log-table.table-cards>tbody>tr>td.log-c-title{order:3;flex:1 1 100%;font-size:13px;font-weight:600;color:var(--text)}
  table.log-table.table-cards>tbody>tr>td.log-c-main{order:4;flex:1 1 100%;font-size:13px;line-height:1.45;color:var(--text)}
  table.log-table.table-cards>tbody>tr>td.log-c-meta{order:5;font-size:11px;color:var(--muted)}
  table.log-table.table-cards>tbody>tr>td.log-c-break{order:3;flex-basis:100%}
  table.log-table.table-cards>tbody>tr>td.log-c-meta::before{content:attr(data-label);margin-right:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;opacity:.75}
}

/* ── MEDIA SERVERS (.ms-) ──────────────────────── */
.ms-form-hint{font-size:11px;color:var(--muted);margin-top:3px}
.ms-test-flex{display:flex;gap:8px;align-items:center;margin-bottom:14px}
.ms-test-result{font-size:12px}
.ms-empty{text-align:center;padding:40px 20px}
.ms-empty-icon{font-size:28px;margin-bottom:8px;opacity:.5}
.ms-empty-title{font-size:14px;font-weight:500;margin-bottom:4px}
.ms-empty-subtitle{font-size:12px;color:var(--muted);margin-bottom:14px}
.ms-server-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.ms-server-info{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.ms-server-icon{width:40px;height:40px;border-radius:10px;background:rgba(99,102,241,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ms-server-meta{min-width:0}
.ms-server-name-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ms-server-name{font-size:16px;font-weight:600}
.ms-server-url{font-size:11px;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms-server-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.ms-action-btn{padding:6px 12px;font-size:11px}
.ms-rematch-action-btn{padding:6px 10px;font-size:11px}
.ms-kebab-btn{padding:5px 8px}
.ms-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:var(--card);border:1px solid var(--border);border-radius:8px;min-width:130px;box-shadow:0 8px 24px rgba(0,0,0,.4);z-index:9999;overflow:hidden}
.ms-dropdown-item{display:block;width:100%;padding:8px 14px;font-size:12px;text-align:left;background:none;border:none;color:var(--text);font-family:inherit;cursor:pointer}
.ms-dropdown-item:hover{background:var(--card2)}
.ms-dropdown-delete{color:var(--red)}
.ms-dropdown.ss-pop{right:auto}
.ms-menu-backdrop{position:fixed;inset:0;z-index:1200;background:transparent}
.ms-dropdown-title{display:none;padding:8px 14px 10px;font-size:12px;font-weight:600;color:var(--muted);border-bottom:1px solid var(--border);overflow-wrap:anywhere}
.ms-dropdown.ss-sheet .ms-dropdown-title{display:block}
.ms-lib-4k-opts{margin-top:6px;padding-left:18px;display:flex;flex-direction:column;gap:6px}
.ms-lib-prefix-input{max-width:120px;padding:4px 8px;font-size:11px}
.ms-stats-row{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:14px;padding:10px 14px;background:var(--bg);border-radius:8px;border:1px solid var(--border)}
.ms-stat-label{font-size:10px;color:var(--muted);margin-bottom:1px}
.ms-stat-val{font-size:15px;font-weight:600}
.ms-stat-services{display:flex;gap:4px;flex-wrap:wrap}
.ms-stat-right{margin-left:auto;text-align:right}
.ms-lib-toggle{display:flex;align-items:center;gap:6px;background:none;border:none;cursor:pointer;color:var(--muted);font-size:12px;font-weight:500;padding:0;font-family:inherit;transition:color .15s}
.ms-lib-toggle:hover{color:var(--text)}
.ms-lib-grid{margin-top:10px;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.ms-lib-card{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:10px 12px}
.ms-lib-header{display:flex;align-items:center;justify-content:space-between;gap:6px}
.ms-lib-name{font-size:12px;font-weight:500}
.ms-lib-meta{font-size:10px;color:var(--muted);margin-top:2px}
.ms-lib-config-btn{margin-top:6px;font-size:10px;padding:3px 8px;width:100%}
.ms-lib-config-expand{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}
.ms-lib-form-group{margin-bottom:6px}
.ms-lib-label{font-size:10px;margin-bottom:3px}
.ms-lib-select{width:100%;padding:4px 8px;font-size:11px}
.ms-lib-input{width:100%;padding:4px 8px;font-size:11px}
.ms-lib-check-label{display:flex;align-items:center;gap:5px;font-size:11px;cursor:pointer;margin:0;text-transform:none;letter-spacing:0;font-weight:400;color:var(--text)}
.ms-lib-checkbox{width:13px;height:13px}
.ms-lib-save-btn{font-size:10px;padding:4px 10px;width:100%}
.ms-wf-bar{display:flex;align-items:center;justify-content:center;padding:16px 24px;background:var(--card);border:1px solid var(--border);border-radius:12px;margin-top:4px}
.ms-wf-step{display:flex;align-items:center;gap:10px}
.ms-wf-num{width:32px;height:32px;border-radius:50%;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ms-wf-label{font-size:12px;font-weight:600;color:var(--text);line-height:1.2}
.ms-wf-hint{font-size:10px;color:var(--muted);margin-top:1px}
.ms-wf-line{flex:1;min-width:20px;max-width:60px;height:1px;background:var(--border);margin:0 10px}
@media(max-width:700px){.ms-wf-bar{flex-direction:column;align-items:flex-start;gap:2px}.ms-wf-line{width:1px;min-width:1px;max-width:1px;height:14px;margin:0 0 0 15px}}
.ms-chevron{transition:transform .15s}
.ms-modal-box{max-width:560px}
.ms-add-btn{padding:6px 14px;font-size:12px}
.ms-delete-form{margin:0}
.ms-dropdown-delete{color:var(--red);border-top:1px solid var(--border)}
.ms-dropdown-delete:hover{background:rgba(239,68,68,.06)}
.ms-stat-none{font-size:12px;color:var(--muted)}
.ms-stat-overflow{font-size:10px;color:var(--muted)}
.ms-stat-sync-date{font-size:12px}
.ms-lib-disabled{opacity:.5}
.ms-lib-form-mb8{margin-bottom:8px}
.ms-badge-svc{font-size:9px;white-space:normal;max-width:100%;overflow-wrap:anywhere}
.ms-badge-mode{font-size:9px}
@media (pointer:coarse){
  .ms-server-url{white-space:normal;overflow-wrap:anywhere}
  .ms-modal-box .modal-close{width:40px;height:40px}
  .ms-server-actions .ms-kebab-btn{min-width:40px;min-height:40px;justify-content:center}
  .ms-lib-toggle{min-height:40px;padding:0 4px 0 0}
  .ms-dropdown{min-width:160px}
  .ms-dropdown-item{min-height:44px;font-size:14px;padding:10px 16px}
  .ms-delete-form{margin-top:8px}
  .ms-lib-select,.ms-lib-input{min-height:36px}
  .ms-lib-check-label{min-height:36px;gap:8px}
  .ms-lib-checkbox{width:18px;height:18px}
}
/* Phones: the actions get their own row under the server name instead of squeezing it */
@media (max-width:640px){
  .ms-server-header{flex-wrap:wrap;gap:10px}
  .ms-server-info{flex:1 1 100%}
  .ms-server-name{font-size:15px;overflow-wrap:anywhere}
  .ms-server-url{white-space:normal;overflow-wrap:anywhere}
  .ms-server-actions{flex:1 1 100%;flex-wrap:wrap}
  .ms-server-actions > .ms-action-btn,.ms-server-actions > .ms-rematch-action-btn{flex:1 1 auto;justify-content:center}
  .ms-stats-row{gap:10px 16px}
}
@media (max-width:640px),(pointer:coarse){
  .ms-stat-label,.ms-stat-overflow,.ms-badge-svc,.ms-badge-mode,.ms-lib-meta,.ms-lib-label,.ms-lib-config-btn,.ms-lib-save-btn,.ms-wf-hint{font-size:11px}
}

/* ── SUPERADMIN PAGE ───────────────────────── */

/* Page title */
.sa-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sa-subtitle { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Tab badge (count pill inside tab buttons) */
.sa-tab-badge { font-size: 9px; padding: 1px 6px; margin-left: 4px; }

/* Admin avatar circle */
.sa-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.sa-avatar-super { background: rgba(245,158,11,.12); color: #f59e0b; }
.sa-avatar-admin { background: rgba(99,102,241,.1); color: var(--accent); }

/* Admin name / meta cells */
.sa-admin-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.sa-admin-you { font-size: 10px; color: var(--accent); font-weight: 400; margin-left: 4px; }
.sa-admin-handle { font-size: 11px; color: var(--muted); }
.sa-admin-access { font-size: 12px; color: var(--muted); }
.sa-admin-date { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 2FA status labels */
.sa-2fa-forced { font-size: 9px; color: var(--orange); margin-left: 2px; }
.sa-2fa-off { font-size: 11px; color: var(--muted); opacity: .5; }

/* Context menu (actions dropdown) */
.sa-ctx-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 9999; overflow: hidden;
}
.sa-ctx-btn {
  display: block; width: 100%; padding: 9px 14px; font-size: 13px;
  color: var(--text); text-align: left; background: none;
  border: none; cursor: pointer; transition: background .1s;
}
.sa-ctx-btn:hover { background: var(--card2); }
.sa-ctx-btn-sm {
  display: block; width: 100%; padding: 8px 14px; font-size: 12px;
  text-align: left; background: none; border: none;
  cursor: pointer; transition: background .1s;
}
.sa-ctx-btn-sm:hover { background: var(--card2); }
.sa-ctx-btn-sm.text-orange:hover { background: rgba(245,158,11,.06); }
.sa-ctx-delete {
  display: block; width: 100%; padding: 9px 14px; font-size: 13px;
  color: var(--red); text-align: left; background: none;
  border: none; cursor: pointer; border-top: 1px solid var(--border);
  transition: background .1s;
}
.sa-ctx-delete:hover { background: rgba(239,68,68,.06); }
.sa-ctx-sep { border-top: 1px solid var(--border); padding: 2px 0; }
.sa-ctx-dots { padding: 5px 8px; font-size: 14px; line-height: 1; }
/* Placed by ssPop (fixed to the viewport): drop the in-cell anchoring */
.sa-ctx-menu.ss-pop { right: auto; text-align: left; }
.sa-ctx-head { display: none; }
.sa-ctx-backdrop { display: none; }
/* touch screens: the tap that closes the menu must not also press what is underneath */
@media (pointer: coarse) { .sa-ctx-backdrop { display: block; position: fixed; inset: 0; z-index: 1299; } }
/* While a row's menu is open its (sticky) cell must paint above the rows below it */
table.sa-admin-table > tbody > tr > td.sa-menu-open { z-index: 1301; }
/* The pinned ⋮ cell is opaque: give it the row's zebra/hover tint */
@media (min-width: 641px) {
  table.sa-admin-table > tbody > tr:nth-child(even) > td:last-child { background: linear-gradient(rgba(255,255,255,.01), rgba(255,255,255,.01)) var(--card); }
  table.sa-admin-table > tbody > tr:hover > td:last-child { background: linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)) var(--card); }
}
@media (pointer: coarse) {
  .sa-admin-table .sa-ctx-dots { min-width: 40px; min-height: 40px; justify-content: center; }
  .sa-ctx-btn, .sa-ctx-btn-sm, .sa-ctx-delete { min-height: 42px; }
  .sa-ctx-menu .sa-ctx-delete { margin-top: 8px; }
}
@media (max-width: 640px) {
  .sa-ctx-backdrop { display: block; position: fixed; inset: 0; z-index: 1299; }
  .sa-ctx-menu.ss-sheet { padding: 4px 0 6px; }
  .sa-ctx-menu.ss-sheet .sa-ctx-head { display: block; padding: 10px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
  .sa-ctx-menu.ss-sheet .sa-ctx-btn, .sa-ctx-menu.ss-sheet .sa-ctx-btn-sm, .sa-ctx-menu.ss-sheet .sa-ctx-delete { min-height: 46px; padding: 12px 16px; font-size: 14px; }
  .sa-ctx-menu.ss-sheet .sa-ctx-delete { margin-top: 8px; }
}

/* Empty state (no admins) */
.sa-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* Role cards grid */
.sa-role-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px; margin-bottom: 20px;
}
.sa-role-grid > .card { margin-bottom: 0; }
/* A card being edited grows; its neighbours keep their own height */
.sa-role-grid:has(.sa-role-editing) > .card { align-self: start; }

/* Role card header area */
.sa-role-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sa-role-name { font-weight: 600; font-size: 14px; }
.sa-role-desc { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.sa-role-builtin {
  font-size: 10px; color: var(--muted); white-space: nowrap;
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
}

/* Role permission progress bar */
.sa-perm-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.sa-perm-count { font-size: 12px; color: var(--muted); }
.sa-perm-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.sa-perm-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

/* Role permission group tags */
.sa-perm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.sa-perm-tag { font-size: 10px; padding: 2px 7px; border-radius: 4px; }
.sa-perm-tag-on {
  background: rgba(16,185,129,.08); color: var(--green);
  border: 1px solid rgba(16,185,129,.15);
}
.sa-perm-tag-off {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); opacity: .5;
}

/* Role card footer */
.sa-role-footer { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.sa-role-edit-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sa-role-delete-btn { color: var(--red); padding: 6px 10px; }

/* Create role card */
.sa-create-card { margin-bottom: 0; border-style: dashed; }
.sa-create-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 140px; cursor: pointer;
  color: var(--muted); gap: 8px; transition: color .15s;
}
.sa-create-placeholder:hover { color: var(--accent); }
.sa-create-label { font-size: 13px; font-weight: 500; }

/* Drawer overlay (create/edit admin) */
.sa-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px); z-index: 9999;
}
.sa-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 100vw; background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.sa-drawer-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.sa-drawer-title { font-size: 16px; font-weight: 600; margin: 0; }
.sa-drawer-subtitle { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.sa-drawer-close {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); border-radius: 8px;
  width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--red);
  transition: all .15s; flex-shrink: 0; padding: 0;
  font-size: 20px; font-weight: 400; line-height: 1; font-family: inherit;
}
.sa-drawer-close svg { flex-shrink: 0; }
.sa-drawer-close:hover { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.sa-drawer-body { flex: 1; overflow-y: auto; padding: 24px; overscroll-behavior: contain; }
/* Phones/tablets: the page behind an open drawer does not scroll (or pull-to-refresh) */
@media (pointer: coarse) { html.sa-drawer-lock { overflow: hidden; overscroll-behavior: none; } }
.sa-suspend-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
/* ...and it paints above the sticky Cancel/Save row's bottom padding, which reaches into it */
.sa-drawer-body > .sa-suspend-section { position: relative; z-index: 3; }

/* Step tabs (create admin wizard) */
.sa-steps { display: flex; gap: 8px; margin-bottom: 24px; }
.sa-step {
  flex: 1; text-align: center; padding: 8px;
  border-bottom: 2px solid var(--border); font-size: 12px;
  font-weight: 500; color: var(--muted); transition: all .2s; cursor: pointer;
}

/* Button helpers */
.sa-btn-row { display: flex; gap: 8px; }
.sa-btn-full { width: 100%; justify-content: center; }
.sa-btn-flex { flex: 1; justify-content: center; }

/* Form hint paragraph */
.sa-form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Label hint inline span */
.sa-label-hint { font-weight: 400; color: var(--muted); }

/* Permission editor (renderPermEditor) */
.sa-perm-header-cursor { cursor: pointer; user-select: none; }
.sa-perm-icon { opacity: .6; display: flex; }
.sa-perm-counter { font-size: 10px; font-weight: 400; color: var(--muted); }
.sa-perm-toggle-all {
  font-size: 11px; cursor: pointer; color: var(--accent); font-weight: 500;
  text-transform: none; letter-spacing: 0; margin: 0;
}
.sa-perm-chevron { transition: transform .15s; }
.sa-perm-chevron.is-open { transform: rotate(90deg); }
.sa-perm-body { padding: 4px 0; }

/* New role form header */
.sa-new-role-header { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* Form row bottom margin */
.sa-form-row-mb { margin-bottom: 16px; }

/* Edit drawer footer */
.sa-edit-footer { display: flex; gap: 8px; padding-top: 8px; }

/* Col widths for admin table */
.sa-col-avatar { width: 40px; }
.sa-col-actions { width: 60px; }

/* Drawer Back/Continue/Save rows (.modal-actions-sticky) sit flush with the
   drawer's bottom edge: the sticky inset would otherwise leave the body padding
   showing the form scrolling underneath */
.sa-drawer-body .modal-actions-sticky { bottom: -24px; padding-bottom: 24px; margin-bottom: -24px; }

/* Touch screens and phones */
@media (pointer: coarse) {
  .sa-drawer-close { width: 40px; height: 40px; }
  .sa-step { min-height: 40px; display: flex; align-items: center; justify-content: center; }
  .sa-role-footer { gap: 10px; }
  .sa-role-footer .sa-role-delete-btn { min-width: 40px; min-height: 40px; justify-content: center; }
  .sa-perm-toggle-all { padding: 10px 12px; margin: -10px -4px -10px 0; }
  .sa-head-actions > button, .sa-btn-full, .sa-btn-flex { min-height: 40px; }
  .sa-tabs > button { min-height: 40px; }
  .sa-drawer .pw-btn { min-width: 40px; justify-content: center; }
}
@media (max-width: 640px) {
  .sa-title { font-size: 20px; }
  .sa-drawer-header { padding: 14px 16px; gap: 12px; }
  .sa-drawer-body { padding: 16px; }
  .sa-drawer-body .modal-actions-sticky { bottom: -16px; padding-bottom: 16px; margin-bottom: -16px; }
  .sa-steps { margin-bottom: 18px; }
}
/* Phones, tablets and touch screens: no text below 11px */
@media (max-width: 900px), (pointer: coarse) {
  .sa-tab-badge, .sa-admin-you, .sa-2fa-forced, .sa-perm-counter, .sa-perm-tag, .sa-role-builtin,
  .sa-admin-table .badge, .sa-admin-table .badge-xxs { font-size: 11px; }
}

/* ── TMDB PAGE (.tmdb-) ───────────────────────── */

/* Top grid layout */
.tmdb-top-grid{align-items:stretch;margin-bottom:16px}
.tmdb-top-grid>.card{height:100%;margin-bottom:0;box-sizing:border-box}

/* Card status grid (2-col info display) */
.tmdb-status-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;font-size:12px}
.tmdb-status-label{color:var(--muted);font-size:10px;margin-bottom:2px}

/* Sync-all status bar */
.tmdb-sync-status{font-size:11px;padding:6px 10px;border-radius:5px;margin-top:10px;background:var(--card2);border:1px solid var(--border);color:var(--muted)}

/* How-it-works body */
.tmdb-how-body{font-size:12px;line-height:1.7;color:var(--muted)}
.tmdb-how-body p{margin-bottom:8px}
.tmdb-how-body p:last-child{margin-bottom:0}
.tmdb-how-strong{color:var(--text)}

/* No-services message */
.tmdb-empty-msg{color:var(--muted);font-size:13px}

/* Category toggle label (service cards) */
.tmdb-cat-toggle{display:flex;align-items:center;gap:5px;cursor:pointer;padding:4px 7px;border-radius:5px;background:var(--card2);border:1px solid var(--border);white-space:nowrap;font-size:11px;text-transform:none;letter-spacing:0;font-weight:400;color:var(--text);margin:0}

/* Category toggle label (master card variant) */
.tmdb-cat-toggle-master{display:flex;align-items:center;gap:5px;cursor:pointer;padding:4px 7px;border-radius:5px;background:rgba(129,140,248,.1);border:1px solid rgba(129,140,248,.25);white-space:nowrap;font-size:11px;color:#c7d2fe;text-transform:none;letter-spacing:0;font-weight:400;margin:0}

/* Category toggle checkbox */
.tmdb-cat-checkbox{flex-shrink:0;width:13px;height:13px}

/* Item count badge inside toggle */
.tmdb-cat-count{font-size:9px;padding:1px 5px;margin-left:2px}

/* Year input inside toggle */
.tmdb-year-input{width:60px;padding:1px 4px;font-size:11px;border-radius:3px;border:1px solid var(--border);background:var(--bg);color:var(--text)}
.tmdb-year-input-master{width:56px;padding:1px 3px;font-size:10px;border-radius:3px;border:1px solid rgba(129,140,248,.25);background:rgba(0,0,0,.3);color:#c7d2fe}

/* Service cards grid */
.tmdb-cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(320px,100%),1fr));gap:14px;align-items:stretch}
.tmdb-cards-grid>.card,.tmdb-cards-grid>.card.mb-0,.tmdb-cards-grid>.card.tmdb-master-card{margin-bottom:0 !important;display:flex !important;flex-direction:column !important;height:100% !important;box-sizing:border-box !important}
.tmdb-cards-grid>.card .tmdb-badge-row{flex:1 1 auto}
.tmdb-cards-grid>.card .tmdb-card-actions,.tmdb-cards-grid>.card .tmdb-card-actions-master{margin-top:auto;padding-top:10px}

/* Master card */
.tmdb-master-card{margin-bottom:0;border:1px solid rgba(129,140,248,.3);background:linear-gradient(135deg,rgba(99,102,241,.06) 0%,rgba(139,92,246,.03) 100%)}

/* Card header row */
.tmdb-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:10px}
.tmdb-card-name-row{display:flex;align-items:center;gap:7px;margin-bottom:3px}

/* Master icon box */
.tmdb-master-icon{width:28px;height:28px;border-radius:6px;background:linear-gradient(135deg,#818cf8,#a78bfa);display:flex;align-items:center;justify-content:center;flex-shrink:0}

/* Master title */
.tmdb-master-title{font-weight:600;font-size:14px;color:#a5b4fc}

/* Progress bar row */
.tmdb-progress-row{display:flex;align-items:center;gap:6px;margin-bottom:10px}
.tmdb-progress-track{flex:1;height:3px;background:var(--border);border-radius:2px;overflow:hidden}
.tmdb-progress-track-master{flex:1;height:3px;background:rgba(129,140,248,.15);border-radius:2px;overflow:hidden}
.tmdb-progress-fill{height:100%;border-radius:2px;background:var(--accent)}
.tmdb-progress-fill-master{height:100%;border-radius:2px;background:#818cf8}

/* Category summary badges row */
.tmdb-badge-row{display:flex;flex-wrap:wrap;gap:3px;margin-bottom:12px}
.tmdb-badge-cat{font-size:9px;padding:2px 6px;border-radius:4px}
.tmdb-badge-cat-on{background:rgba(16,185,129,.08);color:var(--green);border:1px solid rgba(16,185,129,.15)}
.tmdb-badge-cat-off{background:transparent;color:var(--muted);border:1px solid var(--border);opacity:.4}
.tmdb-badge-cat-master-on{background:rgba(129,140,248,.12);color:#a5b4fc;border:1px solid rgba(129,140,248,.25)}
.tmdb-badge-cat-master-off{background:transparent;color:var(--muted);border:1px solid var(--border);opacity:.4}

/* Card actions footer */
.tmdb-card-actions{display:flex;gap:6px;border-top:1px solid var(--border);padding-top:10px}
.tmdb-card-actions-master{display:flex;gap:6px;border-top:1px solid rgba(129,140,248,.2);padding-top:10px}

/* Master-accent button overrides */
.tmdb-btn-master{border-color:rgba(129,140,248,.25);color:#c7d2fe}
.tmdb-btn-master-primary{background:#818cf8;border-color:#818cf8;color:#fff}

/* Expandable edit section */
.tmdb-edit-section{margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}
.tmdb-edit-section-master{margin-top:12px;padding-top:12px;border-top:1px solid rgba(129,140,248,.2)}

/* Category section heading */
.tmdb-cat-heading{font-size:10px;font-weight:600;color:var(--muted);margin-bottom:6px}
.tmdb-cat-heading-master{font-size:10px;font-weight:600;color:#a5b4fc;margin-bottom:6px}

/* Category toggles wrap */
.tmdb-cat-wrap{display:flex;flex-wrap:wrap;gap:4px}

/* Sync status box */
.tmdb-sync-status-box{font-size:10px;padding:5px 8px;border-radius:5px;margin-bottom:10px;background:var(--card2);border:1px solid var(--border);color:var(--muted)}
.tmdb-sync-status-break{word-break:break-word}

/* Master save-all status */
.tmdb-master-save-status{font-size:11px;padding:5px 8px;border-radius:5px;margin-top:8px;background:rgba(129,140,248,.06);border:1px solid rgba(129,140,248,.15);color:#c7d2fe}

/* Service card name */
.tmdb-svc-name{font-weight:600;font-size:14px}

/* Test key result */
.tmdb-test-result{font-size:12px;display:flex;align-items:center}

/* Modal narrow */
.tmdb-modal-narrow{max-width:520px}

/* Auto-sync checkbox alignment */
.tmdb-autosync-group{margin-bottom:0;display:flex;align-items:flex-end;padding-bottom:1px}

/* ── Service config modal ───────────────────────────────────────────────────
   Per-service configuration moved out of the card and into a modal. Inline
   expansion grew the grid row, and because .tmdb-cards-grid stretches its
   children to equal height, every sibling card in that row grew with it. */
.tmdb-cfg-modal{max-width:720px}
.tmdb-cfg-modal,.tmdb-modal-narrow,.ms-modal-box{overscroll-behavior:contain}
.tmdb-cfg-modal .modal-body{padding:20px 22px 18px}

/* Meta strip under the modal title */
.tmdb-cfg-meta{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:11px;color:var(--muted);margin-bottom:14px}
.tmdb-cfg-meta b{color:var(--text);font-weight:600}

/* Category grid — the width a modal affords is the point: four columns here
   against the two a 320px card allowed, so the same 16 toggles take a quarter
   of the vertical space. */
.tmdb-cfg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:5px}
.tmdb-cfg-section{margin-bottom:16px}
.tmdb-cfg-section:last-of-type{margin-bottom:0}
.tmdb-cfg-heading{display:flex;align-items:center;gap:7px;font-size:10px;font-weight:700;letter-spacing:.6px;color:var(--muted);margin-bottom:8px;text-transform:uppercase}
.tmdb-cfg-heading::after{content:"";flex:1;height:1px;background:var(--border)}

/* Toggle rows inside the modal. Full-width so the count badge can sit flush
   right and the numbers form a scannable column. */
.tmdb-cfg-toggle{display:flex;align-items:center;gap:6px;cursor:pointer;padding:6px 9px;border-radius:6px;background:var(--card2);border:1px solid var(--border);font-size:11.5px;font-weight:400;color:var(--text);text-transform:none;letter-spacing:0;margin:0;transition:border-color .12s,background .12s}
.tmdb-cfg-toggle:hover{background:rgba(255,255,255,.045);border-color:rgba(255,255,255,.14)}
.tmdb-cfg-toggle:has(input:checked){background:rgba(99,102,241,.09);border-color:rgba(99,102,241,.32)}
.tmdb-cfg-toggle span.lbl{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tmdb-cfg-toggle .tmdb-cat-count{margin-left:auto;flex-shrink:0}
.tmdb-cfg-modal .tmdb-year-input{width:58px;padding:2px 5px;font-size:11px;flex-shrink:0}

/* Master variant keeps the indigo accent it has on the card */
.tmdb-cfg-toggle-master{background:rgba(129,140,248,.08);border-color:rgba(129,140,248,.22);color:#c7d2fe}
.tmdb-cfg-toggle-master:hover{background:rgba(129,140,248,.14);border-color:rgba(129,140,248,.4)}
.tmdb-cfg-toggle-master:has(input:checked){background:rgba(129,140,248,.18);border-color:rgba(129,140,248,.5)}

/* Modal footer actions */
.tmdb-cfg-actions{display:flex;gap:7px;align-items:center;margin-top:18px;padding-top:14px;border-top:1px solid var(--border)}
.tmdb-cfg-actions .spacer{flex:1}

/* Last-sync results, rendered as chips rather than one run-on paragraph */
.tmdb-result-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:4px;margin-bottom:14px}
.tmdb-result-chip{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:4px 8px;border-radius:5px;background:var(--card2);border:1px solid var(--border);font-size:10.5px;color:var(--muted)}
.tmdb-result-chip b{font-variant-numeric:tabular-nums;font-weight:600}
.tmdb-result-chip.ok b{color:var(--green,#34d399)}
.tmdb-result-chip.warn b{color:#fbbf24}
.tmdb-result-chip.bad b{color:var(--red,#f87171)}
.tmdb-result-note{font-size:10.5px;color:var(--muted);padding:6px 9px;border-radius:5px;background:var(--card2);border:1px solid var(--border);margin-bottom:14px;word-break:break-word}

/* Category summary — two fixed-height rows, so a card's height no longer
   depends on how many categories happen to be enabled. */
.tmdb-summary{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;flex:1 1 auto}
.tmdb-summary-row{display:flex;align-items:center;gap:9px}
.tmdb-summary-label{font-size:9.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--muted);width:44px;flex-shrink:0}
.tmdb-summary-dots{display:flex;gap:3px;flex:1}
.tmdb-summary-dots i{width:100%;max-width:15px;height:5px;border-radius:3px;background:var(--border);transition:background .15s}
.tmdb-summary-dots i.on{background:var(--accent,#6366f1)}
.tmdb-summary-count{font-size:10.5px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;flex-shrink:0}
.tmdb-summary-count.zero{color:var(--muted);font-weight:500}
.tmdb-summary-master .tmdb-summary-dots i.on{background:#818cf8}

@media (max-width:560px){
  .tmdb-cfg-grid{grid-template-columns:repeat(auto-fill,minmax(128px,1fr))}
  .tmdb-cfg-actions{flex-wrap:wrap}
}
/* Smallest phones: names wrap instead of "Amazon Pri…" (no tooltip on touch), and the
   Year toggle takes the whole row so its label isn't pushed out by the year field */
@media (max-width:360px){
  .tmdb-cfg-toggle span.lbl{white-space:normal;overflow-wrap:break-word;line-height:1.25}
  .tmdb-cfg-toggle:has(.tmdb-year-input){grid-column:1/-1}
}
/* The action bar is .modal-actions-sticky: it stays on screen while ~37 toggles scroll.
   Phones: Select All / Clear on one row, Cancel / Save on the next (the spacer breaks the line). */
@media (max-width:640px){
  .tmdb-cfg-modal .modal-body{padding:14px}
  .tmdb-cfg-actions .spacer{flex:1 1 100%;height:0}
  .tmdb-cfg-actions > .btn,.tmdb-cfg-actions > .btn-secondary{flex:1 1 0;justify-content:center}
}
@media (max-width:640px), (max-height:560px){
  .tmdb-settings-actions{position:sticky;bottom:0;z-index:2;background:var(--card);border-top:1px solid var(--border);margin-top:16px;padding:10px 0 2px}
  .tmdb-settings-actions > .btn{margin-top:0;width:100%}
}
@media (max-width:640px),(pointer:coarse){
  .tmdb-status-label,.tmdb-summary-label,.tmdb-summary-count,.tmdb-cfg-heading,.tmdb-cat-count,.tmdb-sync-status-box,.tmdb-result-chip,.tmdb-result-note{font-size:11px}
  .tmdb-summary-label{width:54px}
}
@media (pointer:coarse){
  .tmdb-cfg-modal .modal-close,.tmdb-modal-narrow .modal-close{width:40px;height:40px}
  /* Clear Cache / Clear All Cache are destructive: keep them 8px from their neighbours */
  .tmdb-card-actions,.tmdb-top-grid .card-header .flex-center{gap:8px}
  .tmdb-eye-btn{min-width:44px}
  .tmdb-cfg-modal .tmdb-year-input{width:64px;height:36px}
}

/* Small button variant */
.tmdb-btn-xs{padding:5px 12px;font-size:11px}
.tmdb-btn-xs-narrow{padding:5px 10px;font-size:11px}

/* ── UNIFIED CONTENT LAYOUT ──────────────────── */
/* Shared layout for Live, Movies, Series pages   */

/* Header bar with service selector + tabs */
.uc-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:14px}
.uc-header-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;max-width:100%}
.uc-header-left select{padding:6px 10px;font-size:12px;background:var(--card);border:1px solid var(--border);border-radius:8px;color:var(--text);font-family:inherit;min-width:140px}
.uc-header-meta{font-size:11px;color:var(--muted)}
.uc-header-meta .uc-epg-badge{display:inline-block;background:rgba(6,182,212,.1);color:#22d3ee;padding:1px 7px;border-radius:99px;font-size:10px;font-weight:500;margin-left:6px}
.uc-tabs{display:flex;gap:2px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:3px}
.uc-tab{padding:6px 14px;font-size:12px;font-weight:500;border-radius:7px;text-decoration:none;color:var(--muted);display:flex;align-items:center;gap:5px;transition:all .12s;border:none;background:none;cursor:pointer;font-family:inherit;white-space:nowrap}
.uc-tab:hover{color:var(--text);background:rgba(255,255,255,.04)}
.uc-tab.active{color:#fff;background:var(--accent);box-shadow:0 1px 4px rgba(99,102,241,.2)}
.uc-tab-badge{background:rgba(239,68,68,.15);color:#fca5a5;font-size:10px;padding:0 6px;border-radius:99px;min-width:18px;text-align:center;font-weight:600;line-height:18px}
.uc-tab.active .uc-tab-badge{background:rgba(255,255,255,.2);color:#fff}

/* KPI strip */
.uc-kpis{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.uc-kpi{flex:1;min-width:100px;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 14px;text-align:center}
.uc-kpi-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-bottom:2px}
.uc-kpi-val{font-size:20px;font-weight:700;line-height:1.2}
.uc-kpi-sub{font-size:10px;color:var(--muted);margin-top:1px}
.uc-kpi.blue .uc-kpi-val{color:#818cf8}
.uc-kpi.green .uc-kpi-val{color:#34d399}
.uc-kpi.cyan .uc-kpi-val{color:#22d3ee}
.uc-kpi.orange .uc-kpi-val{color:#fbbf24}
.uc-kpi.red .uc-kpi-val{color:#f87171}
.uc-kpi.purple .uc-kpi-val{color:#a78bfa}

/* Notices */
.uc-notice{display:flex;align-items:center;gap:8px;padding:10px 16px;background:rgba(251,191,36,.04);border:1px solid rgba(251,191,36,.12);border-radius:10px;font-size:12px;color:#fde68a;margin-bottom:14px}
.uc-notice a{color:#fbbf24;text-decoration:underline}

/* Main grid: categories left, content right */
.uc-browse{display:grid;grid-template-columns:30% 70%;gap:0;height:calc(100vh - 210px);min-height:460px}

/* ── Left: Category rail ────────────────────────── */
.uc-rail{background:var(--card);border:1px solid var(--border);border-radius:12px 0 0 12px;display:flex;flex-direction:column;overflow:hidden;border-right:none}
.uc-rail-head{padding:10px;border-bottom:1px solid var(--border);flex-shrink:0;display:flex;flex-direction:column;gap:6px}
.uc-rail-head input{width:100%;padding:7px 10px;font-size:11px;background:var(--bg);border-radius:6px;border:1px solid var(--border);color:var(--text);font-family:inherit}
.uc-rail-head input:focus{outline:none;border-color:var(--accent)}
.uc-rail-head-row{display:flex;gap:6px;align-items:center}
.uc-rail-manage-btn{padding:4px 10px;font-size:10px;font-weight:500;border-radius:5px;border:1px solid var(--border);background:rgba(255,255,255,.03);color:var(--muted);cursor:pointer;font-family:inherit;transition:all .12s;white-space:nowrap}
.uc-rail-manage-btn:hover{background:rgba(99,102,241,.08);color:var(--accent);border-color:rgba(99,102,241,.2)}
.uc-rail-manage-btn.active{background:rgba(99,102,241,.12);color:var(--accent);border-color:rgba(99,102,241,.3)}
.uc-rail-items{flex:1;overflow-y:auto;padding:4px 5px}
.uc-rail-sep{height:1px;background:var(--border);margin:4px 8px 6px}
/* <=900px: the rail collapses to this bar (current category + count) */
.uc-rail-toggle{display:none;align-items:center;gap:8px;width:100%;min-height:48px;padding:10px 14px;background:none;border:0;border-radius:0;color:var(--text);font-size:13px;font-weight:600;text-align:left;cursor:pointer}
.uc-rail-toggle-k{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);flex-shrink:0}
.uc-rail-toggle-v{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uc-rail-toggle-chev{flex-shrink:0;color:var(--muted);transition:transform .15s}
.uc-rail.rail-open .uc-rail-toggle-chev{transform:rotate(180deg)}

/* Category "All" button */
.uc-rail-all{display:flex;align-items:center;gap:8px;width:100%;padding:9px 10px;font-size:12px;font-weight:600;background:rgba(255,255,255,.02);border:1px solid transparent;border-radius:8px;cursor:pointer;color:var(--text);text-align:left;font-family:inherit;transition:all .12s;margin-bottom:2px}
.uc-rail-all:hover{background:rgba(99,102,241,.05);border-color:rgba(99,102,241,.1)}
.uc-rail-all.active{background:linear-gradient(135deg,rgba(99,102,241,.1),rgba(139,92,246,.08));color:#a5b4fc;border-color:rgba(99,102,241,.2);box-shadow:0 1px 4px rgba(99,102,241,.1)}
.uc-rail-all-icon{width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,var(--accent),var(--purple));display:flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;box-shadow:0 1px 4px rgba(99,102,241,.2)}

/* Individual category items */
.uc-rail-item{display:flex;align-items:center;gap:7px;width:100%;padding:6px 8px;font-size:12px;background:none;border:none;border-left:2px solid transparent;border-radius:0 6px 6px 0;cursor:pointer;color:var(--muted);text-align:left;font-family:inherit;transition:all .12s;margin-bottom:1px;position:relative}
.uc-rail-item:hover{background:rgba(255,255,255,.035);color:var(--text)}
.uc-rail-item.active{background:rgba(99,102,241,.08);color:var(--accent);border-left-color:var(--accent);font-weight:500}
.uc-rail-item.uc-cat-hidden{opacity:.35}
.uc-rail-item.uc-cat-hidden:hover{opacity:.6}
.uc-rail-dot{width:8px;height:8px;border-radius:3px;flex-shrink:0;opacity:.7;transition:opacity .12s}
.uc-rail-item:hover .uc-rail-dot{opacity:1}
.uc-rail-item.active .uc-rail-dot{opacity:1;box-shadow:0 0 6px currentColor}
.uc-rail-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uc-rail-count{font-size:10px;color:var(--muted);flex-shrink:0;background:rgba(255,255,255,.04);padding:1px 6px;border-radius:99px;min-width:22px;text-align:center;font-weight:400}
.uc-rail-item:hover .uc-rail-count{background:rgba(255,255,255,.07);color:var(--text)}
.uc-rail-item.active .uc-rail-count{background:rgba(99,102,241,.15);color:var(--accent);font-weight:500}

/* Category management mode */
.uc-rail-drag{cursor:grab;color:var(--muted);opacity:.4;flex-shrink:0;font-size:11px;display:none}
.uc-rail.manage-mode .uc-rail-drag{display:flex;align-items:center}
@media(pointer:fine){.uc-rail.manage-mode .uc-rail-drag{justify-content:center;width:20px;height:24px;margin:0 -2px}}   /* 16px footprint like the old glyph, 20x24 hit area */
.uc-rail.manage-mode .uc-rail-item{cursor:grab;padding-left:2px}
.uc-rail.manage-mode .uc-rail-item:active{cursor:grabbing}
.uc-rail-actions{display:none;gap:4px;flex-shrink:0;margin-left:auto}
.uc-rail.manage-mode .uc-rail-actions{display:flex}
.uc-rail-action{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:5px;border:none;cursor:pointer;font-size:12px;transition:all .12s;font-family:inherit;padding:0;line-height:1}
/* Move up/down: touch and narrow screens only (drag stays the desktop way) */
.uc-act-up,.uc-act-down{display:none;background:rgba(255,255,255,.06);color:var(--muted);font-size:10px}
.uc-act-up:hover,.uc-act-down:hover{background:rgba(99,102,241,.15);color:var(--accent)}
.uc-act-up::before{content:"\25B2"}
.uc-act-down::before{content:"\25BC"}

/* Edit (rename) button — cyan/blue */
.uc-act-edit{background:rgba(6,182,212,.1);color:#22d3ee}
.uc-act-edit:hover{background:rgba(6,182,212,.2);color:#67e8f9}
.uc-act-edit::before{content:"\270E"}

/* Visibility button — green when visible, red when hidden */
.uc-act-vis{background:rgba(16,185,129,.1);color:#34d399}
.uc-act-vis:hover{background:rgba(16,185,129,.2);color:#6ee7b7}
.uc-act-vis.is-visible::before{content:"\1F441"}
.uc-act-vis.is-hidden{background:rgba(239,68,68,.1);color:#f87171}
.uc-act-vis.is-hidden:hover{background:rgba(239,68,68,.2);color:#fca5a5}
.uc-act-vis.is-hidden::before{content:"\1F6AB"}

/* Category edit modal */
.uc-cat-modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:1400;display:none;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(3px);overscroll-behavior:contain}
.uc-cat-modal-bg.show{display:flex}
.uc-cat-modal{background:var(--card);border:1px solid var(--border);border-radius:14px;width:100%;max-width:400px;padding:24px 24px 0;box-shadow:0 20px 60px rgba(0,0,0,.5);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
.uc-cat-modal h4{font-size:14px;font-weight:600;margin-bottom:16px}
.uc-cat-modal-field{margin-bottom:14px}
.uc-cat-modal-field label{display:block;font-size:11px;font-weight:500;color:var(--muted);margin-bottom:4px}
.uc-cat-modal-field input[type="text"]{width:100%;padding:8px 10px;font-size:12px;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text);font-family:inherit}
.uc-cat-modal-field input:focus{outline:none;border-color:var(--accent)}
.uc-cat-modal-field .uc-field-hint{font-size:10px;color:var(--muted);margin-top:3px}
.uc-cat-modal-field .uc-field-orig{font-size:12px;color:var(--text);padding:6px 0;font-weight:500}
.uc-cat-modal-toggle{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.uc-cat-modal-toggle input[type="checkbox"]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}
.uc-cat-modal-toggle label{font-size:12px;color:var(--text);cursor:pointer;font-weight:500}
.uc-cat-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:18px;padding:14px 0 24px;border-top:1px solid var(--border);position:sticky;bottom:0;background:var(--card)}
.uc-cat-modal-actions .btn{font-size:12px;padding:7px 18px}
.uc-cat-modal-actions .btn-cancel{background:rgba(255,255,255,.04);border:1px solid var(--border);color:var(--muted);border-radius:6px;cursor:pointer;font-family:inherit;font-size:12px;padding:7px 18px}
.uc-cat-modal-actions .btn-cancel:hover{background:rgba(255,255,255,.08);color:var(--text)}
.uc-cat-modal-prefix-row{display:none;margin-top:6px}
.uc-cat-modal-prefix-row.show{display:block}
.uc-cat-modal{scroll-padding-bottom:84px}
@media(max-height:500px){.uc-cat-modal-bg{padding:12px}.uc-cat-modal{padding:16px 20px 0;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);scroll-padding-bottom:66px}.uc-cat-modal h4{margin-bottom:10px}.uc-cat-modal-field{margin-bottom:10px}.uc-cat-modal-actions{margin-top:12px;padding:10px 0 12px}}
.uc-detail-placeholder{font-size:28px;opacity:.2}

/* Source tag (Smart / Media) */
.uc-rail-src-tag{display:inline-block;font-size:8px;font-weight:600;padding:1px 5px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;vertical-align:middle;margin-left:3px;background:rgba(139,92,246,.12);color:#c4b5fd}
/* Prefix tag shown on category items */
.uc-rail-prefix-tag{display:inline-block;font-size:8px;font-weight:600;padding:1px 5px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;vertical-align:middle;margin-left:3px;background:rgba(251,191,36,.12);color:#fbbf24}
.uc-rail-renamed{font-size:9px;color:var(--cyan);opacity:.7;margin-left:2px}

/* Rename inline input */
.uc-rename-input{width:100%;padding:3px 6px;font-size:11px;background:var(--bg);border:1px solid var(--accent);border-radius:4px;color:var(--text);font-family:inherit;outline:none}

/* Category rail save bar */
.uc-rail-save{padding:8px 10px;border-top:1px solid var(--border);flex-shrink:0;display:flex;gap:6px;align-items:center}
.uc-rail-save .btn{font-size:11px;padding:5px 14px}
.uc-rail-save-hint{font-size:10px;color:var(--muted);flex:1}

/* Sortable ghost/drag styles */
.uc-rail-item.sortable-ghost{opacity:.3;background:rgba(99,102,241,.15)}
.uc-rail-item.sortable-chosen{background:rgba(99,102,241,.08)}

/* ── Right: Content list ────────────────────────── */
.uc-content{background:var(--card);border:1px solid var(--border);border-radius:0 12px 12px 0;display:flex;flex-direction:column;overflow:hidden}
.uc-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border);flex-shrink:0;flex-wrap:wrap}
.uc-toolbar input[type="text"]{padding:7px 10px;font-size:11px;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text);font-family:inherit;flex:0 0 200px;min-width:120px}
.uc-toolbar input:focus{outline:none;border-color:var(--accent)}
.uc-toolbar-meta{font-size:11px;color:var(--muted);white-space:nowrap}
.uc-toolbar-actions{display:flex;gap:6px;margin-left:auto;flex-wrap:wrap;align-items:center}
.uc-toolbar-actions .btn-secondary{font-size:11px;padding:5px 10px}
.uc-toolbar-actions .badge{font-size:10px}

/* Content list scroll area */
.uc-list-scroll{flex:1;overflow-y:auto}

/* Section headers */
.uc-section-hdr{padding:8px 14px 4px;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;background:linear-gradient(rgba(0,0,0,.12),rgba(0,0,0,.12)) var(--card);border-bottom:1px solid rgba(255,255,255,.03);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:2}
.uc-section-cnt{font-weight:400;font-size:10px;text-transform:none;letter-spacing:0;flex-shrink:0;white-space:nowrap;margin-left:8px}

/* Content rows - shared across Live/Movies/Series */
.uc-row{display:flex;align-items:center;gap:10px;padding:6px 14px;border-bottom:1px solid rgba(255,255,255,.03);cursor:pointer;transition:background .1s}
.uc-row:hover{background:rgba(255,255,255,.025)}
.uc-row.selected{background:rgba(99,102,241,.06);box-shadow:inset 3px 0 0 var(--accent)}

/* Row thumbnail (logo for Live, poster for Movies/Series) */
.uc-row-thumb{width:38px;height:28px;flex-shrink:0;background:rgba(0,0,0,.18);border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.uc-row-thumb img{max-width:100%;max-height:100%;object-fit:contain}
.uc-row-thumb-ph{font-size:11px;opacity:.2}
.uc-row-thumb.poster{width:32px;height:44px;border-radius:4px}
.uc-row-thumb.poster img{width:100%;height:100%;object-fit:cover}

/* Row info */
.uc-row-info{flex:1;min-width:0}
.uc-row-name{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.uc-row-cat{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}

/* Row meta columns */
.uc-row-epg{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.uc-row-now{display:flex;align-items:center;gap:6px;min-width:0}
.uc-row-now-title{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.uc-row-progress{height:3px;background:rgba(255,255,255,.06);border-radius:2px;overflow:hidden;max-width:260px}
.uc-row-progress-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--purple));border-radius:2px;transition:width 30s linear}
.uc-row-no-epg{font-size:11px;color:var(--muted);opacity:.4;font-style:italic}
.uc-row-time{font-size:10px;color:var(--muted);flex-shrink:0;min-width:44px;text-align:right}
.uc-row-next{flex:0 0 130px;min-width:0}
.uc-row-next-label{font-size:9px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);opacity:.5;line-height:1.3}
.uc-row-next-title{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}

/* Row status dots */
.uc-row-status{display:flex;gap:3px;flex-shrink:0}

/* Movies/Series specific row columns */
.uc-row-year{font-size:11px;color:var(--muted);flex-shrink:0;min-width:36px;text-align:right}
.uc-row-rating{font-size:11px;flex-shrink:0;min-width:44px;text-align:right;display:flex;align-items:center;gap:3px;justify-content:flex-end}
.uc-row-rating .rating-star{color:#fbbf24;font-size:12px}
.uc-row-rating-val{color:var(--text);font-weight:500}
.uc-row-rating-none{color:var(--muted);opacity:.3;font-size:10px}
/* Source tags — row + detail panel */
.uc-row-src-tag{flex-shrink:0;font-size:11px;padding:4px 12px;border-radius:6px;font-weight:500;white-space:nowrap}
.uc-detail-src-tag{font-size:11px;padding:4px 12px;border-radius:6px;font-weight:500}
.uc-src-click{cursor:pointer}
.uc-detail-src-hint{font-size:11px;color:var(--muted);line-height:1.45;margin:-8px 0 16px}
.uc-src-iptv{background:rgba(99,102,241,.12);color:#a5b4fc}
.uc-src-both{background:rgba(16,185,129,.12);color:#6ee7b7}
.uc-src-ms{background:rgba(139,92,246,.12);color:#c4b5fd}
.uc-src-override{background:rgba(245,158,11,.15);color:#fbbf24;border:1px solid rgba(245,158,11,.25)}

/* Live dot */
.uc-live-dot{width:6px;height:6px;border-radius:50%;background:#ef4444;flex-shrink:0;animation:uc-pulse 2s infinite}
@keyframes uc-pulse{0%,100%{opacity:1}50%{opacity:.3}}

/* Status dots (ok/warn/err) */
.uc-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}
.uc-dot.ok{background:var(--green)}
.uc-dot.warn{background:var(--orange)}
.uc-dot.err{background:var(--red)}
.uc-dot.uc-dot-inline{display:inline-block;vertical-align:middle}

/* Load more button */
.uc-load-more{padding:12px;text-align:center;border-top:1px solid rgba(255,255,255,.03)}
.uc-load-more-btn{font-size:12px}

/* ── Detail panel (right slide-in) ──────────────── */
.uc-inline-form{display:inline}
.uc-detail-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:1199}
.uc-detail{position:fixed;top:0;right:0;bottom:0;width:380px;max-width:90vw;background:var(--card);border-left:1px solid var(--border);box-shadow:-12px 0 48px rgba(0,0,0,.4);z-index:1200;display:flex;flex-direction:column;overflow:hidden}
.uc-detail-head{padding:14px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.uc-detail-head h3{font-size:13px;font-weight:600;margin:0}
.uc-detail-close{background:rgba(255,255,255,.04);border:1px solid var(--border);border-radius:6px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);font-size:14px;font-family:inherit;transition:all .12s;padding:0}
.uc-detail-close:hover{color:var(--text);background:rgba(255,255,255,.08)}
.uc-detail-body{flex:1;overflow-y:auto;padding:20px;overscroll-behavior:contain}
/* page behind an open detail drawer / rename dialog stays put on touch screens */
@media(pointer:coarse){html.uc-lock{overflow:hidden;overscroll-behavior:none}}

/* Detail: poster/logo area */
.uc-detail-visual{width:100%;height:80px;background:rgba(0,0,0,.12);border-radius:8px;display:flex;align-items:center;justify-content:center;margin-bottom:14px;overflow:hidden}
.uc-detail-visual img{max-height:56px;max-width:80%;object-fit:contain}
.uc-detail-visual.poster{height:auto;aspect-ratio:2/3;max-width:140px;margin:0 auto 14px}
.uc-detail-visual.poster img{width:100%;height:100%;max-height:none;max-width:none;object-fit:cover}
.uc-detail-name{font-size:16px;font-weight:600;margin-bottom:2px}
.uc-detail-cat{font-size:12px;color:var(--muted);margin-bottom:12px}
.uc-detail-badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
.uc-detail-section{margin-bottom:18px}
.uc-detail-section-title{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:8px;padding-bottom:6px;border-bottom:1px solid var(--border)}

/* Detail: meta rows */
.uc-meta{display:flex;flex-direction:column;gap:6px}
.uc-meta-row{display:flex;font-size:12px;gap:8px}
.uc-meta-label{color:var(--muted);flex-shrink:0;min-width:90px}
.uc-meta-val{word-break:break-word}

/* Detail: schedule items (Live EPG) */
.uc-sched-item{padding:8px 0;border-bottom:1px solid rgba(255,255,255,.04)}
.uc-sched-item.now{background:rgba(99,102,241,.04);margin:0 -20px;padding:8px 20px;border-radius:6px}
.uc-sched-time{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);margin-bottom:2px}
.uc-sched-live{background:var(--red);color:#fff;font-size:9px;font-weight:700;padding:1px 6px;border-radius:3px;letter-spacing:.04em}
.uc-sched-title{font-size:12px;font-weight:500}
.uc-sched-meta{font-size:10px;color:var(--muted);margin-top:4px}
.uc-progress-full{max-width:100%;margin-top:4px}

/* Detail: plot / fields for movies/series */
.uc-detail-plot{font-size:12px;color:var(--muted);line-height:1.5;margin-bottom:14px}
.uc-detail-fields{display:flex;flex-direction:column;gap:6px;font-size:12px}
.uc-detail-fields>div{display:flex;gap:6px}
.uc-detail-fields>div>span:first-child{color:var(--muted);font-weight:500;flex-shrink:0;min-width:70px}
.uc-detail-field-val{word-break:break-word}

/* Detail: rating display */
.uc-detail-rating{display:flex;align-items:center;gap:4px;font-size:14px;font-weight:600;margin-bottom:12px}
.uc-detail-rating .rating-star{color:#fbbf24;font-size:16px}

/* Detail: source badges */
.uc-detail-src-badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.uc-detail-src-badge{font-size:10px;padding:3px 10px;border-radius:99px;font-weight:500}
.uc-detail-src-iptv{background:rgba(99,102,241,.1);color:#a5b4fc}
.uc-detail-src-fb{background:rgba(16,185,129,.1);color:#6ee7b7}
.uc-detail-src-ms{background:rgba(139,92,246,.1);color:#c4b5fd}

/* Detail: library inline forms (logo/EPG editing) */
.uc-lib-section{margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}
.uc-lib-section-title{font-size:11px;font-weight:600;color:var(--accent);margin-bottom:10px;display:flex;align-items:center;gap:6px}
.uc-lib-form{display:flex;flex-direction:column;gap:8px}
.uc-lib-form label{font-size:11px;color:var(--muted);font-weight:500}
.uc-lib-form select,.uc-lib-form input[type="text"],.uc-lib-form input[type="file"]{width:100%;padding:6px 8px;font-size:11px;background:var(--bg);border:1px solid var(--border);border-radius:5px;color:var(--text);font-family:inherit}
.uc-lib-form select:focus,.uc-lib-form input:focus{outline:none;border-color:var(--accent)}
.uc-lib-form-row{display:flex;gap:6px;align-items:end}
.uc-lib-form-row .btn{font-size:11px;padding:6px 12px;flex-shrink:0}

/* Detail modal overlay (Movies/Series) */
.uc-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:1300;display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(4px)}
.uc-modal{background:var(--card);border:1px solid var(--border);border-radius:16px;max-width:560px;width:100%;max-height:90vh;overflow-y:auto;position:relative;box-shadow:0 24px 64px rgba(0,0,0,.5)}
.uc-modal-close{position:absolute;top:12px;right:12px;background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:6px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);font-size:16px;z-index:2;font-family:inherit;padding:0}
.uc-modal-close:hover{color:var(--text);background:rgba(255,255,255,.1)}
.uc-modal-top{display:flex;gap:20px;padding:24px}
.uc-modal-poster{flex-shrink:0;width:140px;border-radius:10px;overflow:hidden;background:rgba(0,0,0,.2);aspect-ratio:2/3}
.uc-modal-poster img{width:100%;height:100%;object-fit:cover}
.uc-modal-poster-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:28px;opacity:.2}
.uc-modal-info{flex:1;min-width:0;padding-top:4px}
.uc-modal-title{font-size:18px;font-weight:700;margin-bottom:4px;line-height:1.3}
.uc-modal-meta{display:flex;flex-wrap:wrap;gap:6px 10px;font-size:12px;color:var(--muted);margin-bottom:8px}
.uc-modal-meta span{display:inline-flex;align-items:center;gap:3px}

/* Empty state */
.uc-empty{text-align:center;padding:60px 20px}
.uc-empty-icon{font-size:36px;opacity:.3;margin-bottom:12px}
.uc-empty-title{font-size:15px;font-weight:600;margin-bottom:4px}
.uc-empty-sub{font-size:12px;color:var(--muted)}
.uc-empty-sub a{color:var(--accent)}

/* EPG match status inline */
.uc-epg-status{font-size:11px;color:var(--muted);display:inline-flex;align-items:center;gap:4px}
.uc-epg-status .spinner-sm{width:12px;height:12px}

/* Quick guide strip */
.uc-guide{padding:8px 14px;font-size:11px;color:var(--muted);background:rgba(99,102,241,.04);border:1px solid rgba(99,102,241,.1);border-radius:8px;margin-bottom:12px;line-height:1.5}
.uc-guide strong{color:var(--text);font-weight:600}
.uc-guide em{color:#a5b4fc;font-style:normal;font-weight:500}

/* ── Responsive ─────────────────────────────────── */
@media(max-width:1100px){.uc-row-next{display:none}}
/* Stacked (<=900px): the rail is a collapsible picker; the list flows with the page
   (no nested scroll box that a short landscape screen squeezed to 0px). Manage mode
   shows every category, with Save/Cancel pinned under the top bar. */
@media(max-width:900px){.uc-browse{grid-template-columns:minmax(0,1fr);height:auto;min-height:0}.uc-rail{border-radius:12px 12px 0 0;border-right:1px solid var(--border);border-bottom:none;overflow:visible;overflow:clip}.uc-content{border-radius:0 0 12px 12px;overflow:visible;overflow:clip}.uc-content .uc-list-scroll{overflow:visible}.uc-section-hdr{top:60px}.uc-detail{width:320px}.uc-row-time{display:none}
  .uc-rail-toggle{display:flex;border-bottom:1px solid var(--border)}.uc-rail:not(.rail-open) > .uc-rail-items{display:none}.uc-rail:not(.rail-open) > .uc-rail-head{border-bottom:0}
  .uc-rail-head{flex-direction:row;flex-wrap:wrap;align-items:center}.uc-rail-head input{flex:1 1 180px;width:auto;min-width:0}
  .uc-rail-items{max-height:min(55vh,440px);max-height:min(55dvh,440px)}.uc-rail.manage-mode .uc-rail-items{max-height:none;overflow:visible}.uc-rail.manage-mode .uc-rail-head{position:sticky;top:60px;z-index:3;background:var(--card)}.uc-act-up,.uc-act-down{display:flex}.uc-rail.manage-mode .uc-rail-item{scroll-margin-top:130px}
  .uc-row-cat,.uc-section-cnt,.uc-rail-count,.uc-kpi-label,.uc-kpi-sub,.uc-rail-src-tag,.uc-rail-prefix-tag,.uc-cat-modal-field .uc-field-hint{font-size:11px}}
@media(max-width:640px){.uc-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:6px}.uc-kpi{min-width:0;padding:8px 10px}.uc-kpi-val{font-size:16px}.uc-row-epg{display:none}.uc-row{flex-wrap:wrap;row-gap:4px}.uc-row-info{flex:1 1 140px}.uc-row-src-tag{margin-left:auto;padding:3px 10px}.uc-toolbar input[type="text"]{flex:1 1 160px}.uc-detail{width:100%;max-width:100vw}.uc-row-year{display:none}.uc-header{flex-direction:column;align-items:stretch}.uc-modal-top{flex-direction:column;align-items:center}.uc-modal-poster{width:120px}}
@media(max-width:380px){.uc-section-hdr,.uc-rail.manage-mode .uc-rail-head{top:52px}}
@media(pointer:coarse){.uc-header-left select,.uc-rail-head input,.uc-toolbar input[type="text"],.lv-toolbar input{min-height:36px}.uc-rail-manage-btn{min-height:36px;padding:6px 14px;font-size:12px}.uc-rail-all,.uc-rail-item{min-height:40px}.uc-rail-action{width:40px;height:40px;font-size:14px}.uc-act-up,.uc-act-down{display:flex;font-size:12px}
  .uc-rail.manage-mode .uc-rail-drag{opacity:.8;padding:6px 2px}.uc-rail.manage-mode .uc-rail-drag svg{width:16px;height:16px}
  .uc-rail.manage-mode .uc-rail-item{flex-wrap:wrap;row-gap:6px;padding-top:6px;padding-bottom:6px}.uc-rail.manage-mode .uc-rail-name{flex:1 1 140px}.uc-rail.manage-mode .uc-rail-actions{gap:8px}
  .uc-detail-close{width:40px;height:40px;font-size:18px}.uc-row-src-tag.uc-src-click,.uc-detail-src-tag.uc-src-click{display:inline-flex;align-items:center;min-height:36px}.uc-detail-badges{align-items:center}.uc-lib-form select,.uc-lib-form input[type="text"]{min-height:36px}}

/* ── Tabs ───────────────────────────────────────── */
.tabs-bar{display:flex;gap:2px;border-bottom:1px solid var(--border);padding-bottom:0}
.tab-link{padding:8px 18px;font-size:13px;font-weight:500;color:var(--muted);text-decoration:none;border-bottom:2px solid transparent;transition:color .15s,border-color .15s}
.tab-link:hover{color:var(--text)}
.tab-link.active{color:var(--accent);border-bottom-color:var(--accent)}

/* Reseller profile view */
@media(max-width:768px){.rv-profile-grid{grid-template-columns:1fr !important}}
.rv-back{color:var(--muted);text-decoration:none;font-size:13px;display:inline-flex;align-items:center;gap:6px;transition:color .15s}
.rv-back:hover{color:var(--accent)}
.rv-head{padding:24px 28px}
.rv-stats{display:flex;gap:24px;flex-wrap:wrap}
.rv-name{min-width:0}
@media (min-width:641px){.rv-name{min-width:240px}}
.rv-tabnav{background:var(--card);border:1px solid var(--border);border-top:0;border-radius:0 0 14px 14px;padding:0 28px;margin-bottom:20px}
.rv-credit-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.rv-credit-amt{flex:0 0 160px}
.rv-credit-note{flex:1;min-width:200px}
.rv-multi{height:64px}
.rv-pw-eye{position:absolute;right:10px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;background:none;border:none;color:var(--muted);cursor:pointer;padding:4px;width:auto}
.rv-clip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rv-desc{max-width:250px}
.rv-detail{max-width:350px}
@media (pointer:coarse){
  .rv-back{min-height:36px}
  .rv-pw-eye{right:2px;width:40px;height:40px;padding:0}
  .rv-seg{min-height:40px}
}
/* tablets, phones and any touch screen: long log entries wrap instead of an ellipsis whose
   full text is only in a hover tooltip */
@media (max-width:1100px), (pointer:coarse){.rv-clip{white-space:normal;overflow-wrap:anywhere}}
@media (max-width:640px){
  .rv-back{min-height:36px}
  .rv-pw-eye{right:2px;width:40px;height:40px;padding:0}
  .rv-head{padding:16px}
  .rv-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;width:100%}
  .rv-tabnav{padding:10px}
  .rv-credit-amt, .rv-credit-note{flex:1 1 100%;min-width:0}
  .rv-credit-go{width:100%;justify-content:center}
  .rv-multi{height:auto;min-height:112px}
  .rv-desc, .rv-detail{max-width:none}
  table.table-cards.rv-log-table > tbody > tr > td.td-primary, table.table-cards.rv-cl-table > tbody > tr > td.td-primary{padding-right:0}
}
@media (max-width:480px){.rv-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ── Centralized helpers (moved out of page-level inline styles / <style> blocks) ── */
.form-error{color:#fca5a5;font-size:12px}
.form-error-block{color:#fca5a5;font-size:12px;display:block;margin-top:6px}
.alert-error{margin-top:10px;padding:8px 12px;background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.15);border-radius:6px;font-size:12px;color:#fca5a5}

/* Bouquet category picker (was inline <style> in bouquets.php) */
.bq-picker{display:flex;flex-direction:column;height:340px;max-height:45vh;min-height:150px;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.bq-list{flex:1;min-height:0;overflow-y:auto;padding:4px}
.bq-cat{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;cursor:pointer;font-size:13px}
.bq-cat:hover{background:var(--border)}
.bq-cat input{width:15px;height:15px;accent-color:var(--accent);cursor:pointer;flex-shrink:0}
.bq-typetab{font-size:12px;padding:5px 12px;border-radius:6px;cursor:pointer;border:1px solid var(--border);background:transparent;color:var(--muted)}
.bq-typetab.on{background:var(--accent);color:#fff;border-color:var(--accent)}
.bq-name-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin-bottom:12px}
.bq-name{flex:1 1 220px;min-width:0}
.bq-check{margin:0;display:flex;align-items:center;gap:6px;padding-bottom:8px;white-space:nowrap;cursor:pointer}
.bq-search-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.bq-search{flex:1 1 160px;min-width:0;height:32px;font-size:12px}
@media (pointer:coarse){
  .bq-typetab{min-height:36px}
  .bq-search{height:40px}
  .bq-cat{padding:10px}
}
@media (max-width:640px){
  .bq-head .page-title{display:none}
  .bq-head > div{display:contents}
  .bq-name{flex-basis:100%}
  .bq-head .btn-sm{flex:1 1 auto;justify-content:center}
}

/* Portal credential-generation controls (was inline <style> in portal/settings.php) */
.ps-btn{width:36px;height:36px;border-radius:8px;border:1px solid var(--border);background:rgba(255,255,255,.04);color:var(--text);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}
.ps-btn:hover:not(:disabled){background:rgba(99,102,241,.1);border-color:rgba(99,102,241,.3)}
.ps-btn:disabled{opacity:.3;cursor:not-allowed}
.ps-counter{font-size:28px;font-weight:800;width:48px;text-align:center;color:var(--text);letter-spacing:-1px}
.ps-range-track{width:100%;height:4px;background:rgba(255,255,255,.06);border-radius:2px;overflow:hidden}
.ps-range-fill{height:100%;background:var(--accent);border-radius:2px;transition:width .15s}
.ps-option{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 14px;border-radius:10px;border:1px solid var(--border);background:rgba(255,255,255,.015);margin-bottom:6px;transition:all .15s}
.ps-option:hover{border-color:rgba(255,255,255,.12);background:rgba(255,255,255,.03)}
.ps-option-active{border-color:rgba(99,102,241,.35)!important;background:rgba(99,102,241,.06)!important}
.ps-radio{width:18px;height:18px;border-radius:50%;border:2px solid rgba(255,255,255,.15);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s}
.ps-radio-active{border-color:var(--accent)}
.ps-radio-dot{width:8px;height:8px;border-radius:50%;background:transparent;transition:all .15s}
.ps-radio-dot-active{background:var(--accent)}
.ps-option-title{font-size:13px;font-weight:600}
.ps-option-hint{font-size:11px;color:var(--muted);margin-top:1px}
.ps-option-preview{font-size:11px;font-family:monospace;color:var(--muted);background:rgba(255,255,255,.04);padding:4px 8px;border-radius:4px;white-space:nowrap;flex-shrink:0;margin-left:auto}
/* In a narrow box (phones, the half-width card on tablets) the preview chip wraps onto its own line,
   right-aligned, instead of squeezing the title into 3-5 lines */
.ps-option-text{flex:1 1 min(210px,calc(100% - 30px));min-width:0}
@media (pointer:coarse){.ps-btn{width:40px;height:40px}}

/* ── Failover proxy pool (services VPN tab) ── */
.pp-wrap{margin-top:18px;border-top:1px solid var(--border);padding-top:16px}
.pp-intro{margin:2px 0 12px;line-height:1.5}
.pp-intro code{font-family:monospace;font-size:11px;background:rgba(255,255,255,.06);padding:1px 5px;border-radius:4px}
.pp-list{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.pp-row{display:flex;align-items:center;gap:9px;background:var(--input);border:1px solid var(--border);border-radius:8px;padding:7px 10px}
.pp-order{flex-shrink:0;width:18px;height:18px;line-height:18px;text-align:center;font-size:11px;font-weight:700;color:var(--muted);background:rgba(255,255,255,.05);border-radius:5px}
.pp-label{flex:1;min-width:0;font-size:12.5px;font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
.pp-input{flex:1;min-width:0}
.pp-live{flex-shrink:0;font-size:10.5px;font-weight:600;padding:1px 7px;border-radius:20px}
.pp-live-on{color:var(--green);background:rgba(34,197,94,.12)}
.pp-live-off{color:var(--orange);background:rgba(249,115,22,.12)}
.pp-btns{flex-shrink:0;display:flex;gap:3px}
.pp-btn{width:24px;height:24px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);background:var(--card);color:var(--muted);border-radius:6px;cursor:pointer;font-size:13px;line-height:1;transition:all .12s}
.pp-btn:hover:not(:disabled){color:var(--text);border-color:var(--accent)}
.pp-btn:disabled{opacity:.3;cursor:default}
.pp-btn-del:hover{color:var(--red);border-color:var(--red)}
.pp-empty{font-size:12px;color:var(--muted);font-style:italic;padding:8px 2px 12px}
.pp-add{display:flex;flex-direction:column;gap:8px}
.pp-add-row{display:flex;gap:8px}
.pp-add-sel,.pp-add-inp{flex:1;min-width:0}
.pp-add-quick{display:flex;gap:8px;flex-wrap:wrap}
@media (pointer:coarse){
  .pp-btns{gap:6px}
  .pp-btn{width:40px;height:40px;font-size:16px}
  .pp-btn-del{margin-left:4px}
}
@media (max-width:640px),(pointer:coarse){
  .pp-row .badge,.pp-live{font-size:11px}
}
/* Phones: the domain field / member name gets the whole first line, the buttons the second */
@media (max-width:640px){
  .pp-row{flex-wrap:wrap;row-gap:8px}
  .pp-row > .pp-input{flex:1 1 calc(100% - 40px)}
  .pp-label{flex:1 1 calc(100% - 100px);white-space:normal;overflow-wrap:anywhere;line-height:1.35}
  .pp-btns{margin-left:auto}
}

/* ── Portal / form responsive grid ──
   Full-width cards whose form fields flow into as many columns as fit, then
   stack on narrow screens. Use inside a .card to make forms fill the width
   responsively instead of a fixed narrow column. */
.pf-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px 18px;align-items:start}
.pf-grid .form-group{margin:0}
.pf-grid > .pf-span-2{grid-column:1/-1}       /* full-width field within the grid */
.pf-grid .form-input,.pf-grid textarea.form-input{width:100%;max-width:100%}
/* Cards laid side-by-side, natural (not stretched) heights, responsive wrap */
.pf-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr));gap:16px;align-items:stretch;margin-bottom:16px}
.pf-cards > .card{margin-bottom:0}

/* Input paired with an icon button (e.g. regenerate) — button matches the input's
   height exactly and stays square. Icon-only buttons must reset the base button
   padding, which is 20px horizontal and would otherwise clip the icon. */
.input-row{display:flex;gap:6px;align-items:stretch}
.input-row > .form-input{flex:1;min-width:0}
.input-btn{flex:0 0 auto;width:42px;padding:0;border:1px solid var(--border);background:rgba(255,255,255,.04);color:var(--muted);border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s}
.input-btn:hover{color:var(--text);border-color:var(--accent);background:rgba(255,255,255,.06)}
.input-btn svg{width:15px;height:15px}
.ps-btn{padding:0}   /* same icon-clip fix for the +/- stepper buttons */

/* Prominent "select all" toggle for transfer/dual-list pickers */
.selectall-toggle{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:var(--text);padding:5px 12px;border:1px solid var(--border);border-radius:20px;background:rgba(255,255,255,.04);cursor:pointer;transition:all .15s}
.selectall-toggle:hover{border-color:var(--accent);color:var(--accent)}
.selectall-toggle input{margin:0;width:15px;height:15px}

/* ── Create-client bouquet dual-list transfer ── */
.cc-transfer{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:stretch}
.cc-col{display:flex;flex-direction:column;min-width:0}
.cc-col-h{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:6px}
.cc-search{margin-bottom:6px;font-size:12px}
.cc-list{height:360px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;background:var(--input);padding:4px}
.cc-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 10px;border-radius:6px;cursor:pointer;font-size:12.5px;color:var(--text);transition:background .12s;user-select:none}
.cc-item:hover{background:rgba(255,255,255,.05)}
.cc-item-in{background:rgba(99,102,241,.08)}
.cc-marked{background:rgba(99,102,241,.30) !important;box-shadow:inset 3px 0 0 var(--accent)}
.cc-item-whole{border-left:2px solid var(--accent)}
.cc-arrow{color:var(--muted);font-size:12px;flex-shrink:0}
.cc-empty{font-size:12px;color:var(--muted);font-style:italic;padding:10px}
/* middle arrow column (» add all, › add selected, ‹ remove selected, « remove all) */
.cc-arrows{display:flex;flex-direction:column;justify-content:center;gap:6px;align-self:center}
.cc-arrow-btn{width:38px;height:32px;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;line-height:1;color:var(--text);background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .12s}
.cc-arrow-btn:hover{background:var(--accent);border-color:var(--accent);color:#fff}
/* sort / reorder bar under the Selected list */
.cc-sortbar{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.cc-sortbar .btn-secondary{flex:1 1 36px;min-width:0;padding:6px 8px;font-size:12px}
.cc-sort-move{flex:0 0 auto !important;width:40px}
/* template quick-apply bar */
.cc-templatebar{display:flex;gap:8px;align-items:stretch;margin-bottom:12px}
.cc-templatebar .form-input{flex:1;font-size:12.5px}
/* keyboard focus on the active column (shift-range / Ctrl+A / Enter / Esc) */
.cc-list:focus{outline:none;box-shadow:inset 0 0 0 1px var(--accent)}
.cc-list:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--accent)}
.cc-hint{font-size:11px;color:var(--muted);margin-bottom:8px}
.cc-hint b{color:var(--text);font-weight:600}
/* dual-list inside a modal: shorter lists + let the box scroll on short screens */
.cc-modal{max-height:94vh}
.cc-modal .modal-body{overflow-y:auto}
.cc-modal .cc-list{height:280px}
/* Bouquet Templates management page */
.tpl-list{display:flex;flex-direction:column;gap:6px;max-height:440px;overflow-y:auto}
.tpl-row{display:flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:8px;background:var(--input);padding-right:4px}
.tpl-row-active{border-color:var(--accent);background:rgba(99,102,241,.10)}
.tpl-row-main{flex:1;min-width:0;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 10px;cursor:pointer}
.tpl-name{font-size:13px;font-weight:600;color:var(--text)}
.tpl-badge{font-size:10px;font-weight:700;color:var(--accent)}
.tpl-count{font-size:11px;color:var(--muted);margin-left:auto}
.tpl-del{width:30px;height:30px;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0;background:none;border:none;color:var(--muted);cursor:pointer;border-radius:6px}
.tpl-del:hover{color:var(--red);background:rgba(239,68,68,.10)}
.tpl-del svg{width:15px;height:15px}
.tpl-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:16px}
/* Touch: the delete button is a real target and sits apart from the row it deletes */
@media(pointer:coarse){.tpl-row{gap:8px}.tpl-row-main{min-height:44px}.tpl-del{width:40px;height:40px}}
/* Phones: the main header already names the page, so the heading keeps only its note */
@media(max-width:640px){.tpl-head .page-title{flex:1 1 160px;min-width:0;font-size:13px;line-height:1.35}.tpl-head-title{display:none}}
@media(max-width:640px){.cc-transfer{grid-template-columns:1fr}.cc-arrows{flex-direction:row;justify-content:center}.cc-list{height:220px}}
/* Phones: the lists are stacked, so the move arrows point down (add) and up (remove) */
@media(max-width:640px){.cc-arrow-btn{transform:rotate(90deg)}}
/* Touch: taller rows and buttons; the keyboard tips are swapped for a tap hint */
.cc-hint-touch{display:none}
@media(pointer:coarse){
  .cc-item{min-height:40px;font-size:13.5px}
  .cc-arrow-btn{width:44px;height:40px}
  .cc-sortbar .btn-secondary{min-height:40px}
  .selectall-toggle{min-height:36px}
  .cc-hint-kbd{display:none}
  .cc-hint-touch{display:inline}
}

/* ══════════════════════════════════════════════════════════════════════════
   CENTRALIZED STYLING — reference
   ---------------------------------------------------------------------------
   Tokens live in :root (top of file): colors (--red/--green/--orange/--red-soft
   /--success…), spacing (--sp-1..7), radius (--r-xs..xl,--r-pill), font-size
   (--fs-xs..2xl), shadow (--shadow-sm/md/lg).
   RULE: don't hardcode hex or px for anything semantic/repeated — use a token,
   a utility below, or a component class (.card/.btn/.form-input/.badge/.pf-* /
   .cc-*). Inline style= only for genuinely dynamic values (e.g. :style width%).
   Keep component base rules at single-class specificity so modifiers win.
   ══════════════════════════════════════════════════════════════════════════ */
/* Flex/justify (gaps existing above) */
.justify-between{justify-content:space-between}
.justify-start{justify-content:flex-start}
.justify-end{justify-content:flex-end}
.justify-around{justify-content:space-around}
.items-end{align-items:flex-end}
.items-baseline{align-items:baseline}
.flex-shrink-0{flex-shrink:0}
.flex-grow-1{flex-grow:1}
.inline-flex{display:inline-flex}
/* Margins — PIXEL-named to match the existing convention (.mb-16=16px, .mt-16=16px).
   mb-0..24, mt-2..20, ml-4 already exist above; only real gaps added here. */
.mt-0{margin-top:0}
.mr-6{margin-right:6px}
/* Type — .text-xs(10)/sm(12)/md(13) exist above as raw px; add lg to complete the scale */
.text-lg{font-size:var(--fs-lg)}
.fw-500{font-weight:500}.fw-600{font-weight:600}.fw-700{font-weight:700}
/* Semantic text colors */
.text-red{color:var(--red)}.text-green{color:var(--success)}.text-orange{color:var(--orange)}.text-accent{color:var(--accent)}

/* ── Moved out of page <style> blocks (was duplicated in license.php + updates.php) ── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Packages page (was inline <style> in packages.php) */
.drag-row{cursor:grab}.drag-row:active{cursor:grabbing}
.drag-row.dragging{opacity:.35;background:rgba(99,102,241,.08)}
.drag-row.drag-over{border-top:2px solid var(--accent) !important}
.drag-handle{color:var(--muted);font-size:16px;cursor:grab;user-select:none;padding:0 6px}
.drag-handle:hover{color:var(--text)}
.rates-bar{display:flex;gap:20px;align-items:center;background:var(--input);border:1px solid var(--border);border-radius:8px;padding:8px 16px;font-size:13px}
.rates-bar label{display:flex;align-items:center;gap:6px;font-weight:500}
.rates-bar input{width:80px;text-align:center;height:28px;font-size:13px;font-weight:600}
.toggle-sw{position:relative;width:40px;height:22px;display:inline-block}
.toggle-sw input{opacity:0;width:0;height:0}
.toggle-sw .slider{position:absolute;inset:0;background:var(--border);border-radius:22px;cursor:pointer;transition:.2s}
.toggle-sw .slider::before{content:'';position:absolute;width:16px;height:16px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.2s}
.toggle-sw input:checked+.slider{background:var(--accent)}
.toggle-sw input:checked+.slider::before{transform:translateX(18px)}
.slab-row{display:grid;grid-template-columns:1fr 20px 1fr 1fr 36px;gap:8px;align-items:center;margin-bottom:6px}
.slab-row input{height:32px;font-size:13px;text-align:center}
.slab-remove{background:none;border:none;color:var(--muted);cursor:pointer;font-size:18px;padding:0 4px}
.slab-remove:hover{color:var(--red)}
.pkg-head .toolbar-actions{gap:6px;align-items:stretch}
.pkg-rate-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pkg-rate{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500;white-space:nowrap}
.pkg-rate-input{width:80px;text-align:center;height:28px;font-size:13px;font-weight:600}
.action-row .pkg-move{display:none}
.pkg-free{display:flex;align-items:center;min-height:44px}
.pkg-checks{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin-top:12px}
.pkg-checks label{display:inline-flex;align-items:center;gap:6px;margin:0;white-space:nowrap;cursor:pointer}
.pkg-pb-row{display:flex;align-items:center;gap:6px;padding:2px 0;cursor:pointer}
.pkg-pb-row input{flex-shrink:0}
@media (pointer:coarse){
  .pkg-head .toolbar-actions{gap:8px}
  .pkg-rate-input, .slab-row input{height:36px}
  .slab-row{grid-template-columns:1fr 20px 1fr 1fr 40px;margin-bottom:8px}
  .slab-remove{width:40px;height:40px;padding:0}
  .action-row .pkg-move{display:inline-flex;align-items:center;justify-content:center;min-width:40px}
  .pkg-table .rs-acts-cell .btn-sm{min-height:40px}
  .pkg-table > thead > tr > th:first-child, .pkg-table > tbody > tr > td.drag-handle{display:none}
  .pkg-pb-row{padding:7px 0}
  .pkg-pb-clear{display:inline-block;padding:8px 4px}
}
.pkg-dur{white-space:nowrap}
@media (min-width:641px) and (max-width:900px){.pkg-table td.td-primary{min-width:170px}}
@media (min-width:901px) and (max-width:1300px) and (pointer:coarse){.pkg-table td.td-primary{min-width:150px}}
/* narrow phones: tier inputs keep room for their values (the column header already says $) */
@media (max-width:400px){
  .slab-row{grid-template-columns:1fr 12px 1fr 1.25fr 40px;gap:8px}
  .slab-row input{padding:4px 6px}
  .slab-cur{display:none}
}
@media (max-width:640px){
  .pkg-mode .btn-sm, .pkg-filters .btn-sm{min-height:36px}
  .pkg-head .page-title{display:none}
  .pkg-head .toolbar-actions{width:100%}
  .pkg-head .toolbar-actions > button{flex:1 1 auto;justify-content:center}
}
/* Inline icon before label text (was repeated `vertical-align:-2px;margin-right:4px`) */
.ico-inline{vertical-align:-2px;margin-right:4px}
/* Small uppercase caption/label (exact match of a repeated inline pattern) */
.cap-label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:600;margin-bottom:4px}

/* ═══ Reseller Clients page — overhaul components ═══════════════════════════ */
/* Status sub-view tabs (mirror the sidebar sub-menu) */
.view-tabs{display:inline-flex;gap:4px;background:var(--bg2);border:1px solid var(--border);border-radius:9px;padding:3px;flex-wrap:wrap}
.view-tabs button{appearance:none;background:transparent;border:0;color:var(--muted);font-size:12px;font-weight:600;padding:6px 11px;border-radius:6px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;line-height:1;white-space:nowrap;transition:background .12s,color .12s}
.view-tabs button:hover{color:var(--text)}
.view-tabs button.active{background:var(--accent);color:#fff}
.view-tabs .vt-count{font-size:10px;font-weight:700;background:rgba(255,255,255,.12);color:inherit;border-radius:20px;padding:1px 6px;min-width:16px;text-align:center}
.view-tabs button.active .vt-count{background:rgba(255,255,255,.22)}

/* Filter bar in the card header */
.ss-filters{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ss-filters .form-input{height:32px;font-size:12px;width:auto;padding:4px 8px}
.ss-filters select.form-input{min-width:96px}
.ss-filters .ss-search{width:160px}

/* Bulk-selection bar (x-show strips an inline display, so the flex lives here) */
.pc-bulkbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 12px;margin-bottom:10px;background:linear-gradient(rgba(99,102,241,.08),rgba(99,102,241,.08)),var(--card);border:1px solid rgba(99,102,241,.25);border-radius:8px}
.pc-bulk-count{font-size:13px;font-weight:600}
.pc-bulk-clear{margin-left:auto}
/* Phones: select-all + sort, which live in the (hidden) table header elsewhere */
.pc-cardbar{display:none}
.pc-sort{display:flex;align-items:center;gap:6px;min-width:0}
.pc-sort-lbl{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}

/* Sortable headers */
.data-table th.th-sort{cursor:pointer;user-select:none;white-space:nowrap}
.data-table th.th-sort:hover{color:var(--text)}
.sort-ar{font-size:9px;color:var(--accent);margin-left:1px}

/* Password cell */
.pw-cell{display:inline-flex;align-items:center;gap:5px}
.pw-text{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--text);letter-spacing:.5px;background:var(--bg2);padding:2px 7px;border-radius:5px;border:1px solid var(--border);min-width:78px;display:inline-block}
.pw-ic{appearance:none;background:transparent;border:0;color:var(--muted);cursor:pointer;padding:3px;border-radius:5px;display:inline-flex;line-height:0;transition:color .12s,background .12s}
.pw-ic:hover{color:var(--text);background:var(--border)}
.pw-ic.copied{color:var(--green)}

/* Expiry emphasis */
.exp-red{color:var(--red-soft)!important;font-weight:600}
.exp-amber{color:var(--orange)!important;font-weight:600}

/* Clients table: Created on one line */
.ss-clients td.pc-nowrap{white-space:nowrap}
/* Row checkboxes: the label gives cards and touch screens a 40px tap area round the box */
.pc-check{display:inline-flex;align-items:center;position:relative;z-index:0;margin:0;cursor:pointer;vertical-align:middle}
@media (max-width:1000px), (pointer:coarse){.pc-check::after{content:'';position:absolute;inset:-11px;z-index:-1}}
/* Table view: 1001-1100px (the sidebar is a drawer) and from 1280px with a mouse, from
   1366px on touch screens; cards elsewhere — up to 1000px, from 1101 to 1279px where the
   docked sidebar leaves the ten columns too little room, and on touch screens below 1366px,
   whose 40px buttons need more room still (iPads and Android tablets in landscape). Narrower
   gutters under 1536px (and on touch screens) so the columns fit (the Notes column's rules
   are with the notes styles). When they still do not, the pinned Actions column shows an
   edge while columns are hidden under it (.pc-more, set by edgeInit). */
@media (min-width:1001px) and (max-width:1100px) and (pointer:fine), (min-width:1001px) and (max-width:1100px) and (pointer:none), (min-width:1280px) and (max-width:1535px) and (pointer:fine), (min-width:1280px) and (max-width:1535px) and (pointer:none), (min-width:1366px) and (pointer:coarse){.ss-clients > thead > tr > th,.ss-clients > tbody > tr > td{padding-left:8px;padding-right:8px}}
@media (min-width:1001px) and (max-width:1100px) and (pointer:fine), (min-width:1001px) and (max-width:1100px) and (pointer:none), (min-width:1280px) and (max-width:1365px) and (pointer:fine), (min-width:1280px) and (max-width:1365px) and (pointer:none), (min-width:1366px){
  .ss-clients.table-sticky-actions > tbody > tr:nth-child(even) > td:last-child{background-image:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01))}
  .ss-clients.table-sticky-actions > tbody > tr:hover > td:last-child{background-image:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04))}
  .pc-more > .ss-clients > thead > tr > th:last-child,
  .pc-more > .ss-clients > tbody > tr > td:last-child{box-shadow:inset 1px 0 0 rgba(255,255,255,.16),-12px 0 14px -6px rgba(0,0,0,.7)}
}
/* Row ⋮ menu: the client's name heads the phone bottom sheet */
.pc-menu-title{display:none}
.pc-row-menu{overscroll-behavior:contain}

/* Create / Trial modals */
/* Error / success text sits in the sticky action row, so it is on screen with the buttons */
.pc-act-msg{flex:1 1 100%;margin:0;font-size:12px}
.pc-cred-grid{margin-bottom:12px}
.pc-regen{padding:6px 8px}
.pc-bq-list{max-height:140px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;padding:6px}
.pc-bq-opt{display:flex;align-items:center;gap:8px;padding:5px 8px;margin:0 0 2px;font-size:13px;font-weight:400;text-transform:none;letter-spacing:normal;color:var(--text);cursor:pointer;border-radius:6px}
.pc-bq-opt:hover{background:var(--border)}
.pc-bq-opt input{width:15px;height:15px;accent-color:var(--accent)}

/* ═══ Centralized dropdown menu — used across admin + portal ════════════════
   The alignment guarantee: every direct-child <svg> is forced into an identical
   fixed box (flex-shrink:0), so every label starts on the same left rail no
   matter how wide the icon glyph is. Container sets look; context sets position. */
.ui-menu{background:var(--card2);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-lg);padding:5px;display:flex;flex-direction:column;min-width:180px}
.ui-menu-item{appearance:none;box-sizing:border-box;width:100%;background:transparent;border:0;color:var(--text);font-family:inherit;font-size:13px;font-weight:500;text-align:left;text-decoration:none;padding:9px 11px;border-radius:7px;cursor:pointer;display:flex;align-items:center;gap:10px;line-height:1;min-height:38px;transition:background .12s,color .12s}
.ui-menu-item:hover{background:var(--accent);color:#fff}
.ui-menu-item > svg{width:16px;height:16px;flex-shrink:0;opacity:.9}
.ui-menu-item > span{flex:1 1 auto;min-width:0}
.ui-menu-item.danger{color:var(--red-soft)}
.ui-menu-item.danger:hover{background:var(--red);color:#fff}
.ui-menu-item.warn{color:var(--orange)}
.ui-menu-item.warn:hover{background:var(--orange);color:#fff}
.ui-menu-item.ok{color:var(--green)}
.ui-menu-item.ok:hover{background:var(--green);color:#fff}
.ui-menu-sep{height:1px;background:var(--border);margin:4px 6px}

/* ═══ Portal dashboard: Usage + Announcements 50/50 split ═══════════════════ */
.dash-split{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:stretch}
.dash-split > .card{display:flex;flex-direction:column}
.ann-list{display:flex;flex-direction:column;gap:10px;max-height:360px;overflow-y:auto;padding-right:2px}
.ann-item{padding:10px 12px;border-left:3px solid var(--accent);background:rgba(255,255,255,.03);border-radius:0 8px 8px 0}
.ann-item.lvl-warning{border-left-color:var(--orange)}
.ann-item.lvl-critical{border-left-color:var(--red)}
.ann-item-title{font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ann-item-body{font-size:12px;color:var(--muted);margin:4px 0 0;line-height:1.5}
.ann-item-date{font-size:11px;color:var(--muted);margin-top:6px;opacity:.7}
.ann-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 16px;color:var(--muted)}
@media (max-width:900px){.dash-split{grid-template-columns:1fr}.ann-list{max-height:none;overflow:visible}}   /* stacked: no nested scroll box */
/* KPI row: footer links and the Quick Actions card */
/* (the padding/negative margin pair enlarges the tap area without moving anything) */
.dash-link{display:inline-block;padding:8px 0;margin:-8px 0;text-decoration:none}
@media (pointer:coarse){.dash-link{padding:11px 0;margin:-11px 0}}
.kpi-footer .dash-link{color:var(--accent);font-size:11px}
.dash-qa-btns{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.dash-qa-btns .btn{font-size:11px}
@media (max-width:900px){.dash-qa-btns .btn{flex:1 1 auto;min-height:36px}}
@media (max-width:640px){
  .kpi-grid > .kpi-card.dash-qa{grid-column:1/-1}
  .dash-qa-btns{gap:8px}
  .dash-qa-btns .btn{flex:1 1 0;min-height:40px;font-size:13px}
}
/* Usage: three stats, then one bar per service (full name, wraps; own line on phones) */
.dash-usage-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.dash-usage-val{font-size:20px;font-weight:700}
.dash-svc-list{display:flex;flex-direction:column;gap:6px}
.dash-svc{display:grid;grid-template-columns:minmax(130px,45%) minmax(0,1fr) 44px;align-items:center;column-gap:10px;font-size:12px}
.dash-svc-name{min-width:0;overflow-wrap:anywhere;line-height:1.35}
.dash-svc-bar{height:8px;background:rgba(255,255,255,.05);border-radius:4px;overflow:hidden}
.dash-svc-bar > div{height:100%;background:var(--accent);border-radius:4px}
.dash-svc-cnt{text-align:right;font-weight:600}
@media (max-width:640px){
  .dash-svc-list{gap:10px}
  .dash-svc{grid-template-columns:minmax(0,1fr) 36px;row-gap:4px}
  .dash-svc-name{grid-column:1/-1}
}

/* Row action ⋮ button + fixed dropdown (portal Clients) — reuses .ui-menu look */
.row-menu-btn{appearance:none;background:transparent;border:0;color:var(--muted);cursor:pointer;padding:6px;border-radius:7px;display:inline-flex;line-height:0;transition:color .12s,background .12s}
.row-menu-btn:hover{color:var(--text);background:var(--border)}
.row-menu-backdrop{position:fixed;inset:0;z-index:200;background:transparent}
.row-menu{position:fixed;z-index:201;width:190px}

/* Upgrade preview line */
.upgrade-preview{display:flex;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--muted);background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin-bottom:4px}
.upgrade-preview strong{color:var(--text)}

/* Share modal fields */
.share-grp{margin-bottom:12px}
.share-grp-h{font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:700;margin-bottom:6px}
.share-fld{display:flex;align-items:center;gap:6px;margin-bottom:6px}
.share-lbl{font-size:11px;font-weight:600;color:var(--muted);width:38px;flex-shrink:0}
.share-inp{flex:1;min-width:0;background:var(--bg2);border:1px solid var(--border);border-radius:7px;color:var(--text);font-size:12px;font-family:ui-monospace,Menlo,monospace;padding:7px 9px;text-overflow:ellipsis}
.share-cp{flex-shrink:0;appearance:none;background:var(--card2);border:1px solid var(--border);color:var(--text);font-size:11px;font-weight:600;padding:7px 11px;border-radius:7px;cursor:pointer;min-height:34px;transition:background .12s,color .12s}
.share-cp:hover{background:var(--accent);color:#fff;border-color:var(--accent)}
.share-cp.copied{background:var(--green);color:#fff;border-color:var(--green)}
.share-qr-wrap{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px;background:var(--bg2);border:1px solid var(--border);border-radius:10px;margin-bottom:12px}
.share-qr-wrap #share-qr img{display:block;width:150px;height:150px;image-rendering:pixelated;border-radius:6px}

/* Edit modal top grid */
.edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.edit-grid input[disabled]{opacity:.7;cursor:not-allowed}

/* Inline row action buttons (copy / share) */
.row-acts{display:inline-flex;align-items:center;gap:2px}
.row-act-btn{background:none;border:none;color:var(--muted);cursor:pointer;padding:5px;border-radius:6px;display:inline-flex;align-items:center;transition:color .15s,background .15s}
.row-act-btn:hover{color:var(--text);background:var(--border)}
.row-act-btn.copied svg{stroke:var(--green)}

/* ═══ Airline-style range calendar (Created-date filter) ═══════════════════ */
.ss-date-wrap{position:relative}
/* A <button> gets none of the input rules: give it the look of the selects beside it */
.ss-date-btn{height:32px;font-size:12px;cursor:pointer;text-align:left;min-width:110px;white-space:nowrap;justify-content:flex-start;font-weight:400;background:var(--bg);color:var(--text);border:1px solid rgba(255,255,255,0.1);border-radius:8px}
.ss-date-btn:focus-visible{border-color:rgba(99,102,241,0.4);box-shadow:0 0 0 3px rgba(99,102,241,0.08)}
.cal-pop{position:absolute;top:100%;right:0;margin-top:6px;z-index:250;background:var(--card2);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-lg);padding:14px;display:flex;gap:14px}
.cal-presets{display:flex;flex-direction:column;gap:3px;padding-right:12px;border-right:1px solid var(--border);min-width:116px}
.cal-presets button{appearance:none;background:transparent;border:0;color:var(--muted);font-size:12px;font-weight:500;text-align:left;padding:7px 9px;border-radius:7px;cursor:pointer;white-space:nowrap;transition:background .12s,color .12s}
.cal-presets button:hover{background:var(--border);color:var(--text)}
.cal-body{display:flex;flex-direction:column;gap:10px}
.cal-months{display:flex;gap:18px}
.cal-month{width:224px}
.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;min-height:26px}
.cal-title{font-size:13px;font-weight:600;flex:1;text-align:center}
.cal-nav{appearance:none;background:transparent;border:0;color:var(--text);font-size:20px;line-height:1;width:26px;height:26px;border-radius:6px;cursor:pointer;flex-shrink:0}
.cal-nav:hover{background:var(--border)}
.cal-nav-ph{width:26px;flex-shrink:0}
.cal-dow{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px}
.cal-dow span{font-size:10px;font-weight:600;color:var(--muted);text-align:center}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}
.cal-day{appearance:none;background:transparent;border:0;color:var(--text);font-size:12px;height:32px;cursor:pointer;padding:0;border-radius:7px;transition:background .1s}
.cal-day:hover:not(:disabled):not(.cal-start):not(.cal-end){background:var(--border)}
.cal-day:disabled,.cal-day.cal-empty{visibility:hidden;cursor:default}
.cal-day.cal-today{box-shadow:inset 0 0 0 1px var(--accent)}
.cal-day.cal-inrange{background:rgba(99,102,241,.16);border-radius:0}
.cal-day.cal-start,.cal-day.cal-end{background:var(--accent);color:#fff;font-weight:700}
.cal-day.cal-start{border-radius:7px 0 0 7px}
.cal-day.cal-end{border-radius:0 7px 7px 0}
.cal-day.cal-start.cal-end{border-radius:7px}
.cal-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--border);padding-top:10px}
.cal-range-lbl{font-size:12px;color:var(--muted)}
/* Phones and short (landscape) screens: a bottom sheet over a dimmed page. Anchored to
   the button it hung off the right edge, where the page cannot scroll to it. The dim is a
   real element (.cal-backdrop), so tapping it only closes the sheet. */
.cal-backdrop{display:none}
@media (pointer:coarse){.cal-backdrop{display:block;position:fixed;inset:0;z-index:249;background:transparent}}
@media (max-width:720px), (max-height:500px){
  .cal-backdrop{display:block;position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.5)}
  .cal-pop{position:fixed;left:8px;right:8px;top:auto;bottom:8px;bottom:calc(8px + env(safe-area-inset-bottom));margin:0 auto;z-index:1001;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain;box-shadow:0 -12px 48px rgba(0,0,0,.6)}
}
/* Portrait phones: presets above one full-width month */
@media (max-width:720px) and (min-height:501px){
  .cal-pop{flex-direction:column;gap:10px;padding:12px}
  .cal-presets{flex-direction:row;flex-wrap:wrap;border-right:0;border-bottom:1px solid var(--border);padding-right:0;padding-bottom:10px;min-width:0}
  .cal-presets button{flex:1 1 auto;text-align:center;border:1px solid var(--border)}
  .cal-month{width:100%}
  .cal-day{height:40px;font-size:14px}
  .cal-dow span{font-size:11px}
  .cal-title{font-size:14px}
  .cal-foot{flex-wrap:wrap}
}
/* Short screens (phones in landscape): presets and Clear / Done on the left, the month(s)
   on the right, so the whole sheet fits without scrolling */
@media (max-height:500px){
  .cal-pop{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto 1fr;gap:10px 16px;max-width:760px;padding:12px}
  .cal-body{display:contents}
  .cal-presets{grid-column:1;grid-row:1;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0;border:0;min-width:0}
  .cal-presets button{text-align:center;border:1px solid var(--border)}
  .cal-months{grid-column:2;grid-row:1/3}
  .cal-month{flex:1 1 0;width:auto;min-width:0}
  .cal-day{height:36px}
  .cal-dow span{font-size:11px}
  .cal-foot{grid-column:1;grid-row:2;align-self:end;flex-direction:column;align-items:stretch;gap:8px}
  .cal-foot .btn-micro{flex:1 1 0;justify-content:center}
}
@media (pointer:coarse){
  .cal-nav,.cal-nav-ph{width:40px;height:40px}
  .cal-presets button{min-height:36px}
}

/* Toast (above modals, z-index:9999) */
.cc-toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:10000;background:var(--card2);border:1px solid var(--border);color:var(--text);font-size:13px;font-weight:600;padding:10px 18px;border-radius:10px;box-shadow:var(--shadow-lg)}
/* Clients page toast: centred without translateX, so it can use the full phone width and
   x-transition's scale does not knock it sideways */
.pc-toast{left:16px;right:16px;margin:0 auto;width:max-content;max-width:calc(100vw - 32px);transform:none;text-align:center;bottom:22px;bottom:calc(22px + env(safe-area-inset-bottom))}

/* Touch: comfortable targets (desktop sizes unchanged) */
@media (pointer:coarse){
  .view-tabs button{min-height:36px}
  .view-tabs .vt-count,.ss-clients .badge{font-size:11px}
  .pw-ic,.row-act-btn{min-width:40px;min-height:40px;justify-content:center;align-items:center}
  .ss-filters .form-input,.ss-date-btn{height:36px}
  .pc-bq-opt{padding:9px 8px}
}
@media (pointer:coarse), (max-width:640px){
  .btn-micro.pc-regen{min-width:40px;font-size:15px}
}
/* Tablets / small laptops (and wherever the client cards show): the bulk bar stays under the sticky header while the list scrolls */
@media (max-width:1100px), (min-width:1101px) and (max-width:1279px), (pointer:coarse) and (max-width:1365px){
  .pc-bulkbar{position:sticky;top:60px;z-index:50;box-shadow:0 8px 20px rgba(0,0,0,.35)}
}

/* Clients list as cards up to 1000px (the shared table-cards rules stop at 640px): a tablet
   in portrait or a phone in landscape sees every client's status and expiry without sideways
   scrolling (with touch-size buttons the table needs about 990px). Same card as on phones;
   from 641px the details sit in three columns, one client per row, so a sorted list still
   reads top to bottom. The same cards from 1101 to 1279px, beside the docked sidebar, and
   on touch screens below 1366px. */
@media (max-width:1000px), (min-width:1101px) and (max-width:1279px), (pointer:coarse) and (max-width:1365px){
  .table-wrap.pc-table-wrap{overflow-x:visible;background:none}
  .ss-clients.table-cards,.ss-clients.table-cards > tbody,.ss-clients.table-cards > tbody > tr,.ss-clients.table-cards > tbody > tr > td{display:block;width:100%;box-sizing:border-box}
  .ss-clients.table-cards{border-collapse:separate}
  .ss-clients.table-cards > thead{display:none}
  .ss-clients.table-cards > tbody > tr,.ss-clients.table-cards > tbody > tr:hover{position:relative;background:var(--card2);border:1px solid var(--border);border-radius:12px;padding:10px 12px 8px;margin-bottom:10px}
  .ss-clients.table-cards > tbody > tr > td{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 0;border:0;min-height:28px;text-align:right;font-size:13px;white-space:normal;word-break:break-word}
  .ss-clients.table-cards > tbody > tr > td::before{content:attr(data-label);flex:0 0 auto;max-width:45%;color:var(--muted);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;text-align:left}
  .ss-clients.table-cards > tbody > tr > td > *{max-width:100%}
  .ss-clients.table-cards > tbody > tr > td.td-primary{display:block;text-align:left;font-size:15px;padding:2px 124px 8px 30px;margin-bottom:4px;border-bottom:1px solid var(--border);min-height:0;overflow-wrap:anywhere}
  .ss-clients.table-cards > tbody > tr > td.td-primary::before,.ss-clients.table-cards > tbody > tr > td.td-actions::before,.ss-clients.table-cards > tbody > tr > td.td-check::before{content:none}
  .ss-clients.table-cards > tbody > tr > td.td-actions{position:absolute;top:6px;right:6px;width:auto;min-height:0;padding:0;justify-content:flex-end;background:transparent;box-shadow:none}
  .ss-clients.table-cards > tbody > tr > td.td-check{position:absolute;top:12px;left:12px;width:auto;min-height:0;padding:0}
  .ss-clients.table-cards .badge{font-size:11px}
  .ss-clients.table-cards > tbody > tr > td > .text-muted-sm{font-size:13px}
  .ss-clients .pc-badges{display:inline-flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}
  .ss-clients .pc-badges > .badge{margin-left:0 !important}
  .ss-clients .row-acts{gap:2px}
  .ss-clients .pw-cell{flex-wrap:wrap;justify-content:flex-end}
  /* select-all + sort, which live in the hidden table header */
  .pc-cardbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
  .pc-cardbar .selectall-toggle{min-height:40px;margin:0}
  .pc-sort select.form-input{width:auto;min-width:0;max-width:150px;height:40px;padding:4px 10px}
}
@media (min-width:641px) and (max-width:1000px), (min-width:1101px) and (max-width:1279px), (pointer:coarse) and (min-width:641px) and (max-width:1365px){
  .ss-clients.table-cards > tbody > tr,.ss-clients.table-cards > tbody > tr:hover{display:grid;grid-template-columns:minmax(176px,1fr) repeat(2,minmax(0,1fr));gap:10px 16px;padding:10px 14px 12px}
  .ss-clients.table-cards > tbody > tr > td{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px;padding:0;min-height:0;text-align:left}
  .ss-clients.table-cards > tbody > tr > td::before{max-width:none}
  .ss-clients.table-cards > tbody > tr > td.td-primary{grid-column:1/-1;margin-bottom:0;padding-top:4px}
  .ss-clients .pc-badges,.ss-clients .pw-cell{justify-content:flex-start}
}

@media (max-width:640px){
  .edit-grid{grid-template-columns:1fr}
  .view-tabs{width:100%}
  .view-tabs button{flex:1 1 auto;justify-content:center;padding:7px 6px}
  .view-tabs .vt-count{font-size:11px}
  .ss-filters{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .ss-filters .form-input,.ss-filters .ss-search,.ss-date-wrap,.ss-date-btn{width:100%;min-width:0;height:40px}
  .ss-filters select.form-input{min-width:0}
  .ss-filters .ss-date-btn{font-size:16px;padding:4px 12px}
  .ss-filters > .btn-micro{grid-column:1/-1}
  /* bulk bar: count + Clear on top, the three actions in equal columns below */
  .pc-bulkbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .pc-bulk-count{grid-column:1/3;grid-row:1}
  .pc-bulk-clear{grid-column:3;grid-row:1;margin-left:0}
  .pc-bulkbar > .btn-micro{justify-content:center;min-height:40px}
  .row-menu > .pc-menu-title{display:block;padding:8px 12px 10px;margin-bottom:4px;border-bottom:1px solid var(--border);font-size:14px;font-weight:700;color:var(--text);overflow-wrap:anywhere}
}
@media (max-width:380px){
  .pc-bulkbar{top:52px}
  .ss-clients.table-cards > tbody > tr > td.td-primary{font-size:14px}
}
/* Very narrow phones: the actions take their own row at the foot of the card */
@media (max-width:340px){
  .ss-clients.table-cards > tbody > tr > td.td-primary{padding-right:0}
  .ss-clients.table-cards.table-sticky-actions > tbody > tr > td.td-actions{position:static;padding-top:6px;margin-top:4px;border-top:1px solid var(--border)}
}

/* ═══ Mobile fixes — shell: header, login, task queue, VPN widget, profile, license, updates ═══ */
/* License page (license.php) */
.lic-table { width: 100%; border-collapse: collapse; }
.lic-table td { padding: 8px 0; font-size: 13px; vertical-align: middle; }
.lic-table td:first-child { width: 140px; padding-right: 12px; }
.lic-key { font-size: 13px; background: var(--bg-sidebar); padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.lic-key-box { padding: 10px 14px; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 6px; font-family: monospace; font-size: 13px; letter-spacing: 1px; color: var(--text-muted); overflow-wrap: anywhere; }
.lic-key-input { font-family: monospace; letter-spacing: 1px; text-transform: uppercase; }
.lic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lic-divider { border-color: var(--border); margin: 4px 0 20px; }
.lic-updates-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lic-updates-row > span { flex: 1 1 160px; min-width: 0; }
.lic-updates-row > .btn-sm { white-space: nowrap; }
.lic-foot { padding-top: 16px; }
/* Phones: label above value, so the masked key stays on one line */
@media (max-width: 480px) {
  .lic-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .lic-table tr:last-child { border-bottom: 0; }
  .lic-table td { display: block; padding: 0; border: 0; }
  .lic-table td:first-child { width: auto; padding: 0 0 4px; font-size: 12px; }
  .lic-key-input { letter-spacing: 0; padding-left: 10px; padding-right: 10px; }
}

/* Updates page (updates.php) */
.upd-pulse { animation: pulse 1.5s infinite; }
.upd-pulse-slow { animation: pulse 2s infinite; }
.upd-current { padding: 0 0 16px; }
.upd-text { font-size: 13px; }
.upd-release { background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.upd-release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.upd-release-ver { font-size: 14px; }
.upd-notes { list-style: none; font-size: 13px; color: var(--text-muted); }
.upd-notes li { position: relative; padding: 2px 0 2px 14px; overflow-wrap: anywhere; }
.upd-notes li::before { content: '•'; position: absolute; left: 2px; }
.upd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.upd-term { background: #0d1117; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.upd-term-head { background: #161b22; padding: 8px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #30363d; }
.upd-term-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.upd-term-dot-r { background: #f85149; }
.upd-term-dot-y { background: #d29922; }
.upd-term-dot-g { background: #3fb950; }
.upd-term-title { color: #8b949e; font-size: 12px; margin-left: 8px; font-family: monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd-term-state { margin-left: auto; font-size: 11px; flex-shrink: 0; }
.upd-term-running { color: #58a6ff; }
.upd-term-done { color: #3fb950; }
.upd-term-body { padding: 14px; max-height: 500px; max-height: min(500px, 70vh); overflow-y: auto; overscroll-behavior: contain; font-family: 'Fira Code', Consolas, 'Courier New', monospace; font-size: 12px; line-height: 1.6; color: #c9d1d9; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 480px) { .upd-term-body { padding: 10px; font-size: 11px; } }

/* Touch: the shared ≤640/≤380 blocks shrink .btn to 32/28px; keep these primary actions comfortable */
@media (pointer: coarse) {
  .profile-form .btn, .lic-actions .btn { min-height: 40px; }
  .profile-form .pw-btn { min-width: 40px; justify-content: center; }
}
/* ═══ end shell ═══ */


/* ═══ Mobile fixes — dashboard: dashboard, performance, logs, sync, superadmin ═══ */

/* ═══ end dashboard ═══ */


/* ═══ Mobile fixes — services: services, media servers, library, TMDB ═══ */

/* ═══ end services ═══ */


/* ═══ Mobile fixes — clients: clients, add/edit client, partners, bouquet picker ═══ */
/* client_create.php */
@media(pointer:coarse){.cc-back{min-height:40px}}
/* partners.php: the actions column is pinned while a narrow table scrolls sideways */
.pa-acts{display:flex;gap:10px;align-items:center}
.pa-acts form{margin:0}
@media(min-width:641px){
  .pa-table > tbody > tr:nth-child(even) > td:last-child{background:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01)) var(--card)}
  .pa-table > tbody > tr:hover > td:last-child{background:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04)) var(--card)}
}
table.table-cards.table-sticky-actions.pa-table > tbody > tr > td[colspan]{position:static;background:none;box-shadow:none}
@media(pointer:coarse){.pa-count{display:inline-block;min-width:28px;padding:6px 4px;text-align:center}}
@media(max-width:640px){
  .pa-table .pa-acts > *{flex:1 1 0}
  .pa-table .pa-acts .btn-micro,.pa-table .pa-name-it .btn{width:100%}
  /* pinned in the table view; in the card it is a normal full-width row (the shared card rule makes it absolute) */
  table.table-cards.table-sticky-actions.pa-table > tbody > tr > td:last-child{position:static}
}

/* ═══ end clients ═══ */


/* ═══ Mobile fixes — content: live channels, movies, series, categories, guide, templates ═══ */

/* ═══ end content ═══ */


/* ═══ Mobile fixes — vpn: VPN page ═══ */

/* ═══ end vpn ═══ */


/* ═══ Mobile fixes — resellers: resellers, reseller view, packages, bouquets, reseller billing ═══ */
/* Group modals: a 40px × on touch; Save/Cancel stay left-aligned as before */
@media (pointer:coarse){.rs-modal .modal-close{width:40px;height:40px;font-size:20px} .rs-modal .share-close-btn{min-height:40px}}
.modal-actions-sticky.rs-modal-acts{justify-content:flex-start;align-items:center}
/* Text that desktop users read in a title tooltip; touch screens have no hover */
.rs-touch-hint{display:none}
@media (pointer:coarse){.rs-touch-hint{display:block;font-size:11px;line-height:1.45;color:var(--muted);margin:8px 0 0}}
/* Swipes on an open modal scroll the modal, never the page behind it (pages set
   html.rs-lock while one is open; touch only, so desktop scrollbars don't jump) */
.rs-modal{overscroll-behavior:contain}
@media (pointer:coarse){html.rs-lock{overflow:hidden;overscroll-behavior:none}}
/* List tables: the actions cell is a row of real buttons; on phone cards it sits at the
   foot of the card with Delete at the far end, away from the other buttons */
@media (max-width:640px){
  table.table-cards > tbody > tr > td.rs-acts-cell{margin-top:6px;padding-top:10px;border-top:1px solid var(--border)}
  table.table-cards.table-sticky-actions > tbody > tr > td.rs-acts-cell:last-child{position:static}
  .rs-acts-cell .action-row{flex-wrap:wrap;gap:8px}
  .rs-acts-cell .btn-sm{min-width:64px;min-height:36px;justify-content:center}
  .rs-acts-cell .rs-del{margin-left:auto}
  .rs-acts-cell .btn-sm.pkg-move{min-width:40px;width:40px;padding:0}
}
/* Whole tab labels: the service tabs (packages, bouquets) wrap into rows instead of breaking
   names inside a tab, also beside the docked sidebar (phones keep the shared chips); the
   reseller-view strip gets compact single-line tabs on tablets */
@media (min-width:641px){
  .rs-svc-tabs{flex-wrap:wrap}
  .rs-svc-tabs .tab-link{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
}
@media (min-width:641px) and (max-width:900px){
  .rv-tabnav{padding:0 8px}
  .rv-tabnav .tabs-bar{flex-wrap:wrap}
  .rv-tabnav .tab-link{padding:8px 10px;white-space:nowrap}
}
/* Pinned actions column (table-sticky-actions + rs-pin) at every table width: the docked
   sidebar narrows these tables above 1100px too. The pinned cell is painted like its row
   (zebra, hover) and draws its edge shadow only while columns scroll under it; where scroll-
   driven animations exist, a table with nothing to scroll has an inactive timeline: no shadow */
@media (min-width:641px){
  .rs-pin > tbody > tr:nth-child(even) > td:last-child{background:linear-gradient(rgba(255,255,255,.01),rgba(255,255,255,.01)) var(--card)}
  .rs-pin > tbody > tr:hover > td:last-child{background:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04)) var(--card)}
  .rs-pin > tbody > tr.dragging > td:last-child{background:linear-gradient(rgba(99,102,241,.08),rgba(99,102,241,.08)) var(--card)}
}
@supports (animation-timeline:scroll()){
  @media (min-width:641px){
    table.rs-pin > thead > tr > th:last-child, table.rs-pin > tbody > tr > td:last-child{box-shadow:none;animation:rs-pin-edge linear both;animation-timeline:scroll(nearest inline)}
  }
}
@keyframes rs-pin-edge{0%,98%{box-shadow:-12px 0 12px -12px rgba(0,0,0,.7)}100%{box-shadow:none}}
/* 641-900px, and touch tablets up to 1300px (landscape, where touch-only buttons widen rows): the
   base th/td rules come after the shared `@media (max-width:900px){td, th{padding:8px 10px}}` and
   cancel it; the group's tables take its 10px side padding so they need less sideways scrolling */
@media (min-width:641px) and (max-width:900px), (min-width:641px) and (max-width:1300px) and (pointer:coarse){
  :is(.rs-acc-table, .rs-dom-table, .rs-ann-table, .pkg-table, .bq-table, .rb-table, .rv-log-table, .rv-cl-table) > :is(thead, tbody) > tr > :is(th, td){padding-left:10px;padding-right:10px}
}
/* Status lines inside a sticky Save/Cancel row: their own line, always in view */
.rs-acts-msg{flex:1 1 100%;font-size:12px}
/* Confirmation toasts: centred without transform (Alpine's x-transition writes an inline
   transform that would shift a translateX(-50%) toast while it fades), and they never block a
   tap on the controls under them */
.rs-toast{left:0;right:0;margin:0 auto;width:max-content;max-width:calc(100vw - 32px);transform:none;pointer-events:none}

/* Resellers → Accounts: row Actions menu (placed by ssPop; a bottom sheet on phones) */
.rs-act-btn{display:flex;align-items:center;gap:4px}
.rs-act-dots{display:none}
.rs-menu{position:absolute;top:100%;right:0;margin-top:4px;z-index:50;width:190px}
.rs-menu.ss-pop{right:auto}
.rs-menu-bd{position:fixed;inset:0;z-index:1200}
.rs-multi{height:56px}
/* the ⋮ trigger up to 720px: "Actions ▾" pushed the 6-column table past its box on landscape phones */
@media (max-width:720px){
  .rs-acc-table td.td-actions .rs-act-btn{width:40px;height:40px;min-height:40px;padding:0;justify-content:center;background:transparent;border-color:transparent;color:var(--muted)}
  .rs-act-btn .rs-act-txt, .rs-act-btn .rs-act-chev{display:none}
  .rs-act-btn .rs-act-dots{display:block}
  .rs-acc-table > thead > tr > th:last-child{width:1px !important}
}
@media (max-width:640px){
  .rs-menu.ss-sheet .ui-menu-item{min-height:44px;font-size:14px}
  .rs-multi{height:auto;min-height:112px}
}
/* Nameservers: read-only values shown as wrapping text, not inputs (phones force inputs to
   16px, which clipped the names); a tap selects the whole name */
.rs-ns-val{flex:1;min-width:0;display:flex;align-items:center;background:var(--bg);border:1px solid rgba(255,255,255,.1);border-radius:8px;color:var(--text);opacity:.6;font-family:monospace;font-size:12px;line-height:1.35;overflow-wrap:anywhere;-webkit-user-select:all;user-select:all}
.rs-ns-compact{min-height:32px;padding-top:6px !important;padding-bottom:6px !important}
.rs-ns-row{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.rs-ns-row .rs-ns-val{min-height:32px;padding:4px 10px}
.rs-ns-row .btn-sm{height:32px;font-size:11px;flex-shrink:0}
@media (pointer:coarse){.rs-ns-row .rs-ns-val{min-height:40px} .rs-ns-row .btn-sm{height:40px}}

/* Resellers → Domains: Cloudflare status forms, Add Domain row */
.rs-cf-status{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 14px;background:var(--input);border-radius:8px;font-size:12px}
.rs-cf-form{display:flex;gap:6px;align-items:center;min-width:0;max-width:100%}
.rs-cf-form input{height:28px;font-size:11px;padding:4px 8px}
.rs-cf-acct{width:280px;max-width:100%}
.rs-cf-ip{width:140px;max-width:100%}
.rs-cf-ipform{margin-left:auto}
.rs-add-dom{display:flex;gap:10px;align-items:flex-end}
.rs-add-dom-name{flex:1}
.rs-add-dom-label{flex:.5}
@media (pointer:coarse){
  .rs-cf-form input{height:36px}
  .rs-share-row .share-input, .rs-share-row .share-copy{min-height:40px !important}
}
@media (max-width:640px){
  .rs-cf-form{width:100%}
  .rs-cf-ipform{margin-left:0}
  .rs-cf-form input{flex:1 1 auto;width:auto;min-width:0}
  .rs-add-dom{flex-direction:column;align-items:stretch}
  .rs-add-dom-name, .rs-add-dom-label{flex:none}
  .rs-add-dom > .btn{justify-content:center}
}

/* Reseller Billing: custom-amount pricing fields; the Store URL can't push the card wider */
.rb-pricing{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap}
.rb-w110{width:110px}
.rb-w120{width:120px}
.rb-w150{width:150px}
.rb-w180{width:180px}
.rb-url-f{flex:1 1 100%;min-width:0}
.rb-url{opacity:.7;font-family:monospace;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:640px){
  .rb-pricing{gap:12px}
  .rb-f{flex:1 1 140px;min-width:0}
  .rb-f input{width:100%}
  .rb-url{white-space:normal;overflow-wrap:anywhere}
}
/* ═══ end resellers ═══ */


/* ═══ Mobile fixes — settings: settings, API tokens, docs ═══ */

/* ═══ end settings ═══ */


/* ═══ Mobile fixes — portal-a: portal clients, add/edit client, templates, sub-resellers ═══ */
/* Sub-resellers: row Actions menu (placed by ssPop, a bottom sheet on phones), modals */
.sr-actions{position:relative;display:inline-block}
.sr-actions-btn{display:flex;align-items:center;gap:4px}
.sr-menu{position:absolute;top:100%;z-index:50;text-align:left}
.ss-sheet.sr-menu .ui-menu-item{min-height:44px;font-size:14px}
.ss-sheet > .pc-menu-title{display:block;text-align:left;padding:8px 12px 10px;margin-bottom:4px;border-bottom:1px solid var(--border);font-size:14px;font-weight:700;color:var(--text);overflow-wrap:anywhere}
.sr-details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.sr-act-error{flex:1 1 100%;margin:0}
@media (pointer:coarse){.sr-table .badge{font-size:11px}}
/* Phone sheet: a real dim under it takes the tap that closes it (a box-shadow dim let the
   tap through to the button underneath) */
.sr-menu-backdrop{display:none}
@media (max-width:640px){
  .sr-menu-backdrop{display:block;position:fixed;inset:0;z-index:1299;background:rgba(0,0,0,.45)}
  .ss-pop.ss-sheet.sr-menu{box-shadow:0 -12px 48px rgba(0,0,0,.6);overscroll-behavior:contain}
  .sr-table.table-cards > tbody > tr > td.td-primary{padding-right:104px}
  .sr-table.table-cards > tbody > tr > td::before{font-size:11px}
  .sr-table.table-cards .badge{font-size:11px}
  .sr-details-grid > .sr-wide{grid-column:1/-1}
}

/* Create / Edit client: Save + Cancel. Stacked (≤900px) they move to a bar that stays at
   the bottom of the screen while the bouquet lists scroll past. */
.pcc-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pcc-actions-bar{display:none}
@media (max-width:900px){
  .pcc-actions{display:none}
  .pcc-actions-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;position:sticky;bottom:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:40;padding:10px 12px;background:var(--bg2);border:1px solid var(--border);border-radius:12px;box-shadow:0 -6px 24px rgba(0,0,0,.45)}
  .pcc-actions-bar > .form-error,.pcc-actions-bar > .text-green{flex:1 1 100%;margin:0}
  .pcc-actions-bar > .btn,.pcc-actions-bar > .btn-secondary{flex:1 1 0;justify-content:center;min-height:40px}
}
/* Bouquet Templates (portal): the editor is below the list when stacked */
.ptpl-below{display:none}
.ptpl-builder{scroll-margin-top:72px}
@media (max-width:900px){.ptpl-side{display:none}.ptpl-below{display:inline}}


/* ═══ end portal-a ═══ */


/* ═══ Mobile fixes — portal-b: portal dashboard, credits, buy credits, profile, settings, API, login, layout ═══ */
/* Low-credit banner (portal layout): the button drops below the text on narrow screens */
.rp-lowcredit{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;padding:10px 14px;margin-bottom:16px;border-left:3px solid var(--orange);background:rgba(245,158,11,.08);border-radius:0 8px 8px 0}
.rp-lowcredit > span{flex:1 1 200px;min-width:0;font-size:13px}
.rp-lowcredit > .btn{white-space:nowrap}

/* Transaction tables (Credits, dashboard Recent Transactions): one card per row on phones,
   type badge on top, amount in the top-right corner, description in full below */
.rp-tx .rp-tx-date,.rp-tx .badge,.rp-tx-amt,.rp-tx-bal{white-space:nowrap}
.rp-tx-amt{font-weight:600}
.rp-tx td.td-full{overflow-wrap:anywhere}
@media (max-width:760px){.rp-tx .rp-tx-date{white-space:normal}}
@media (max-width:640px){
  table.table-cards.rp-tx > tbody > tr{display:flex;flex-direction:column}
  table.table-cards.rp-tx > tbody > tr > td.td-primary{order:-1;padding-right:110px}
  table.table-cards.rp-tx > tbody > tr > td.rp-tx-amt{position:absolute;top:10px;right:12px;width:auto;min-height:0;padding:0;font-size:15px}
  table.table-cards.rp-tx > tbody > tr > td.rp-tx-amt::before{content:none}
  table.table-cards.rp-tx > tbody > tr > td.td-full{font-size:12.5px;line-height:1.45;padding-top:6px}
  .rp-tx .badge{font-size:11px}
}

/* Profile: field rows, at most 2 per row (Change Password: 3), fewer when the card is narrow,
   one on phones. The max() floor caps the column count; 2FA forms wrap */
.rp-profile-id{min-width:0;overflow-wrap:anywhere}
.rp-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(max(160px,calc((100% - 12px)/2)),1fr));gap:14px 12px;margin-bottom:14px}
.rp-fields.rp-fields-3{grid-template-columns:repeat(auto-fit,minmax(max(160px,calc((100% - 24px)/3)),1fr))}
.rp-2fa-row{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px}   /* code field + button, same height */
.rp-2fa-row .form-group{margin-bottom:0}
.rp-2fa-code{flex:1 1 160px}
@media (max-width:640px){
  .rp-fields,.rp-fields.rp-fields-3{grid-template-columns:minmax(0,1fr);row-gap:0}
  .rp-profile .twofa-backup-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Settings: checkbox rows (whole label is the tap target) and the logo preview row */
.rp-check{display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer}
.rp-check-row{display:flex;flex-wrap:wrap;gap:4px 18px;margin-bottom:16px}
.rp-logo-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-bottom:8px}
@media (pointer:coarse){.rp-check{min-height:40px}}

/* Buy Credits: equal-height pack cards with the button at the bottom; custom amount row */
.rp-packs{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.rp-pack{display:flex;flex-direction:column;min-width:0;padding:14px;border:1px solid var(--border);border-radius:10px;text-align:center;overflow-wrap:anywhere}
.rp-pack > :last-child{margin-top:auto}
.rp-custom{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}

/* Portal sign-in: the shared LOGIN PAGE rules handle the error flash and short landscape screens */
.rp-login .login-totp-input::placeholder{letter-spacing:0}
.rp-login .login-2fa-cancel{display:inline-block;padding:12px 8px;margin:-12px -8px}
@media (pointer:coarse){.rp-login .login-remember{min-height:40px;margin-bottom:16px}}
/* ═══ end portal-b ═══ */


/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE LAYER — phones and tablets (mobile audit, Oct 2026)
   Shared components only; page sections above keep their own small-screen rules.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── List tables become cards on phones ─────────────────────────────────────
   Opt in with <table class="table-cards">. Every cell shows its column name as a
   label (data-label; the layout script fills it from the table header when a cell
   has none, also for rows Alpine renders later). Optional cell markers:
     .td-primary  the row's main cell (name / username): full width, no label
     .td-actions  the actions cell (⋮ menu or buttons): pinned top-right of the card
     .td-check    the selection checkbox: pinned top-left of the card
     .td-full     a cell that should use the full card width (long content)
     .card-hide   a cell left out of the card (low-value detail)
   Cards have room for every column, so cells hidden in the narrow TABLE view
   (.col-hide-mobile / .col-hide-tablet) DO show in cards — no option goes missing
   on a phone unless a page deliberately marks it .card-hide. */
@media (max-width: 640px) {
  table.table-cards,
  table.table-cards > tbody,
  table.table-cards > tbody > tr,
  table.table-cards > tbody > tr > td { display: block; width: 100%; box-sizing: border-box; }
  table.table-cards { border-collapse: separate; }
  table.table-cards > thead { display: none; }
  table.table-cards > tbody > tr {
    position: relative;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px 8px;
    margin-bottom: 10px;
  }
  table.table-cards > tbody > tr:hover { background: var(--card2); }
  table.table-cards > tbody > tr > td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 4px 0; border: 0; min-height: 28px; text-align: right;
    font-size: 13px; white-space: normal; word-break: break-word;
  }
  table.table-cards > tbody > tr > td::before {
    content: attr(data-label);
    flex: 0 0 auto; max-width: 45%;
    color: var(--muted); font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; text-align: left;
  }
  table.table-cards > tbody > tr > td[data-label=""]::before { content: none; }
  table.table-cards > tbody > tr > td.card-hide { display: none; }
  table.table-cards > tbody > tr > td > * { max-width: 100%; }
  table.table-cards > tbody > tr > td.td-primary {
    display: block; text-align: left; font-size: 14px;
    padding: 2px 46px 8px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--border); min-height: 0;
  }
  table.table-cards > tbody > tr > td.td-primary::before,
  table.table-cards > tbody > tr > td.td-actions::before,
  table.table-cards > tbody > tr > td.td-check::before { content: none; }
  table.table-cards > tbody > tr > td.td-full { display: block; text-align: left; }
  table.table-cards > tbody > tr > td.td-full::before { display: block; margin-bottom: 4px; max-width: none; }
  table.table-cards > tbody > tr > td.td-actions {
    position: absolute; top: 6px; right: 6px;
    width: auto; min-height: 0; padding: 0; justify-content: flex-end;
  }
  table.table-cards > tbody > tr > td.td-actions .row-menu-btn { padding: 8px; }
  table.table-cards > tbody > tr > td.td-check {
    position: absolute; top: 12px; left: 12px; width: auto; min-height: 0; padding: 0;
  }
  table.table-cards > tbody > tr:has(> td.td-check) > td.td-primary { padding-left: 30px; }
  /* Empty-state / message rows spanning the table */
  table.table-cards > tbody > tr > td[colspan] { display: block; text-align: center; }
  table.table-cards > tbody > tr > td[colspan]::before { content: none; }
  table.table-cards > tbody > tr:has(> td[colspan]:only-child) { background: transparent; border-style: dashed; }
  /* The card list never needs sideways scrolling */
  .table-wrap:has(> table.table-cards) { overflow-x: visible; background: none; }
}

/* ── Tables that stay tables: show that they scroll sideways ─────────────── */
@media (max-width: 900px) {
  .table-wrap {
    background:
      linear-gradient(to right, var(--card) 30%, rgba(28,32,48,0)) left center / 32px 100% no-repeat local,
      linear-gradient(to left,  var(--card) 30%, rgba(28,32,48,0)) right center / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%,    rgba(0,0,0,.55), rgba(0,0,0,0)) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.55), rgba(0,0,0,0)) right center / 12px 100% no-repeat scroll;
  }
}

/* ── Modals fit the screen; their buttons stay reachable ─────────────────── */
@media (max-width: 640px) {
  .modal-backdrop { padding: 8px; align-items: center; }
  .modal-box {
    width: 100% !important; max-width: 100% !important;
    max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .modal-header { padding: 12px 14px; border-radius: 14px 14px 0 0; }
  .modal-body { padding: 14px; }
  .modal-footer {
    position: sticky; bottom: 0; z-index: 1;
    background: var(--card); padding: 10px 14px;
    flex-wrap: wrap; gap: 8px;
  }
  .modal-footer > .btn, .modal-footer > button { flex: 1 1 auto; justify-content: center; }
}

/* ── Row action menus open as a bottom sheet on phones ───────────────────── */
@media (max-width: 640px) {
  .row-menu.ui-menu {
    left: 8px !important; right: 8px !important;
    top: auto !important; bottom: 8px !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-height: 75vh; max-height: 75dvh; overflow-y: auto;
    z-index: 1001; border-radius: 14px; padding: 6px;
  }
  .row-menu-backdrop { background: rgba(0,0,0,.5); z-index: 1000; }
  .row-menu .ui-menu-item { min-height: 44px; font-size: 14px; }
}
.ui-menu { max-height: calc(100vh - 16px); overflow-y: auto; }

/* ── Filter bars: two compact columns on phones instead of one long stack ── */
@media (max-width: 640px) {
  .form-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end; }
  .form-filter > * { min-width: 0; width: auto; }
  .form-filter .form-group { margin: 0; }
  .form-filter input, .form-filter select { width: 100%; min-width: 0; }
  .form-filter > div:has(> .btn-filter) { display: flex; gap: 8px; }
  .form-filter > div:has(> .btn-filter) .btn-filter { width: 100%; justify-content: center; }
}

/* ── Card headers with several actions wrap instead of overflowing ───────── */
@media (max-width: 640px) {
  .card-header-actions { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .card-header-actions input[type=file] { max-width: 100%; }
}

/* ── Pop-ups placed by ss-ui.js (ssPop.place): never clipped by a scroll box ─ */
.ss-pop { position: fixed !important; margin: 0 !important; z-index: 1300 !important; max-height: calc(100vh - 16px); overflow-y: auto; }
@media (max-width: 640px) {
  .ss-pop.ss-sheet {
    left: 8px !important; right: 8px !important; top: auto !important;
    bottom: 8px !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    width: auto !important; min-width: 0 !important; max-width: none !important;
    max-height: 70vh; max-height: 70dvh;
    border-radius: 14px; box-shadow: 0 -12px 48px rgba(0,0,0,.6);
  }
  .ss-pop.ss-sheet .vpn-sel-options { max-height: 50vh; max-height: 50dvh; }
  .ss-pop.ss-sheet .vpn-sel-opt { padding: 12px 14px; font-size: 14px; }
}

/* ── Touch screens: comfortable tap targets ───────────────────────────────── */
@media (pointer: coarse) {
  .btn-sm, .btn-tiny, .btn-micro, .btn-micro-narrow, .btn-xs,
  .tab-btn, .page-link, .cl-page, .vpn-sel-btn { min-height: 36px; }
  .btn-micro, .btn-micro-narrow, .btn-tiny { font-size: 11px; padding-left: 10px; padding-right: 10px; }
  .row-menu-btn { min-width: 40px; min-height: 40px; justify-content: center; align-items: center; }
  input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
  .action-row, .action-btns { gap: 8px; }
}

/* ── Phones: text fields at 16px so iOS Safari does not zoom in on focus ──── */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
  select, textarea, textarea.share-input { font-size: 16px !important; }
}

/* ── Icon-only buttons: the base button padding must not squash the icon ─── */
.icon-btn { padding: 0 !important; min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn > svg { flex-shrink: 0; }
@media (pointer: coarse) { .icon-btn { min-width: 40px; min-height: 40px; } }

/* ── Modals: close button never shrinks; long names wrap; no sideways drag ── */
.modal-close { flex-shrink: 0; }
.modal-header h3 { min-width: 0; overflow-wrap: anywhere; padding-right: 8px; }
.modal-box { overflow-x: hidden; }
.modal-body { overflow-wrap: anywhere; }
/* Buttons placed at the end of a modal form: keep them on screen while the form scrolls */
.modal-actions-sticky {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--card); border-top: 1px solid var(--border);
  margin-top: 16px; padding: 12px 0 4px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
@media (max-width: 640px) {
  .modal-actions-sticky > .btn, .modal-actions-sticky > button { flex: 1 1 auto; }
}
/* Two-column field rows in modals: one even rhythm, stacked or side by side */
.modal-body .form-row { gap: 20px 16px; margin-bottom: 20px; }
.modal-body .form-row > .form-group { margin-bottom: 0; }

/* ── Links: readable accent on dark cards when a page sets no colour ──────── */
a { color: var(--accent); }

/* ── KPI rows on phones: three per row, labels readable (2 lines allowed) ─── */
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .kpi-card { padding: 10px 8px 12px; }
  .kpi-label { font-size: 10px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
  .kpi-value { font-size: 16px; }
}
@media (max-width: 380px) {
  .kpi-label { font-size: 10px; }
  .kpi-value { font-size: 14px; }
}

/* ── Tab bars on phones: full rows of comfortable tabs ────────────────────── */
@media (max-width: 640px) {
  .tab-bar > .tab-btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Tablets in landscape / small laptops (≤1100px): the sidebar is the slide-in
   drawer here too. Docked, it left a 1024px screen ~760px of content, so wide
   tables and fixed grids spilled over and their right-hand controls were cut off. */
@media (max-width: 1100px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.6); }
  .main-wrap { margin-left: 0; width: 100%; max-width: 100vw; }
}

/* ── Wide tables that stay tables: keep the actions column in view while the
   rest scrolls sideways. Opt in with <table class="table-sticky-actions">.
   The pinned cell takes its row's zebra/hover tint, and shows an edge shade only
   while columns are scrolled under it (ss-ui.js marks the .table-wrap; box-shadow
   is not painted on cells of a border-collapse table, so the shade is a gradient). */
.table-sticky-actions > thead > tr > th:last-child,
.table-sticky-actions > tbody > tr > td:last-child {
  position: sticky; right: 0; z-index: 1;
  background-color: var(--card);
  background-image: var(--pin-edge, none), var(--pin-tint, none);
  box-shadow: none;
}
.table-sticky-actions > tbody > tr:nth-child(even) > td:last-child { --pin-tint: linear-gradient(rgba(255,255,255,.01), rgba(255,255,255,.01)); }
.table-sticky-actions > tbody > tr:hover > td:last-child { --pin-tint: linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)); }
.table-sticky-actions > tbody > tr.dragging > td:last-child { --pin-tint: linear-gradient(rgba(99,102,241,.08), rgba(99,102,241,.08)); }
.table-wrap.ss-scrolls:not(.ss-at-end) .table-sticky-actions > thead > tr > th:last-child,
.table-wrap.ss-scrolls:not(.ss-at-end) .table-sticky-actions > tbody > tr > td:last-child { --pin-edge: linear-gradient(to right, rgba(0,0,0,.42), rgba(0,0,0,0) 12px); }
/* An empty-state row spanning the table is never pinned */
.table-sticky-actions > tbody > tr > td[colspan] { position: static; background: none; }
@media (max-width: 640px) {
  /* cards: only a .td-actions cell is pinned (top-right); any other last cell stays in the card */
  table.table-cards.table-sticky-actions > tbody > tr > td:last-child { position: static; background: none; }
  table.table-cards.table-sticky-actions > tbody > tr > td.td-actions:last-child { position: absolute; }
}

/* ── Drawer (≤1100px): out of the tab order while closed, a close button inside,
   and the page behind does not scroll while it is open (ss-ui.js sets the class). */
.sidebar-close { display: none; }
@media (max-width: 1100px) {
  .sidebar { visibility: hidden; transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s linear .3s; }
  .sidebar.open { visibility: visible; transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s; }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar-close {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 40px; height: 40px; margin-left: auto; padding: 0;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
  }
  .sidebar-close:hover { background: rgba(255,255,255,0.08); }
}
/* touch only: hiding a mouse user's scrollbar would shift the page sideways */
@media (max-width: 1100px) and (pointer: coarse) { html.ss-drawer-open { overflow: hidden; overscroll-behavior: none; } }
@media (min-width: 1101px) { #sidebar-overlay { display: none !important; } }

/* ── Running-task toasts on phones: full width at the bottom, and below the
   drawer and modals so they never cover a Save button or the drawer's buttons. */
@media (max-width: 640px) {
  #tq-toast-container {
    left: 8px; right: 8px; bottom: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    max-width: none; z-index: 990;
  }
  .tq-close { min-width: 32px; min-height: 32px; font-size: 20px; }
}

/* ── Underline tab strips (.tabs-bar): on phones every tab stays visible — they
   wrap into a set of chips instead of running off the right edge. */
@media (max-width: 640px) {
  .tabs-bar { flex-wrap: wrap; gap: 6px; border-bottom: 0; padding-bottom: 2px; }
  .tabs-bar .tab-link {
    display: inline-flex; align-items: center; min-height: 36px; max-width: 100%;
    padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--card); overflow-wrap: anywhere; line-height: 1.3;
  }
  .tabs-bar .tab-link.active { border-color: var(--accent); background: rgba(99,102,241,.14); }
}

/* ── Two-card editors (Details | Bouquets, Saved templates | Builder): side by
   side only when both fit, one column otherwise. Pages may set the ratio with
   style="--pf-split: minmax(260px,.9fr) minmax(340px,1.4fr)". */
.pf-cards.pf-split { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 901px) {
  .pf-cards.pf-split { grid-template-columns: var(--pf-split, minmax(300px, 1fr) minmax(340px, 1.3fr)); }
}

/* ── KPI rows on phones: keep the footer line (counts, "View history →" links) ─ */
@media (max-width: 640px) {
  .kpi-footer { display: block; font-size: 10px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
}

/* ── Modal header: the title takes the room, the × keeps its size ────────── */
.modal-header { gap: 12px; }
.modal-header h3 { flex: 1 1 auto; }

/* ── Small layout utilities for page toolbars and filter chips ────────────────
   .page-toolbar   title/filters on the left, actions on the right; wraps to two
                   lines instead of pushing buttons off-screen
   .toolbar-actions a wrapping group of buttons
   .chip-row       a wrapping row of filter chips / small buttons */
.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.page-toolbar > * { min-width: 0; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ── Bottom sheets dim the page behind them ──────────────────────────────── */
@media (max-width: 640px) {
  .ss-pop.ss-sheet { box-shadow: 0 0 0 100vmax rgba(0,0,0,.45), 0 -12px 48px rgba(0,0,0,.6); }
}

/* ── Modals taller than the visible screen stay reachable ───────────────────
   vh is measured with the phone browser's toolbars hidden, so a 90vh box could
   push its title/× and Save buttons off-screen. dvh sizes it to what is visible;
   the backdrop scrolls and auto margins keep the top in view when it is taller. */
.modal-backdrop { overflow-y: auto; overscroll-behavior: contain; }
.modal-box { margin: auto; max-height: 90vh; max-height: 90dvh; overscroll-behavior: contain; }
@media (max-width: 640px) {
  .modal-box { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
}
.mv-detail-overlay, .sv-detail-overlay, .sa-overlay, .uc-cat-modal-bg, .uc-modal-overlay { overscroll-behavior: contain; }
/* While a modal or drawer is open on a phone or tablet the page behind stays put
   (ss-ui.js sets the class; swipes on the modal no longer scroll the list or
   trigger pull-to-refresh). */
@media (pointer: coarse) {
  html.ss-modal-open { overflow: hidden; overscroll-behavior: none; }
}

/* ── Copy/saved toasts: full message on one or two lines, not half the screen ─ */
.cc-toast {
  left: 16px; right: 16px; margin: 0 auto; transform: none;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
  bottom: 22px; bottom: calc(22px + env(safe-area-inset-bottom));
}

/* ── Phones: no text below 11px (badges and labels used to drop to 8–10px) ─── */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .badge, .badge-xs, .badge-xxs, .text-xs, .kpi-label, .kpi-footer, .share-label, .share-grp-h,
  .tpl-badge, .cl-kpi-label, .lv-detail-section-title, .uc-detail-section-title { font-size: 11px; }
  .badge { padding: 2px 7px; }
  table.table-cards > tbody > tr > td::before { font-size: 11px; }
}
@media (pointer: coarse) {
  .btn, .btn-secondary, .btn-danger, .btn-warn, .btn-success { min-height: 36px; }
}

/* ── Tap-to-read tooltips on touch screens (ss-ui.js shows an element's title) ── */
.ss-tip {
  position: fixed; z-index: 1500; max-width: min(320px, calc(100vw - 16px));
  background: var(--card2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 8px 10px; font-size: 12px; line-height: 1.45;
  white-space: pre-line; overflow-wrap: anywhere; pointer-events: none;
}

/* ── Tap-catcher behind a pop-up placed by ssPop (touch screens; ss-ui.js) ─── */
.ss-pop-backdrop { position: fixed; inset: 0; z-index: 1299; background: transparent; -webkit-tap-highlight-color: transparent; }

/* ── Follow-ups from the page groups (shared components) ─────────────────── */
/* Modals sit above the docked sidebar, which used to stay lit and clickable behind them */
.modal-backdrop { z-index: 1150; }
/* Tab / Next keeps the focused field clear of the sticky modal header and Save bar */
.modal-box { scroll-padding-top: 72px; }
.modal-box:has(.modal-actions-sticky) { scroll-padding-bottom: 76px; }
/* Touch screens: icon-only and small shared controls */
@media (pointer: coarse) {
  .modal-close { width: 40px; height: 40px; min-width: 40px; font-size: 20px; }
  .pw-btn { min-width: 40px; justify-content: center; }
  .page-link, .cl-page { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; }
  .share-cp, .share-close-btn { min-height: 40px; }
  details > summary { padding: 6px 0; }
}
details summary { font-size: max(12px, .85em); }
/* VPN picker: long names wrap instead of being cut mid-word; the live tick stays */
.vpn-sel-opt { white-space: normal; overflow-wrap: anywhere; }
.vpn-sel-opt > span:first-child { min-width: 0; }
.vpn-live-indicator { flex-shrink: 0; }
/* Tab strips up to 1100px: whole tabs wrap instead of breaking their labels */
@media (max-width: 1100px) {
  .tabs-bar { flex-wrap: wrap; }
  .tabs-bar .tab-link { white-space: nowrap; }
}
@media (max-width: 640px) { .tabs-bar .tab-link { white-space: normal; } }
/* Cards: a cell marked card-hide never shows, even when it is also td-full */
@media (max-width: 640px) { table.table-cards > tbody > tr > td.card-hide { display: none !important; } }
.mt-18 { margin-top: 18px; }
/* "form-group mb-0" kept the 18px .form-group margin (same specificity, later rule):
   rows of fields ended up unevenly spaced and inline Save buttons sat low */
.form-group.mb-0 { margin-bottom: 0; }

/* ── Tap-catchers for small pop-ups (account menu, sidebar Task Queue / VPN status):
   on touch screens the tap that closes the pop-up must not also press what is under it */
.ss-catcher { display: none; }
@media (pointer: coarse) {
  .ss-catcher { display: block; position: fixed; inset: 0; background: transparent; -webkit-tap-highlight-color: transparent; }
  .ss-catcher-hdr { z-index: 99; }      /* below the sticky header (100), which holds the menu */
  .ss-catcher-tq  { z-index: 9999; }    /* just below .tq-popup */
  .ss-catcher-vpn { z-index: 299; }     /* just below .vpn-sidebar-popup */
}
/* "card mb-0" kept the card's margin too (cards in grids already have their gap) */
.card.mb-0 { margin-bottom: 0; }
/* a dialog box that takes focus when it opens draws no outline (its fields do) */
.ss-focus-box:focus { outline: none; }

/* ── Client notes (Notes column on the admin and portal Clients lists) ────── */
.note-cell { display: flex; align-items: center; gap: 2px; min-width: 0; }
.note-text {
  flex: 1 1 auto; min-width: 0; max-width: 220px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  white-space: pre-line; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.35;
}
.note-btns { display: flex; flex-shrink: 0; gap: 2px; }
.note-btn { flex-shrink: 0; background: transparent; border: 0; color: var(--muted); border-radius: 6px; }
/* Admin table (wide, it scrolls sideways anyway): room for a readable note */
@media (min-width: 641px) { td.cl-note-cell { min-width: 150px; } }
/* Portal table (1001-1100px and from 1280px; cards in between): every column still fits.
   The note asks for about a sixth of the width, Service keeps 130px so long service names
   do not stretch the rows, and up to 1535px Created steps aside — the date is in the cards,
   the export and the date filter. */
@media (min-width:1001px) and (max-width:1100px) and (pointer:fine), (min-width:1001px) and (max-width:1100px) and (pointer:none), (min-width:1280px) and (max-width:1365px) and (pointer:fine), (min-width:1280px) and (max-width:1365px) and (pointer:none), (min-width:1366px) {
  .ss-clients td.pc-note-cell { width: 14%; }
  .ss-clients td.pc-col-service { min-width: 130px; }
}
@media (min-width: 1001px) and (max-width: 1100px) and (pointer: fine), (min-width: 1001px) and (max-width: 1100px) and (pointer: none), (min-width: 1280px) and (max-width: 1535px) and (pointer: fine), (min-width: 1280px) and (max-width: 1535px) and (pointer: none), (min-width: 1366px) and (max-width: 1535px) and (pointer: coarse) {
  .ss-clients td.pc-note-cell { width: 16%; }
  .ss-clients .pc-col-created { display: none; }
}
@media (min-width: 1001px) and (max-width: 1100px) and (pointer: fine), (min-width: 1001px) and (max-width: 1100px) and (pointer: none), (min-width: 1280px) and (max-width: 1535px) and (pointer: fine), (min-width: 1280px) and (max-width: 1535px) and (pointer: none) {
  .ss-clients td.pc-note-cell .note-btn.icon-btn { width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; }
}
/* Touch screens in the table view (a tablet in landscape): two 40px buttons would leave the
   note no room. The pencil stays; a tap on a cut-off note shows all of it, where it can be
   selected and copied. */
@media (min-width: 1366px) and (pointer: coarse) { .ss-clients td.pc-note-cell .note-copy { display: none; } }
@media (pointer: fine) { .note-btn.icon-btn { min-width: 26px; min-height: 26px; } }
.note-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.note-btn.note-copied, .note-btn.copied { color: var(--green); }
/* Portal cards on tablets (and beside the docked sidebar): the note has a row of its own at the foot of the card */
@media (min-width: 641px) and (max-width: 1000px), (min-width: 1101px) and (max-width: 1279px), (pointer: coarse) and (min-width: 641px) and (max-width: 1365px) {
  .ss-clients.table-cards > tbody > tr > td.pc-note-cell { grid-column: 1 / -1; order: 1; }
  .ss-clients.table-cards > tbody > tr > td.pc-note-cell > .note-cell { width: 100%; }
}
/* cards: the note gets the full width and up to four lines */
@media (max-width:1000px), (min-width:1101px) and (max-width:1279px), (pointer:coarse) and (max-width:1365px) {
  .ss-clients.table-cards > tbody > tr > td.pc-note-cell .note-text { max-width: none; -webkit-line-clamp: 4; font-size: 13px; }
}
@media (max-width: 640px) {
  table.table-cards > tbody > tr > td.cl-note-cell .note-text { max-width: none; -webkit-line-clamp: 4; font-size: 13px; }
}
/* Create / edit forms: a short note box, and the line that says what the panel creates */
textarea.cc-note-input { min-height: 58px; resize: vertical; line-height: 1.4; }
.cc-field-hint { font-size: 12px; margin-top: 5px; line-height: 1.4; }
.cc-cred-hint { font-size: 12px; line-height: 1.4; margin: 6px 0 12px; }
.pc-note-field { margin-bottom: 12px; }
.input-btn.is-on { color: var(--accent); border-color: var(--accent); }
