/* ============================================================
   Casas Amigas 2026 — Design System
   Tema: Verde político / oscuro, glassmorphism
   ============================================================ */

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

/* ── Variables ───────────────────────────────────────────── */
:root {
  --green-900:  #064e3b;
  --green-800:  #065f46;
  --green-700:  #047857;
  --green-600:  #059669;
  --green-500:  #10b981;
  --green-400:  #34d399;
  --green-300:  #6ee7b7;
  --green-100:  #d1fae5;
  --green-50:   #ecfdf5;

  --dark-950:   #030712;
  --dark-900:   #0f1117;
  --dark-800:   #1a1d27;
  --dark-700:   #252836;
  --dark-600:   #31364a;
  --dark-500:   #404558;

  --text-primary:   #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;

  --accent:       var(--green-500);
  --accent-hover: var(--green-400);
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.5);
  --shadow-glow: 0 0 24px rgba(16,185,129,.25);

  --transition: .2s ease;
  --font: 'Inter', system-ui, sans-serif;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark-900);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* ── Layout ──────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--dark-800);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(5,150,105,.2), rgba(16,185,129,.1));
  color: var(--accent);
  border: 1px solid rgba(16,185,129,.2);
}

.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--dark-700);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-info .name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info .role {
  font-size: 11px; color: var(--text-muted);
}

.btn-logout {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--danger); }

/* Main content */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--dark-800);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-badge {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.page-body {
  padding: 32px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-wrap {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.progress-title { font-size: 15px; font-weight: 600; }
.progress-pct   { font-size: 28px; font-weight: 800; color: var(--accent); }

.progress-bar {
  height: 14px;
  background: var(--dark-700);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--green-400));
  border-radius: 999px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; bottom: 0;
  width: 80%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer { to { left: 120%; } }

.progress-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Filters ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.filter-control {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color var(--transition);
  width: 100%;
}

.filter-control:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--dark-700);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}
tbody tr:hover {
  background: rgba(255,255,255,.025);
}

.cell-coord {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 180px;
}

.cell-small {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline progress in table */
.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-bar {
  flex: 1;
  height: 6px;
  background: var(--dark-600);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
}
.mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-700), var(--green-400));
  border-radius: 999px;
  transition: width .8s ease;
}
.mini-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green  { background: rgba(16,185,129,.15); color: var(--green-400); }
.badge-yellow { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-red    { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-orange { background: rgba(249,115,22,.15);  color: #fb923c; }
.badge-gray   { background: rgba(255,255,255,.08); color: var(--text-secondary); }
.badge-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }

/* Semáforo para barras de progreso */
.progress-fill.red, .mini-fill.red { background: linear-gradient(90deg, #ef4444, #f87171) !important; }
.progress-fill.orange, .mini-fill.orange { background: linear-gradient(90deg, #f97316, #fb923c) !important; }
.progress-fill.yellow, .mini-fill.yellow { background: linear-gradient(90deg, #eab308, #facc15) !important; }
.progress-fill.green, .mini-fill.green { background: linear-gradient(90deg, #10b981, #34d399) !important; }

/* Semáforo para colores de texto */
.text-red { color: #f87171 !important; }
.text-orange { color: #fb923c !important; }
.text-yellow { color: #facc15 !important; }
.text-green { color: #34d399 !important; }


/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,185,129,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  box-shadow: 0 4px 20px rgba(16,185,129,.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--dark-700);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.08);
}
.btn-secondary:hover {
  background: var(--dark-600);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239,68,68,.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.2);
}
.btn-danger:hover {
  background: rgba(239,68,68,.25);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.08);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-corte {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.btn-corte:hover {
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,.4);
}
.btn-corte:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}

.form-control::placeholder { color: var(--text-muted); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(6,95,70,.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(5,150,105,.15) 0%, transparent 50%),
              var(--dark-950);
}

.login-card {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-circle {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--green-700), var(--green-400));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-glow);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

.error-alert {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Responsable Blocks ──────────────────────────────────── */
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.block-card {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.block-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-700), var(--green-400));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.block-card:hover {
  border-color: rgba(16,185,129,.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: inherit;
}

.block-card:hover::before { transform: scaleX(1); }

.block-companera {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.block-dir {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.block-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.block-count {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}
.block-count-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Activistas grid ─────────────────────────────────────── */
.activistas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.activista-btn {
  aspect-ratio: 1;
  background: var(--dark-700);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}

.activista-btn:hover {
  background: rgba(16,185,129,.15);
  border-color: var(--green-500);
  color: var(--green-400);
  transform: scale(1.05);
}

.activista-btn.marcando {
  opacity: .5;
  pointer-events: none;
}

.activista-btn.completo,
.activista-btn.completo:disabled {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--green-500) !important;
  color: #34d399 !important;
  opacity: 1 !important;
  cursor: default;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  padding: 0 10px;
}

.page-btn:hover {
  background: var(--dark-600);
  color: var(--text-primary);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  border-color: transparent;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--dark-800);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  max-width: 320px;
}

.toast-success { border-left: 3px solid var(--green-500); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.25);
  color: var(--green-400);
}

/* ── Util ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark-900); }
::-webkit-scrollbar-thumb { background: var(--dark-600); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark-500); }

/* ── Mobile Overlay (sidebar backdrop) ──────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 99;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sidebar-overlay.visible { display: block; }

/* ── Mobile toggle button (always visible on mobile) ────── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.menu-toggle:hover { background: var(--dark-600); }

/* ── Bottom Navigation (mobile responsables) ─────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--dark-800);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 90;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: var(--radius-md);
  transition: color var(--transition);
  min-width: 64px;
}
.bottom-nav-item .bn-icon { font-size: 22px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:hover  { color: var(--accent); }

/* ── Dashboard mobile card view (replaces table on mobile) ─ */
.bloque-cards-mobile {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.bloque-card-m {
  background: var(--dark-700);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.bloque-card-m-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.bloque-card-m-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.bloque-card-m-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.bloque-card-m-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

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

/* Tablets (768px y menores) */
@media (max-width: 768px) {

  /* Sidebar → drawer off-canvas */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main sin margen izquierdo */
  .main-content {
    margin-left: 0;
    padding-bottom: 70px; /* espacio para bottom nav */
  }

  /* Topbar compacto */
  .topbar {
    padding: 10px 14px;
    position: sticky;
    top: 0;
  }
  .topbar-title { font-size: 15px; }
  .topbar-badge { display: none; }

  /* Mostrar toggle del menú */
  .menu-toggle { display: flex; }

  /* Esconder el botón legacy */
  #menuToggle { display: none !important; }

  /* Page body */
  .page-body { padding: 14px; }

  /* Stats: 2x2 en móvil */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px; }
  .stat-icon { font-size: 22px; margin-bottom: 8px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }

  /* Progress */
  .progress-wrap { padding: 16px; }
  .progress-pct  { font-size: 22px; }

  /* Cards */
  .card { padding: 14px; }
  .card-header { margin-bottom: 14px; }
  .card-title  { font-size: 14px; }

  /* Filters → columna */
  .filter-bar {
    flex-direction: column;
    gap: 10px;
  }
  .filter-group { min-width: 0; width: 100%; }
  .filter-control { font-size: 16px; padding: 10px 12px; } /* evita zoom en iOS */
  .filter-bar > div { width: 100%; }
  .filter-bar .btn { width: 100%; justify-content: center; padding: 12px; }

  /* Tabla admin: ocultar, mostrar cards */
  .table-wrap { display: none; }
  .bloque-cards-mobile { display: flex; }

  /* Blocks grid del responsable: 1 columna */
  .blocks-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .block-card { padding: 16px; }
  .block-companera { font-size: 15px; }

  /* Activistas: botones más grandes para touch */
  .activistas-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
  }
  .activista-btn {
    min-height: 64px;
    font-size: 16px;
    border-radius: var(--radius-lg);
    border-width: 2px;
  }

  /* Paginación */
  .pagination { gap: 4px; }
  .page-btn { min-width: 40px; height: 40px; font-size: 14px; }

  /* Bottom nav visible */
  .bottom-nav { display: block; }

  /* Login */
  .login-card {
    padding: 32px 20px;
    border-radius: var(--radius-lg);
    margin: 16px;
  }

  /* Modal full-screen en móvil */
  .modal { margin: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-overlay { align-items: flex-end; }

  /* Toast abajo centrado */
  .toast-container {
    bottom: 80px;
    right: 12px;
    left: 12px;
  }
  .toast { max-width: 100%; }

  /* Ocultar columnas no esenciales en tablas de usuarios */
  .hide-mobile { display: none !important; }
}

/* Móviles pequeños (< 480px) */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card  { padding: 12px; }
  .stat-value { font-size: 20px; }

  /* Activistas más compactos pero grandes */
  .activistas-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
  }
  .activista-btn { min-height: 56px; font-size: 14px; }

  /* Bloque header en columna */
  .bloque-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bloque-counter { text-align: left !important; }
}

/* Asegura que inputs no hagan zoom en iOS */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-size: 16px !important;
}

/* Touch active state */
@media (hover: none) {
  .activista-btn:active {
    background: rgba(16,185,129,.25);
    border-color: var(--green-400);
    transform: scale(.96);
  }
  .block-card:active {
    transform: scale(.98);
    border-color: rgba(16,185,129,.4);
  }
  .btn:active { opacity: .85; transform: scale(.97); }
}
