/* ARI Dashboard - estilos con 4 skins */

/* ============================================
   VARIABLES POR SKIN
   ============================================ */

/* Skin claro (default) */
:root,
[data-skin="claro"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-soft: #9a9a9a;
  --border: #e5e5e5;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;
}

/* Skin oscuro */
[data-skin="oscuro"] {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232730;
  --text: #f1f1f1;
  --text-muted: #a8a8a8;
  --text-soft: #6b6b6b;
  --border: #2d3139;
  --accent: #60a5fa;
  --accent-soft: #1e3a5f;
  --danger: #f87171;
  --danger-soft: #4a1f1f;
  --warning: #fbbf24;
  --warning-soft: #4a3a0e;
  --success: #4ade80;
  --success-soft: #1a3a23;
}

/* Skin cálido */
[data-skin="calido"] {
  --bg: #f5ecd9;
  --surface: #fdf6e3;
  --surface-2: #f0e3c8;
  --text: #3a2e1a;
  --text-muted: #7a6952;
  --text-soft: #b0a085;
  --border: #d9c9a8;
  --accent: #b45309;
  --accent-soft: #fde68a;
  --danger: #b91c1c;
  --danger-soft: #fecaca;
  --warning: #c2410c;
  --warning-soft: #fed7aa;
  --success: #15803d;
  --success-soft: #bbf7d0;
}

/* Skin Marca RR (azul corporativo) */
[data-skin="marca"] {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --text: #0a2540;
  --text-muted: #4a5e7a;
  --text-soft: #8ea2b8;
  --border: #cdd9e6;
  --accent: #0a2540;
  --accent-soft: #d6e3f0;
  --danger: #c5283d;
  --danger-soft: #fadce0;
  --warning: #c47800;
  --warning-soft: #fde7c0;
  --success: #0f7c4a;
  --success-soft: #c5ecd5;
}

/* ============================================
   RESET BASICO
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

select, input {
  font-family: inherit;
  font-size: 14px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-left h1 {
  margin-bottom: 2px;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.clima {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.clima-emoji {
  font-size: 18px;
}

.skin-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.skin-selector select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
}

.logout {
  font-size: 18px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.saludo {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ============================================
   METRICAS
   ============================================ */

.metricas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.metrica {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.metrica-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metrica-valor {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   GRID PRINCIPAL
   ============================================ */

.grid-principal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 1.5rem;
}

@media (max-width: 800px) {
  .grid-principal {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BLOQUES
   ============================================ */

.bloque {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.bloque-titulo {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lista-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.lista-item-nombre {
  font-size: 14px;
  color: var(--text);
}

.lista-item-tiempo {
  font-size: 12px;
  color: var(--text-muted);
}

/* Urgencias en pendientes */
.lista-item.urgencia-alta {
  background: var(--danger-soft);
}

.lista-item.urgencia-alta .lista-item-nombre,
.lista-item.urgencia-alta .lista-item-tiempo {
  color: var(--danger);
  font-weight: 500;
}

.lista-item.urgencia-media {
  background: var(--warning-soft);
}

.lista-item.urgencia-media .lista-item-nombre,
.lista-item.urgencia-media .lista-item-tiempo {
  color: var(--warning);
}

.lista-item.urgencia-vieja {
  opacity: 0.6;
}

/* Gastos con barra */
.gasto-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.gasto-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.gasto-item-nombre {
  color: var(--text-muted);
}

.gasto-item-monto {
  color: var(--text);
  font-weight: 600;
}

.gasto-barra {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.gasto-barra-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* Etiquetas de aprendizajes */
.etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.etiqueta {
  font-size: 13px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
}

/* Estado cargando / vacio */
.estado-cargando, .estado-vacio {
  text-align: center;
  padding: 1rem;
  color: var(--text-soft);
  font-size: 14px;
}

.estado-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

/* Total de gastos destacado */
.gastos-total {
  font-size: 24px;
  font-weight: 600;
  text-align: right;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-soft);
  padding: 1rem 0;
  margin-top: 1rem;
}

/* ============================================
   LOGIN
   ============================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 360px;
}

.login-card h1 {
  margin-bottom: 4px;
}

.login-card .sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-card label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  font-size: 15px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card button {
  margin-top: 1rem;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}

.login-card .error {
  margin-top: 1rem;
  padding: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}


/* === Reporte semanal === */
.reporte-semanal {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid var(--accent, #2563eb);
}
.reporte-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.reporte-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text, #0f172a);
}
.reporte-fecha {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}
.reporte-contenido {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text, #0f172a);
    background: transparent;
}
