/* ── Variables — Paleta Elliptical ───────────────────────────────────────── */
:root {
  --bg-dark:        #070d17;      /* fondo principal: navy casi negro */
  --bg-card:        #0d1626;      /* tarjetas / header */
  --bg-input:       #0a1020;
  --bg-hover:       #111e35;
  --accent:         #0072f5;      /* azul corporativo Elliptical */
  --accent-light:   #3394ff;
  --accent-glow:    rgba(0, 114, 245, 0.25);
  --text-primary:   #e8edf5;
  --text-muted:     #7a8fa8;
  --border:         #1c2d45;
  --border-focus:   #0072f5;
  --error-bg:       #1f0c10;
  --error-border:   #c0392b;
  --error-text:     #e74c3c;
}

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

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════════════════════ */
.login-body {
  align-items: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 114, 245, 0.18) 0%, transparent 70%),
    var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* faint grid overlay */
.login-body::before {
  background-image:
    linear-gradient(rgba(0,114,245,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,114,245,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(0,114,245,0.08),
    0 24px 64px rgba(0, 0, 0, 0.7);
  max-width: 440px;
  padding: 52px 44px;
  position: relative;
  width: 100%;
  z-index: 1;
}

/* thin top accent line */
.login-card::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 20px 20px 0 0;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.login-logo {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.login-logo img {
  height: 80px;
  max-width: 260px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(0,114,245,0.35));
}

.brand-name {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  text-align: center;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 32px;
  text-align: center;
}

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  color: var(--error-text);
  font-size: 0.875rem;
  margin-bottom: 20px;
  padding: 12px 16px;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 20px; }

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

.form-group label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-group input,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  padding: 12px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  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 fill='%237a8fa8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-group select option { background: #0a1020; }
.form-group select option:disabled { color: #4a5f7a; }

.form-group input::placeholder { color: #4a5f7a; }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Primary Button ──────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 14px;
  text-align: center;
  transition: background 0.2s, box-shadow 0.2s;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ── Help text ───────────────────────────────────────────────────────────── */
.login-help {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: 28px;
  text-align: center;
}

.login-help a { color: var(--accent-light); text-decoration: none; }
.login-help a:hover { text-decoration: underline; }

/* ── Background watermark ────────────────────────────────────────────────── */
.login-bg-text {
  bottom: 20px;
  color: rgba(255,255,255,0.05);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  user-select: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════════════════ */
.dashboard-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.dashboard-header {
  align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  height: 58px;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
}

/* bottom accent line on header */
.dashboard-header::after {
  background: linear-gradient(90deg, var(--accent), transparent 60%);
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  width: 100%;
}

.header-left  { align-items: center; display: flex; min-width: 160px; }
.header-center { flex: 1; text-align: center; }
.header-right { align-items: center; display: flex; justify-content: flex-end; min-width: 160px; }

.header-logo {
  filter: brightness(1.1);
  height: 30px;
  object-fit: contain;
}

.header-client {
  color: var(--accent-light);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Logout Button ───────────────────────────────────────────────────────── */
.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 16px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn-logout:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ── Report Frame ────────────────────────────────────────────────────────── */
.report-container {
  background: #04111F;   /* mismo fondo que las páginas del reporte: sin bandas */
  flex: 1;
  overflow: hidden;
  position: relative;
}

#reportFrame {
  height: 100%;
  width: 100%;
}

#reportFrame iframe {
  border: none;
  height: 100%;
  width: 100%;
}

/* ── Overlay de carga ────────────────────────────────────────────────────── */
.loading-overlay {
  align-items: center;
  background: #04111F;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 16px;
  inset: 0;
  justify-content: center;
  position: absolute;
  transition: opacity .4s;
  z-index: 10;
}

.loading-overlay.oculto { opacity: 0; pointer-events: none; }

.spinner {
  animation: girar 0.9s linear infinite;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--accent);
  height: 38px;
  width: 38px;
}

@keyframes girar { to { transform: rotate(360deg); } }

/* ── Botones del header del dashboard ────────────────────────────────────── */
.btn-header {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  text-decoration: none;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-header:hover { border-color: var(--accent); color: var(--accent-light); }

.header-right { gap: 8px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { border-radius: 0; margin: 0; min-height: 100vh; padding: 40px 24px; }
  .dashboard-header { padding: 0 16px; }
  .header-client { font-size: 0.8rem; }
}
