/* ═══════════════════════════════════════════════════════════
   Tarjetas MTG — Premium Dark Financial Dashboard
   Style: Dark Glassmorphism + Fintech Precision
   Fonts: Syne (display) + DM Sans (body)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap');

/* ── Variables ── */
:root {
  --bg-base: #080c16;
  --bg-surface: #0d1220;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-card-border: rgba(255, 255, 255, 0.08);

  --primary: #00d4aa;
  --primary-dim: rgba(0, 212, 170, 0.15);
  --primary-glow: rgba(0, 212, 170, 0.3);
  --indigo: #6366f1;
  --indigo-dim: rgba(99, 102, 241, 0.15);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-dim: rgba(244, 63, 94, 0.15);
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.15);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #00d4aa;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.12);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 170, 0.1);

  --sidebar-width: 240px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 212, 170, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 60% 30%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 18, 32, 0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--bg-card-border);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.3);
}

.logo-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
}

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

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
}

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

.nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-dim);
  color: var(--primary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-badge {
  margin-left: auto;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--bg-card-border);
}

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

/* ── Top Bar ── */
.topbar {
  background: rgba(8, 12, 22, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 40px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.user-pill:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  font-size: 11px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 24px;
}

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color, var(--primary)), transparent);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-value.accent { color: var(--primary); }
.stat-value.danger { color: var(--rose); }
.stat-value.warning { color: var(--amber); }

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

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--bg-card-border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Tags / Badges ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-pendiente { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.tag-ok { background: var(--emerald-dim); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.tag-revisar { background: var(--indigo-dim); color: var(--indigo); border: 1px solid rgba(99, 102, 241, 0.2); }
.tag-descartado { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.2); }

.cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #0a0e1a;
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.25);
}

.btn-primary:hover {
  background: #00f5c3;
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--rose-dim);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--rose);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.btn-success {
  background: var(--emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--emerald);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 9px;
  font-size: 11px;
  gap: 4px;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  transition: all var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 212, 170, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

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

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Chart Containers ── */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  max-width: 100%;
}

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 20px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.page-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--primary-dim);
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--primary);
}

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

.alert-success { background: var(--emerald-dim); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--emerald); }
.alert-error { background: var(--rose-dim); border: 1px solid rgba(244, 63, 94, 0.2); color: var(--rose); }
.alert-warning { background: var(--amber-dim); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--amber); }

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

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: white;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.3s ease;
  max-width: 320px;
}

.toast-success { background: rgba(16, 185, 129, 0.9); border: 1px solid rgba(16, 185, 129, 0.3); }
.toast-error { background: rgba(244, 63, 94, 0.9); border: 1px solid rgba(244, 63, 94, 0.3); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
}

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), 0 0 80px rgba(0, 212, 170, 0.08);
  animation: fadeInUp 0.5s ease;
}

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

.login-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 0 40px rgba(0, 212, 170, 0.3);
}

.login-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* ── Monospace amounts ── */
.amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.amount-ars { color: var(--primary); }
.amount-usd { color: var(--amber); }
.amount-negative { color: var(--rose); }

/* ── Section headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ── Dividers ── */
hr.divider {
  border: none;
  border-top: 1px solid var(--bg-card-border);
  margin: 24px 0;
}

/* ── Upload drop zone ── */
.dropzone {
  border: 2px dashed var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.dropzone-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone-text { color: var(--text-secondary); font-size: 15px; margin-bottom: 8px; }
.dropzone-hint { font-size: 12px; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .page-content {
    padding: 20px 16px;
  }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; height: 56px; }
  .page-content { padding: 14px 12px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 10px; }
  .stat-value { font-size: 22px; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px 12px; }
}

/* iPhone 16 Pro Max and large mobile (430px+) */
@media (min-width: 400px) and (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 16px 14px; }
  .stat-value { font-size: 20px; }
  .page-title { font-size: 17px; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .page-content { padding: 12px; }
}

/* ── Focus states (accessibility) ── */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Prefers reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Color dot indicators ── */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.filters-row .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 140px;
}

/* ── Category color dots ── */
.cat-combustible { color: #f59e0b; }
.cat-salud_farmacia { color: #10b981; }
.cat-servicios_digitales { color: #6366f1; }
.cat-supermercado { color: #3b82f6; }
.cat-gastronomia { color: #f97316; }
.cat-hogar { color: #8b5cf6; }
.cat-transporte { color: #06b6d4; }
.cat-telecom { color: #ec4899; }
.cat-negocios { color: #84cc16; }
.cat-sin_clasificar { color: #64748b; }

/* ── Inline edit select ── */
.inline-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  appearance: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.inline-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Action buttons group ── */
.btn-group {
  display: flex;
  gap: 4px;
}

/* ── Table wrapper scroll ── */
.table-scroll {
  overflow-x: auto;
}

/* ── Chart wrapper with aspect ratio ── */
.chart-wrap-pie { max-width: 320px; margin: 0 auto; }
.chart-wrap-bar { position: relative; height: 280px; }
.chart-wrap-line { position: relative; height: 320px; }
