/*
 * EHERO Conecta - Estilos compartidos del panel.
 * Branding consistente con el ecosistema EHERO (colores, header/footer, toasts).
 */

:root {
  --ehero-primary: #2563eb;
  --ehero-primary-dark: #1d4ed8;
  --ehero-bg: #f4f6fb;
  --ehero-card: #ffffff;
  --ehero-text: #1f2937;
  --ehero-muted: #6b7280;
  --ehero-border: #e5e7eb;
  --ehero-success: #16a34a;
  --ehero-error: #dc2626;
  --ehero-warning: #d97706;
  --ehero-radius: 12px;
  --ehero-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

body.ehero-conecta {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ehero-bg);
  color: var(--ehero-text);
}

.ehero-conecta-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header */
.ehero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ehero-card);
  border: 1px solid var(--ehero-border);
  border-radius: var(--ehero-radius);
  padding: 16px 22px;
  box-shadow: var(--ehero-shadow);
  margin-bottom: 22px;
}

.ehero-header__brand { display: flex; align-items: center; gap: 14px; }
.ehero-header__logo { height: 40px; width: auto; }
.ehero-header__titles h1 { font-size: 18px; margin: 0; line-height: 1.2; }
.ehero-header__titles span { font-size: 12px; color: var(--ehero-muted); }
.ehero-header__version {
  font-size: 11px;
  background: var(--ehero-bg);
  border: 1px solid var(--ehero-border);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--ehero-muted);
}

/* Footer nav tabs */
.ehero-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 26px 0 10px;
  border-top: 1px solid var(--ehero-border);
  padding-top: 16px;
}
.ehero-footer a {
  text-decoration: none;
  color: var(--ehero-muted);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
}
.ehero-footer a.is-active,
.ehero-footer a:hover { background: var(--ehero-primary); color: #fff; }
.ehero-footer__legal { width: 100%; text-align: center; color: var(--ehero-muted); font-size: 11px; margin-top: 10px; }

/* Cards */
.ehero-card {
  background: var(--ehero-card);
  border: 1px solid var(--ehero-border);
  border-radius: var(--ehero-radius);
  padding: 20px 22px;
  box-shadow: var(--ehero-shadow);
  margin-bottom: 18px;
}
.ehero-card h2 { margin: 0 0 14px; font-size: 15px; }

/* Buttons */
.ehero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ehero-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.ehero-btn:hover { background: var(--ehero-primary-dark); }
.ehero-btn--ghost { background: transparent; color: var(--ehero-primary); border: 1px solid var(--ehero-primary); }

/* Tables */
.ehero-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ehero-table th, .ehero-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ehero-border); }
.ehero-table th { color: var(--ehero-muted); font-weight: 600; }

/* Status pills */
.ehero-pill { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.ehero-pill--ok { background: #dcfce7; color: var(--ehero-success); }
.ehero-pill--error { background: #fee2e2; color: var(--ehero-error); }
.ehero-pill--warn { background: #fef3c7; color: var(--ehero-warning); }

/* Progress bar */
.ehero-progress { background: var(--ehero-border); border-radius: 999px; height: 12px; overflow: hidden; }
.ehero-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ehero-primary), var(--ehero-primary-dark));
  width: 0;
  transition: width .4s ease;
}

/* Toasts */
.ehero-toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.ehero-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  background: #fff;
  border-left: 4px solid var(--ehero-primary);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  position: relative;
  overflow: hidden;
}
.ehero-toast--in { transform: translateX(0); opacity: 1; }
.ehero-toast--out { transform: translateX(120%); opacity: 0; }
.ehero-toast__icon svg { width: 20px; height: 20px; }
.ehero-toast__body { flex: 1; font-size: 13px; }
.ehero-toast__close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ehero-muted); }
.ehero-toast__progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; background: var(--ehero-primary); animation: ehero-toast-progress 6s linear forwards; }
.ehero-toast--success { border-left-color: var(--ehero-success); } .ehero-toast--success .ehero-toast__icon { color: var(--ehero-success); }
.ehero-toast--error { border-left-color: var(--ehero-error); } .ehero-toast--error .ehero-toast__icon { color: var(--ehero-error); }
.ehero-toast--warning { border-left-color: var(--ehero-warning); } .ehero-toast--warning .ehero-toast__icon { color: var(--ehero-warning); }

@keyframes ehero-toast-progress { from { width: 100%; } to { width: 0; } }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --ehero-bg: #0f172a;
    --ehero-card: #1e293b;
    --ehero-text: #e2e8f0;
    --ehero-muted: #94a3b8;
    --ehero-border: #334155;
  }
  .ehero-toast { background: #1e293b; color: #e2e8f0; }
}
