/* =========================================================
   BinariaOS QR Platform — Design System v2.0
   Paleta: Slate neutro + Azul corporativo como acento único
   Filosofía: limpio, serio, funcional, sin decoración innecesaria
   ========================================================= */

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

/* ── VARIABLES ── */
:root {
  /* Superficies */
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --surface-2:   #f1f5f9;
  --surface-3:   #e8eef5;

  /* Bordes */
  --border:      #e2e8f0;
  --border-2:    #cbd5e1;

  /* Texto */
  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --text-4:      #cbd5e1;

  /* Acento principal */
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --accent-dim:  #eff6ff;
  --accent-mid:  #bfdbfe;

  /* Estados */
  --ok:          #16a34a;
  --ok-bg:       #f0fdf4;
  --ok-border:   #bbf7d0;
  --err:         #dc2626;
  --err-bg:      #fef2f2;
  --err-border:  #fecaca;
  --warn:        #d97706;
  --warn-bg:     #fffbeb;
  --warn-border: #fde68a;

  /* Sidebar */
  --sb-bg:       #0f172a;
  --sb-hover:    #1e293b;
  --sb-active:   #1e40af;
  --sb-text:     #94a3b8;
  --sb-text-on:  #ffffff;
  --sb-border:   rgba(255,255,255,0.06);

  /* Dimensiones */
  --sidebar-w:   248px;
  --topbar-h:    60px;

  /* Radios */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl:20px;

  /* Sombras */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.05);
  --sh-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --sh:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --sh-md: 0 8px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --sh-lg: 0 20px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  /* Tipografía */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html, body {
  /* Ocultar scrollbar en Firefox y IE/Edge */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Ocultar scrollbar en Chrome, Safari y Opera */
html::-webkit-scrollbar, 
body::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ── TIPOGRAFÍA ── */
h1 { font-size: 1.75rem;  font-weight: 800; line-height: 1.2; color: var(--text); }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; color: var(--text); }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--text); }
h4 { font-size: 0.9375rem;font-weight: 600; color: var(--text); }
p  { color: var(--text-2); line-height: 1.65; }

/* ══════════════════════════════════════════════════════════
   LAYOUT PÚBLICO
   ══════════════════════════════════════════════════════════ */
.layout-public { display: flex; flex-direction: column; min-height: 100vh; }

/* Header público */
.public-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.public-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1.5rem;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.625rem;
  font-weight: 700; font-size: 0.9375rem; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--text); }
.nav-logo { width: 30px; height: 30px; object-fit: contain; border-radius: var(--r-sm); }
.nav-links { display: flex; align-items: center; gap: 0.75rem; }
.nav-link {
  color: var(--text-2); font-size: 0.875rem; font-weight: 500;
  padding: 0.4rem 0.6rem; border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-2); padding: 0.25rem; }

/* Footer público */
.public-main { flex: 1; }
.public-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--surface);
}
.footer-content {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
}
.footer-copy { font-size: 0.8125rem; color: var(--text-3); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.8125rem; color: var(--text-3); }
.footer-links a:hover { color: var(--text-2); }

/* ══════════════════════════════════════════════════════════
   LAYOUT APP (AUTENTICADO)
   ══════════════════════════════════════════════════════════ */
.layout-app { overflow: visible; }
.app-shell  { display: flex; min-height: 100vh; overflow: visible; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  /* Ocultar scrollbar del sidebar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.125rem;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-logo { width: 28px; height: 28px; object-fit: contain; border-radius: var(--r-sm); }
.sidebar-brand-name { color: var(--sb-text-on); font-weight: 700; font-size: 0.875rem; line-height: 1.2; }
.sidebar-close { display: none; background: none; border: none; color: var(--sb-text); padding: 0.25rem; border-radius: var(--r-sm); }
.sidebar-close:hover { color: var(--sb-text-on); background: var(--sb-hover); }

.sidebar-section { padding: 1rem 0.875rem 0.5rem; }
.sidebar-section-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--sb-text);
  padding: 0 0.5rem; margin-bottom: 0.375rem;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--r);
  color: var(--sb-text);
  font-size: 0.875rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--sb-hover); color: var(--sb-text-on); text-decoration: none; }
.nav-item.active { background: var(--sb-active); color: var(--sb-text-on); }
.nav-item.nav-item-disabled { opacity: .62; filter: grayscale(.25); }
.nav-item.nav-item-disabled:hover { background: rgba(148,163,184,.12); color: var(--sb-text); }
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.125rem 0.4rem;
  border-radius: 999px;
  line-height: 1.4;
}

.sidebar-divider { height: 1px; background: var(--sb-border); margin: 0.5rem 0.875rem; }

.sidebar-footer {
  padding: 0.875rem;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 0.5rem;
  margin-bottom: 0.375rem;
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sb-active);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.8125rem; font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  color: var(--sb-text-on); font-size: 0.8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  color: var(--sb-text); font-size: 0.6875rem;
  text-transform: capitalize;
}
.nav-item-logout { color: #f87171 !important; }
.nav-item-logout:hover { background: rgba(248,113,113,0.1) !important; color: #fca5a5 !important; }

/* Overlay móvil */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 199;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* ── Main content ── */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

.app-topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
  box-shadow: var(--sh-xs);
  flex-shrink: 0;
  overflow: hidden;
}
/* iOS Safari: ensure topbar content doesn't overflow on narrow screens */
@supports (-webkit-touch-callout: none) {
  .app-topbar { overflow: visible; }
  .topbar-breadcrumb { min-width: 0; }
  .topbar-actions { flex-wrap: nowrap; overflow: hidden; }
}
.topbar-menu-btn { display: none; background: none; border: none; color: var(--text-2); padding: 0.25rem; }
.topbar-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem;
}
.topbar-breadcrumb-home { color: var(--text-3); }
.topbar-breadcrumb-sep  { color: var(--text-4); }
.topbar-breadcrumb-current { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 1; min-width: 0; }

.app-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  padding: .32rem .55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 700;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.toolbar-btn:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}
.toolbar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toolbar-btn svg { flex-shrink: 0; }
@media (max-width: 760px) {
  .app-toolbar { display: none; }
}


.app-content {
  flex: 1; padding: 1.75rem 1.75rem;
  max-width: 1040px; width: 100%;
}

/* ══════════════════════════════════════════════════════════
   BOTONES
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem; font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.15s ease;
  text-decoration: none; white-space: nowrap; line-height: 1.4;
  font-family: var(--font);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-secondary {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }

.btn-outline {
  background: transparent; color: var(--text-2); border-color: var(--border-2);
}
.btn-outline:hover { background: var(--surface-2); color: var(--text); }

.btn-ghost {
  background: transparent; color: var(--text-2); border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: transparent; color: var(--err); border-color: var(--err-border);
}
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }

.btn-danger-solid {
  background: var(--err); color: #fff; border-color: var(--err);
}
.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-xs  { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-sm  { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg  { padding: 0.6875rem 1.375rem; font-size: 1rem; }
.btn-xl  { padding: 0.875rem 1.75rem; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; }
.btn-icon.btn-sm { padding: 0.375rem; }

/* ══════════════════════════════════════════════════════════
   FORMULARIOS
   ══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block; font-size: 0.875rem; font-weight: 500;
  color: var(--text); margin-bottom: 0.375rem;
}
.form-label-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.375rem;
}
.form-label-optional { font-size: 0.75rem; color: var(--text-3); font-weight: 400; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute; left: 0.75rem;
  color: var(--text-3); pointer-events: none;
  display: flex; align-items: center; z-index: 1;
}
.input-suffix {
  position: absolute; right: 0.75rem;
  display: flex; align-items: center; gap: 0.25rem;
}
.btn-pass-toggle {
  background: none; border: none; color: var(--text-3); padding: 0;
  display: flex; align-items: center; cursor: pointer;
  transition: color 0.15s;
}
.btn-pass-toggle:hover { color: var(--text-2); }

.form-control {
  width: 100%;
  padding: 0.5625rem 0.875rem 0.5625rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 0.9rem; font-family: var(--font);
  color: var(--text); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-control::placeholder { color: var(--text-4); }
.form-control.no-icon { padding-left: 0.875rem; }
.form-control.has-suffix { padding-right: 2.75rem; }
.form-control:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }

.form-control-color {
  padding: 0.25rem 0.375rem;
  height: 42px; width: 72px;
  cursor: pointer; border-radius: var(--r);
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.form-control-color:focus { outline: none; border-color: var(--accent); }

.form-hint { font-size: 0.8rem; color: var(--text-3); margin-top: 0.3rem; line-height: 1.5; }
.form-error-msg { font-size: 0.8rem; color: var(--err); margin-top: 0.3rem; }
.form-legal {
  font-size: 0.8rem; color: var(--text-3); text-align: center;
  margin-top: 1rem; line-height: 1.6;
}
.form-legal a { color: var(--text-2); }
.form-legal a:hover { color: var(--text); }

/* Select */
select.form-control { padding-left: 0.875rem; }

/* ══════════════════════════════════════════════════════════
   ALERTAS
   ══════════════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem; line-height: 1.5;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--err-bg);  color: var(--err);  border-color: var(--err-border); }
.alert-success { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-border); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.alert-info    { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-mid); }

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.card-header {
  padding: 1.125rem 1.375rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface);
}
.card-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 0.8125rem; color: var(--text-3); margin-top: 0.125rem; }
.card-body { padding: 1.375rem; }
.card-footer {
  padding: 1rem 1.375rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.card + .card { margin-top: 1.25rem; }

/* ══════════════════════════════════════════════════════════
   STATS / MÉTRICAS
   ══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--sh-xs);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  opacity: 0.6;
}
.stat-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
.stat-value { font-size: 1.875rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 0.8rem; color: var(--text-3); margin-top: 0.375rem; }
.stat-icon  {
  position: absolute; right: 1.125rem; top: 1.125rem;
  color: var(--border-2);
}

/* ══════════════════════════════════════════════════════════
   TABLA DE QR
   ══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.qr-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}
.qr-table thead tr {
  border-bottom: 2px solid var(--border);
}
.qr-table th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.6875rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; background: var(--surface-2);
}
.qr-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.qr-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.qr-table td {
  padding: 0.875rem 1rem; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.qr-table tbody tr:last-child td { border-bottom: none; }
.qr-table tbody tr { transition: background 0.1s; }
.qr-table tbody tr:hover { background: var(--surface-2); }

.qr-thumb {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--surface-2); padding: 3px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.qr-name { font-weight: 600; color: var(--text); font-size: 0.875rem; }
.qr-dest {
  font-size: 0.75rem; color: var(--text-3);
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.qr-slug-link {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem; color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem; border-radius: var(--r-xs);
  white-space: nowrap;
}
.qr-slug-link:hover { text-decoration: none; background: var(--accent-mid); }
.qr-date { color: var(--text-3); font-size: 0.8125rem; white-space: nowrap; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-active  { background: #dcfce7; color: #15803d; }
.badge-expired { background: #fef9c3; color: #92400e; }
.badge-deleted { background: #fee2e2; color: #b91c1c; }
.badge-admin   { background: var(--accent-dim); color: var(--accent); }
.badge-soon    { background: var(--surface-3); color: var(--text-3); opacity: 0.8; }

.actions-cell { display: flex; gap: 0.375rem; justify-content: flex-end; align-items: center; }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 3.5rem 1.5rem;
}
.empty-state-icon {
  width: 72px; height: 72px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--text-4);
}
.empty-state h3 { color: var(--text-2); font-size: 1rem; margin-bottom: 0.5rem; }
.empty-state p  { font-size: 0.875rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* ══════════════════════════════════════════════════════════
   FORMULARIO CREACIÓN QR (layout 2 columnas)
   ══════════════════════════════════════════════════════════ */
.create-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
.create-form-col { display: flex; flex-direction: column; gap: 1.25rem; }

.qr-preview-panel {
  position: sticky; top: calc(var(--topbar-h) + 1.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--sh-xs);
  text-align: center;
}
.qr-preview-label {
  font-size: 0.6875rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem;
}
.qr-preview-frame {
  width: 200px; height: 200px; margin: 0 auto;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.qr-preview-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-preview-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 1rem; color: var(--text-4);
}
.qr-preview-placeholder p { font-size: 0.8rem; color: var(--text-3); }
.qr-preview-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-preview-note { font-size: 0.75rem; color: var(--text-3); margin-top: 1rem; line-height: 1.5; }

/* Tipo de QR selector */
.qr-type-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.625rem;
}
.qr-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 0.875rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer; transition: all 0.15s;
  font-size: 0.75rem; font-weight: 600; color: var(--text-2);
  text-align: center;
}
.qr-type-btn svg { color: var(--text-3); transition: color 0.15s; }
.qr-type-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.qr-type-btn:hover svg { color: var(--accent); }
.qr-type-btn.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.qr-type-btn.selected svg { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   AUTENTICACIÓN
   ══════════════════════════════════════════════════════════ */
.auth-page {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Panel izquierdo (branding) */
.auth-brand-panel {
  background: var(--sb-bg);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  position: relative; overflow: hidden;
  min-width: 0;
}
.auth-brand-panel::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(37,99,235,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.auth-brand-logo {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none; position: relative; z-index: 1;
}
.auth-brand-logo img { width: 32px; height: 32px; border-radius: var(--r-sm); }
.auth-brand-logo span { color: #fff; font-weight: 700; font-size: 1rem; }
.auth-brand-content { position: relative; z-index: 1; }
.auth-brand-content h2 {
  color: #fff; font-size: 1.4rem; font-weight: 800;
  line-height: 1.25; margin-bottom: 0.625rem;
}
.auth-brand-content p { color: var(--sb-text); font-size: 0.875rem; line-height: 1.55; }
.auth-brand-features { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.auth-brand-feature {
  display: flex; align-items: center; gap: 0.625rem;
  color: var(--sb-text); font-size: 0.875rem;
}
.auth-brand-feature svg { color: var(--accent); flex-shrink: 0; }
.auth-brand-footer { color: var(--sb-text); font-size: 0.8rem; position: relative; z-index: 1; margin-top: auto; }

/* Ilustración decorativa QR en el panel de marca */
.auth-brand-illustration {
  position: relative; z-index: 1;
  display: block;
  margin: 0.75rem auto 0;
  width: 380px;
  max-width: 100%;
  height: 380px;
  overflow: hidden;
  border-radius: var(--r-lg);
  flex-shrink: 0;
}
.auth-brand-illustration img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--r-lg);
  opacity: 0.88;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

/* Panel derecho (formulario) */
.auth-form-panel {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 2rem;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Centrar verticalmente solo cuando el contenido cabe en pantalla */
@supports (min-height: fit-content) {
  .auth-form-panel { min-height: 100%; }
  .auth-form-inner { margin: auto 0; }
}
.auth-form-inner { width: 100%; max-width: 440px; }
.auth-form-inner .form-group { margin-bottom: 0.75rem; }
.auth-form-inner .form-label { margin-bottom: 0.25rem; font-size: 0.8125rem; }
.auth-form-inner .btn-block { margin-top: 0.25rem; }
.auth-form-inner .form-legal { font-size: 0.75rem; margin-top: 0.625rem; }
.auth-form-header { margin-bottom: 1.25rem; }
.auth-form-header h1 { font-size: 1.375rem; margin-bottom: 0.25rem; }
.auth-form-header p  { font-size: 0.875rem; color: var(--text-3); }

.auth-form-footer {
  text-align: center; margin-top: 0.875rem;
  font-size: 0.875rem; color: var(--text-3);
}
.auth-form-footer a { color: var(--accent); font-weight: 600; }

.link-forgot { font-size: 0.8125rem; color: var(--text-3); }
.link-forgot:hover { color: var(--text-2); }

/* Requisitos de contraseña */
.pass-reqs {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.5rem 0.875rem;
  margin-bottom: 0.75rem;
}
.pass-reqs-title { font-size: 0.7rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.3rem; }
.pass-reqs ul { display: flex; flex-direction: column; gap: 0.2rem; }
.req-item {
  font-size: 0.8rem; color: var(--text-3);
  display: flex; align-items: center; gap: 0.4rem;
}
.req-item::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border-2); flex-shrink: 0;
  transition: all 0.2s;
}
.req-item.valid { color: var(--ok); }
.req-item.valid::before { background: var(--ok); border-color: var(--ok); }
.req-item.invalid { color: var(--err); }
.req-item.invalid::before { background: var(--err); border-color: var(--err); }

/* ══════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500; align-items: center; justify-content: center;
  padding: 1rem;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ══════════════════════════════════════════════════════════
   LOADING OVERLAY
   ══════════════════════════════════════════════════════════ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.loading-overlay.active {
  display: flex;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
.loading-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-lg);
  width: 100%; max-width: 480px;
  animation: modalIn 0.2s ease;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-3);
  display: flex; align-items: center; padding: 0.25rem;
  border-radius: var(--r-sm); transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.75rem; justify-content: flex-end;
  background: var(--surface-2);
}

/* ══════════════════════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.625rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: var(--sb-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: 0.875rem; color: #fff;
  max-width: 360px; pointer-events: all;
  animation: toastIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
  border-left: 3px solid transparent;
}
.toast-success { border-left-color: #4ade80; }
.toast-error   { border-left-color: #f87171; }
.toast-info    { border-left-color: #60a5fa; }
.toast svg { flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; padding: 0; display: flex; align-items: center;
  transition: color 0.15s;
}
.toast-close:hover { color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Loader en botones */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.btn-loading .btn-text { visibility: hidden; }
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ══════════════════════════════════════════════════════════
   PÁGINAS DE ERROR
   ══════════════════════════════════════════════════════════ */
.error-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.error-container { text-align: center; padding: 2rem; max-width: 440px; }
.error-code {
  font-size: 7rem; font-weight: 900; line-height: 1;
  color: var(--border); margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}
.error-title { font-size: 1.5rem; margin-bottom: 0.75rem; }
.error-message { color: var(--text-3); margin-bottom: 2rem; font-size: 0.9375rem; }
.error-icon-lg {
  color: var(--text-4); margin-bottom: 1.5rem;
  display: flex; justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   PERFIL
   ══════════════════════════════════════════════════════════ */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.plan-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.plan-detail-row:last-child { border-bottom: none; }
.plan-detail-label { color: var(--text-3); }
.plan-detail-value { font-weight: 600; color: var(--text); }

/* ══════════════════════════════════════════════════════════
   LANDING PÚBLICA
   ══════════════════════════════════════════════════════════ */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.hero-inner { max-width: 680px; margin: 0 auto; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.8125rem; font-weight: 600; padding: 0.3rem 0.75rem;
  border-radius: 999px; margin-bottom: 1.25rem;
  border: 1px solid var(--accent-mid);
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 1.125rem;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.0625rem; color: var(--text-2); max-width: 520px; margin: 0 auto 2.5rem; line-height: 1.7; }
.hero-cta { display: flex; gap: 0.875rem; justify-content: center; flex-wrap: wrap; }

.features-section { padding: 4rem 0; }
.section-header { text-align: center; max-width: 560px; margin: 0 auto 3rem; }
.section-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem;
}
.section-header h2 { font-size: 1.875rem; margin-bottom: 0.75rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover { box-shadow: var(--sh-md); border-color: var(--border-2); }
.feature-icon {
  width: 44px; height: 44px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.feature-card p  { font-size: 0.875rem; }

.cta-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}
.cta-section h2 { font-size: 1.75rem; margin-bottom: 0.75rem; }
.cta-section p  { color: var(--text-2); margin-bottom: 2rem; }

/* Pricing */
.pricing-section { padding: 4rem 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem; max-width: 900px; margin: 0 auto;
}
.pricing-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 2rem;
  position: relative;
  transition: box-shadow 0.2s;
}
.pricing-card:hover { box-shadow: var(--sh-md); }
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.08), var(--sh-md);
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 0.6875rem; font-weight: 700; padding: 0.25rem 0.75rem;
  border-radius: 999px; white-space: nowrap;
}
.pricing-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }
.pricing-desc { font-size: 0.8125rem; color: var(--text-3); margin-bottom: 1.25rem; }
.pricing-price {
  font-size: 2.5rem; font-weight: 900; color: var(--text);
  line-height: 1; margin-bottom: 1.5rem; letter-spacing: -0.03em;
}
.pricing-price sup { font-size: 1.25rem; vertical-align: top; margin-top: 0.5rem; font-weight: 600; }
.pricing-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-3); }
.pricing-features { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1.75rem; }
.pricing-feature {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: var(--text-2);
}
.pricing-feature svg { color: var(--ok); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   UTILIDADES
   ══════════════════════════════════════════════════════════ */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3) !important; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Separador */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 2rem 1.5rem; }
  .auth-form-inner { max-width: 100%; }
}

@media (max-width: 768px) {
  /* Sidebar */
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .topbar-menu-btn { display: flex; }
  .app-main { margin-left: 0; }

  /* Layouts */
  .create-layout { grid-template-columns: 1fr; }
  .qr-preview-panel { position: static; }
  .profile-grid { grid-template-columns: 1fr; }

  /* Nav pública */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    gap: 0.25rem;
    z-index: 200;
    box-shadow: var(--shadow-md);
  }
  .nav-links.nav-links--open { display: flex; }
  .mobile-menu-btn { display: flex; }
  .public-header { position: relative; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tabla */
  /*.qr-table th:nth-child(5),
  .qr-table td:nth-child(5) { display: none; }*/

  /* App content */
  .app-content { padding: 1.25rem 1rem; }
  .app-topbar { padding: 0 1rem; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.75rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .qr-type-grid { grid-template-columns: repeat(2, 1fr); }
  .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
  .toast { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   FASE FINAL — Componentes: Admin, Stats, Gráficos
   ═══════════════════════════════════════════════════════ */

/* ── Gráficos ─────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}
.chart-wrap-sm {
  max-width: 220px;
  margin: 0 auto 1rem;
}

/* ── Leyenda de gráficos de dona ─────────────────────── */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label {
  flex: 1;
  color: var(--text-2);
  text-transform: capitalize;
}
.legend-value {
  font-weight: 600;
  color: var(--text);
  font-size: 0.8rem;
}

/* ── Layout de dos columnas para gráficos de stats ────── */
.stats-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── Paginación ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 0.875rem;
  color: var(--text-3);
}

/* ── Acciones en tabla ────────────────────────────────── */
.actions-cell {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
  align-items: center;
}
.btn-icon {
  padding: 0.375rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #fecaca;
  border-color: #f87171;
  color: #b91c1c;
}

/* ── Badges adicionales ───────────────────────────────── */
.badge-neutral  { background: var(--surface-2); color: var(--text-2); }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-deleted  { background: #f3f4f6; color: #9ca3af; }

/* ── Sidebar: sección admin ───────────────────────────── */
.sidebar-nav-admin .sidebar-nav-item {
  border-left: 2px solid transparent;
}
.sidebar-nav-admin .sidebar-nav-item.active,
.sidebar-nav-admin .sidebar-nav-item:hover {
  border-left-color: var(--accent);
}

/* ── Topbar: badge de rol admin ───────────────────────── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Destino del QR en tabla ──────────────────────────── */
.qr-dest {
  font-size: 0.75rem;
  color: var(--text-3);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

/* ── Helpers de texto ─────────────────────────────────── */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.8125rem; }
.text-muted { color: var(--text-3); }
.mb-3 { margin-bottom: 1.25rem; }

/* ── Responsive: stats y admin ────────────────────────── */
@media (max-width: 900px) {
  .stats-charts-row { grid-template-columns: 1fr; }
  .stat-card { padding: 1rem; }
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .actions-cell { flex-wrap: wrap; }
  .stat-card { padding: 1rem; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .pagination { flex-direction: column; gap: 0.5rem; }
  .stat-card { padding: 1rem; }
}

/* ══════════════════════════════════════════════════════════
   BOTÓN GOOGLE / SEPARADOR AUTH
   ══════════════════════════════════════════════════════════ */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 0.875rem;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.btn-google:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
/* Facebook OAuth button: similar style but with blue accent */
.btn-facebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: #fff;
  color: #1877f2;
  border: 1px solid #dadce0;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 0.875rem;
}
.btn-facebook:hover {
  background: #f5f8fc;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.btn-facebook:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  color: var(--text-3);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   GENERADOR QR ANÓNIMO (HOME)
   ══════════════════════════════════════════════════════════ */
.guest-qr-section {
  padding: 3rem 0 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.guest-qr-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 2.5rem;
  max-width: 860px;
  margin: 0 auto;
}

.guest-qr-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.guest-qr-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.guest-qr-header p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.guest-qr-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.guest-qr-form-col { flex: 1; }

.guest-qr-input-wrap {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.guest-qr-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color 0.15s;
  outline: none;
}
.guest-qr-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.guest-qr-input::placeholder { color: var(--text-3); }

.guest-qr-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guest-qr-hint {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin: 0;
}

/* Alertas del generador */
.guest-qr-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  margin-top: 0.875rem;
}
.guest-qr-alert--error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}
.guest-qr-alert--limit {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--text-2);
}
.guest-qr-alert--limit svg { flex-shrink: 0; color: #f59e0b; margin-top: 2px; }

/* Panel de previsualización */
.guest-qr-preview-col { flex-shrink: 0; }

.guest-qr-preview {
  width: 200px;
  height: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.guest-qr-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-3);
  font-size: 0.8125rem;
  text-align: center;
  padding: 1rem;
}

.guest-qr-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  position: absolute;
  top: 0; left: 0;
}

.guest-qr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.625rem 0.5rem 0.5rem;
}

.guest-qr-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--bg-rgb, 15,15,20), 0.5);
}

/* Responsive */
@media (max-width: 640px) {
  .guest-qr-card { padding: 1.5rem 1.25rem; }
  .guest-qr-body { grid-template-columns: 1fr; }
  .guest-qr-preview-col { display: flex; justify-content: center; }
  .guest-qr-input-wrap { flex-direction: column; }
  .guest-qr-btn { width: 100%; justify-content: center; }
}




/* ─────────────────────────────────────────────────────────
   Layout de Creación de QRs (Dos Columnas)
   ───────────────────────────────────────────────────────── */
.create-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (max-width: 992px) {
  .create-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 1.25rem 0;
}

@media (max-width: 600px) {
  .type-selector {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .type-card {
    min-height: 85px;
    padding: 0.6rem 0.4rem;
  }
  .type-card span {
    font-size: 0.7rem;
  }
}

.type-option {
  flex: 1;
  cursor: pointer;
}

.type-option input {
  display: none;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  height: 100%;
  min-height: 90px;
  position: relative;
}

.type-card span {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.type-option input:checked + .type-card {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: scale(1.02);
}

.type-card svg {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.type-option input:checked + .type-card svg {
  opacity: 1;
  stroke: currentColor;
}

/* Soporte para el botón de Bulk (que es un enlace) */
.type-option:hover .type-card.type-bulk {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  transform: scale(1.02);
}

/* Colores por tipo */
.type-option input:checked + .type-card.type-url { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.type-option input:checked + .type-card.type-vcard { border-color: #10b981; background: rgba(16, 185, 129, 0.1); color: #10b981; }
.type-option input:checked + .type-card.type-social { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.type-option input:checked + .type-card.type-text { border-color: #6b7280; background: rgba(107, 114, 128, 0.1); color: #6b7280; }
.type-option input:checked + .type-card.type-wifi { border-color: #06b6d4; background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.type-option input:checked + .type-card.type-email { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.type-option input:checked + .type-card.type-whatsapp { border-color: #22c55e; background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.type-option input:checked + .type-card.type-event { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.type-option input:checked + .type-card.type-pdf { border-color: #dc2626; background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.type-option input:checked + .type-card.type-multilink { border-color: #6366f1; background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.type-option input:checked + .type-card.type-app { border-color: #111827; background: rgba(17, 24, 39, 0.1); color: #111827; }
.type-option input:checked + .type-card.type-bulk { border-color: #2563eb; background: rgba(37, 99, 235, 0.1); color: #2563eb; }

/* Panel de Previsualización (Derecha) */
.preview-sticky {
  position: sticky;
  top: 1.5rem;
  z-index: 10;
}

.qr-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--sh-md);
}

/* ===============================
   MOBILE DASHBOARD FIX FINAL
   =============================== */

.edit-modal-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
}

@media (max-width: 600px) {
  #editModal .modal {
    --modal-max-width: 95vw;
    width: 95vw;
    max-width: 95vw;
    margin: 0 auto;
  }

  #editModal .modal-body {
    max-height: 80vh;
  }

  #editModal .edit-modal-grid {
    grid-template-columns: 1fr;
  }

  #editModal .edit-modal-grid > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  #editModal .edit-modal-grid > div:last-child {
    padding-top: 1rem !important;
  }

  /* Grillas de producto colapsan a 1 col en móvil */
  .prod-grid-2 { grid-template-columns: 1fr !important; }

  /* Limitar altura de formulario de catálogo con scroll propio */
  #edit_catalog_products_container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
  }
  #section-edit-catalogo { padding-bottom: 1rem; }

  /* En móvil ocultamos columnas menos críticas */
  .col-check,
  .col-expiry,
  .col-status {
    display: none !important;
  }

  /* Aseguramos que las acciones y el link sean visibles */
  .col-actions,
  .col-link {
    display: table-cell !important;
  }

  .qr-table td:nth-child(5) a {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Acciones siempre visibles */
  .actions-cell {
    justify-content: flex-end;
    gap: 0.35rem;
    min-width: 108px;
  }

  .actions-cell .btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(37,99,235,0.15) 0%, transparent 65%);
}

.auth-brand-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.14;
    background-image:
      url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.95' stroke='%23ffffff' stroke-width='5'%3E%3Crect x='8' y='8' width='20' height='20' rx='4'/%3E%3Crect x='56' y='8' width='20' height='20' rx='4'/%3E%3Crect x='8' y='56' width='20' height='20' rx='4'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Crect x='39' y='39' width='8' height='8' rx='2'/%3E%3Crect x='55' y='40' width='7' height='7' rx='2'/%3E%3Crect x='68' y='39' width='8' height='8' rx='2'/%3E%3Crect x='40' y='56' width='8' height='8' rx='2'/%3E%3Crect x='56' y='66' width='8' height='8' rx='2'/%3E%3Crect x='69' y='56' width='7' height='7' rx='2'/%3E%3C/g%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.95' stroke='%23ffffff' stroke-width='5'%3E%3Crect x='8' y='8' width='20' height='20' rx='4'/%3E%3Crect x='56' y='8' width='20' height='20' rx='4'/%3E%3Crect x='8' y='56' width='20' height='20' rx='4'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Crect x='38' y='38' width='10' height='10' rx='2'/%3E%3Crect x='55' y='40' width='8' height='8' rx='2'/%3E%3Crect x='69' y='38' width='7' height='7' rx='2'/%3E%3Crect x='39' y='57' width='7' height='7' rx='2'/%3E%3Crect x='55' y='57' width='21' height='7' rx='2'/%3E%3Crect x='69' y='69' width='7' height='7' rx='2'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 132px 132px, 86px 86px;
    background-position: calc(100% - 3rem) 16%, 2.25rem calc(100% - 5rem);
    animation: authQrFloat 13s ease-in-out infinite;
}

@keyframes authQrFloat {
  0%, 100% {
    background-position: calc(100% - 3rem) 16%, 2.25rem calc(100% - 5rem);
  }
  50% {
    background-position: calc(100% - 3rem) calc(16% - 10px), 2.25rem calc(100% - 4.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand-panel::after,
  .auth-body::before {
    animation: none;
  }
}

/* ── PLANES CUSTOM STYLES ── */
.stat-card-free { background: var(--ok-bg) !important; border-color: var(--ok-border) !important; }
.stat-card-free::before { background: var(--ok) !important; opacity: 1 !important; }
.stat-card-free .stat-value { color: var(--ok) !important; }

.stat-card-pro { background: var(--warn-bg) !important; border-color: var(--warn-border) !important; }
.stat-card-pro::before { background: var(--warn) !important; opacity: 1 !important; }
.stat-card-pro .stat-value { color: var(--warn) !important; }

.stat-card-elite { background: var(--err-bg) !important; border-color: var(--err-border) !important; }
.stat-card-elite::before { background: var(--err) !important; opacity: 1 !important; }
.stat-card-elite .stat-value { color: var(--err) !important; }

/* Elite Star Animation */
@keyframes star-pulse {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 0px var(--err)); }
  50% { transform: scale(1.2) rotate(15deg); filter: drop-shadow(0 0 8px var(--err)); }
  100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 0px var(--err)); }
}
.star-animated {
  animation: star-pulse 2s infinite ease-in-out;
  display: block;
}
.star-animated svg { color: var(--err) !important; }

/* ══════════════════════════════════════════════════════════
   AUTH REFRESH V3.1 — compacto, responsive y limpio
   ══════════════════════════════════════════════════════════ */
.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.45) 100%),
    var(--bg);
  position: relative;
  overflow-x: hidden;
}
.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.95' stroke='%232563eb' stroke-width='5'%3E%3Crect x='8' y='8' width='20' height='20' rx='4'/%3E%3Crect x='56' y='8' width='20' height='20' rx='4'/%3E%3Crect x='8' y='56' width='20' height='20' rx='4'/%3E%3C/g%3E%3Cg fill='%23ff780a'%3E%3Crect x='39' y='39' width='8' height='8' rx='2'/%3E%3Crect x='55' y='40' width='7' height='7' rx='2'/%3E%3Crect x='68' y='39' width='8' height='8' rx='2'/%3E%3Crect x='40' y='56' width='8' height='8' rx='2'/%3E%3Crect x='56' y='66' width='8' height='8' rx='2'/%3E%3Crect x='69' y='56' width='7' height='7' rx='2'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 112px 112px;
  background-position: calc(100% - 2rem) calc(100% - 2rem);
  animation: authBodyQrFloat 14s ease-in-out infinite;
}

@keyframes authBodyQrFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

.auth-page.auth-page--compact {
  min-height: 100vh;
  height: auto;
  max-height: none;
  overflow: hidden;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  position: relative;
  z-index: 1;
}

.auth-page--compact .auth-brand-panel {
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
  background:
    linear-gradient(145deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.97)),
    var(--sb-bg);
}

.auth-page--compact .auth-brand-panel::before {
  background:
    radial-gradient(circle at 20% 16%, rgba(255,120,10,0.22), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(18,168,243,0.18), transparent 28%);
}

.auth-page--compact .auth-brand-logo img,
.auth-mobile-brand img {
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.28);
}

.auth-page--compact .auth-brand-content {
  max-width: 520px;
  margin: auto 0;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}
.auth-kicker::before {
  content: '';
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.14);
}

.auth-page--compact .auth-brand-content h2 {
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin-bottom: 0.85rem;
}
.auth-page--compact .auth-brand-content p {
  max-width: 440px;
  color: rgba(226,232,240,0.78);
}

.auth-brand-features--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.auth-brand-features--grid .auth-brand-feature {
  min-height: 38px;
  padding: 0.58rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
  color: rgba(226,232,240,0.86);
  font-size: 0.78rem;
}
.auth-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.12);
  flex: 0 0 auto;
}

.auth-brand-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: min(100%, 420px);
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.64);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}
.auth-brand-card strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
}
.auth-brand-card span {
  display: block;
  margin-top: 0.12rem;
  color: rgba(226,232,240,0.68);
  font-size: 0.78rem;
}
.auth-orbit {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(34,211,238,0.82));
  box-shadow: 0 16px 38px rgba(37,99,235,0.36);
}
.auth-orbit::before,
.auth-orbit::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(255,255,255,0.62);
  inset: 10px;
  border-radius: 9px;
}
.auth-orbit::after {
  inset: 17px;
  background: #fff;
  border: 0;
  border-radius: 4px;
}

.auth-page--compact .auth-brand-illustration { display: none; }

.auth-page--compact .auth-form-panel {
  min-height: 100vh;
  align-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: transparent;
}

.auth-card {
  max-width: 430px;
  padding: clamp(1.15rem, 2.4vw, 1.75rem);
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
}
.auth-card--register { max-width: 560px; }
.auth-card--recover { max-width: 430px; }

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}
.auth-mobile-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.auth-page--compact .auth-form-header {
  margin-bottom: 0.95rem;
}
.auth-page--compact .auth-form-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.auth-page--compact .auth-form-header p {
  margin-top: 0.45rem;
  line-height: 1.45;
}

.auth-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}
.auth-social-grid .btn-google,
.auth-social-grid .btn-facebook,
.auth-social-btn {
  min-height: 42px;
  margin: 0;
  padding: 0.58rem 0.75rem;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-social-grid .google-auth-slot {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.auth-social-grid .google-auth-slot > div,
.auth-social-grid .google-auth-slot iframe {
  width: 100% !important;
  min-width: 0 !important;
}

.auth-page--compact .auth-divider {
  margin: 0.75rem 0 0.85rem;
  font-size: 0.74rem;
}

.auth-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}
.auth-form-stack .form-group,
.auth-page--compact .auth-form-inner .form-group {
  margin-bottom: 0;
}
.auth-page--compact .form-label {
  font-size: 0.76rem;
  font-weight: 750;
}
.auth-page--compact .form-control {
  min-height: 42px;
  padding-top: 0.52rem;
  padding-bottom: 0.52rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
}
.auth-page--compact .btn-lg {
  min-height: 44px;
  padding-block: 0.68rem;
  border-radius: 14px;
}
.auth-page--compact .link-forgot {
  font-weight: 700;
  text-decoration: none;
}
.auth-page--compact .link-forgot:hover,
.auth-page--compact .auth-form-footer a:hover {
  text-decoration: underline;
}

.auth-fields-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.pass-reqs--compact {
  padding: 0.62rem 0.7rem;
  margin: 0;
  border-radius: 14px;
}
.pass-reqs--compact .pass-reqs-title {
  margin-bottom: 0.45rem;
}
.pass-reqs--compact ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem 0.55rem;
}
.pass-reqs--compact .req-item {
  font-size: 0.73rem;
}
.pass-reqs--compact .req-item::before {
  width: 11px;
  height: 11px;
}

.auth-page--compact .form-legal {
  margin: -0.1rem 0 0;
  color: var(--text-3);
  line-height: 1.45;
}
.auth-page--compact .auth-form-footer {
  margin-top: 0.85rem;
}
.auth-success-panel {
  align-items: flex-start;
  line-height: 1.45;
}
.auth-loading-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

@media (max-width: 1180px) {
  .auth-page.auth-page--compact {
    grid-template-columns: minmax(280px, 0.75fr) minmax(400px, 1.25fr);
  }
  .auth-brand-features--grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-page.auth-page--compact {
    display: block;
    min-height: 100vh;
    overflow: auto;
  }
  .auth-page--compact .auth-brand-panel {
    display: none;
  }
  .auth-page--compact .auth-form-panel {
    min-height: 100vh;
    padding: 1rem;
  }
  .auth-card,
  .auth-card--register,
  .auth-card--recover {
    max-width: 560px;
  }
  .auth-mobile-brand {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .auth-page--compact .auth-form-panel {
    align-items: flex-start;
    padding: 0.7rem;
  }
  .auth-card {
    width: 100%;
    padding: 1rem;
    border-radius: 20px;
  }
  .auth-social-grid,
  .auth-fields-two,
  .pass-reqs--compact ul {
    grid-template-columns: 1fr;
  }
  .auth-page--compact .auth-form-header h1 {
    font-size: 1.55rem;
  }
  .auth-page--compact .auth-form-header p {
    font-size: 0.82rem;
  }
  .auth-page--compact .auth-divider {
    margin: 0.65rem 0;
  }
}

@media (max-height: 740px) and (min-width: 901px) {
  .auth-page--compact .auth-form-panel {
    align-items: flex-start;
  }
  .auth-card {
    margin-block: auto;
  }
  .auth-page--compact .auth-brand-content h2 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
  }
}
