/* ===========================================================================
   Reporte Venezuela — Hoja de estilos
   Diseño profesional, moderno y totalmente responsive (mobile-first).
   =========================================================================== */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #e4e8f0;
  --text: #18212f;
  --muted: #5d6b7e;
  --primary: #1f4ed1;
  --primary-dark: #163ea6;
  --primary-light: #eef3fd;
  --accent: #1f4ed1;
  --ink: #14213d;
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .05);
  --shadow: 0 6px 22px -8px rgba(20, 33, 61, .13), 0 2px 6px -3px rgba(20, 33, 61, .07);
  --shadow-lg: 0 22px 48px -16px rgba(20, 33, 61, .24);
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 64px;
  --chart-track: #eceff5;
  --overlay: rgba(20, 33, 61, .46);
  --topbar-bg: #ffffff;
}

/* ----------------------------------------------------------- Tema oscuro */
[data-theme="dark"] {
  --bg: #0f1421;
  --surface: #181f2e;
  --surface-2: #212a3b;
  --border: #2c3650;
  --text: #e8edf6;
  --muted: #98a4b8;
  --primary: #5a8af0;
  --primary-dark: #4576dd;
  --primary-light: #1b2540;
  --accent: #5a8af0;
  --ink: #0c1322;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 8px 26px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 50px -16px rgba(0, 0, 0, .72);
  --chart-track: #283450;
  --overlay: rgba(6, 11, 22, .66);
  --topbar-bg: rgba(16, 21, 34, .82);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }

/* ----------------------------------------------------------- Header / navbar */
.topbar {
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 18px;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
}
.brand {
  font-weight: 800; font-size: 1.18rem; color: var(--text);
  display: flex; align-items: center; gap: 8px; letter-spacing: -.02em;
}
.brand:hover { color: var(--text); }
.brand-text { line-height: 1; }
.brand-accent { color: var(--primary); }
.logo {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; background: transparent;
}
[data-theme="dark"] .logo { background: transparent; }
.logo svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 1.5px rgba(20, 33, 61, .18)); }
/* Navegación en línea estilo Facebook (centrada, solo escritorio). */
.topbar-nav { display: none; }
.account-menu-wrap { display: none; position: relative; }
@media (min-width: 768px) {
  .topbar-nav { display: flex; gap: 4px; margin: 0 auto; }
  .account-menu-wrap { display: block; }
}
.topbar-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .94rem;
  position: relative; transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar-nav a.active { color: var(--primary); }
.topbar-nav a.active::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--primary);
}
.topbar-nav a .i { display: grid; place-items: center; }
.topbar-nav a .i svg { width: 19px; height: 19px; }

/* Avatar de cuenta + menú desplegable de la barra. */
.account-btn { padding: 0; overflow: hidden; }
.c-avatar-sm { width: 34px; height: 34px; font-size: .9rem; }
.account-avatar-guest { display: grid; place-items: center; color: var(--text); }
.account-avatar-guest svg { width: 20px; height: 20px; }
.account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.account-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.account-dropdown::before {
  content: ''; position: absolute; top: -6px; right: 14px; width: 12px; height: 12px;
  background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

/* ----------------------------------------------------------------- Layout */
.container { max-width: 1140px; margin: 0 auto; padding: 26px 18px 80px; }
.narrow { max-width: 760px; }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 17px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: .94rem; cursor: pointer; background: #eef2f7; color: var(--text);
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:hover { transform: translateY(-1px); color: var(--text); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px -2px rgba(31, 78, 209, .45);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 6px 16px -4px rgba(31, 78, 209, .5); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: #cbd5e1; background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: rgba(220, 38, 38, .08); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 320px at 88% -40%, rgba(95, 138, 240, .22), transparent 60%),
    linear-gradient(150deg, #16244a, var(--ink));
  color: #fff; border-radius: var(--radius);
  padding: 44px 34px; margin-bottom: 26px;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.55rem, 4.5vw, 2.25rem); margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: rgba(229, 236, 248, .82); margin: 0; max-width: 640px; font-size: 1.03rem; }
.hero .btn { margin-top: 20px; background: #fff; color: var(--ink); border-color: #fff; }
.hero .btn:hover { background: #eef3fd; color: var(--primary-dark); }

/* ---------------------------------------------------------------- Filters */
/* Barra de búsqueda: campo + botón de filtros */
.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-field {
  position: relative; flex: 1; display: flex; align-items: center;
}
.search-ic {
  position: absolute; left: 14px; display: grid; place-items: center;
  color: var(--muted); pointer-events: none;
}
.search-ic svg { width: 18px; height: 18px; }
.search-field input {
  width: 100%; padding: 12px 14px 12px 42px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; background: var(--surface); color: var(--text); font-family: inherit;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.search-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 209, .16);
}
.filter-toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.filter-toggle:hover { border-color: var(--primary); }
.filter-toggle.open, .filter-toggle.has-active { border-color: var(--primary); color: var(--primary); }
.filter-toggle svg { width: 18px; height: 18px; }
.filter-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 1;
}

/* Panel de filtros desplegable */
.filter-panel {
  display: grid; gap: 10px; margin-bottom: 24px;
  grid-template-columns: repeat(3, 1fr) auto;
  align-items: center;
  background: var(--surface); padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  animation: filter-drop .18s ease;
}
.filter-panel[hidden] { display: none; }
@keyframes filter-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.filter-panel select,
.field input, .field select, .field textarea {
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; background: var(--surface); color: var(--text); font-family: inherit;
  width: 100%; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.filter-panel select:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 209, .16);
}
.field input::placeholder, .search-field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }

/* Flecha personalizada en los selects (se quitó la nativa con appearance:none) */
.filter-panel select, .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d6b7e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
[data-theme="dark"] .filter-panel select, [data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a4b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ Cards */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3dced; }
[data-theme="dark"] .card:hover { border-color: #3a4666; }
.card .cover {
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, #e0e9f5, #eef2f7) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.card .cover-empty {
  font-size: .95rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 0 14px; text-align: center;
}
.hint-ok   { color: #166534; }
.hint-warn { color: #92400e; }
.card-body { padding: 15px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card h3 { margin: 0; font-size: 1.06rem; font-weight: 700; }
.card .desc {
  color: var(--muted); font-size: .9rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: auto; }

.tag {
  font-size: .76rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-weight: 600; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 5px;
}
.tag svg { width: 13px; height: 13px; }

/* --------------------------------------------------------- Status badges */
.status { font-size: .76rem; padding: 4px 11px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.status.pendiente   { background: #fef3c7; color: #92400e; }
.status.en_revision { background: #e0e7ff; color: #3730a3; }
.status.en_proceso  { background: #cffafe; color: #0e7490; }
.status.resuelto    { background: #dcfce7; color: #166534; }
.status.rechazado   { background: #fee2e2; color: #991b1b; }

/* -------------------------------------------------------- Support button */
.support {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 700; color: var(--text); font-size: .9rem;
  transition: .15s; width: 100%;
}
.support:hover { border-color: var(--primary); background: var(--primary-light); }
.support.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.support .count {
  font-variant-numeric: tabular-nums; margin-left: auto;
  background: var(--surface-2); padding: 2px 9px; border-radius: 999px; font-size: .85rem;
}
.support.active .count { background: #dbeafe; }

/* ------------------------------------------------------ Compartir reporte */
.share-btn { width: auto; }
.share-btn svg { width: 17px; height: 17px; flex: none; }

/* ----------------------------------------------- Autor del reporte */
.report-author { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.report-author-info { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }

/* ----------------------------------------------- Estadísticas del reporte */
.stat-inline {
  display: inline-flex; align-items: center; gap: 5px;
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
.stat-inline svg { width: 15px; height: 15px; flex: none; }

/* Estadísticas en las tarjetas del listado. */
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-stats { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; }
.card-stats span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.card-stats svg { width: 15px; height: 15px; flex: none; }
.card-stats .pledge-chip { color: #166534; font-weight: 700; }
[data-theme="dark"] .card-stats .pledge-chip { color: #4ade80; }

/* ------------------------------------------------------------------ Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 17px; }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .8rem; }
.field textarea { min-height: 140px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.panel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------- Detail page */
.detail-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.detail-head h1 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.7rem); flex: 1; min-width: 240px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); transition: transform .15s; }
.gallery a:hover img { transform: scale(1.02); }
.kv { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* Encabezado de sección discreto y consistente (descripción, fichas, etc.). */
.section-label {
  margin: 0 0 10px; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
.report-desc p { font-size: .98rem; }

/* --------------------------------------------------------------- Comments */
.comment { padding: 14px 0; border-top: 1px solid var(--border); }
.comment .who { font-weight: 700; font-size: .9rem; }
.comment .when { color: var(--muted); font-size: .8rem; }
.comment.new { animation: commentIn .45s ease both; }
@keyframes commentIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment.flash { position: relative; }
.comment.flash::before {
  content: ''; position: absolute; inset: 0 -12px; border-radius: 10px;
  background: var(--primary-light); z-index: -1; animation: flashFade 1.6s ease forwards;
}
@keyframes flashFade { from { opacity: 1; } to { opacity: 0; } }

/* Resplandor al llegar a un comentario desde una notificación: lo resalta unos
   segundos para que el usuario lo ubique visualmente antes de responder. */
.comment.glow { position: relative; }
.comment.glow::before {
  content: ''; position: absolute; inset: -6px -12px; border-radius: 12px; z-index: -1;
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary), 0 0 22px 5px rgba(31, 78, 209, .42);
  animation: glowPulse 2.9s ease forwards;
}
@keyframes glowPulse {
  0% { opacity: 0; }
  10% { opacity: 1; }
  20% { opacity: .55; }
  30% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

/* Botón en estado "enviando" */
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- Tables */
.table-scroll { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); box-shadow: var(--shadow-sm); border-radius: var(--radius); overflow: hidden; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td select { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; background: var(--surface); color: var(--text); }

/* -------------------------------------------------------------- Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; box-shadow: var(--shadow-sm); text-align: center;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s;
}
.stat:hover { border-color: #d3dced; transform: translateY(-1px); }
[data-theme="dark"] .stat:hover { border-color: #3a4666; }
.stat .n { font-size: 2.05rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* ------------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; transition: .15s; }
.tab:hover { border-color: #cbd5e1; }
.tab.active { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 3px 10px -3px rgba(31,78,209,.45); }
.hidden { display: none !important; }

/* ----------------------------------------------------------------- Alerts */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 14px; border: 1px solid transparent; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

.pagination { display: flex; gap: 10px; justify-content: center; margin-top: 28px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }

/* page header row (panel/admin) */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head h1 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.7rem); }
.page-head .spacer { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 860px) {
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .filter-panel #clearFilters { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .container { padding: 18px 14px 64px; }
  .hero { padding: 28px 20px; border-radius: var(--radius); }
  .filter-toggle span:not(.filter-badge):not(.filter-ic) { display: none; }
  .filter-toggle { padding: 0 14px; }
  .filter-panel { grid-template-columns: 1fr; padding: 12px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .row { grid-template-columns: 1fr; }
  .panel-card { padding: 17px; }
  .stats { grid-template-columns: 1fr 1fr; }

  /* Navbar compacta: el texto de los botones se oculta y queda el ícono. */
  .brand { font-size: 1.05rem; }
  .topbar nav { gap: 6px; }
  .topbar nav .btn { padding: 8px 11px; }
  .nav-label-full { display: none; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 12px; }
}

@media (hover: none) {
  .card:hover { transform: none; }
}

/* =========================================================================
   Botones de ícono, menú hamburguesa, cajón lateral y cambio de tema
   ========================================================================= */
.icon-btn {
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  font-size: 1.15rem; color: var(--text); transition: background .15s, border-color .15s, transform .12s;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); border-color: #cbd5e1; }
[data-theme="dark"] .icon-btn:hover { border-color: #3a486a; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn [data-theme-icon] { display: grid; place-items: center; }

/* =========================================================================
   Centro de notificaciones (campana del encabezado + panel + sonido)
   ========================================================================= */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--danger, #dc2626); color: #fff;
  font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
  border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(16deg); } 40% { transform: rotate(-13deg); }
  60% { transform: rotate(8deg); }  80% { transform: rotate(-5deg); }
}
.notif-bell.ring svg { animation: bellRing .7s ease; transform-origin: 50% 12%; }

.notif-panel {
  position: fixed; top: calc(var(--header-h) + 8px); right: 14px; z-index: 80;
  width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: hidden;
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .16s ease, transform .16s ease;
}
.notif-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--border); flex: none;
}
.notif-head strong { font-size: .98rem; }
.notif-head-actions { display: flex; align-items: center; gap: 6px; }
.notif-sound { background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 4px; border-radius: 7px; }
.notif-sound:hover { background: var(--surface-2); }
.notif-readall {
  background: none; border: none; color: var(--primary); font-weight: 600; font-size: .82rem;
  cursor: pointer; padding: 4px 6px; border-radius: 7px;
}
.notif-readall:hover { background: var(--surface-2); }

.notif-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.notif-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: .9rem; }
.notif-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px;
  border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: var(--primary-light); filter: brightness(.98); }
.notif-ic {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.notif-ic.t-contribution, .notif-ic.t-contrib_verified, .notif-ic.t-resolution_approved { background: #dcfce7; color: #166534; border-color: transparent; }
.notif-ic.t-resolution_rejected { background: #fee2e2; color: #b91c1c; border-color: transparent; }
.notif-ic.t-comment, .notif-ic.t-reply { background: #e0f2fe; color: #075985; border-color: transparent; }
.notif-ic.t-status { background: #ede9fe; color: #5b21b6; border-color: transparent; }
[data-theme="dark"] .notif-ic.t-contribution, [data-theme="dark"] .notif-ic.t-contrib_verified, [data-theme="dark"] .notif-ic.t-resolution_approved { background: #0f2f1d; color: #86efac; }
[data-theme="dark"] .notif-ic.t-resolution_rejected { background: #3a1414; color: #fca5a5; }
[data-theme="dark"] .notif-ic.t-comment, [data-theme="dark"] .notif-ic.t-reply { background: #0c2f44; color: #7dd3fc; }
[data-theme="dark"] .notif-ic.t-status { background: #241a40; color: #c4b5fd; }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text strong { font-size: .9rem; font-weight: 700; line-height: 1.25; }
.notif-body { font-size: .84rem; color: var(--muted); line-height: 1.3; word-break: break-word; }
.notif-when { font-size: .74rem; color: var(--muted); margin-top: 2px; }

@media (max-width: 520px) {
  .notif-panel { right: 8px; left: 8px; width: auto; max-width: none; }
}

/* Toast flotante */
.toast-wrap { position: fixed; z-index: 90; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; max-width: 92vw; }
.toast {
  display: flex; align-items: center; gap: 11px; min-width: 250px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: 13px; padding: 13px 16px;
  box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 500;
  transform: translateX(120%); opacity: 0;
  transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .32s;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.clickable { cursor: pointer; }
.toast.clickable:hover { filter: brightness(.98); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
.toast .tic { display: grid; place-items: center; flex: none; }
.toast .tic svg { width: 18px; height: 18px; }
.toast.success .tic { color: var(--success); }
.toast.error .tic { color: var(--danger); }
@media (max-width: 520px) {
  .toast-wrap { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; }
}

/* Íconos en menú lateral y botón de apoyo */
.nav-drawer-nav a .i { display: grid; place-items: center; width: 22px; flex: none; color: var(--muted); }
.nav-drawer-nav a.active .i { color: var(--primary); }
.nav-drawer-nav a .i svg { width: 19px; height: 19px; }
.support svg { width: 17px; height: 17px; flex: none; }
.count.bump { animation: bump .34s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }

.topbar-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* Overlay translúcido detrás del cajón */
.nav-overlay {
  position: fixed; inset: 0; background: var(--overlay); z-index: 60;
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s;
  backdrop-filter: blur(2px);
}
.nav-overlay.open { opacity: 1; visibility: visible; }

/* Cajón lateral (drawer) */
.nav-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: 300px; max-width: 86vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 70;
  transform: translateX(105%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.nav-drawer-head .brand { font-size: 1.05rem; }
.nav-drawer-nav { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.nav-drawer-nav a {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px;
  border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 1rem;
  transition: background .14s;
}
.nav-drawer-nav a:hover { background: var(--surface-2); color: var(--text); }
.nav-drawer-nav a.active { background: var(--primary-light); color: var(--primary); }
.nav-drawer-nav a .i { font-size: 1.2rem; width: 24px; text-align: center; }
.nav-drawer-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); }

/* Interruptor de tema dentro del cajón */
.theme-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
  font-weight: 600; color: var(--text); font-size: .95rem;
}
.theme-switch:hover { border-color: #cbd5e1; }
.theme-switch .pill {
  width: 46px; height: 26px; border-radius: 999px; background: var(--border);
  position: relative; transition: background .2s; flex: none;
}
.theme-switch .pill::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .theme-switch .pill { background: var(--primary); }
[data-theme="dark"] .theme-switch .pill::after { transform: translateX(20px); }

/* =========================================================================
   Skeletons (placeholders animados durante la carga)
   ========================================================================= */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shimmer 1.4s infinite;
}
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

.sk-line { height: 12px; border-radius: 6px; }
.sk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.sk-cover { aspect-ratio: 16 / 9; border-radius: 0; }
.sk-body { padding: 15px 16px; display: flex; flex-direction: column; gap: 10px; }
.sk-table { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.sk-trow { display: flex; gap: 14px; align-items: center; }
.sk-trow .sk-line { height: 14px; }

/* Transición suave al cambiar de tema */
body, .topbar, .card, .panel-card, .filter-panel, .search-field input, .filter-toggle, table, th, td,
.field input, .field select, .field textarea, .btn-ghost, .tag, .stat, .tab,
.nav-drawer, .icon-btn, .support, .empty, .theme-switch {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

body { display: flex; flex-direction: column; min-height: 100vh; }
.container { width: 100%; flex: 1; }

.footer-staff { display: block; text-align: center; color: var(--muted); font-size: .82rem; margin-top: 6px; }
.footer-staff:hover { color: var(--primary); }

/* =========================================================================
   Galería + Lightbox (visor de imágenes dentro de la página)
   ========================================================================= */
.gallery-item {
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: zoom-in; background: var(--surface-2); aspect-ratio: 4 / 3;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; display: block; }
.gallery-item:hover img { transform: scale(1.06); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 22, .93); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lb-img { max-width: 92vw; max-height: 86vh; border-radius: 8px; object-fit: contain; box-shadow: 0 24px 70px rgba(0, 0, 0, .6); animation: lbIn .25s ease; }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.lb-close { position: fixed; top: 18px; right: 18px; width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-close:hover { background: rgba(255, 255, 255, .26); }
.lb-close svg { width: 22px; height: 22px; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lightbox.one .lb-nav { display: none; }

/* =========================================================================
   Sección de comentarios profesional + respuestas + tiempo real
   ========================================================================= */
.comments-section { margin-top: 26px; }
.comments-title { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: livePulse 2s infinite; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 128, 61, .5); }
  70% { box-shadow: 0 0 0 7px rgba(22, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 128, 61, 0); }
}

/* Avatar con inicial */
.c-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: var(--primary); font-size: .95rem; user-select: none;
}
.c-avatar.lg { width: 42px; height: 42px; }
.c-avatar-anon { background: var(--muted); }
.c-avatar-anon svg { width: 62%; height: 62%; }

/* Caja para escribir comentario */
.comment-box {
  display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.comment-box-fields { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.comment-box textarea, .reply-form textarea {
  width: 100%; min-height: 74px; resize: vertical; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: .95rem;
}
.comment-box textarea:focus, .reply-form textarea:focus,
.comment-box-foot input:focus, .reply-form-foot input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16);
}
.comment-box-foot, .reply-form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-box-foot input, .reply-form-foot input {
  flex: 1; min-width: 140px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit;
}
.comment-box-foot .counter { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.comment-box-foot .btn { margin-left: auto; }

/* Casilla "comentar como anónimo" (sustituye al campo de nombre cuando hay sesión). */
.anon-toggle {
  flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .85rem; cursor: pointer; user-select: none;
}
.comment-box-foot .anon-toggle input, .reply-form-foot .anon-toggle input {
  flex: none; min-width: 0; width: 16px; height: 16px; padding: 0; margin: 0; cursor: pointer; accent-color: var(--primary);
}

/* Lista y comentarios */
.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comments-list > .comment {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.c-row { display: flex; gap: 12px; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.c-head .who { font-weight: 700; font-size: .92rem; }
.c-head .when { color: var(--muted); font-size: .78rem; }
.c-body { margin: 5px 0 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: .94rem; }
.c-tools { margin: 8px 0 0 50px; }
.reply-btn {
  display: inline-flex; align-items: center; gap: 5px; background: none; border: none;
  color: var(--muted); font-weight: 600; font-size: .82rem; cursor: pointer; padding: 2px 0;
}
.reply-btn:hover { color: var(--primary); }
.reply-btn svg { width: 13px; height: 13px; }

.replies { margin: 10px 0 0 50px; display: flex; flex-direction: column; gap: 12px; border-left: 2px solid var(--border); padding-left: 14px; }
.replies:empty { display: none; }
.comment.reply { border-top: none; padding: 0; }
.comment.reply .c-avatar { width: 32px; height: 32px; font-size: .82rem; }

.reply-form { margin: 10px 0 0 50px; display: flex; flex-direction: column; gap: 8px; }
.reply-form-foot .btn { margin-left: 0; }

/* Animación de tarjeta nueva en el feed en vivo */
.card-new { animation: cardIn .5s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(-10px) scale(.99); } to { opacity: 1; transform: none; } }

/* Fila de apoyo en el detalle: el botón a su tamaño natural */
.support-row { display: flex; align-items: center; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.support-row .support { width: auto; }

@media (max-width: 520px) {
  .c-tools, .replies, .reply-form { margin-left: 0; }
  .comment-box { padding: 13px; }
  .comment-box-foot .btn { margin-left: 0; width: 100%; }
}

/* =========================================================================
   Cuentas de ciudadano: menú, perfil, reputación
   ========================================================================= */
.drawer-city { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.drawer-city label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.drawer-city select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: .92rem; -webkit-appearance: none; appearance: none;
}
.drawer-city select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }

.drawer-account { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.account-card {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.account-card:hover { border-color: var(--primary); color: var(--text); }
.account-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.account-meta strong { font-size: .92rem; }
.account-meta .muted { font-size: .78rem; }
.account-actions { display: flex; flex-direction: column; gap: 8px; }

.rep-badge {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  font-weight: 700; font-size: .74rem; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
[data-theme="dark"] .rep-badge { color: var(--primary); }

/* Cabecera de perfil — banner profesional centrado y simétrico */
.profile-banner { padding: 0; overflow: hidden; }
.profile-cover {
  height: 96px; position: relative;
  background: linear-gradient(120deg, var(--primary), var(--accent));
}
.profile-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 150% at 12% -10%, rgba(255, 255, 255, .25), transparent 55%);
}
.profile-body { padding: 0 24px 26px; margin-top: -48px; text-align: center; position: relative; z-index: 1; }
.c-avatar.xl {
  width: 92px; height: 92px; font-size: 2.1rem; margin: 0 auto;
  border: 4px solid var(--surface); box-shadow: var(--shadow);
}
.profile-name {
  margin: 14px 0 0; font-size: 1.55rem; letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.profile-meta { margin: 8px 0 0; font-size: .9rem; }
.profile-rep-inline {
  margin: 16px auto 0; display: inline-flex; align-items: baseline; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.profile-rep-inline strong { font-size: 1.35rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.profile-rep-inline span { color: var(--muted); font-size: .85rem; }
/* Compatibilidad con el bloque de reputación numérico (otros usos) */
.rep-number { font-size: 2.2rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }

.level-badge {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: middle;
  font-weight: 700; font-size: .78rem; padding: 3px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.level-badge svg { width: 12px; height: 12px; }
.level-badge.is-verified { box-shadow: 0 0 0 1px currentColor inset; }
.level-badge.tier-2 { background: #e0f2fe; color: #075985; border-color: transparent; }
.level-badge.tier-3 { background: #dcfce7; color: #166534; border-color: transparent; }
.level-badge.tier-4 { background: #ede9fe; color: #5b21b6; border-color: transparent; }
.level-badge.tier-5 { background: #fef3c7; color: #92400e; border-color: transparent; }
[data-theme="dark"] .level-badge.tier-2 { background: #0c2f44; color: #7dd3fc; }
[data-theme="dark"] .level-badge.tier-3 { background: #0f2f1d; color: #86efac; }
[data-theme="dark"] .level-badge.tier-4 { background: #241a40; color: #c4b5fd; }
[data-theme="dark"] .level-badge.tier-5 { background: #382a0d; color: #fcd34d; }

/* Lista compacta de reportes (perfil) */
.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini-report {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.mini-report:hover { border-color: #d3dced; color: var(--text); transform: translateY(-1px); }
[data-theme="dark"] .mini-report:hover { border-color: #3a4666; }

@media (max-width: 520px) {
  .profile-body { padding: 0 16px 22px; }
}

/* Progreso al siguiente nivel */
.level-progress { margin: 16px auto 0; display: flex; flex-direction: column; gap: 6px; max-width: 380px; width: 100%; }
.level-progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.level-progress-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .5s ease; }

/* Desglose de reputación */
.rep-breakdown { display: flex; flex-direction: column; }
.rep-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.rep-row:first-child { border-top: none; }
.rep-row .muted { font-variant-numeric: tabular-nums; }
.rep-row strong { color: var(--success); min-width: 52px; text-align: right; }
.rep-row.total { border-top: 2px solid var(--border); font-weight: 700; }
.rep-row.total strong { color: var(--text); }

/* Pestañas internas del perfil */
.profile-tabs { display: flex; gap: 6px; margin: 24px 0 14px; flex-wrap: wrap; }
.ptab { padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.ptab:hover { border-color: #cbd5e1; }
.ptab.active { background: var(--primary); color: #fff; border-color: transparent; }

/* =========================================================================
   Resolución ciudadana + donaciones (materiales / pago móvil)
   ========================================================================= */
.solve-section { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.solve-cta { border-left: 4px solid var(--primary); }
.resolver-card { border-left: 4px solid var(--success); }
.resolved-title { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.resolved-title svg { width: 20px; height: 20px; color: var(--success); }

.pago-box {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .95rem; font-weight: 600;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 10px 0; word-break: break-word;
}

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.inline-form input {
  flex: 1; min-width: 140px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: .92rem;
}
.inline-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }

/* Campo de monto con prefijo fijo de moneda (USD) que no se puede editar ni borrar. */
.amount-field { position: relative; flex: 1; min-width: 140px; display: flex; }
.amount-field .amount-prefix {
  position: absolute; left: 1px; top: 1px; bottom: 1px; display: flex; align-items: center;
  padding: 0 11px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: #075985;
  background: #e0f2fe; border-radius: var(--radius-sm) 0 0 var(--radius-sm); pointer-events: none; user-select: none;
}
.amount-field input {
  width: 100%; flex: 1; padding: 11px 13px 11px 56px; font: inherit; font-size: .95rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.amount-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }
[data-theme="dark"] .amount-field .amount-prefix { background: #0c2a3f; color: #7dd3fc; }

.ledger { display: flex; flex-direction: column; gap: 8px; }
.ledger-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.ledger-main { flex: 1; min-width: 0; font-size: .92rem; }
.ledger-tag { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; flex: none; margin-top: 1px; }
.ledger-tag.material { background: #dcfce7; color: #166534; }
.ledger-tag.dinero { background: #e0f2fe; color: #075985; }
.ledger-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ledger-item.is-verified { border-color: #bbf7d0; }
[data-theme="dark"] .ledger-item.is-verified { border-color: #1f5135; }
.verified-badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; color: var(--success); background: #dcfce7; padding: 2px 8px; border-radius: 999px; }
.verified-badge svg { width: 12px; height: 12px; }
[data-theme="dark"] .verified-badge { background: #16341f; }
.declared-badge { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.ref-chip { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; font-family: ui-monospace, Menlo, monospace; }
.wa-link { display: inline-block; margin-top: 5px; font-size: .82rem; font-weight: 600; color: #16a34a; }
.wa-link:hover { color: #15803d; text-decoration: underline; }
.ledger-item .verify-btn { margin-top: 7px; }

/* Ofrecimientos ("puedo solucionarlo") e incentivos (promesas de donación) */
.offers-card { border-left: 4px solid var(--primary); }
.pledges-card { border-left: 4px solid var(--success); }
.stack-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.stack-form textarea,
.stack-form > input,
.stack-form select {
  width: 100%; resize: vertical; padding: 11px 13px; font: inherit; font-size: .92rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.stack-form textarea { min-height: 64px; }
.stack-form textarea:focus,
.stack-form > input:focus,
.stack-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }
.stack-form input::placeholder { color: var(--muted); opacity: .8; }
.stack-form button { align-self: flex-start; }
.my-offer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 2px; }
.offer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
/* Separa el formulario de aporte del listado de la comunidad; mismo trato en
   ambas tarjetas (incentivos y ofrecimientos) para que queden simétricas. */
.community-list { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.ledger-more { align-self: center; margin-top: 10px; }
.offer-item { padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.offer-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-who { font-weight: 700; }
.offer-when { font-size: .78rem; margin-left: auto; }
.offer-note { margin: 5px 0 0; white-space: pre-wrap; font-size: .92rem; }
.pledges-card select {
  padding: 9px 10px; font: inherit; font-size: .92rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.pledges-card select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }
.pledge-total-wrap { display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.pledge-total { font-size: .78rem; font-weight: 800; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 10px; }
[data-theme="dark"] .pledge-total { color: #4ade80; background: #16341f; }

/* =========================================================================
   Recompensa / "Donar ahora" — tarjeta de custodia de la plataforma
   ========================================================================= */
.donate-card { border-left: 4px solid var(--success); }
.donate-card > h3 { display: flex; align-items: center; gap: 8px; }

/* Panel de totales (Recaudado / Prometido). Reutilizado en el panel admin. */
.reward-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px;
  margin: 16px 0;
}
.reward-total {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.reward-total.secured  { background: #f0fdf5; border-color: #bbf7d0; }
.reward-total.promised { background: #eff5ff; border-color: #c3d9fb; }
[data-theme="dark"] .reward-total.secured  { background: #0f2418; border-color: #1f5135; }
[data-theme="dark"] .reward-total.promised { background: #14233f; border-color: #28477a; }
.rt-val {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em;
  line-height: 1.05; font-variant-numeric: tabular-nums;
}
.reward-total.secured  .rt-val { color: #15803d; }
.reward-total.promised .rt-val { color: var(--primary); }
[data-theme="dark"] .reward-total.secured  .rt-val { color: #4ade80; }
[data-theme="dark"] .reward-total.promised .rt-val { color: #7dabff; }
.rt-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rt-sub { font-size: .76rem; margin-top: 1px; }

/* Datos de pago móvil de la plataforma: bloque estructurado tipo "ficha". */
.pm-box {
  margin: 14px 0; padding: 4px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.pm-title {
  margin: 14px 0 4px; font-size: .8rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.pm-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex: none;
}
.pm-data { list-style: none; margin: 0; padding: 0; }
.pm-data li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.pm-data li:first-child { border-top: none; }
.pm-data li > span { font-size: .82rem; color: var(--muted); flex: none; }
.pm-data li > strong {
  font-size: .9rem; font-weight: 700; text-align: right; word-break: break-word;
  font-variant-numeric: tabular-nums;
}

/* Texto de ayuda genérico bajo los formularios (fuera de .field). */
.hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.hint-ok   { color: #166534; }
.hint-warn { color: #92400e; }
[data-theme="dark"] .hint-ok   { color: #4ade80; }
[data-theme="dark"] .hint-warn { color: #fcd34d; }

/* Estado de "tu donación está por confirmar" dentro de la tarjeta. */
.donate-card .my-offer-row .declared-badge {
  background: #fef9ec; color: #92400e; border-color: #fce3a6; font-size: .82rem; padding: 6px 12px;
}
[data-theme="dark"] .donate-card .my-offer-row .declared-badge {
  background: #382a0d; color: #fcd34d; border-color: #5b4310;
}

/* Donación en el libro: importe destacado y badge de estado a la derecha. */
#donList .ledger-item { align-items: center; }
#donList .ledger-line { justify-content: flex-start; }

/* Selector segmentado: Donar ahora / Prometer. */
.reward-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 14px;
  padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
}
.rt-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border: none; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); background: transparent;
  transition: background .15s, color .15s, box-shadow .15s;
}
.rt-tab:hover { color: var(--text); }
.rt-tab svg { width: 16px; height: 16px; }
.rt-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .rt-tab.active { background: var(--surface); color: #7dabff; }

.reward-panel[hidden] { display: none; }
.reward-mode-desc { margin: 0 0 12px; font-size: .9rem; }

/* Avisos / política — callouts serios con borde lateral de color. */
.callout {
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: .86rem; line-height: 1.5;
  border: 1px solid var(--border); border-left-width: 4px; background: var(--surface-2);
}
.callout + .callout, .reward-panel + .callout, .reward-policy { margin-top: 12px; }
.callout strong { font-weight: 700; }
.callout-warn {
  background: #fef9ec; border-color: #fce3a6; border-left-color: var(--warning); color: #7a4f10;
}
.callout-info {
  background: var(--primary-light); border-color: #c3d9fb; border-left-color: var(--primary); color: var(--ink);
}
[data-theme="dark"] .callout-warn { background: #2e2410; border-color: #5b4310; border-left-color: #d97706; color: #fcd34d; }
[data-theme="dark"] .callout-info { background: #14233f; border-color: #28477a; border-left-color: #5a8af0; color: #cdddf7; }

/* Los dos libros (custodia / promesas) bajo la tarjeta de recompensa. */
.reward-ledgers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border);
}
.reward-ledger-group .section-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .reward-ledgers { grid-template-columns: 1fr; gap: 16px; } }

.staff-resolutions { border-left: 4px solid var(--warning); }
.res-claim { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.res-claim:first-of-type { border-top: none; }
.res-claim-info { flex: 1; min-width: 220px; }
.res-actions { display: flex; gap: 8px; }
.reject-form { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.reject-form textarea {
  width: 100%; min-height: 56px; resize: vertical; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: .9rem;
}
.reject-form textarea:focus { outline: none; border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.reject-form-foot { display: flex; gap: 8px; }

/* Formulario "ya lo solucioné" */
#resolveForm { display: flex; flex-direction: column; gap: 10px; }
#resolveForm textarea {
  width: 100%; min-height: 70px; resize: vertical; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: .94rem;
}
#resolveForm textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 209, .16); }
.file-label { font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.file-label input[type=file] { font-size: .85rem; color: var(--text); }
#resolveForm button { align-self: flex-start; }

/* Miniaturas de evidencia */
.evi-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.evi-thumb { padding: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); width: 76px; height: 76px; }
.evi-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.evi-thumb:hover img { transform: scale(1.08); }
.resolution-proof { margin-top: 4px; }

/* Aviso de solicitudes en el panel de moderación */
.res-badge { background: #fef3c7; color: #92400e; font-weight: 700; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
[data-theme="dark"] .ledger-tag.material { background: #16341f; color: #4ade80; }
[data-theme="dark"] .ledger-tag.dinero { background: #0c2a3f; color: #7dd3fc; }

/* --- Autor en tarjeta de reporte (insignia de confianza) ----------------- */
.card-author { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.card-author strong { color: var(--text); font-weight: 600; }

/* --- Ranking de vecinos -------------------------------------------------- */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th, .ranking-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.ranking-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ranking-table tbody tr:hover { background: var(--surface-2); }
.ranking-table .rk-pos { font-weight: 700; width: 48px; font-size: 1.05rem; text-align: center; }
.ranking-table .rk-pts { text-align: right; font-weight: 800; color: var(--primary); white-space: nowrap; }
.ranking-table a { font-weight: 600; }
.ranking-table tr.rk-top .rk-pos { font-size: 1.25rem; }
.ranking-table tr.rk-top td { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 6%, transparent), transparent); }

/* --- Chip de estado (subdominio multi-tenant) ---------------------------- */
.state-chip {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 9px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; border-radius: 999px;
  background: var(--primary-light); color: var(--primary); border: 1px solid var(--border);
  white-space: nowrap;
}

/* --- Botón flotante para reportar (FAB) ---------------------------------- */
/* Acceso permanente y sticky, fijo en la esquina inferior derecha. */
/* El color se fija en todos los estados para ganarle a la regla global
   `a:hover { color: var(--primary-dark) }`, que de lo contrario teñía el
   texto e icono (currentColor) del mismo azul del fondo al presionar. */
.report-fab,
.report-fab:link,
.report-fab:visited,
.report-fab:hover,
.report-fab:active,
.report-fab:focus { color: #fff; }
.report-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 20px;
  font-family: inherit; font-size: .95rem; font-weight: 700; line-height: 1;
  letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid color-mix(in srgb, #fff 16%, var(--primary));
  border-radius: 999px;
  box-shadow:
    0 10px 28px -8px color-mix(in srgb, var(--primary) 65%, transparent),
    0 4px 10px -4px rgba(20, 33, 61, .28);
  cursor: pointer;
  /* Sin transform en reposo: un position:fixed con transform activo se
     "despega" del viewport y deriva al hacer scroll en móvil. */
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow .2s ease, background .2s ease;
  animation: fab-in .32s ease both;
}
.report-fab:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow:
    0 16px 36px -8px color-mix(in srgb, var(--primary) 72%, transparent),
    0 6px 14px -4px rgba(20, 33, 61, .32);
}
.report-fab:active { transform: translateY(-1px) scale(.98); }
.report-fab:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary) 35%, transparent),
    0 10px 28px -8px color-mix(in srgb, var(--primary) 65%, transparent);
}
.report-fab-ic { display: grid; place-items: center; }
.report-fab-ic svg { width: 20px; height: 20px; stroke-width: 2.4; }
.report-fab-label { display: inline-block; }

/* Entrada solo con opacidad para no dejar un transform residual en el FAB. */
@keyframes fab-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* En dispositivos táctiles el estado :hover se queda "pegado" tras tocar;
   sin transform persistente el botón fijo no deriva al hacer scroll. */
@media (hover: none) {
  .report-fab:hover, .report-fab:active { transform: none; }
}

/* En pantallas pequeñas se compacta a un botón circular (solo icono). */
@media (max-width: 560px) {
  .report-fab {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    padding: 0; width: 56px; height: 56px;
    justify-content: center; gap: 0;
  }
  .report-fab-label { display: none; }
  .report-fab-ic svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .report-fab { animation: none; transition: box-shadow .2s ease; }
  .report-fab:hover, .report-fab:active { transform: none; }
}

/* ============================================================ Auth (ingresar / registro / staff) */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

/* --- Panel de marca (izquierda en desktop) --- */
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 48px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(90, 138, 240, .42), transparent 60%),
    radial-gradient(100% 80% at 92% 100%, rgba(31, 78, 209, .40), transparent 55%),
    linear-gradient(150deg, #16244a, var(--ink));
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 100% at 30% 0%, #000, transparent 70%);
          mask-image: radial-gradient(120% 100% at 30% 0%, #000, transparent 70%);
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }

.auth-brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.28rem; color: #fff; }
.auth-brand .logo { width: 34px; height: 34px; display: grid; place-items: center; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.auth-brand .logo svg { width: 100%; height: 100%; }
.auth-brand .brand-accent { color: #9bbcff; }

.auth-aside-body { margin: auto 0; max-width: 420px; }
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #c9d8ff; background: rgba(255, 255, 255, .1);
  padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
}
.auth-headline { font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.12; font-weight: 800; margin: 20px 0 14px; letter-spacing: -.02em; }
.auth-headline .grad { background: linear-gradient(90deg, #ffe27a, #ffd116 40%, #9bbcff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tagline { color: rgba(255, 255, 255, .82); font-size: 1.02rem; line-height: 1.55; }

.auth-points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 15px; }
.auth-points li { display: flex; align-items: flex-start; gap: 12px; color: rgba(255, 255, 255, .9); font-size: .95rem; line-height: 1.4; }
.auth-points .tick {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); color: #9bffd0;
}
.auth-points .tick svg { width: 15px; height: 15px; }

.auth-aside-foot { font-size: .82rem; color: rgba(255, 255, 255, .55); }

/* --- Panel del formulario (derecha) --- */
.auth-main {
  display: flex;
  flex-direction: column;
  padding: 28px clamp(20px, 5vw, 64px);
}
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-topbar .auth-brand { color: var(--text); font-size: 1.12rem; }
.auth-topbar .auth-brand .brand-accent { color: var(--primary); }
.auth-mini-link { font-size: .88rem; font-weight: 600; color: var(--muted); }
.auth-mini-link:hover { color: var(--text); }

.auth-card { width: 100%; max-width: 396px; margin: auto; padding: 8px 0 40px; }
.auth-card h1 { font-size: clamp(1.5rem, 3vw, 1.85rem); margin: 0 0 6px; letter-spacing: -.02em; }
.auth-card .auth-sub { color: var(--muted); font-size: .95rem; line-height: 1.5; margin: 0 0 24px; }
.auth-card form { margin: 0; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .field label { font-size: .86rem; color: var(--text); }

/* Campo con icono y revelado de contraseña */
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input .lead {
  position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted);
  pointer-events: none; transition: color .15s;
}
.auth-input input, .auth-input select { width: 100%; padding-left: 42px; padding-top: 12px; padding-bottom: 12px; }
.auth-input:focus-within .lead { color: var(--primary); }
.auth-input.has-toggle input { padding-right: 44px; }
.auth-reveal {
  position: absolute; right: 6px; width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; transition: color .15s, background .15s;
}
.auth-reveal:hover { color: var(--text); background: var(--surface-2); }
.auth-reveal svg { width: 18px; height: 18px; }
.auth-reveal .eye-off { display: none; }
.auth-reveal.on .eye-on { display: none; }
.auth-reveal.on .eye-off { display: block; }

.auth-forgot { display: inline-block; margin-top: 9px; font-size: .85rem; font-weight: 600; color: var(--primary); }
.auth-forgot:hover { color: var(--primary-dark); text-decoration: underline; }

.auth-card .btn-primary { width: 100%; padding: 12px; font-size: .98rem; margin-top: 4px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: .92rem; }
.auth-foot a { font-weight: 600; }

.auth-sep { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: .8rem; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.icon-btn.auth-theme { width: 38px; height: 38px; }

/* --- Responsive: una sola columna --- */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { min-height: 100vh; padding: 22px; }
}
@media (max-width: 380px) {
  .auth-main { padding: 18px 16px; }
}
