/* File: assets/css/onepsico-core.css
   Propósito: Hoja de estilos global (admin + front) scoped a .onepsico-theme */
.onepsico-theme {
  --one-bg: #ffffff;
  --one-text: #111827;
}

/* Forzar tipografía bajo scope (evita herencias del admin) */
.onepsico-theme,
.onepsico-theme body,
.onepsico-theme .wrap,
.onepsico-theme #wpwrap,
.onepsico-theme .wp-core-ui {
  font-family: var(--one-font) !important;
}

/* Heredar tipografía en controles */
.onepsico-theme button,
.onepsico-theme input,
.onepsico-theme select,
.onepsico-theme textarea,
.onepsico-theme .components-button {
  font-family: inherit !important;
}

/* =================== Tarjetas / contenedores =================== */
.onepsico-theme .onepsico-card {
  background: var(--one-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--one-radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-size: 15px;
}

/* =================== Botón propio =================== */
.onepsico-theme .onepsico-btn {
  display:inline-flex;align-items:center;gap:8px;
  background: var(--one-primary);
  color: #fff;
  border: none;
  border-radius: calc(var(--one-radius) - 4px);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  font-size: 15px;
}
.onepsico-theme .onepsico-btn:hover { filter: brightness(0.95); }
.onepsico-theme .onepsico-btn:focus {
  outline: 2px solid color-mix(in srgb, var(--one-primary) 60%, #ffffff);
  outline-offset: 2px;
}

/* =================== Badges genéricos =================== */
.onepsico-theme .onepsico-badge {
  display:inline-block;
  background: rgba(0,0,0,0.04);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

/* =================== Formularios base =================== */
.onepsico-theme input[type=text],
.onepsico-theme input[type=number],
.onepsico-theme input[type=email],
.onepsico-theme input[type=url],
.onepsico-theme input[type=search],
.onepsico-theme input[type=password],
.onepsico-theme select,
.onepsico-theme textarea {
  border: 1px solid #e5e7eb;
  border-radius: calc(var(--one-radius) - 6px);
  padding: 10px 12px;
  color: var(--one-text);
  background: #fff;
  font-size: 15px;
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.onepsico-theme input[type=text]:focus,
.onepsico-theme input[type=number]:focus,
.onepsico-theme input[type=email]:focus,
.onepsico-theme input[type=url]:focus,
.onepsico-theme input[type=search]:focus,
.onepsico-theme input[type=password]:focus,
.onepsico-theme select:focus,
.onepsico-theme textarea:focus {
  border-color: color-mix(in srgb, var(--one-primary) 40%, #e5e7eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--one-primary) 20%, transparent);
  outline: none;
}

/* =================== Tablas base =================== */
.onepsico-theme table.wp-list-table th,
.onepsico-theme table.wp-list-table td {
  vertical-align: middle;
  font-size: 14px;
}
.onepsico-theme table.wp-list-table th {
  color:#374151;
  font-weight: 600;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.onepsico-theme table.wp-list-table tbody tr:nth-child(odd) td { background:#fafafa; }
.onepsico-theme table.wp-list-table tbody tr:hover td { background:#f5f5f5; }

/* =================== Progress bar con % visible =================== */
.onepsico-theme .onepsico-progress {
  background:#f3f4f6; border-radius:999px; height:10px; position:relative; overflow:hidden;
}
.onepsico-theme .onepsico-progress .bar {
  background: var(--one-primary); height:100%; width: calc(var(--pct, 0) * 1%); position:relative;
}
.onepsico-theme .onepsico-progress .bar::after {
  content: attr(data-pct);
  position:absolute; right:4px; top:-22px;
  font-size:12px; color:#374151;
}

/* =================== Tarjetas de reporte =================== */
.onepsico-theme .onepsico-report-title {
  font-size:19px; font-weight:700; color: var(--one-secondary); margin-bottom:8px;
}
.onepsico-theme .onepsico-legend { display:flex; gap:8px; flex-wrap:wrap; font-size:14px; }
.onepsico-theme .onepsico-legend .item { display:flex; align-items:center; gap:6px; }
.onepsico-theme .onepsico-legend .dot { width:10px; height:10px; border-radius:50%; background:#9ca3af; }

/* =================== Estados de riesgo – PALETA FIJA (reportería) =================== */
/* Base: pill uniforme y robusto contra estilos de botones */
.onepsico-theme .risk-badge,
.onepsico-theme .risk-none,
.onepsico-theme .risk-low,
.onepsico-theme .risk-mid,
.onepsico-theme .risk-high,
.onepsico-theme .risk-vhigh {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-width: 164px;                 /* ancho uniforme; ajusta si lo deseas */
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;               /* permite 2 líneas */
  text-decoration: none !important;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
  margin-left: 12px;                 /* separación del número */
}

/* Paleta de colores fija (con !important para ganar a estilos de botones) */
.onepsico-theme .risk-none  { background:#E6F7E9 !important; color:#065F46 !important; }
.onepsico-theme .risk-low   { background:#E8F2FF !important; color:#1E3A8A !important; }
.onepsico-theme .risk-mid   { background:#FFF7E6 !important; color:#92400E !important; }
.onepsico-theme .risk-high  { background:#FEE2E2 !important; color:#991B1B !important; }
.onepsico-theme .risk-vhigh { background:#FDE8E8 !important; color:#7F1D1D !important; }

/* =================== Utilidades =================== */
.onepsico-theme .grid { display:grid; gap:16px; }
.onepsico-theme .grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.onepsico-theme .grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.onepsico-theme .muted { color:#6b7280; }

/* =================== Encabezado con logo =================== */
.onepsico-theme .onepsico-header { display:flex; align-items:center; gap:12px; padding:8px 0; }
.onepsico-theme .onepsico-header .brand { display:none; }
.onepsico-theme .onepsico-header .brand-logo img { max-height:72px; }

/* =================== Botones nativos de WP (admin) =================== */
.onepsico-theme .wp-core-ui .button,
.onepsico-theme .wp-core-ui .button-secondary,
.onepsico-theme a.button,
.onepsico-theme button.button,
.onepsico-theme input[type="button"],
.onepsico-theme input[type="submit"],
.onepsico-theme .button-link,
.onepsico-theme a.button-link {
  border-radius: calc(var(--one-radius) - 6px);
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

/* —— Centrado perfecto en TODOS los botones (incluye page-title y components) —— */
.onepsico-theme .wp-core-ui .button,
.onepsico-theme .wp-core-ui .button-secondary,
.onepsico-theme a.button,
.onepsico-theme button.button,
.onepsico-theme input[type="button"],
.onepsico-theme input[type="submit"],
.onepsico-theme .button-link,
.onepsico-theme a.button-link,
.onepsico-theme .page-title-action,
.onepsico-theme .components-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding-block: 8px;
  vertical-align: middle;
  line-height: 1.2;
}

.onepsico-theme .wp-core-ui .button:hover,
.onepsico-theme .wp-core-ui .button-secondary:hover,
.onepsico-theme a.button:hover,
.onepsico-theme button.button:hover,
.onepsico-theme input[type="button"]:hover,
.onepsico-theme input[type="submit"]:hover,
.onepsico-theme .button-link:hover,
.onepsico-theme a.button-link:hover {
  filter: brightness(0.98);
}

/* Botón primario */
.onepsico-theme .wp-core-ui .button-primary,
.onepsico-theme .wp-core-ui .button.button-primary,
.onepsico-theme a.button.button-primary,
.onepsico-theme button.button.button-primary,
.onepsico-theme input[type="submit"].button-primary {
  background: var(--one-primary);
  border-color: var(--one-primary);
  color: #fff;
  border-radius: calc(var(--one-radius) - 4px);
  font-size: 14px;
}
.onepsico-theme .wp-core-ui .button-primary:hover,
.onepsico-theme .wp-core-ui .button.button-primary:hover,
.onepsico-theme a.button.button-primary:hover,
.onepsico-theme button.button.button-primary:hover,
.onepsico-theme input[type="submit"].button-primary:hover {
  filter: brightness(0.95);
}

/* Botón de encabezado: .page-title-action */
.onepsico-theme .page-title-action {
  border-radius: calc(var(--one-radius) - 6px);
  border: 1px solid var(--one-primary);
  background: #fff;
  color: var(--one-primary);
  font-weight: 700;
  padding: 6px 12px;
  text-decoration: none;
}

/* Botones modernos de componentes (Gutenberg / componentes WP) */
.onepsico-theme .components-button {
  border-radius: calc(var(--one-radius) - 6px);
  font-weight: 600;
}
.onepsico-theme .components-button.is-primary {
  background: var(--one-primary);
  border-color: var(--one-primary);
  color: #fff;
}

/* Focus states unificados */
.onepsico-theme .wp-core-ui .button:focus,
.onepsico-theme .wp-core-ui .button-secondary:focus,
.onepsico-theme a.button:focus,
.onepsico-theme button.button:focus,
.onepsico-theme input[type="button"]:focus,
.onepsico-theme input[type="submit"]:focus,
.onepsico-theme .button-link:focus,
.onepsico-theme a.button-link:focus,
.onepsico-theme .page-title-action:focus,
.onepsico-theme .components-button:focus {
  outline: 2px solid color-mix(in srgb, var(--one-primary) 60%, #ffffff);
  outline-offset: 2px;
}