/* ============================================================
   estilos.css — Hoja de estilos del Portal integranube
   PS Integradores SA de CV | Actualizado: 6 de abril de 2026
   ============================================================ */

/* --- RESET Y BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:      #2563eb;
  --azul-dark: #1a2e4a;
  --sidebar-w: 240px;
  --header-h:  56px;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4f8;
}

/* ============================================================
   HEADER (dashboard + admin)
   ============================================================ */
header {
  background: var(--azul-dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Header fijo — solo en dashboard */
header.header-fijo {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  padding: 0 20px 0 16px;
  z-index: 100;
}

header h1 { font-size: 18px; font-weight: 700; }

.header-logo {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.header-logo span { color: #60a5fa; }

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  font-size: 13px;
}

.header-user strong { color: #ffffff; }

.nav-links a {
  color: #93c5fd;
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
}

.nav-links a:hover { color: #fff; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}

.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: #1d4ed8; }

.btn-secundario {
  background: #f1f5f9;
  color: var(--azul-dark);
  border: 1px solid #e2e8f0;
}
.btn-secundario:hover { background: #e2e8f0; }

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.btn-danger:hover { background: #fee2e2; }

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

.btn-logout {
  padding: 5px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-superadmin { background: #dbeafe; color: #1d4ed8; }
.badge-admin      { background: #d1fae5; color: #065f46; }
.badge-usuario    { background: #f3f4f6; color: #6b7280; }
.badge-activo     { background: #d1fae5; color: #065f46; }
.badge-inactivo   { background: #fef2f2; color: #dc2626; }

.rol-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--azul);
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================================
   MENSAJES DE ESTADO
   ============================================================ */
.msg-ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.msg-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.error-msg {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.bloqueo-msg {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ============================================================
   SECCIONES Y TARJETAS (admin)
   ============================================================ */
.contenido {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

.contenido-usuarios { max-width: 1000px; }

h2 {
  font-size: 22px;
  color: var(--azul-dark);
  margin-bottom: 20px;
}

.seccion {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 24px;
  margin-bottom: 24px;
}

.seccion h3 {
  font-size: 16px;
  color: var(--azul-dark);
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

.acciones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Tarjetas de estadísticas */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 24px 20px;
  text-align: center;
}

.card-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--azul);
}

.card-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* ============================================================
   TABLA DE LOG (admin/index.php)
   ============================================================ */
.tabla-log {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tabla-log thead tr { background: #f8fafc; color: #374151; }

.tabla-log th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.tabla-log td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.tabla-log td.celda-gris { color: #64748b; }

.resultado-ok    { color: #16a34a; font-weight: 600; }
.resultado-fallo { color: #dc2626; font-weight: 600; }

/* ============================================================
   TABLA DE USUARIOS (admin/usuarios.php)
   ============================================================ */
.tabla-usuarios {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabla-usuarios thead tr { background: #f8fafc; }

.tabla-usuarios th {
  padding: 10px 12px;
  text-align: left;
  color: #374151;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

.tabla-usuarios td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}

.tabla-usuarios tr:hover td { background: #f8fafc; }

.tabla-usuarios td.celda-gris {
  color: #64748b;
  font-size: 13px;
}

/* ============================================================
   FORMULARIO DE USUARIOS (admin/usuarios.php)
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group.full { grid-column: 1 / -1; }

.form-group.alinear-abajo { justify-content: flex-end; padding-bottom: 4px; }

label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-row input { width: 16px; height: 16px; cursor: pointer; }
.checkbox-row label { font-weight: normal; cursor: pointer; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.texto-sin-datos { color: #64748b; font-size: 14px; }

/* ============================================================
   DASHBOARD — SIDEBAR Y LAYOUT
   ============================================================ */
body.dashboard-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-section {
  padding: 6px 16px 2px;
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-section.mt { margin-top: 16px; }

.sidebar-item {
  display: block;
  padding: 10px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-item:hover {
  background: #f1f5f9;
  color: var(--azul);
}

.sidebar-item.activo {
  background: #eff6ff;
  color: var(--azul);
  border-left-color: var(--azul);
  font-weight: 600;
}

.main {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--azul-dark);
}

.page-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.tablero-wrapper {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  flex: 1;
  min-height: 600px;
}

.tablero-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
  display: block;
}

.sin-tableros {
  text-align: center;
  padding: 80px 20px;
  color: #64748b;
}

.sin-tableros h2 { margin-bottom: 8px; color: #374151; }

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

.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 420px;
}

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

.logo-texto {
  font-size: 28px;
  font-weight: 700;
  color: #1a2e4a;
  letter-spacing: -0.5px;
}

.logo-texto span { color: #2563eb; }

.logo-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.form-group-login { margin-bottom: 20px; }

.input-login {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  transition: border-color 0.2s;
  outline: none;
}

.input-login:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.campo-trampa {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.btn-acceder {
  width: 100%;
  padding: 13px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-acceder:hover { background: #1d4ed8; }
.btn-acceder:disabled { background: #94a3b8; cursor: not-allowed; }

.footer-login {
  text-align: center;
  margin-top: 28px;
  font-size: 12px;
  color: #9ca3af;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}


/* Botón deshabilitado — para funcionalidad pendiente de implementar */
.btn-deshabilitado {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
