/* Contenedor Principal: Flexbox para poner Sidebar al lado del Contenido */
.yupy-platform-wrapper {
    display: flex;
    min-height: 600px;
    background: #f4f6f9; /* Color de fondo tipo app */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', sans-serif;
}

/* --- SIDEBAR --- */
.yupy-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0; /* Que no se encoja */
}

.yupy-profile-card {
    text-align: center;
    margin-bottom: 40px;
}

.yupy-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0073aa;
    margin-bottom: 10px;
}

.yupy-username {
    margin: 5px 0;
    font-size: 18px;
    color: #333;
}

.yupy-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yupy-nav li {
    margin-bottom: 8px;
}

.yupy-nav a {
    display: block;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.yupy-nav li.active a, 
.yupy-nav a:hover {
    background: #e6f7ff;
    color: #0073aa;
}

.yupy-nav li.logout {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.yupy-nav li.logout a {
    color: #d63638;
}

/* --- AREA DE CONTENIDO --- */
.yupy-content-area {
    flex-grow: 1;
    padding: 40px;
    background: #f4f6f9;
}

/* =============================================================================
   YUPY Dashboard — Responsive (global)
   =============================================================================
   Esto aplica al dashboard en general: hace que el layout sea usable en móvil.
   No depende de reportes; mejora TODAS las vistas del dashboard.
============================================================================= */

@media (max-width: 900px) {
  .yupy-platform-wrapper {
    flex-direction: column;
    min-height: auto;
  }

  .yupy-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 18px 16px;
  }

  .yupy-content-area {
    padding: 18px 16px; /* antes 40px: se veía gigante en móvil */
  }
}

/* =============================================================================
   Reportes (FRONT) — Scoped styles
   =============================================================================
   OJO:
   - Esto NO usa estilos de wp-admin.
   - Todo está scopeado a #yupy-reportes para que no afecte a otras páginas.
============================================================================= */

#yupy-reportes {
  /* Si quieres centrar el contenido dentro del dashboard */
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
#yupy-reportes .yupy-reportes__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

#yupy-reportes .yupy-reportes__title {
  margin: 0;
  font-size: 22px;
  color: #222;
}

#yupy-reportes .yupy-reportes__subtitle {
  margin: 6px 0 0;
  color: #666;
  line-height: 1.35;
}

/* Filtros */
#yupy-reportes .yupy-reportes__filters {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;

  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

#yupy-reportes .yupy-reportes__field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: #333;
}

#yupy-reportes .yupy-reportes__field input[type="date"] {
  width: 220px;
  max-width: 100%;
  padding: 10px 10px;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  background: #fff;
}

#yupy-reportes .yupy-reportes__check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  user-select: none;
}

#yupy-reportes .yupy-reportes__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botones (propios, para no depender del theme ni del wp-admin) */
#yupy-reportes .yupy-btn {
  appearance: none;
  border: 1px solid #cfd7df;
  background: #fff;
  color: #333;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.02s ease, filter 0.15s ease;
}

#yupy-reportes .yupy-btn:hover {
  filter: brightness(0.98);
}

#yupy-reportes .yupy-btn:active {
  transform: translateY(1px);
}

#yupy-reportes .yupy-btn--primary {
  background: #0073aa;
  border-color: #0073aa;
  color: #fff;
}

/* Textos auxiliares */
#yupy-reportes .yupy-muted {
  color: #777;
  font-size: 13px;
}

#yupy-reportes .yupy-link {
  color: #0073aa;
  text-decoration: none;
  font-weight: 700;
}
#yupy-reportes .yupy-link:hover {
  text-decoration: underline;
}

/* KPIs */
#yupy-reportes .yupy-reportes__kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

#yupy-reportes .yupy-reportes__kpi {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
  border-left: 4px solid #0073aa;
}

#yupy-reportes .yupy-reportes__kpi--money {
  border-left-color: #28a745;
}

#yupy-reportes .yupy-reportes__kpi-label {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 800;
}

#yupy-reportes .yupy-reportes__kpi-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 900;
  color: #222;
}

/* Tabla */
#yupy-reportes .yupy-reportes__table-wrap {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: auto; /* clave para móvil */
}

#yupy-reportes .yupy-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px; /* fuerza scroll horizontal en móvil */
}

#yupy-reportes .yupy-table thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #555;
  padding: 12px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

#yupy-reportes .yupy-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
}

#yupy-reportes .yupy-table tbody tr:nth-child(even) {
  background: #fcfcfd;
}

#yupy-reportes .yupy-reportes__amount {
  font-weight: 900;
}

/* Pills de estado */
#yupy-reportes .yupy-reportes__pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

#yupy-reportes .yupy-reportes__pill.is-ok {
  background: #d4edda;
  color: #155724;
}

#yupy-reportes .yupy-reportes__pill.is-warn {
  background: #fff3cd;
  color: #856404;
}

/* Empty state */
#yupy-reportes .yupy-reportes__empty {
  background: #fff;
  border: 1px dashed #cfcfcf;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
}

/* Responsive reportes */
@media (max-width: 900px) {
  #yupy-reportes .yupy-reportes__kpis {
    grid-template-columns: 1fr;
  }

  #yupy-reportes .yupy-reportes__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  #yupy-reportes .yupy-reportes__field input[type="date"] {
    width: 100%;
  }
}

/* Contenedor con scroll */
.yupy-scroll-box {
    max-height: 250px;       /* Altura máxima (ajusta a tu gusto: 300px, 400px) */
    overflow-y: auto;        /* Scroll vertical automático */
    border: 1px solid #e5e7eb; /* Borde sutil opcional */
    border-radius: 6px;
}

/* (Opcional) Header fijo (Sticky Header) */
/* Esto hace que los títulos de la tabla NO desaparezcan al bajar */
.yupy-scroll-box thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb; /* Color de fondo para que no sea transparente */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Sombra suave al borde inferior */
}
