/* =========================================================
   GLA-DPR - TEMA VISUAL
   Azules claros coordinados con la cabecera
   (CSS depurado: sin duplicados + fixes de checkboxes)
   ========================================================= */

:root{
  --bg: #eef8ff;
  --card: #ffffff;
  --text: #0f2f46;
  --muted: #46677c;
  --border: #cfe8f6;
  --shadow: 0 14px 34px rgba(25,118,163,.12);

  --red: #1d9bd7;
  --red-dark: #0f5d85;

  --black: #0f5d85;
}

/* ===================== BASE ===================== */

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Segoe UI", Roboto, Arial, sans-serif;
  background:linear-gradient(180deg, #f7fcff 0%, var(--bg) 260px, #eef8ff 100%);
  color:var(--text);
}

.container{
  max-width:1200px;
  margin:0 auto;
  padding:25px;
}

h1,h2,h3{
  margin:0 0 10px 0;
  font-weight:700;
}

.muted{
  color:var(--muted);
  font-size:14px;
}

.sep{
  border:none;
  border-top:1px solid var(--border);
  margin:18px 0;
}

/* ===================== TOPBAR ===================== */

.topbar{
  background:linear-gradient(135deg, #f7fcff 0%, #dff4ff 48%, #b9e4fb 100%);
  padding:16px 25px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:var(--text);
  border-bottom:4px solid var(--red);
  box-shadow:0 10px 26px rgba(25,118,163,.12);
}

.topbar .brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.topbar .title b{
  display:block;
  font-size:15px;
}

.topbar .title span{
  font-size:13px;
  opacity:.7;
}

.topbar .actions{
  display:flex;
  gap:10px;
}

/* ===================== LOGO TOPBAR ===================== */

.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
}

.topbar-logo{
  display:flex;
  align-items:center;
}

.topbar-logo img{
  max-width:140px;
  object-fit:contain;
  display:block;
}

/* ===================== CARDS ===================== */

.card{
  background:var(--card);
  border-radius:18px;
  padding:25px;
  margin-bottom:25px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
}

/* ===================== BOTONES ===================== */

.btn{
  display:inline-block;
  background:linear-gradient(135deg, var(--red-dark), var(--red));
  color:#fff;
  padding:9px 16px;
  border-radius:8px;
  border:1px solid rgba(29,155,215,.35);
  font-weight:600;
  font-size:14px;
  text-decoration:none;
  transition:all .2s ease;
  cursor:pointer;
}

.btn:hover{
  background:linear-gradient(135deg, #0c4f72, var(--red-dark));
  border-color:rgba(15,93,133,.45);
}

.btn.secondary{
  background:#fff;
  color:var(--red-dark);
  border:1px solid #b9e4fb;
}

.btn.secondary:hover{ background:#eef8ff; }

.btn.danger{
  background:#0f5d85;
  border-color:#0f5d85;
}

.btn.danger:hover{ background:#0c4f72; }

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

/* ===================== FORMULARIOS ===================== */

.form .field{ margin-bottom:14px; }

.form label{
  display:block;
  font-size:13px;
  margin-bottom:6px;
  font-weight:600;
}

input,
select,
textarea{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--border);
  font-size:14px;
  background:#fff;
}

/* ✅ FIX CRÍTICO:
   Tu regla global de input { width:100% } hace que los CHECKBOX ocupen todo el ancho
   y se vean "centrados" o raros en layouts.
*/
input[type="checkbox"],
input[type="radio"]{
  width:auto !important;
  padding:0 !important;
  border-radius:4px;
}

input:focus,
select:focus,
textarea:focus{
  outline:none;
  border-color:var(--red);
  box-shadow:0 0 0 3px rgba(29,155,215,0.18);
}

.row{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}

.row .field{
  flex:1;
  min-width:220px;
}

/* ===================== TABLAS ===================== */

.table{
  width:100%;
  border-collapse:collapse;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border);
  table-layout:fixed;
}

.table thead th{
  background:#e6f5fd;
  padding:10px 14px;
  text-align:left;
  font-weight:700;
  border-bottom:1px solid var(--border);
}

.table tbody th{
  background:#f3fbff;
  padding:10px 14px;
  text-align:left;
  font-weight:600;
  width:420px;
  border-bottom:1px solid var(--border);
  word-break:normal;
  overflow-wrap:break-word;
}

.table tbody td{
  padding:10px 14px;
  border-bottom:1px solid #e6f5fd;
  word-break:normal;
  overflow-wrap:break-word;
}

.table tbody tr:hover td,
.table tbody tr:hover th{
  background:#f1f5f9;
}

/* ===================== TABLA RESPONSIVE WRAPPER ===================== */

.table-responsive{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.table-responsive .table{ min-width:700px; }

/* PF (buscar.php): deja que la tabla se adapte y no "aplastes" columnas */
.table.pf-results{ table-layout:auto; }

.table.pf-results th,
.table.pf-results td{
  word-break:normal;
  overflow-wrap:break-word;
}

/* ===================== ALERTAS ===================== */

.alert{
  padding:12px 14px;
  border-radius:8px;
  margin-bottom:14px;
  font-size:14px;
}

.alert.error{
  background:#fff1f1;
  color:#7a0000;
  border:1px solid rgba(196,0,0,0.3);
}

.alert.success{
  background:#f0fff5;
  color:#065f46;
  border:1px solid rgba(16,185,129,0.3);
}

.alert.info{
  background:#e6f5fd;
  color:#0f5d85;
  border:1px solid rgba(29,155,215,0.32);
}

/* ===================== LINKS ===================== */

a{ color:var(--red); }
a:hover{ color:var(--red-dark); }

/* ===================== ACCIONES (tablas) ===================== */

.td-actions{ white-space:normal; }
.td-actions .btn{ margin:2px 6px 2px 0; }

/* ===================== CHECKBOX PERMISOS ===================== */

.permisos-list{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  margin-top:10px;
}

.permisos-list label{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:500;
  cursor:pointer;
}

.permisos-list input[type="checkbox"]{
  width:auto;
  transform:scale(1.1);
  cursor:pointer;
}

/* =========================================================
   CHECKBOX LISTS — FORZAR ALINEACIÓN A LA IZQUIERDA
   Afecta a:
   - LENGUA DE ORIGEN (origen)
   - RECATEGORIZACIÓN
   - LOCALIZACIÓN (acepciones)
   - CHECKBOX PRIVADA
   ========================================================= */

.chklist{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:flex-start !important;
  text-align:left !important;
  width:100% !important;
}

.chklist .chkitem,
.field .chkitem{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
  width:100% !important;
  text-align:left !important;
  margin:0 0 6px 0 !important;
}

.chklist input[type="checkbox"],
.field .chkitem input[type="checkbox"]{
  margin:0 !important;
}

/* Si algún contenedor está centrando hijos, anulamos */
.field.field-chkpriv,
.chklist--origen,
.chklist--recat,
.chklist--localizacion{
  text-align:left !important;
  justify-content:flex-start !important;
  align-items:flex-start !important;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width:768px){
  .topbar-right{
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }

  .topbar-logo{ align-self:flex-end; }

  .topbar-logo img{
    height:35px;
    max-width:160px;
  }

  .row{ flex-direction:column; }

  .table tbody th{ width:180px; }

  .container{ padding:15px; }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  .topbar .actions{
    width:100%;
    flex-wrap:wrap;
  }

  .topbar .actions .btn{
    flex:1;
    text-align:center;
  }

  .card{ padding:16px; }

  .table-responsive .table{ min-width:600px; }

  /* Responsive móvil - acciones */
  .td-actions{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:110px;
  }

  .pf-results th,
  .pf-results td{
    font-size:13px;
    padding:10px 8px;
  }

  /* En móvil: prioriza scroll horizontal en lugar de "aplastar" columnas */
  .table-responsive .table.pf-results{ min-width:900px; }

  /* Ocultamos columnas menos importantes en móvil */
  .pf-results th:nth-child(4),
  .pf-results td:nth-child(4),
  .pf-results th:nth-child(5),
  .pf-results td:nth-child(5),
  .pf-results th:nth-child(6),
  .pf-results td:nth-child(6){
    display:none;
  }

  /* DETALLE PF (detalle.php): apilar tabla */
  .pf-detail .table.pf-detail-table,
  .pf-detail .table.pf-detail-table tbody,
  .pf-detail .table.pf-detail-table tr,
  .pf-detail .table.pf-detail-table th,
  .pf-detail .table.pf-detail-table td{
    display:block;
    width:100%;
  }

  .pf-detail .table.pf-detail-table colgroup{ display:none; }

  .pf-detail .table.pf-detail-table tbody tr{
    border-bottom:1px solid var(--border);
  }

  .pf-detail .table.pf-detail-table tbody th{
    width:100%;
    border-bottom:none;
  }

  .pf-detail .table.pf-detail-table tbody td{
    padding-top:6px;
    border-bottom:none;
  }
}



/* =========================================================
   FIX: CHECKBOX + TEXTO JUNTOS A LA IZQUIERDA EN MENÚS (multi)
   (evita separación tipo "dos columnas" dentro de chklists)
   ========================================================= */

.chklist,
.chklist *{
  text-align:left;
}

.chklist label.chkitem{
  display:flex !important;
  flex-direction:row !important;
  justify-content:flex-start !important;
  align-items:center !important;
  gap:10px !important;
}

.chklist label.chkitem .chktext{
  margin:0 !important;
  padding:0 !important;
}

/* Caso específico: recategorización */
.recategorizacion-list{
  align-items:flex-start !important;
  justify-content:flex-start !important;
}
/* =========================================================
   FIX GLOBAL: checkbox + texto juntos a la izquierda
   Afecta a: PRIVADA, LOCALIZACIÓN, ORIGEN (y cualquier chklist)
   ========================================================= */

/* contenedores típicos */
.chklist,
.chklist--origen,
.chklist--localizacion,
.field-chkpriv,
.privada-wrap,
.localizacion-list,
.origen-list{
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

/* el item (label) */
.chkitem,
.chklist label,
.field-chkpriv label{
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important; /* <-- clave (evita space-between) */
  gap: 10px !important;
  width: 100% !important;
  text-align: left !important;
}

/* el texto al lado del checkbox */
.chktext{
  margin: 0 !important;
  text-align: left !important;
}

/* por si alguna regla empuja el texto a la derecha */
.chkitem .chktext,
.chklist label .chktext,
.field-chkpriv label .chktext{
  margin-left: 0 !important;
  margin-right: auto !important; /* evita que se pegue a la derecha */
}

/* checkbox normal */
.chkitem input[type="checkbox"],
.chklist input[type="checkbox"],
.field-chkpriv input[type="checkbox"]{
  margin: 0 !important;
  width: auto !important;
}
/* =========================================================
   OVERRIDE FUERTE — ACEPCIONES: PRIVADA + LOCALIZACIÓN
   (checkbox + texto juntos a la izquierda)
   Pegar AL FINAL de style.css
   ========================================================= */

/* contenedor del bloque (por si algo lo centra) */
.field.field-chkpriv,
.field .locSel,
.locSel,
.chklist.localizacion-list{
  text-align:left !important;
  align-items:flex-start !important;
  justify-content:flex-start !important;
}

/* cada opción (label) */
.field.field-chkpriv label.chkitem,
.chklist.localizacion-list label.chkitem{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start !important;  /* <- clave */
  gap:10px !important;
  width:100% !important;
  text-align:left !important;
}

/* el checkbox (evitar centrado por márgenes) */
.field.field-chkpriv label.chkitem > input[type="checkbox"],
.chklist.localizacion-list label.chkitem > input[type="checkbox"]{
  margin:0 !important;
  width:auto !important;
  align-self:flex-start !important;
}

/* el texto (evitar que se vaya a la derecha por margin-left:auto) */
.field.field-chkpriv label.chkitem > .chktext,
.chklist.localizacion-list label.chkitem > .chktext{
  margin-left:0 !important;
  margin-right:0 !important;
  text-align:left !important;
}
/* ==========================================
   FORZAR MISMO ASPECTO QUE RECATEGORIZACIÓN
   - Checkbox PRIVADA (acepciones)
   - LOCALIZACIÓN (multi) (acepciones)
   ========================================== */

/* 1) PRIVADA */
.field.field-chkpriv label.chkitem{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: auto !important;            /* <-- clave: evita separar columnas */
  max-width: 100% !important;
}

.field.field-chkpriv label.chkitem .chktext{
  flex: 0 0 auto !important;         /* <-- el texto NO se estira */
  width: auto !important;
  margin-left: 0 !important;         /* <-- anula margin-left:auto de otros css */
  text-align: left !important;
}

/* 2) LOCALIZACIÓN (multi) */
.chklist.localizacion-list label.chkitem{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: auto !important;            /* <-- clave */
  max-width: 100% !important;
}

.chklist.localizacion-list label.chkitem .chktext{
  flex: 0 0 auto !important;
  width: auto !important;
  margin-left: 0 !important;
  text-align: left !important;
}

/* 3) Por si algún CSS está empujando el texto a la derecha */
.field.field-chkpriv .chktext,
.chklist.localizacion-list .chktext{
  margin-right: 0 !important;
}
/* =========================================================
   ESTILO ÚNICO PARA TODOS LOS MENÚS (multi)
   (mismo aspecto que LOCALIZACIÓN)
   ========================================================= */

.chklist.multi-menu{
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  background: #f7fcff !important;
  padding: 12px 14px !important;

  /* como LOCALIZACIÓN: caja con scroll cuando hay muchas opciones */
  max-height: 180px !important;      /* ajusta si quieres */
  overflow-y: auto !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

.chklist.multi-menu label.chkitem{
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 !important;
}

.chklist.multi-menu label.chkitem .chktext{
  margin: 0 !important;
  text-align: left !important;
  flex: 0 0 auto !important;
}
/* RECATEGORIZACIÓN debe verse como LOCALIZACIÓN */
.chklist.multi-menu.recategorizacion-list label.chkitem{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
  width:100% !important;
}

.chklist.multi-menu.recategorizacion-list label.chkitem input[type="checkbox"]{
  margin:0 !important;
  width:auto !important;
}

.chklist.multi-menu.recategorizacion-list label.chkitem .chktext{
  margin:0 !important;
  flex:0 0 auto !important;
  text-align:left !important;
}
/* LENGUA DE ORIGEN igual que LOCALIZACIÓN */
.chklist.multi-menu.origen-list label.chkitem{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
  width:100% !important;
}

.chklist.multi-menu.origen-list label.chkitem input[type="checkbox"]{
  margin:0 !important;
  width:auto !important;
}

.chklist.multi-menu.origen-list label.chkitem .chktext{
  margin:0 !important;
  flex:0 0 auto !important;
  text-align:left !important;
}
/* =================================
   ESTILO DICCIONARIO DEFINITIVO
================================= */

/* Contenedor general */
.entry-content{
  font-size: 18px !important;   /* tamaño uniforme del cuerpo */
  line-height: 1.6;
}


/* Forzar mismo tamaño en todos los elementos internos */
.entry-content p,
.entry-content div,
.entry-content span,
.entry-content a,
.entry-content strong,
.entry-content em{
  font-size: inherit !important;
}

/* EXCEPCIÓN: lema + remisión */
.lema-linea,
.lema-linea *{
  font-size: unset !important;
}

/* Acepciones */
.acepcion-item {
    display: flex;
    align-items: flex-start;
    margin-top: 22px;
    width: 100%;
}

.acepcion-grid{
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: .25em;
  align-items: first baseline;
  width: 100%;
}

.acepcion-num{
  font-weight: 700;
  font-size: inherit !important;
  line-height: 1.5;
}

.acepcion-body{
  min-width: 0;
  font-size: inherit !important;
  line-height: 1.5;
}

.acepcion-body > div,
.acepcion-body > p{
  margin: 0 0 .6rem 0;
}

.acepcion-body > .acepcion-ej:has(+ .acepcion-ej),
.acepcion-body > .locucion-ej:has(+ .locucion-ej){
  margin-bottom: .004rem;
}

/* opcional: que la definición tenga el mismo “peso” visual de diccionario */
.acepcion-def{
  line-height: 1.5;
}
.lema-linea{
  font-size: 40px !important;   /* MUCHÍSIMO más grande */
  line-height: 1.05;
  margin: 0 0 16px 0;
  font-weight: 400;
}

.lema-linea .lema{
  font-weight: 700;
}

.lema-linea .lema.cursiva{
  font-style: italic;
}

.lema-linea .remision{
  font-weight: 400;
}

.lema-linea a{
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit;
  text-decoration: none;
}

/* Primera documentación */
.prim-doc {
    margin-top: 8px;
}

/* =================================
   FORZAR TIMES NEW ROMAN EN TODO EL LEMA
   ================================= */

.card .entry-content,
.card .entry-content h1,
.card .entry-content h2,
.card .entry-content h3,
.card .entry-content p,
.card .entry-content div,
.card .entry-content span {
    font-family: "Times New Roman", Times, serif !important;
}
