/* 1. VARIABLES Y RESET */
:root {
  --primary: #4f46e5;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* 2. LAYOUT DEL DASHBOARD (FOTO DEL MÓVIL) */
.container { width: 95%; max-width: 1200px; margin: 20px auto; padding: 0 10px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}

.navlinks { display: flex; gap: 12px; list-style: none; }
.navlinks a { text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.navlinks a:hover { color: var(--primary); }

/* Estadísticas Estilizadas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card); padding: 24px; border-radius: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border: 1px solid var(--border); }
.stat-label { color: var(--text-muted); font-size: 14px; font-weight: 600; text-transform: uppercase; }
.stat-value { display: block; font-size: 28px; font-weight: 800; margin-top: 8px; }
.value-up { color: var(--success); }
.value-down { color: var(--danger); }

/* Tablas Profesionales */
.table-container { background: var(--card); border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f1f5f9; padding: 16px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; }
td { padding: 16px; border-top: 1px solid var(--border); font-size: 15px; }
tr:hover { background-color: #f8fafc; }

/* 3. LOGIN (CENTRADITO Y MODERNO) */
.auth-page { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-wrapper { width: 100%; max-width: 440px; padding: 20px; }
.auth-card { background: var(--card); padding: 40px; border-radius: 32px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15); }

.logo-container { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.logo { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), #22c55e); border-radius: 16px; }
.brand-text h2 { font-size: 20px; font-weight: 700; }
.brand-text p { font-size: 14px; color: var(--text-muted); }

.tip-card { background: #eff6ff; padding: 16px; border-radius: 16px; border: 1px solid #dbeafe; margin-bottom: 32px; }
.tip-card strong { color: var(--primary); font-size: 12px; text-transform: uppercase; }
.tip-card p { font-size: 13px; color: #1e40af; margin-top: 4px; }

/* Inputs y Botones Globales */
input { width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); margin-bottom: 16px; font-size: 16px; transition: 0.2s; }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

button, .btn-primary { 
    width: 100%; padding: 14px; background: var(--primary); color: white; border: none; 
    border-radius: 12px; font-weight: 600; font-size: 16px; cursor: pointer; transition: 0.2s;
}
button:hover { background: #4338ca; transform: translateY(-1px); }

/* 4. RESPONSIVO MÓVIL */
@media (max-width: 768px) {
  .topbar { flex-direction: column; gap: 16px; text-align: center; }
  .stats { grid-template-columns: 1fr; }
  .table-container { overflow-x: auto; }
  table { min-width: 600px; } /* Permite scroll horizontal en tablas */
  .auth-card { padding: 30px 20px; }
}