:root {
  --background: #0f0f0f;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-hover: #222222;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --text: #ffffff;
  --text-secondary: #a1a1aa;
  --ok: #3ddc97;
  --warn: #f5c84c;
  --danger: #f87171;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --ease: 160ms ease;

  /* aliases legado */
  --bg: var(--background);
  --bg-elev: var(--surface);
  --bg-hover: var(--surface-hover);
  --line: var(--border);
  --muted: var(--text-secondary);
  --red: var(--primary);
  --red-dim: var(--primary-hover);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.yt {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 40px; height: 40px; opacity: 0.55; }

/* —— Shell —— */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.main-col { min-width: 0; background: var(--background); display: flex; flex-direction: column; min-height: 100vh; }

/* —— Sidebar —— */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 10px 16px;
  z-index: 30;
}
.side-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  border-radius: var(--radius-sm);
}
.brand-mark {
  width: 28px;
  height: 20px;
  border-radius: 6px;
  background: var(--primary);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px 0 4px 9px;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent #fff;
  width: 0;
  height: 0;
}
.side-brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-close { display: none; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  padding: 8px 12px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background var(--ease), color var(--ease);
}
.side-link:hover { background: var(--surface-hover); color: #fff; }
.side-link.is-active {
  background: var(--surface);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}
.side-link .side-ico { color: var(--text-secondary); }
.side-link.is-active .side-ico,
.side-link:hover .side-ico { color: var(--text); }

.side-foot {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 25;
}

/* —— Topbar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(12px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.top-brand { font-weight: 700; font-size: 1rem; }
.mobile-only { display: none !important; }
.desktop-only { display: inline-flex; }

.global-search {
  position: relative;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.global-search .search-ico {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  pointer-events: none;
}
.global-search input {
  width: 100%;
  margin: 0;
  padding: 10px 40px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--ease), background var(--ease);
}
.global-search input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: none;
}
.search-hint {
  position: absolute;
  right: 12px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); }

.profile-menu { position: relative; }
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.profile-trigger:hover { background: var(--surface-hover); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3f3f46, #27272a);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.profile-meta { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.profile-name { font-size: 0.82rem; font-weight: 600; }
.profile-role { font-size: 0.7rem; color: var(--text-secondary); }

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
  animation: popIn 140ms ease;
}
.dropdown-panel.is-fixed {
  position: fixed;
  right: auto;
  z-index: 90;
  max-height: min(70vh, 420px);
  overflow-y: auto;
}
.dropdown-panel a,
.dropdown-panel button.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.dropdown-panel a:hover,
.dropdown-panel button.menu-item:hover { background: var(--surface-hover); }
.dropdown-panel .danger { color: var(--danger); }
.dropdown-head {
  padding: 10px 12px 8px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-head small {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* —— Content —— */
.wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 28px 72px;
  flex: 1;
}
.wrap-public { padding-top: 40px; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.page-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-desc {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 560px;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.muted { color: var(--text-secondary); }
.hero-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dash-greeting {
  margin-bottom: 22px;
}
.dash-greeting h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.dash-greeting p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}
.stat-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}
.stat-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
  color: var(--text);
}
.stat-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.12);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.stat-card-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}
.stat-card-value {
  font-size: 1.85rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* legado .stat */
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}
.grid.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}
.stat b {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: start;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color var(--ease), background var(--ease);
}
.quick-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: #fff;
}
.quick-action .qa-ico {
  color: var(--primary);
}

.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  flex: 0 0 auto;
}
.activity-body { min-width: 0; }
.activity-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}
.activity-body span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* —— Forms —— */
label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 12px 0 6px;
  font-weight: 600;
}
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
button:hover, .btn:hover { background: var(--primary-hover); color: #fff; }
.btn-sm { margin-top: 0; padding: 8px 12px; font-size: 0.85rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn.btn-ghost { margin-top: 0; text-decoration: none; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar .search-field {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.toolbar .search-field .search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.toolbar .search-field input {
  padding-left: 38px;
  margin: 0;
  border-radius: 999px;
}
.toolbar select {
  width: auto;
  min-width: 140px;
  margin: 0;
  border-radius: 999px;
}
.toolbar button { margin-top: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.filter-chip {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #121212;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.filter-chip:hover { color: #fff; border-color: #555; }
.filter-chip.is-active {
  color: #fff;
  border-color: var(--primary);
  background: rgba(220, 38, 38, 0.12);
}

/* —— Tables —— */
.table-wrap { overflow-x: auto; }
table.data-table,
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
  background: transparent;
}
tr:hover td { background: rgba(255,255,255,0.02); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  background: #2a2a2a;
  color: var(--text);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.status-ok { background: rgba(61, 220, 151, 0.12); color: var(--ok); }
.status-warn { background: rgba(245, 200, 76, 0.12); color: var(--warn); }
.status-danger { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.status-neutral { background: #2a2a2a; color: var(--text-secondary); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #303030;
  color: var(--text);
}
.badge.ok { background: rgba(61, 220, 151, 0.15); color: var(--ok); }
.badge.warn { background: rgba(245, 200, 76, 0.15); color: var(--warn); }
.badge.danger { background: rgba(255, 107, 122, 0.16); color: var(--danger); }

.row-actions { position: relative; display: flex; justify-content: flex-end; }
.row-actions .icon-btn { width: 34px; height: 34px; }
.row-actions .dropdown-panel { min-width: 180px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.actions button { margin-top: 0; }
.actions input[type=number] { width: 72px; margin: 0; padding: 8px; }
.actions.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.inline-form input[type=number],
.inline-form input[type=password] {
  width: 110px;
  margin: 0;
  padding: 8px 10px;
}
.inline-form button { margin-top: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.form-grid .form-span { grid-column: 1 / -1; }

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.03em;
}
[data-copy] { cursor: pointer; }
[data-copy].copied { color: var(--ok); }

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.quick-links a {
  display: block;
  padding: 16px;
  border-radius: 12px;
  background: #121212;
  border: 1px solid var(--border);
  font-weight: 600;
}
.quick-links a:hover { border-color: #555; background: var(--surface-hover); }
.quick-links span {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Empty / toast / modal */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-state h3 { margin: 12px 0 6px; font-size: 1.1rem; }
.empty-state p { margin: 0; color: var(--text-secondary); max-width: 360px; margin-inline: auto; }
.empty-actions { margin-top: 18px; }
.empty-actions .btn { margin-top: 0; }

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: popIn 160ms ease;
}
.toast-ok { border-color: rgba(61, 220, 151, 0.35); }
.toast-error { border-color: rgba(248, 113, 113, 0.4); }
.toast-msg { flex: 1; font-size: 0.9rem; font-weight: 500; }
.toast-close {
  margin: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.flash-ok { background: rgba(61, 220, 151, 0.1); }
.flash-error { background: rgba(255, 107, 122, 0.12); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 140ms ease;
}
.modal-backdrop[hidden] {
  display: none !important;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  animation: popIn 160ms ease;
}
.modal-lg { width: min(640px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal-foot .btn { margin-top: 0; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 70;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 75;
  padding: 20px;
  overflow-y: auto;
  animation: slideIn 180ms ease;
}
@keyframes slideIn {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(220, 38, 38, 0.16), transparent 55%),
    var(--background);
}
.login-box { width: min(420px, 94vw); }
.login-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #2a1f00;
  border-bottom: 1px solid #f5c84c;
  color: #ffe6a8;
  font-weight: 600;
  font-size: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.impersonation-bar strong { color: #fff; }
.impersonation-form { margin: 0; }
.impersonation-form .btn { margin: 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: 0.5; }

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.summary-chip {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.summary-chip strong { font-weight: 700; margin-right: 4px; }

.search-results-group { margin-bottom: 20px; }
.search-results-group h2 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-hit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 8px;
  transition: background var(--ease);
}
.search-hit:hover { background: var(--surface-hover); color: #fff; }
.search-hit span { color: var(--text-secondary); font-size: 0.8rem; }

.upload-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  background: var(--surface-2);
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.upload-drop strong { display: block; color: var(--text); margin-bottom: 6px; }

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.settings-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.settings-nav a.is-active {
  color: #fff;
  border-color: var(--primary);
  background: rgba(220, 38, 38, 0.12);
}

.wa-preview,
.wa-preview-card .wa-preview {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  margin: 0;
  cursor: pointer;
  max-height: 360px;
  overflow: auto;
}
.wa-preview:hover,
.wa-preview.copied {
  border-color: rgba(61, 220, 151, 0.45);
}

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.pkg-card {
  margin: 0;
  padding: 20px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pkg-credits {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.pkg-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.pkg-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.pkg-name { margin: 4px 0 12px; font-size: 0.85rem; }
.pkg-card .btn { margin-top: auto; width: 100%; }

.mp-settings-form label { display: block; margin-top: 12px; }
.mp-settings-form textarea {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.check-row input { width: auto; margin: 0; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-columns { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .search-hint { display: none; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow);
  }
  .app-shell.sidebar-open .sidebar { transform: none; }
  .sidebar-backdrop { display: block; }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-backdrop[hidden] { display: none !important; }
  .sidebar-close { display: inline-flex; }

  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 12px;
  }
  .global-search input { padding-left: 38px; font-size: 0.9rem; }
  .wrap { padding: 18px 16px 56px; }
  .stats-grid, .grid, .grid.stats-4 { grid-template-columns: 1fr; }
  .page-title { font-size: 1.4rem; }
}

/* Captcha matemático próprio */
.math-captcha {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.18);
}
.math-captcha label {
  display: block;
  margin: 0 0 8px;
  font-size: .92rem;
}
.math-captcha input[name="_captcha_answer"] {
  max-width: 140px;
  letter-spacing: .04em;
  font-weight: 600;
}
.math-captcha-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.repeat-editor {
  margin: 10px 0 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(20, 184, 166, 0.06));
}
.repeat-editor--credits {
  border-color: rgba(245, 158, 11, 0.35);
}
.repeat-editor__head,
.repeat-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(90px, 0.6fr) minmax(110px, 0.7fr) auto;
  gap: 8px;
  align-items: center;
}
.repeat-editor__head {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93c5fd;
}
.repeat-editor--credits .repeat-editor__head { color: #fcd34d; }
.repeat-row { margin-bottom: 8px; }
.repeat-row input {
  margin: 0;
}
.repeat-add { margin-top: 4px; }
@media (max-width: 720px) {
  .repeat-editor__head { display: none; }
  .repeat-row { grid-template-columns: 1fr; }
}

.trial-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.trial-filter .search-field { flex: 1; }
.trial-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 22px;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(220, 38, 38, 0.18), transparent 55%),
    var(--surface);
}
.trial-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.trial-hero h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}
.trial-hero p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 62ch;
}
.trial-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.trial-metric {
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}
.trial-metric strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}
.trial-metric span {
  color: var(--text-secondary);
  font-size: 12px;
}
.trial-metric-live { border-color: rgba(61, 220, 151, 0.45); }
@media (max-width: 800px) {
  .trial-hero { grid-template-columns: 1fr; }
  .trial-metrics { grid-template-columns: 1fr; }
}
