/* ============================================================
   Panel de administración (admin/ y superadmin/) — se carga junto
   con style.css. Usa su propia paleta "SaaS" (--sa-*) para que el
   panel se vea como un producto profesional, distinto del diseño
   editorial del sitio público de cada diario.
   ============================================================ */

:root {
  --sa-bg: #f4f5fb;
  --sa-surface: #ffffff;
  --sa-surface-alt: #f7f8fc;
  --sa-border: #e5e7f2;
  --sa-ink: #1a1d2e;
  --sa-ink-soft: #656b7f;
  --sa-ink-faint: #9498ab;
  --sa-primary: #4f46e5;
  --sa-primary-dark: #4038c7;
  --sa-primary-soft: #edecfd;
  --sa-primary-rgb: 79, 70, 229;
  --sa-success: #16a34a;    --sa-success-soft: #e7f8ee; --sa-success-ink: #0f7a37;
  --sa-warning: #d97706;    --sa-warning-soft: #fef3e2; --sa-warning-ink: #92580a;
  --sa-danger: #dc2626;     --sa-danger-soft: #fdecec;  --sa-danger-ink: #a11515;
  --sa-info: #0284c7;       --sa-info-soft: #e6f4fc;    --sa-info-ink: #075f8c;
  --sa-neutral-soft: #eef0f4; --sa-neutral-ink: #4b5163;
  --sa-radius: 12px;
  --sa-radius-sm: 8px;
  --sa-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --sa-shadow: 0 2px 10px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .08);
  --sa-shadow-md: 0 12px 28px rgba(16, 24, 40, .12);
}

.admin-body { background: var(--sa-bg); font-family: var(--sans); }

.admin-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.admin-sidebar {
  width: 252px; flex-shrink: 0; color: #b6b8d6; display: flex; flex-direction: column; padding: 22px 0;
  background: linear-gradient(180deg, #1c1e42 0%, #121327 100%);
}
.admin-sidebar-brand {
  font-weight: 800; font-size: 18px; color: #fff; padding: 0 22px 20px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08); letter-spacing: -0.2px;
}
.admin-sidebar-brand span {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px;
  color: #8d8fe0; margin-top: 4px; font-weight: 700;
}
.admin-nav { display: flex; flex-direction: column; flex: 1; gap: 2px; padding: 4px 10px; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; color: #aaacce; padding: 10px 12px; font-size: 13.5px;
  font-weight: 600; border-radius: 8px; transition: all 140ms ease;
}
.admin-nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.admin-nav a.active { background: var(--sa-primary); color: #fff; box-shadow: var(--sa-shadow-sm); }
.admin-nav a.active svg { opacity: 1; }
.admin-sidebar-footer { padding: 16px 22px 0; margin-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.admin-sidebar-footer a { color: #9294bd; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.admin-sidebar-footer a svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.8; }
.admin-sidebar-footer a:hover { color: #fff; }
.admin-sidebar-footer span { display: block; color: #5f6188; font-size: 11px; margin-top: 8px; }

/* ===== Topbar ===== */
.admin-content { flex: 1; min-width: 0; }
.admin-topbar {
  background: var(--sa-surface); border-bottom: 1px solid var(--sa-border); padding: 18px 32px;
  display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 5;
}
.admin-topbar h1 { font-size: 21px; font-weight: 800; margin: 0; color: var(--sa-ink); letter-spacing: -0.3px; }
.admin-topbar-user { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--sa-ink-soft); }
.admin-topbar-user em { font-style: normal; color: var(--sa-ink-faint); }
.admin-topbar-user a { font-weight: 600; }
.admin-user-chip { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--sa-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.admin-topbar-divider { color: var(--sa-border); }

.admin-main { padding: 28px 32px 70px; max-width: 1180px; }
.admin-section-title { font-size: 16px; font-weight: 800; margin: 34px 0 14px; color: var(--sa-ink); }
.admin-main > .admin-section-title:first-child { margin-top: 0; }

/* ===== Stat cards ===== */
.stat-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card {
  background: var(--sa-surface); border: 1px solid var(--sa-border); border-radius: var(--sa-radius);
  padding: 20px 22px; min-width: 160px; flex: 1; box-shadow: var(--sa-shadow-sm);
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.stat-card:hover { box-shadow: var(--sa-shadow-md); transform: translateY(-2px); }
.stat-card-value { display: block; font-size: 28px; font-weight: 800; color: var(--sa-ink); letter-spacing: -0.6px; }
.stat-card-label { font-size: 12.5px; color: var(--sa-ink-soft); font-weight: 600; margin-top: 3px; display: block; }

/* ===== Tablas ===== */
.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--sa-surface);
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius); overflow: hidden; box-shadow: var(--sa-shadow-sm);
}
.admin-table th, .admin-table td { padding: 13px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--sa-border); vertical-align: middle; }
.admin-table th { background: var(--sa-surface-alt); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--sa-ink-soft); font-weight: 700; }
.admin-table tbody tr { transition: background 120ms ease; }
.admin-table tbody tr:hover { background: var(--sa-surface-alt); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table-actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.admin-table-actions form { display: inline; margin: 0; }
.admin-table-actions a { font-weight: 600; }
.admin-table-slug { color: var(--sa-ink-faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ===== Badges (estados de notas, clientes y facturación) ===== */
.badge { font-size: 10.5px; padding: 4px 10px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; display: inline-block; white-space: nowrap; }
.badge--published, .badge--active, .badge--paid { background: var(--sa-success-soft); color: var(--sa-success-ink); }
.badge--draft, .badge--pending, .badge--trial { background: var(--sa-warning-soft); color: var(--sa-warning-ink); }
.badge--featured { background: var(--sa-primary-soft); color: var(--sa-primary-dark); }
.badge--suspended, .badge--overdue { background: var(--sa-danger-soft); color: var(--sa-danger-ink); }
.badge--cancelled, .badge--canceled { background: var(--sa-neutral-soft); color: var(--sa-neutral-ink); }

/* ===== Botones y alertas (paleta indigo del panel, no la roja del sitio) ===== */
.admin-body .btn, .admin-auth-body .btn {
  border-color: var(--sa-border); color: var(--sa-ink); border-radius: var(--sa-radius-sm); font-weight: 700;
}
.admin-body .btn:hover, .admin-auth-body .btn:hover { border-color: var(--sa-primary); color: var(--sa-primary); }
.admin-body .btn-primary, .admin-auth-body .btn-primary {
  background: var(--sa-primary); border-color: var(--sa-primary); color: #fff;
  box-shadow: 0 1px 2px rgba(var(--sa-primary-rgb), .35);
}
.admin-body .btn-primary:hover, .admin-auth-body .btn-primary:hover { background: var(--sa-primary-dark); border-color: var(--sa-primary-dark); color: #fff; }
.admin-body .btn-primary:disabled, .admin-auth-body .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-body .btn-ghost, .admin-auth-body .btn-ghost { color: var(--sa-ink-soft); border-color: transparent; }
.admin-body .btn-ghost:hover, .admin-auth-body .btn-ghost:hover { background: var(--sa-primary-soft); color: var(--sa-primary-dark); }
.admin-body .btn-danger, .admin-auth-body .btn-danger { border-color: var(--sa-danger); color: var(--sa-danger); }
.admin-body .btn-danger:hover, .admin-auth-body .btn-danger:hover { background: var(--sa-danger); color: #fff; }
.admin-body .form-error, .admin-auth-body .form-error {
  background: var(--sa-danger-soft); color: var(--sa-danger-ink); border: 1px solid #f6cfcf;
  border-radius: var(--sa-radius-sm); padding: 12px 16px; font-size: 14px; font-weight: 500; margin: 0 0 18px;
}
.admin-body .form-success, .admin-auth-body .form-success {
  background: var(--sa-success-soft); color: var(--sa-success-ink); border: 1px solid #bfe6cb;
  border-radius: var(--sa-radius-sm); padding: 12px 16px; font-size: 14px; font-weight: 600; margin: 0 0 18px;
}

.link-btn { background: none; border: none; color: var(--sa-primary); font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn--danger { color: var(--sa-danger); }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.admin-toolbar-filters { display: flex; gap: 8px; }

/* ===== Formularios ===== */
.admin-form {
  display: flex; flex-direction: column; gap: 16px; max-width: 720px; background: var(--sa-surface);
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius); padding: 22px 24px; box-shadow: var(--sa-shadow-sm);
}
.admin-form label { font-size: 12px; font-weight: 700; color: var(--sa-ink-soft); display: flex; flex-direction: column; gap: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="password"],
.admin-form input[type="url"], .admin-form input[type="number"], .admin-form input[type="file"],
.admin-form select, .admin-form textarea {
  border: 1px solid var(--sa-border); border-radius: var(--sa-radius-sm); padding: 10px 13px; font-size: 14px;
  font-family: inherit; color: var(--sa-ink); background: var(--sa-surface-alt); transition: all 140ms ease;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  outline: none; border-color: var(--sa-primary); background: var(--sa-surface); box-shadow: 0 0 0 3px var(--sa-primary-soft);
}
.admin-form h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--sa-ink-soft); margin: 6px 0 -4px; padding-top: 12px; border-top: 1px solid var(--sa-border); }
.admin-form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.admin-form-row > label { flex: 1; min-width: 180px; }
.admin-form-hint { font-size: 12.5px; color: var(--sa-ink-faint); margin: -6px 0 0; }
.admin-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; text-transform: none !important; }
.admin-current-image { max-width: 220px; border-radius: var(--sa-radius-sm); border: 1px solid var(--sa-border); margin-top: -6px; }

.admin-form--inline { flex-direction: row; align-items: center; flex-wrap: wrap; max-width: none; }
.admin-form--inline input, .admin-form--inline select { flex: 1; min-width: 150px; }

.inline-role-form select { border: 1px solid var(--sa-border); border-radius: var(--sa-radius-sm); padding: 6px 10px; font-size: 13px; background: var(--sa-surface-alt); }

/* Editor de texto enriquecido (compartido entre notas del sitio y del panel) */
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar button {
  border: 1px solid var(--sa-border); background: var(--sa-surface); border-radius: var(--sa-radius-sm);
  padding: 7px 11px; font-size: 13px; color: var(--sa-ink-soft); cursor: pointer; font-weight: 600;
}
.toolbar button:hover { border-color: var(--sa-primary); color: var(--sa-primary-dark); background: var(--sa-primary-soft); }
.content-editable {
  min-height: 320px; border: 1px solid var(--sa-border); border-radius: var(--sa-radius-sm); padding: 16px;
  font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--sa-ink); background: var(--sa-surface);
}
.content-editable:focus { outline: none; border-color: var(--sa-primary); box-shadow: 0 0 0 3px var(--sa-primary-soft); }
.content-editable:empty::before { content: attr(data-placeholder); color: var(--sa-ink-faint); }
.hidden-textarea { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* Banners */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.banner-card { background: var(--sa-surface); border: 1px solid var(--sa-border); border-radius: var(--sa-radius); overflow: hidden; box-shadow: var(--sa-shadow-sm); transition: box-shadow 160ms ease; }
.banner-card:hover { box-shadow: var(--sa-shadow); }
.banner-card--inactive { opacity: 0.55; }
.banner-card img { width: 100%; height: 120px; object-fit: cover; background: var(--sa-surface-alt); }
.banner-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.banner-card-body strong { font-size: 13px; }
.banner-card-body span { font-size: 12px; color: var(--sa-ink-soft); }
.banner-card-actions { display: flex; gap: 12px; margin-top: 8px; }

/* Comentarios (moderación) */
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-mod-card { background: var(--sa-surface); border: 1px solid var(--sa-border); border-radius: var(--sa-radius); padding: 16px 20px; box-shadow: var(--sa-shadow-sm); }
.comment-mod-meta { display: flex; gap: 12px; font-size: 12px; color: var(--sa-ink-faint); flex-wrap: wrap; margin-bottom: 8px; }
.comment-mod-meta strong { color: var(--sa-ink); }
.comment-mod-body { font-size: 14px; margin: 0 0 12px; color: var(--sa-ink); }
.comment-mod-actions { display: flex; gap: 10px; }
.comment-mod-actions form { margin: 0; }

/* ===== Login / instalación / panel superadmin ===== */
.admin-auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 18% 20%, #2b2d6b 0%, #17182f 55%, #0b0c18 100%);
}
.admin-auth-card { background: var(--sa-surface); border-radius: 18px; padding: 40px 34px; width: 100%; max-width: 400px; box-shadow: 0 30px 70px rgba(0,0,0,.4); }
.admin-auth-logo {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--sa-primary), #7c3aed); color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 8px 20px rgba(var(--sa-primary-rgb), .35);
}
.admin-auth-card h1 { font-family: var(--sans); font-weight: 800; font-size: 22px; margin: 0 0 4px; text-align: center; color: var(--sa-ink); letter-spacing: -0.3px; }
.admin-auth-subtitle { text-align: center; color: var(--sa-ink-soft); font-size: 13px; margin: 0 0 26px; }
.admin-auth-back { text-align: center; margin-top: 18px; font-size: 13px; }
.admin-auth-card .admin-form { box-shadow: none; border: none; padding: 0; max-width: none; }
.admin-auth-card .admin-form label { text-transform: none; font-size: 13px; font-weight: 600; color: var(--sa-ink); letter-spacing: 0; }

@media (max-width: 800px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 12px; }
  .admin-sidebar-brand, .admin-sidebar-footer { display: none; }
  .admin-nav { flex-direction: row; padding: 0; }
  .admin-nav a.active { box-shadow: none; }
  .admin-main { padding: 18px; }
  .admin-topbar { padding: 14px 18px; }
}

/* ===== Responsive reforzado (jle.com.ar/infonexo) ===== */
@media (max-width: 800px) {
  .admin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .admin-topbar { flex-wrap: wrap; gap: 10px; position: static; }
  .admin-topbar h1 { font-size: 18px; }
  .admin-topbar-user { flex-wrap: wrap; gap: 10px; }
  .admin-topbar-divider { display: none; }
  .admin-nav a { white-space: nowrap; }
  .admin-form { padding: 18px; max-width: 100%; }
  .admin-form-row > label { min-width: 100%; }
  .admin-toolbar-filters { flex-wrap: wrap; }
  .stat-cards > * { min-width: calc(50% - 8px); }
}
@media (max-width: 480px) {
  .admin-main { padding: 14px; }
  .stat-cards > * { min-width: 100%; }
  .admin-form-actions { flex-direction: column; }
  .admin-form-actions .btn { width: 100%; }
  .admin-auth-card { padding: 30px 22px; }
}


/* ===== Panel en celular: menú desplegable y tablas como tarjetas ===== */
.admin-menu-toggle { display: none; }
.table-wrap { width: 100%; }
@media (max-width: 800px) {
  .admin-sidebar { flex-direction: column; overflow: visible; padding: 0; position: sticky; top: 0; z-index: 50; }
  .admin-sidebar-brand { display: block; padding: 14px 64px 14px 16px; font-size: 16px; }
  .admin-sidebar-brand span { display: none; }
  .admin-menu-toggle {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 10px;
    width: 42px; height: 42px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08);
    color: #fff; font-size: 20px; cursor: pointer;
  }
  .admin-nav, .admin-sidebar-footer { display: none; }
  .admin-sidebar.is-open .admin-nav { display: flex; flex-direction: column; padding: 4px 10px 10px; max-height: 70vh; overflow-y: auto; }
  .admin-sidebar.is-open .admin-sidebar-footer { display: block; padding: 10px 22px 14px; }
  .admin-nav a { white-space: normal; padding: 12px 14px; }

  /* Tablas → tarjetas (los títulos de columna los pone admin.js en data-label) */
  .admin-table, .admin-table.is-cards { display: block; overflow: visible; white-space: normal; border: 0; box-shadow: none; background: transparent; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: block; }
  .admin-table tr {
    display: block; background: var(--sa-surface, #fff); border: 1px solid var(--sa-border); border-radius: 12px;
    padding: 10px 14px; margin-bottom: 10px; position: relative;
  }
  .admin-table tbody tr:hover { background: var(--sa-surface, #fff); }
  .admin-table td { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 6px 0; border: 0; font-size: 14px; text-align: right; }
  .admin-table td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--sa-ink-soft); text-align: left; flex-shrink: 0; }
  .admin-table td:not([data-label])::before, .admin-table td[data-label=""]::before { content: none; }
  .admin-table td:first-child[data-label] { font-weight: 600; }
  .admin-table td.admin-table-actions { justify-content: flex-start; gap: 18px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--sa-border); }
  .admin-table td:empty { display: none; }
  /* Asa de arrastre y casilla arriba a la derecha de la tarjeta */
  .admin-table tr:has(.td-handle), .admin-table tr:has(.td-check) { padding-top: 38px; }
  .admin-table td.td-handle { position: absolute; top: 8px; right: 10px; padding: 0; }
  .admin-table td.td-check { position: absolute; top: 10px; left: 14px; padding: 0; }
  .admin-table td .cat-indent { margin-left: 0 !important; }
  .admin-table-slug { word-break: break-all; }

  .admin-form--inline { flex-direction: column; align-items: stretch; }
  .admin-form--inline input, .admin-form--inline select, .admin-form--inline .btn { width: 100%; min-width: 0; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar > .btn { width: 100%; text-align: center; }
  .content-editable { min-height: 260px; }
  .banner-grid { grid-template-columns: 1fr !important; }
  img { max-width: 100%; height: auto; }
}

/* ==========================================================================
   InfoNexo v2 — paneles (administración, superadmin y socios) — nov-2026
   Capa agregada al final: no borra reglas anteriores.
   ========================================================================== */
.admin-body, .admin-auth-body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; color: var(--sa-ink); }
:where(.admin-body, .admin-auth-body) :where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid rgba(var(--sa-primary-rgb), .35); outline-offset: 2px; }

/* Barra lateral fija con su propio scroll (escritorio) */
@media (min-width: 801px) {
  .admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
  .admin-content { flex: 1; min-width: 0; }
}
.admin-sidebar-brand { display: flex; flex-direction: column; }
.admin-sidebar-brand::before { content: ''; display: block; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 6px 16px rgba(99,102,241,.4); }
.admin-nav a { border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; position: relative; transition: background .15s, color .15s; }
.admin-nav a.active { background: linear-gradient(135deg, var(--sa-primary), #7c3aed); }
.admin-nav a.active::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #a5b4fc; }

/* Barra superior */
.admin-topbar { background: rgba(255,255,255,.88); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.admin-topbar h1 { font-size: 20px; }
.admin-avatar { box-shadow: 0 0 0 3px var(--sa-primary-soft); }
.panel-lang { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--sa-surface-alt); border: 1px solid var(--sa-border); gap: 2px; }
.panel-lang a { padding: 4px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 800; color: var(--sa-ink-soft); letter-spacing: .4px; }
.panel-lang a:hover { text-decoration: none; color: var(--sa-ink); }
.panel-lang a.is-active { background: var(--sa-primary); color: #fff; }

/* Contenido */
.admin-main { margin: 0 auto; width: 100%; box-sizing: border-box; }
.admin-section-title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.stat-card { border-radius: 14px; border: 1px solid var(--sa-border); box-shadow: var(--sa-shadow-sm); transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sa-shadow); }
.stat-card-value { font-variant-numeric: tabular-nums; }

/* Formularios */
.admin-form { border-radius: 14px; border: 1px solid var(--sa-border); box-shadow: var(--sa-shadow-sm); }
.admin-body input[type=text], .admin-body input[type=email], .admin-body input[type=password], .admin-body input[type=number], .admin-body input[type=url],
.admin-body input[type=search], .admin-body input[type=date], .admin-body input[type=datetime-local], .admin-body input[type=tel], .admin-body select, .admin-body textarea,
.admin-auth-body input[type=email], .admin-auth-body input[type=password], .admin-auth-body input[type=text] {
  min-height: 42px; border: 1px solid #d9dcea; border-radius: 10px; background: #fff; padding: 9px 12px; font: inherit; font-size: 14.5px; color: var(--sa-ink);
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box; max-width: 100%;
}
.admin-body textarea { min-height: 90px; line-height: 1.5; }
.admin-body input:focus, .admin-body select:focus, .admin-body textarea:focus, .admin-auth-body input:focus { outline: none; border-color: var(--sa-primary); box-shadow: 0 0 0 4px rgba(var(--sa-primary-rgb), .12); }
.admin-body input[type=checkbox], .admin-body input[type=radio] { accent-color: var(--sa-primary); width: 17px; height: 17px; }
.admin-form-hint { color: var(--sa-ink-soft); font-size: 12.5px; }
.form-error, .form-success { border-radius: 10px; }

/* Botones */
.admin-body .btn, .admin-auth-body .btn { min-height: 40px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, box-shadow .15s, background .15s; }
.admin-body .btn-primary, .admin-auth-body .btn-primary { background: linear-gradient(135deg, var(--sa-primary), #6d28d9); border-color: transparent; box-shadow: 0 6px 16px rgba(var(--sa-primary-rgb), .28); }
.admin-body .btn-primary:hover, .admin-auth-body .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(var(--sa-primary-rgb), .34); }
.admin-body .btn-small { min-height: 32px; padding: 5px 12px; font-size: 13px; }

/* Tablas (escritorio) */
@media (min-width: 801px) {
  .admin-table { border-radius: 14px; overflow: hidden; border: 1px solid var(--sa-border); box-shadow: var(--sa-shadow-sm); }
  .admin-table thead th { background: var(--sa-surface-alt); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--sa-ink-soft); }
  .admin-table tbody tr { transition: background .12s; }
  .admin-table tbody tr:hover { background: #f8f8ff; }
  .admin-table td { vertical-align: middle; }
}
.badge { border-radius: 999px; font-weight: 700; letter-spacing: .2px; }

/* Login */
.admin-auth-body { background: radial-gradient(circle at 18% 18%, #2e3080 0%, #17182f 55%, #0b0c18 100%); min-height: 100vh; min-height: 100dvh; }
.admin-auth-card { border-radius: 20px; }
.admin-auth-logo { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; box-shadow: 0 10px 26px rgba(99,102,241,.45); }
.admin-auth-card .panel-lang { margin-top: 4px; }

/* Celulares */
@media (max-width: 800px) {
  .admin-body input, .admin-body select, .admin-body textarea, .admin-auth-body input { font-size: 16px !important; } /* evita el zoom de iPhone */
  .admin-topbar { position: static; padding: 10px 16px; min-height: 0; }
  .admin-topbar h1 { font-size: 17px; width: 100%; }
  .admin-topbar-user { width: 100%; justify-content: space-between; font-size: 12.5px; }
  .admin-user-chip em { display: none; }
  .admin-sidebar-brand::before { display: none; }
  .admin-nav a.active::before { display: none; }
  .admin-nav a { min-height: 46px; display: flex; align-items: center; }
  .admin-main { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .admin-body .btn { min-height: 44px; }
  .admin-table tr { box-shadow: var(--sa-shadow-sm); }
}

@media (prefers-reduced-motion: reduce) {
  .admin-body *, .admin-auth-body * { transition: none !important; }
}
