.mbr-container { padding:16px; }
.mbr-badge { display:inline-block; padding:8px 12px; border-radius:10px; background:#eef4ff; color:#1e40af; font-weight:600; }
.mbr-container ul { margin:8px 0 0; padding-left:18px; }


/* ===== Contenedor general ===== */
.mbr-container {
  padding: 12px 10px;
  max-width: 1400px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
}

/* Títulos principales */
.mbr-title-page {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===== Tabla de médicos ===== */

#mbr-list-view {
  margin-top: 8px;
}

#mbr-grid {
  width: 100% !important;
  font-size: 0.80rem; /* más compacto */
}

/* Cabeceras */
#mbr-grid thead th {
  white-space: nowrap;
  padding: 6px 4px;
}

/* Celdas */
#mbr-grid tbody td {
  padding: 5px 4px;
  vertical-align: middle;
}

/* Botón "Ver / Asignar" dentro de la tabla */
.mbr-btn.mbr-ver {
  padding: 4px 8px;
  font-size: 0.78rem;
}

/* Wrapper de DataTables para que pueda hacer scroll horizontal en pantallas pequeñas */
.dataTables_wrapper {
  width: 100%;
}
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_info {
  font-size: 0.75rem;
}

/* ===== Detalle de médico ===== */

.mbr-card {
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.mbr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mbr-card-header h3 {
  margin: 0;
  font-size: 1rem;
}
.mbr-card-header small {
  font-size: 0.8rem;
  color: #6b7280;
}

.mbr-card-actions {
  display: flex;
  gap: 6px;
}

.mbr-card-body {
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Información mini en la cabecera (Usuario, Matricula, etc.) */
.mbr-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.mbr-meta-row strong {
  font-weight: 600;
}

/* ===== Botones generales ===== */

.mbr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  white-space: nowrap;
}
.mbr-btn:hover {
  background: #1d4ed8;
}
.mbr-btn-secondary {
  background: #6b7280;
}
.mbr-btn-secondary:hover {
  background: #4b5563;
}
.mbr-btn-danger {
  background: #ef4444;
}
.mbr-btn-danger:hover {
  background: #dc2626;
}

/* ===== Listado de bricks en detalle ===== */

#mbr-mybricks {
  margin-top: 8px;
}

.mbr-bricks-group-title {
  margin: 4px 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.mbr-bricks-list {
  list-style: none;
  margin: 4px 0;
  padding: 0;
}

/* fila de brick */
.mbr-brick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: #f3f4f6;
  font-size: 0.8rem;
}

.mbr-brick-row--highlight {
  background: #e0f2fe; /* azul suave para scores altos */
}

.mbr-brick-main {
  flex: 1;
  min-width: 0;
}

.mbr-brick-title {
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mbr-brick-code {
  font-weight: 700;
}
.mbr-brick-desc {
  color: #374151;
}

.mbr-brick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.75rem;
  color: #6b7280;
}

.mbr-brick-actions {
  flex-shrink: 0;
}

/* Badge score */
.mbr-badge-score {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
}
.mbr-badge-score--high {
  background: #bbf7d0;
  color: #166534;
}
.mbr-badge-score--medium {
  background: #fee2e2;
  color: #b91c1c;
}

/* Badge asignado */
.mbr-badge-ok {
  padding: 2px 8px;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-size: 0.7rem;
}

/* ===== Modal de bricks ===== */

#mbr-modal .mbr-modal-filters {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.5fr auto;
  gap: 6px;
  margin-top: 10px;
}
#mbr-modal select,
#mbr-modal input[type="text"] {
  width: 100%;
  padding: 4px 6px;
  font-size: 0.8rem;
}

/* ===== Breakpoints ===== */

/* Tablets (≤ 1024px): compactar tabla */
@media (max-width: 1024px) {
  #mbr-grid {
    font-size: 0.75rem;
  }

  /* ocultar columnas menos críticas en tablet */
  #mbr-grid thead th:nth-child(2),
  #mbr-grid thead th:nth-child(3),
  #mbr-grid thead th:nth-child(7),
  #mbr-grid thead th:nth-child(11),
  #mbr-grid thead th:nth-child(15),
  #mbr-grid tbody td:nth-child(2),
  #mbr-grid tbody td:nth-child(3),
  #mbr-grid tbody td:nth-child(7),
  #mbr-grid tbody td:nth-child(11),
  #mbr-grid tbody td:nth-child(15) {
    display: none;
  }

  .mbr-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .mbr-card-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Móviles (≤ 640px): modo "cards" y aún más compacto */
@media (max-width: 640px) {
  .mbr-container {
    padding: 10px 8px;
  }

  /* La tabla se vuelve "scrollable" horizontalmente */
  .dataTables_wrapper {
    overflow-x: auto;
  }

  /* Esconder aún más columnas en móvil */
  #mbr-grid thead th:nth-child(1),
  #mbr-grid thead th:nth-child(4),
  #mbr-grid thead th:nth-child(6),
  #mbr-grid thead th:nth-child(10),
  #mbr-grid thead th:nth-child(13),
  #mbr-grid tbody td:nth-child(1),
  #mbr-grid tbody td:nth-child(4),
  #mbr-grid tbody td:nth-child(6),
  #mbr-grid tbody td:nth-child(10),
  #mbr-grid tbody td:nth-child(13) {
    display: none;
  }

  .mbr-card {
    padding: 10px;
  }

  .mbr-brick-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .mbr-brick-actions {
    width: 100%;
  }
  .mbr-brick-actions .mbr-btn {
    width: 100%;
    justify-content: center;
  }

  #mbr-modal .mbr-modal-filters {
    grid-template-columns: 1fr 1fr;
  }
}



/* Contenedor general del listado */
#mbr-list-view {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 10px 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  overflow-x: auto; /* seguridad extra para móviles */
}

/* Wrapper de DataTables dentro del listado */
#mbr-list-view .dataTables_wrapper {
  width: 100%;
}

/* Cabecera de la tabla (TH) y celdas (TD) más compactas */
#mbr-list-view table.dataTable thead th,
#mbr-list-view table.dataTable tbody td {
  padding: 4px 6px;        /* antes suele venir ~10px */
  font-size: 0.60rem;      /* un poco más pequeño */
  white-space: nowrap;
}

/* Filas zebra suaves sobre fondo blanco */
#mbr-list-view table.dataTable tbody tr:nth-child(even) {
  background-color: #f9fafb;
}
#mbr-list-view table.dataTable tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Top bar (Show / Search) más pequeña y limpia */
#mbr-list-view .dataTables_length,
#mbr-list-view .dataTables_filter {
  font-size: 0.80rem;
  margin-bottom: 4px;
}
#mbr-list-view .dataTables_length select {
  padding: 2px 4px;
  font-size: 0.80rem;
}

/* Paginación compacta */
#mbr-list-view .dataTables_paginate a,
#mbr-list-view .dataTables_paginate span a {
  padding: 2px 6px;
  font-size: 0.80rem;
}

/* Botón "Ver / Asignar" un poco más pequeño */
#mbr-list-view .mbr-btn.mbr-ver {
  padding: 4px 10px;
  font-size: 0.78rem;
}

/* ----- Responsive iPad / smartphone ----- */
@media (max-width: 1024px) {
  #mbr-list-view {
    padding: 6px;
    border-radius: 8px;
  }
  #mbr-list-view table.dataTable {
    width: 100% !important;
    min-width: 900px; /* garantiza scroll horizontal, no columnas apretadas */
  }
  #mbr-list-view .dataTables_length,
  #mbr-list-view .dataTables_filter {
    float: none;
    text-align: left;
    margin-bottom: 6px;
  }
}

@media (max-width: 640px) {
  #mbr-list-view table.dataTable thead th,
  #mbr-list-view table.dataTable tbody td {
    font-size: 0.74rem;
    padding: 3px 4px;
  }
}


.mbr-input {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  outline: none;
}
.mbr-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.mbr-badge-bricks-empty {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: tomato;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.mbr-badge-bricks-ok {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #16a34a; /* verde */
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

#mbr-badge {
  background: #fff;
  text-align: center;
  border-bottom: 10px;
  border-radius: 30px;
  color: #000;
  font-weight: bold;
  padding: 5px 0px;
}

#mbr-detail-view{
  margin-top: 10px;
}


#mbr-summary.mbr-summary {
  margin: 8px 0 16px;
  font-size: 0.95rem;
}

.mbr-summary-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px 12px;
}

.mbr-summary-box span {
  white-space: nowrap;
}
