/* ================================================================
   assets/css/main.css — Estilos globales BPM Shield
   Paleta: Azul NubePlatform · Bootstrap 5 base
   ================================================================ */

:root {
  --bs-primary:     #1A5276;
  --bs-primary-rgb: 26, 82, 118;
  --nube-dark:      #0D2B5E;
  --nube-blue:      #1A5276;
  --nube-mid:       #2E86C1;
  --nube-light:     #AED6F1;
  --nube-success:   #1E8449;
  --nube-danger:    #922B21;
  --nube-warning:   #D4AC0D;
  --sidebar-width:  260px;
}

/* ── Layout general ──────────────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4f8;
  color: #2c3e50;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--nube-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-brand .brand-name {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-brand .brand-name span {
  color: var(--nube-mid);
}

.sidebar-brand .brand-sub {
  color: rgba(255, 255, 255, .45);
  font-size: .75rem;
  margin-top: 2px;
}

.sidebar-empresa {
  padding: .75rem 1.25rem;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-empresa .emp-nombre {
  color: rgba(255, 255, 255, .9);
  font-size: .85rem;
  font-weight: 600;
}

.sidebar-empresa .emp-rol {
  color: rgba(255, 255, 255, .4);
  font-size: .75rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0;
}

.sidebar-nav .nav-section {
  padding: .6rem 1.25rem .25rem;
  color: rgba(255, 255, 255, .3);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-size: .9rem;
  border-radius: 0;
  transition: background .15s, color .15s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.sidebar-nav a.activo {
  background: var(--nube-blue);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-footer a {
  color: rgba(255, 255, 255, .5);
  font-size: .85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sidebar-footer a:hover { color: rgba(255, 255, 255, .85); }

/* ── Contenido principal ─────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nube-dark);
  margin: 0;
}

.page-subtitle {
  font-size: .875rem;
  color: #6c757d;
  margin-top: .15rem;
}

/* ── Tarjetas KPI ────────────────────────────────────────────────────────────── */
.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e8ecf0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-card.kpi-primary::before   { background: var(--nube-blue); }
.kpi-card.kpi-success::before   { background: var(--nube-success); }
.kpi-card.kpi-danger::before    { background: var(--nube-danger); }
.kpi-card.kpi-warning::before   { background: var(--nube-warning); }
.kpi-card.kpi-info::before      { background: var(--nube-mid); }

.kpi-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8898a9;
  font-weight: 600;
  margin-bottom: .4rem;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--nube-dark);
  line-height: 1.1;
}

.kpi-sub {
  font-size: .8rem;
  color: #adb5bd;
  margin-top: .3rem;
}

/* ── Tablas ──────────────────────────────────────────────────────────────────── */
.tabla-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecf0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  overflow: hidden;
}

.tabla-card .tabla-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tabla-card .tabla-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nube-dark);
  margin: 0;
}

.tabla-card table {
  margin: 0;
}

.tabla-card thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e8ecf0;
  color: #6c757d;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  padding: .75rem 1rem;
  white-space: nowrap;
}

.tabla-card tbody td {
  padding: .75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f4f8;
  font-size: .9rem;
}

.tabla-card tbody tr:last-child td {
  border-bottom: none;
}

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

/* ── Badges de resultado ─────────────────────────────────────────────────────── */
.badge-resultado {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 1rem;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-aprobado      { background: #d4edda; color: #155724; }
.badge-rechazado     { background: #f8d7da; color: #721c24; }
.badge-no_identificado { background: #cce5ff; color: #004085; }
.badge-sin_audio     { background: #fff3cd; color: #856404; }

/* ── Botones personalizados ──────────────────────────────────────────────────── */
.btn-nube {
  background: var(--nube-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-nube:hover  { background: var(--nube-dark); color: #fff; }
.btn-nube:active { transform: scale(.97); }

.btn-xs {
  padding: .15rem .45rem;
  font-size: .7rem;
  border-radius: .25rem;
  line-height: 1.4;
}

.btn-nube-outline {
  background: transparent;
  color: var(--nube-blue);
  border: 1.5px solid var(--nube-blue);
  border-radius: 8px;
  padding: .45rem 1.1rem;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-nube-outline:hover {
  background: var(--nube-blue);
  color: #fff;
}

/* ── Modales de foto ─────────────────────────────────────────────────────────── */
.foto-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
}

.foto-thumb:hover {
  border-color: var(--nube-mid);
}

/* ── Filtros ─────────────────────────────────────────────────────────────────── */
.filtros-bar {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  border: 1px solid #e8ecf0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  margin-bottom: 1.5rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ── Alertas inline ─────────────────────────────────────────────────────────── */
.alert-nube {
  border-radius: 10px;
  padding: .75rem 1rem;
  font-size: .9rem;
  border: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
}

/* ── Estados de suscripción ──────────────────────────────────────────────────── */
.badge-activa      { background: #d4edda; color: #155724; }
.badge-prueba      { background: #fff3cd; color: #856404; }
.badge-suspendida  { background: #f8d7da; color: #721c24; }
.badge-cancelada   { background: #e2e3e5; color: #383d41; }

/* ── Toggle de sidebar en móvil ─────────────────────────────────────────────── */
.btn-toggle-sidebar {
  display: none;
  background: none;
  border: none;
  color: var(--nube-dark);
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem;
}

@media (max-width: 768px) {
  .btn-toggle-sidebar { display: block; }
}
