* { box-sizing: border-box; }
body {
  margin: 0; background: #fff; color: #222;
  font-family: Arial, sans-serif; line-height: 1.5;
}
.login {
  min-height: 100vh; display: grid;
  place-items: center; padding: 24px;
}
.acceso { width: 100%; max-width: 390px; }
.marca { color: #6a341c; font-weight: bold; letter-spacing: 2px; }
h1 { font-size: 28px; }
label { display: block; margin-top: 18px; font-weight: bold; }
input {
  width: 100%; padding: 12px; margin-top: 6px;
  border: 1px solid #aaa; border-radius: 6px; font-size: 16px;
}
button {
  background: #6a341c; color: white; border: 0;
  border-radius: 6px; padding: 12px 20px;
  font-size: 16px; cursor: pointer;
}
.acceso button { width: 100%; margin-top: 24px; }
.error { color: #a12020; }
header {
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 30px; border-bottom: 1px solid #ddd;
}
.secundario { background: #eee; color: #222; }
.contenido { max-width: 1100px; margin: auto; padding: 30px; }
li { margin-bottom: 10px; }

/* Don Mamino maestros v1 */
a { color:#6a341c; }
.catalogos { display:flex; gap:12px; flex-wrap:wrap; margin:20px 0; }
.catalogos a { padding:9px 12px; border:1px solid #ddd; border-radius:6px; text-decoration:none; }
.catalogos a[aria-current="page"] { background:#6a341c; color:#fff; }
.acciones,.fila { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.acciones { justify-content:space-between; }
.boton { display:inline-block; padding:10px 16px; background:#6a341c; color:#fff; border-radius:6px; text-decoration:none; }
.busqueda { margin:15px 0 25px; }
.busqueda input { max-width:400px; }
.tabla-scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th,td { padding:12px; border-bottom:1px solid #ddd; text-align:left; }
th { background:#f5f5f5; }
.formulario { max-width:580px; }
select { width:100%; padding:12px; margin-top:6px; border:1px solid #aaa; border-radius:6px; font-size:16px; background:#fff; }
.ayuda { color:#555; font-size:14px; margin-top:5px; }
.margen { margin-top:24px; }

/* Don Mamino proveedores v1 */
.proveedor-form { max-width:900px; }
.proveedor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; }
.proveedor-grid .ancho { grid-column:1 / -1; }
button:disabled { opacity:.5; cursor:default; }
@media(max-width:650px) { .proveedor-grid { grid-template-columns:1fr; } }

/* Acciones Proveedores en una sola fila */
.acciones-proveedor {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    width: max-content;
}
.acciones-proveedor > a,
.acciones-proveedor > form {
    flex: 0 0 auto;
    white-space: nowrap;
}
.acciones-proveedor > form { margin: 0; }
.acciones-proveedor button { white-space: nowrap; }

/* Don Mamino documentos v1 */
.documento-form { max-width:900px; }
.documento-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; }
.documento-grid > div { min-width:0; }
.documento-grid .ancho { grid-column:1 / -1; }
.documento-grid select { max-width:100%; }
.documento-grid input[readonly] { background:#f6f6f6; }
.tabla-documentos { min-width:1050px; }
.importe { text-align:right; white-space:nowrap; }
.sin-salto { white-space:nowrap; }
.acciones-documento { display:flex; align-items:center; gap:12px; flex-wrap:nowrap; width:max-content; }
.acciones-documento > a,.acciones-documento > form { flex:0 0 auto; white-space:nowrap; }
.acciones-documento > form { margin:0; }
.acciones-documento button { white-space:nowrap; }
@media(max-width:650px) { .documento-grid { grid-template-columns:1fr; } }

/* Don Mamino OT v1 */
.ot-form { max-width:950px; }
.ot-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; }
.ot-grid > div { min-width:0; }
.ot-grid .ancho { grid-column:1 / -1; }
.ot-grid input[readonly] { background:#f6f6f6; }
textarea { width:100%; padding:12px; margin-top:6px; border:1px solid #aaa; border-radius:6px; font:inherit; }
.documento-opcion { display:flex; align-items:center; gap:12px; font-weight:normal; margin:12px 0; }
.documento-opcion input { width:auto; margin:0; }
.acciones-ot { display:flex; gap:12px; align-items:center; flex-wrap:nowrap; width:max-content; }
.acciones-ot > a,.acciones-ot > form { flex:0 0 auto; white-space:nowrap; }
.acciones-ot > form { margin:0; }
.observaciones-ot { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:650px) { .ot-grid { grid-template-columns:1fr; } }
@media print { .no-imprimir { display:none !important; } .ot-impresion { max-width:none; padding:0; } .ot-impresion table { break-inside:auto; } .ot-impresion tr { break-inside:avoid; } .ot-impresion th { background:white; } }

/* DM adelantos v2 */
.adelanto-opcion{padding:14px;border:1px solid #ddd;margin:10px 0;border-radius:8px}.adelanto-opcion input[name=adelanto_importe]{max-width:220px;display:block;margin-top:8px}#alerta_adelantos{font-weight:bold;color:#805b00}

/* Don Mamino OT v4 - distribución acordada: datos + cotización / observaciones completa */
.ot-contenido{max-width:1450px}.ot-form{max-width:none}.ot-titulo{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:20px}.ot-titulo h1{margin:2px 0 0}.ot-kicker{margin:0;color:#6a341c;font-weight:bold;font-size:13px;letter-spacing:1px}.ot-titulo>strong{font-size:20px;color:#6a341c;text-align:right}
.ot-cabecera{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,.85fr);gap:18px;align-items:start}.ot-panel,.ot-seccion{border:1px solid #ddd;border-radius:10px;background:#fff;padding:18px}.ot-panel h2,.ot-seccion h2{margin:0 0 8px;font-size:19px}.ot-panel-datos{grid-column:1}.ot-panel-cotizacion{grid-column:2}.ot-panel-observaciones{grid-column:1/-1}
.ot-datos-grid{display:grid;grid-template-columns:minmax(150px,.45fr) minmax(210px,.65fr) minmax(260px,1fr);gap:0 16px}.ot-datos-grid>div{min-width:0}.ot-datos-grid>div:nth-child(1){grid-column:1}.ot-datos-grid>div:nth-child(2){grid-column:2}.ot-datos-grid>div:nth-child(3){grid-column:1/-1}.ot-datos-grid>div:nth-child(n+4){grid-column:1/-1}.ot-datos-grid .ancho{grid-column:1/-1}
.ot-cotizacion-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.ot-cotizacion-grid .ancho{grid-column:1/-1}.ot-panel label{margin-top:10px;font-size:14px}.ot-panel input,.ot-panel select{padding:9px;margin-top:4px}.ot-panel input[readonly]{background:#f6f6f6}.ot-panel-observaciones textarea{min-height:105px;resize:vertical;margin-top:8px}.ot-total-box{margin-top:10px;padding-top:8px;border-top:1px solid #ddd}.ot-total-box input{font-size:20px;font-weight:bold}
.ot-seccion{margin-top:18px;padding:0;overflow:hidden}.ot-seccion-titulo{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:16px 18px;background:#fafafa;border-bottom:1px solid #ddd}.ot-seccion-titulo h2,.ot-seccion-titulo p{margin:0}.ot-seccion-titulo p{color:#555;font-size:14px;margin-top:3px}.boton-secundario{background:#fff;color:#6a341c;border:1px solid #6a341c;padding:9px 13px}.tabla-ot-detalle{min-width:760px}.tabla-ot-detalle th{font-size:13px;text-transform:uppercase;letter-spacing:.25px}.tabla-ot-detalle th,.tabla-ot-detalle td{padding:10px 14px}.tabla-ot-detalle tbody tr:hover{background:#fcfaf8}.tabla-ot-detalle .col-check{width:48px}.tabla-ot-detalle input[type=checkbox]{width:auto;margin:0}.importe-aplicar{width:130px;min-width:110px;padding:8px;margin:0;text-align:right}.ot-resumen{display:flex;justify-content:flex-end;gap:30px;padding:12px 18px;border-top:1px solid #eee}.ot-resumen strong{min-width:120px;text-align:right}.ot-resumenes{display:flex;justify-content:flex-end;flex-wrap:wrap}.ot-resumenes .ot-resumen{min-width:330px}.ot-resumen.destacado{background:#faf7f4}.ot-resumen.destacado strong{color:#6a341c;font-size:18px}#alerta_adelantos{margin:12px 18px;font-weight:bold;color:#805b00}.ot-pie{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:20px;padding:16px 0}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.duplicado-documento{border:2px solid #d58a8a;background:#fff0f0;border-radius:8px;padding:16px;margin:16px 0}.duplicado-documento h2{margin:0 0 8px;font-size:19px}.duplicado-documento p{margin:5px 0}.duplicado-acciones{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:12px}
@media(max-width:900px){.ot-cabecera{grid-template-columns:1fr}.ot-panel-datos,.ot-panel-cotizacion,.ot-panel-observaciones{grid-column:1}.ot-datos-grid{grid-template-columns:1fr 1fr}.ot-datos-grid>div:nth-child(1){grid-column:1}.ot-datos-grid>div:nth-child(2){grid-column:2}.ot-datos-grid>div:nth-child(n+3){grid-column:1/-1}}
@media(max-width:560px){.ot-datos-grid,.ot-cotizacion-grid{grid-template-columns:1fr}.ot-datos-grid>div:nth-child(n),.ot-cotizacion-grid .ancho{grid-column:1}.ot-titulo,.ot-seccion-titulo,.ot-pie{align-items:flex-start;flex-direction:column}.ot-titulo>strong{text-align:left}.ot-resumenes{display:block}.ot-resumenes .ot-resumen{min-width:0}.ot-resumen{justify-content:space-between}}

/* DM V5 acciones OT */
.acciones-tabla{white-space:nowrap;text-align:right}.enlace-boton{border:0;background:transparent;color:#7a3518;text-decoration:underline;padding:2px 4px;cursor:pointer;font:inherit}.enlace-boton.peligro{color:#a3261d}.acciones-adelanto{display:inline-flex;gap:4px;margin-left:14px;align-items:center}.adelanto-opcion.pendiente-eliminar{opacity:.58;background:#fff7f5}.adelanto-opcion.pendiente-eliminar input[name="adelanto_importe"]{text-decoration:line-through}


/* V8 - listado de OT más compacto */
.tabla-listado-ot table{font-size:9pt;}
.tabla-listado-ot th,.tabla-listado-ot td{font-size:9pt;padding:9px 10px;}
.tabla-listado-ot .ayuda{font-size:8.5pt;}
.tabla-listado-ot .acciones-ot,
.tabla-listado-ot .acciones-ot a,
.tabla-listado-ot .acciones-ot button{font-size:9pt;}


/* V9 - tipografia compacta global para reportes/listados */
.tabla-scroll table,
table.tabla,
table.reporte,
.reporte table,
.listado table,
.tabla-listado-ot table {
    font-size: 9pt !important;
}
.tabla-scroll th, .tabla-scroll td,
table.tabla th, table.tabla td,
table.reporte th, table.reporte td,
.reporte table th, .reporte table td,
.listado table th, .listado table td,
.tabla-listado-ot th, .tabla-listado-ot td {
    font-size: 9pt !important;
    line-height: 1.25 !important;
}
.tabla-scroll .ayuda,
table .ayuda {
    font-size: 8.5pt !important;
}
/* Acciones dentro de reportes, sin afectar formularios generales */
.tabla-scroll td a,
.tabla-scroll td button,
.tabla-scroll td input,
.tabla-scroll td select,
table.tabla td a,
table.tabla td button,
table.reporte td a,
table.reporte td button {
    font-size: 9pt !important;
}
/* Reportes dinámicos de OT: documentos y adelantos */
#documentos_ot,
#adelantos_ot,
#documentos_ot table,
#adelantos_ot table,
#documentos_ot th, #documentos_ot td,
#adelantos_ot th, #adelantos_ot td,
#documentos_ot a, #adelantos_ot a,
#documentos_ot button, #adelantos_ot button,
#adelantos_ot input {
    font-size: 9pt !important;
}



/* V10 - formulario de Orden de Trabajo a 9 pt */
.ot-form,
.ot-form label,
.ot-form input,
.ot-form select,
.ot-form textarea,
.ot-form button,
.ot-form a,
.ot-form .ayuda,
.ot-form .panel,
.ot-form .card,
.ot-form .campo {
    font-size: 9pt !important;
}

/* Compatibilidad con la plantilla actual de OT */
form[action*="ordenes-trabajo"] label,
form[action*="ordenes-trabajo"] input,
form[action*="ordenes-trabajo"] select,
form[action*="ordenes-trabajo"] textarea,
form[action*="ordenes-trabajo"] button {
    font-size: 9pt !important;
}

/* Encabezados de los bloques mostrados en la captura */
.ot-layout h2,
.ot-layout h3,
.ot-panel h2,
.ot-panel h3,
.ot-card h2,
.ot-card h3 {
    font-size: 12pt !important;
}



/* V11 - tamaño global 10 pt */
html, body,
body,
p, span, div, label,
input, select, textarea, button,
a,
table, th, td,
.tabla-scroll table,
.tabla-scroll th, .tabla-scroll td,
table.tabla, table.tabla th, table.tabla td,
table.reporte, table.reporte th, table.reporte td,
.reporte table, .reporte table th, .reporte table td,
.listado table, .listado table th, .listado table td,
.tabla-listado-ot table, .tabla-listado-ot th, .tabla-listado-ot td,
.ot-form, .ot-form label, .ot-form input, .ot-form select,
.ot-form textarea, .ot-form button, .ot-form a,
#documentos_ot, #adelantos_ot,
#documentos_ot table, #adelantos_ot table,
#documentos_ot th, #documentos_ot td,
#adelantos_ot th, #adelantos_ot td,
#documentos_ot a, #adelantos_ot a,
#documentos_ot button, #adelantos_ot button,
#adelantos_ot input {
    font-size: 10pt !important;
}

/* Mantener jerarquía visual de títulos */
h1 { font-size: 22pt !important; }
h2 { font-size: 16pt !important; }
h3 { font-size: 13pt !important; }



/* V12 - formulario OT: texto y controles a 10 pt */
.ot-form,
.ot-form *:not(h1):not(h2):not(h3),
.ot-form label,
.ot-form input,
.ot-form select,
.ot-form textarea,
.ot-form option,
.ot-form button,
.ot-form a,
.ot-form p,
.ot-form span {
    font-size: 10pt !important;
}

/* Selectores específicos de la estructura actual */
.ot-shell label,
.ot-shell input,
.ot-shell select,
.ot-shell textarea,
.ot-shell option,
.ot-shell p,
.ot-shell span,
.ot-grid label,
.ot-grid input,
.ot-grid select,
.ot-grid textarea,
.ot-grid option,
.ot-panel label,
.ot-panel input,
.ot-panel select,
.ot-panel textarea,
.ot-panel option {
    font-size: 10pt !important;
}

/* Títulos de secciones: compactos pero distinguibles */
.ot-form h2, .ot-shell h2, .ot-grid h2, .ot-panel h2 { font-size: 13pt !important; }
.ot-form h3, .ot-shell h3, .ot-grid h3, .ot-panel h3 { font-size: 12pt !important; }


/* V13 - proveedor buscable por RUC o nombre */
.proveedor-buscable #buscar_proveedor{
    width:100%;
    font-size:10pt !important;
}




/* V14 - sugerencias instantaneas de proveedor */
.proveedor-sugerencias-v14{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  z-index:1000;
  max-height:260px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #b9b9b9;
  border-radius:0 0 6px 6px;
  box-shadow:0 5px 14px rgba(0,0,0,.12);
}
.proveedor-sugerencias-v14[hidden]{display:none;}
.proveedor-opcion-v14{
  display:block;
  width:100%;
  border:0;
  border-bottom:1px solid #eee;
  border-radius:0;
  background:#fff;
  text-align:left;
  padding:8px 10px;
  font-size:10pt !important;
  color:#111;
  cursor:pointer;
}
.proveedor-opcion-v14:hover,
.proveedor-opcion-v14:focus{
  background:#f2f2f2;
}


/* V15 - proveedor dinámico en Documento Tributario */
.proveedor-documento-buscable{position:relative;}
.proveedor-documento-buscable #buscar_proveedor_documento{width:100%;font-size:10pt !important;}
.proveedor-sugerencias-v15{
 position:absolute;left:0;right:0;top:100%;z-index:1100;max-height:260px;overflow-y:auto;
 background:#fff;border:1px solid #b9b9b9;border-radius:0 0 6px 6px;
 box-shadow:0 5px 14px rgba(0,0,0,.12);
}
.proveedor-sugerencias-v15[hidden]{display:none;}
.proveedor-opcion-v15{
 display:block;width:100%;border:0;border-bottom:1px solid #eee;border-radius:0;background:#fff;
 text-align:left;padding:8px 10px;font-size:10pt !important;color:#111;cursor:pointer;
}
.proveedor-opcion-v15:hover,.proveedor-opcion-v15:focus{background:#f2f2f2;}


/* V16 - proveedor documento visible y preseleccionado */
.proveedor-documento-v16{position:relative;}
.proveedor-documento-v16 #buscar_proveedor_documento{width:100%;font-size:10pt!important;}
.proveedor-select-real-v16{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;}
.proveedor-sugerencias-v16{position:absolute;left:0;right:0;top:100%;z-index:5000;max-height:280px;overflow:auto;background:#fff;border:1px solid #aaa;border-radius:0 0 6px 6px;box-shadow:0 6px 16px rgba(0,0,0,.15);}
.proveedor-sugerencias-v16[hidden]{display:none;}
.proveedor-opcion-v16{display:block;width:100%;padding:9px 12px;border:0;border-bottom:1px solid #eee;border-radius:0;background:#fff;text-align:left;font-size:10pt!important;cursor:pointer;}
.proveedor-opcion-v16:hover,.proveedor-opcion-v16:focus{background:#f1f1f1;}


/* V17 - texto negro en resultados del buscador de proveedor */
.proveedor-sugerencias-v14,
.proveedor-sugerencias-v15,
.proveedor-sugerencias-v16,
.proveedor-sugerencias-v14 *,
.proveedor-sugerencias-v15 *,
.proveedor-sugerencias-v16 *,
.proveedor-opcion-v14,
.proveedor-opcion-v15,
.proveedor-opcion-v16 {
    color: #000 !important;
}

.proveedor-opcion-v14,
.proveedor-opcion-v15,
.proveedor-opcion-v16 {
    background-color: #fff !important;
}

.proveedor-opcion-v14:hover,
.proveedor-opcion-v14:focus,
.proveedor-opcion-v15:hover,
.proveedor-opcion-v15:focus,
.proveedor-opcion-v16:hover,
.proveedor-opcion-v16:focus {
    color: #000 !important;
    background-color: #f1f1f1 !important;
}



/* V15 - uniformidad tipografica y ancho de reportes */
html, body, input, select, textarea, button, table, th, td, a, label {
  font-family: Arial, Helvetica, sans-serif;
}
input[type="date"] {
  font-family: Arial, Helvetica, sans-serif !important;
  font-variant-numeric: normal;
}
.contenido.documentos-ancho {
  width: calc(100% - 32px) !important;
  max-width: 1850px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.contenido.documentos-ancho .tabla-scroll {
  width: 100% !important;
  max-width: none !important;
}
.contenido.documentos-ancho table.tabla-documentos {
  width: 100% !important;
  min-width: 1500px;
}



/* V16 - compactar columnas de Documentos Tributarios */
.contenido.documentos-ancho {
  width: calc(100% - 28px) !important;
  max-width: none !important;
}

/* Evitar que la tabla fuerce ancho extra y repartir mejor las columnas */
.contenido.documentos-ancho table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.contenido.documentos-ancho th,
.contenido.documentos-ancho td {
  padding-left: 10px !important;
  padding-right: 10px !important;
  vertical-align: middle !important;
}

/* Anchos compactos: Fecha, Proveedor, Documento, Moneda, Sin IGV, IGV, Total, Uso, Detalle */
.contenido.documentos-ancho th:nth-child(1),
.contenido.documentos-ancho td:nth-child(1) { width: 8% !important; }

.contenido.documentos-ancho th:nth-child(2),
.contenido.documentos-ancho td:nth-child(2) { width: 20% !important; }

.contenido.documentos-ancho th:nth-child(3),
.contenido.documentos-ancho td:nth-child(3) { width: 9% !important; }

.contenido.documentos-ancho th:nth-child(4),
.contenido.documentos-ancho td:nth-child(4) { width: 8% !important; }

.contenido.documentos-ancho th:nth-child(5),
.contenido.documentos-ancho td:nth-child(5) { width: 8% !important; }

.contenido.documentos-ancho th:nth-child(6),
.contenido.documentos-ancho td:nth-child(6) { width: 6% !important; }

.contenido.documentos-ancho th:nth-child(7),
.contenido.documentos-ancho td:nth-child(7) { width: 7% !important; }

.contenido.documentos-ancho th:nth-child(8),
.contenido.documentos-ancho td:nth-child(8) { width: 10% !important; }

.contenido.documentos-ancho th:nth-child(9),
.contenido.documentos-ancho td:nth-child(9) { width: 24% !important; }

/* Quitar huecos visuales y permitir que textos largos se ajusten dentro de su columna */
.contenido.documentos-ancho td {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}



/* V17 - Documentos tributarios: ganar espacio para boton Ver */
.contenido.documentos-ancho {
  width: calc(100% - 20px) !important;
  max-width: none !important;
}

/* Dejamos espacio para una columna adicional de acción */
.contenido.documentos-ancho table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

.contenido.documentos-ancho th,
.contenido.documentos-ancho td {
  padding-left: 7px !important;
  padding-right: 7px !important;
}

/* Fecha */
.contenido.documentos-ancho th:nth-child(1),
.contenido.documentos-ancho td:nth-child(1) { width: 8% !important; }

/* Proveedor: más angosto para que el nombre use aproximadamente 2 líneas */
.contenido.documentos-ancho th:nth-child(2),
.contenido.documentos-ancho td:nth-child(2) {
  width: 20% !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* Documento */
.contenido.documentos-ancho th:nth-child(3),
.contenido.documentos-ancho td:nth-child(3) { width: 9% !important; }

/* Moneda */
.contenido.documentos-ancho th:nth-child(4),
.contenido.documentos-ancho td:nth-child(4) { width: 8% !important; }

/* Sin IGV */
.contenido.documentos-ancho th:nth-child(5),
.contenido.documentos-ancho td:nth-child(5) { width: 7% !important; }

/* IGV */
.contenido.documentos-ancho th:nth-child(6),
.contenido.documentos-ancho td:nth-child(6) { width: 6% !important; }

/* Total */
.contenido.documentos-ancho th:nth-child(7),
.contenido.documentos-ancho td:nth-child(7) { width: 7% !important; }

/* Uso */
.contenido.documentos-ancho th:nth-child(8),
.contenido.documentos-ancho td:nth-child(8) { width: 10% !important; }

/* Detalle: compactar un poco más */
.contenido.documentos-ancho th:nth-child(9),
.contenido.documentos-ancho td:nth-child(9) { width: 20% !important; }

/* Si existe columna Ver/Acciones, reservarle espacio visible */
.contenido.documentos-ancho th:nth-child(10),
.contenido.documentos-ancho td:nth-child(10) {
  width: 5% !important;
  white-space: nowrap !important;
  text-align: center !important;
}


/* V23 - Usuarios y Roles */
.seguridad-contenido{max-width:1250px}.seguridad-titulo{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:20px}.seguridad-acciones,.acciones-seguridad,.seguridad-busqueda{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.acciones-seguridad form{margin:0}.seguridad-busqueda input{max-width:430px;margin:0}.boton-tabla{padding:7px 10px;font-size:10pt}.tabla-seguridad{min-width:850px}.seguridad-form{max-width:900px}.seguridad-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.seguridad-grid .ancho{grid-column:1/-1}.seguridad-panel{margin-top:22px;padding:18px;border:1px solid #ddd;border-radius:10px}.seguridad-panel h2{margin:0 0 8px}.checks-seguridad,.permisos-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin-top:14px}.check-seguridad{display:flex;gap:10px;align-items:flex-start;margin:0;padding:11px 12px;border:1px solid #e2e2e2;border-radius:8px;font-weight:normal}.check-seguridad input{width:auto;margin:3px 0 0}.check-seguridad small{display:block;color:#666;margin-top:2px}@media(max-width:700px){.seguridad-titulo{align-items:flex-start;flex-direction:column}.seguridad-grid,.checks-seguridad,.permisos-grid{grid-template-columns:1fr}.seguridad-grid .ancho{grid-column:1}}


/* V24 - permisos detallados */
.rol-v24{max-width:1500px}.rol-nombre{max-width:520px;margin:20px 0}.cabecera-v24{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:16px}.cabecera-v24 h2,.cabecera-v24 p{margin:0 0 4px}.grid-v24{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.modulo-v24{border:1px solid #d9e0ea;border-radius:14px;background:#f8faff;padding:18px 20px}.titulo-v24{display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid #dce3ed;padding-bottom:10px}.titulo-v24 h3{margin:0}.titulo-v24 label{display:flex;gap:6px;align-items:center;margin:0;font-size:10pt}.titulo-v24 input,.accion-v24 input{width:auto;margin:0}.accion-v24{display:flex;gap:12px;align-items:flex-start;margin:0;padding:12px 0;border-bottom:1px solid #e2e7ef;font-weight:normal;cursor:pointer}.accion-v24:last-child{border-bottom:0}.accion-v24 input{margin-top:3px}.accion-v24 strong,.accion-v24 small{display:block}.accion-v24 small{margin-top:3px;color:#667085;line-height:1.35}@media(max-width:1100px){.grid-v24{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.grid-v24{grid-template-columns:1fr}.cabecera-v24{align-items:flex-start;flex-direction:column}}

/* V25 - Contraseña provisional */
.aviso-provisional{display:inline-block;margin:6px 0 0;padding:6px 10px;border-radius:6px;background:#fff3cd;border:1px solid #ead58a;color:#6b5200;font-size:9.5pt;font-weight:600}
.cambio-clave{max-width:470px}
.cambio-clave h1{margin-bottom:8px}
.cambio-clave .ayuda{font-size:9.5pt;color:#666;line-height:1.4}
.salir-cambio-clave{margin-top:10px}
.salir-cambio-clave button{width:100%}

/* V27 - Dashboard y reportes */
.dashboard-contenido{max-width:1650px}.dash-sub{color:#555;margin-top:-6px}.dash-filtros{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:14px;margin:18px 0;border:1px solid #ddd;border-radius:9px;background:#fafafa}.dash-filtros label{min-width:180px;margin:0}.dash-filtros input,.dash-filtros select{margin-top:5px}.dash-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:18px 0}.dash-kpi{border:1px solid #ddd;border-radius:10px;padding:15px;background:#fff}.dash-kpi span,.dash-kpi small{display:block;color:#666}.dash-kpi strong{display:block;font-size:18pt;margin:7px 0;color:#743315}.dash-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.dash-panel{border:1px solid #ddd;border-radius:10px;padding:16px;background:#fff;min-width:0}.dash-panel h2{font-size:15pt;margin:0 0 15px}.dash-bars{display:grid;gap:9px}.dash-row{display:grid;grid-template-columns:minmax(120px,210px) 1fr 125px;gap:10px;align-items:center;font-size:9.5pt}.dash-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-track{height:20px;background:#f0f0f0;border-radius:4px;overflow:hidden}.dash-track span{display:block;height:100%;background:#7a3518;border-radius:4px;min-width:1px}.dash-value{text-align:right;font-variant-numeric:tabular-nums}.dash-vacio{color:#777}@media(max-width:1200px){.dash-kpis{grid-template-columns:repeat(3,1fr)}}@media(max-width:850px){.dash-grid{grid-template-columns:1fr}.dash-kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:560px){.dash-kpis{grid-template-columns:1fr}.dash-row{grid-template-columns:100px 1fr 105px}}

/* V28 - Auditoría */
.auditoria-contenido{max-width:1650px} .auditoria-ayuda{color:#555;max-width:980px}
.auditoria-filtros{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:14px;margin:16px 0;border:1px solid #ddd;border-radius:9px;background:#fafafa}
.auditoria-filtros label{margin:0;min-width:145px} .auditoria-filtros input,.auditoria-filtros select{margin-top:5px}
.auditoria-buscar{min-width:260px!important;flex:1} .auditoria-resumen{margin:10px 0;color:#555}
.tabla-scroll{overflow:auto} .auditoria-tabla{width:100%;border-collapse:collapse;font-size:9.5pt}
.auditoria-tabla th,.auditoria-tabla td{padding:8px;border-bottom:1px solid #ddd;text-align:left;vertical-align:top}
.auditoria-tabla th{background:#f2d36b;white-space:nowrap} .aud-fecha{white-space:nowrap} .aud-accion{font-weight:700}
.aud-ruta{color:#777;word-break:break-all} .aud-paginacion{display:flex;align-items:center;justify-content:center;gap:12px;margin:18px 0}

/* V28.2 - Auditoría legible anterior/nuevo */
.aud-v29 td{vertical-align:middle} .aud-v29 .aud-badge{display:inline-block;padding:4px 10px;border-radius:5px;background:#7a3518;color:#fff;font-weight:700}
.aud-ver{white-space:nowrap;padding:5px 10px!important} .aud-detalle-row td{background:#fafafa;padding:8px 16px 14px!important}
.aud-cambios{border:1px solid #d4d9dd;border-radius:8px;padding:10px;background:#f7f9fa} .aud-cambios>strong{display:block;margin-bottom:8px}
.aud-cambios table{width:100%;border-collapse:collapse} .aud-cambios th,.aud-cambios td{padding:6px 10px!important;border:1px solid #dfe3e6!important;text-align:left}
.aud-cambios th{background:#e9edef!important;color:#222} .aud-cambios td:first-child{width:28%;background:#fff}
.aud-cambios .aud-anterior{background:#f8d7da!important;color:#842029;white-space:normal} .aud-cambios .aud-nuevo{background:#d1e7dd!important;color:#0f5132;font-weight:600;white-space:normal}

/* V28.3 - Auditoría compacta */
.aud-v29 .aud-badge{font-size:8pt!important;padding:2px 7px!important;border-radius:4px!important;line-height:1.25!important}
.aud-v29 .aud-ver{font-size:8pt!important;padding:3px 8px!important;min-height:0!important;line-height:1.25!important}


/* V29 - Pantalla principal */
.home-v29-body{min-height:100vh;background:#fff;color:#172033;overflow-x:hidden;position:relative}
.home-v29-header{position:relative;z-index:3;padding:14px 30px;background:rgba(255,255,255,.96);box-shadow:0 1px 8px rgba(0,0,0,.06)}
.home-v29-brand{display:flex;align-items:center;gap:10px;color:#172033}
.home-v29-brand strong{font-size:11pt}.home-v29-logo{color:#7a3518;font-size:23px;font-weight:900;line-height:1}
.home-v29-header form{margin:0}.home-v29-logout{font-size:9.5pt;padding:9px 15px;margin:0}
.home-v29{position:relative;z-index:2;max-width:1120px;margin:0 auto;padding:26px 28px 90px}
.home-v29-welcome{text-align:center;margin:0 auto 25px}
.home-v29-welcome h1{font-size:27px;margin:0 0 5px;color:#111827}
.home-v29-welcome p{margin:0;color:#667085;font-size:11pt}
.home-v29-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.home-v29-card{min-height:160px;padding:19px 22px 17px;border:1px solid #e5e7eb;border-radius:12px;background:rgba(255,255,255,.96);
 box-shadow:0 7px 20px rgba(40,25,15,.08);text-decoration:none;color:#172033;display:flex;flex-direction:column;align-items:center;
 justify-content:center;text-align:center;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.home-v29-card:hover{transform:translateY(-3px);box-shadow:0 11px 27px rgba(75,40,20,.13);border-color:#d8c1b5;color:#172033}
.home-v29-icon{width:62px;height:62px;border-radius:50%;background:#f8eee8;color:#7a3518;display:flex;align-items:center;justify-content:center;
 font-size:28px;font-weight:800;margin-bottom:10px;letter-spacing:-3px}
.home-v29-card strong{font-size:14.5pt;line-height:1.15;margin-bottom:6px}
.home-v29-card small{display:block;max-width:245px;color:#667085;font-size:10.5pt;line-height:1.35}
.home-v29-wave{position:fixed;z-index:0;left:-5%;width:110%;height:130px;border-radius:50% 50% 0 0/80% 80% 0 0;pointer-events:none}
.home-v29-wave-a{bottom:-70px;background:#f8eee8;transform:rotate(1deg)}
.home-v29-wave-b{bottom:-100px;background:#f3e2d7;transform:rotate(-2deg)}
@media(max-width:850px){.home-v29-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-v29{padding-top:22px}}
@media(max-width:560px){.home-v29-header{padding:12px 16px}.home-v29-brand strong{font-size:9.5pt}.home-v29{padding:22px 16px 70px}
 .home-v29-grid{grid-template-columns:1fr;gap:12px}.home-v29-card{min-height:135px}.home-v29-welcome h1{font-size:23px}}

/* Dashboard: mostrar lista COMPLETA de centros de costo, sin scroll interior */
.dash-panel-centros { height: auto !important; max-height: none !important; overflow: visible !important; }
.dash-panel-centros .dash-bars { height: auto !important; max-height: none !important; overflow: visible !important; }

/* CENTROS_TODOS_V2: lista completa sin recorte */
.dash-panel-centros,.dash-panel-centros .dash-bars {height:auto!important;max-height:none!important;overflow:visible!important;}


/* DON MAMINO - BOTONES SMALL UNIFICADOS V1 */
/* Botones y enlaces de acción, con texto visible y tamaño compacto. */
button:not(.home-v29-icon),
a.boton,
.boton,
a.boton-tabla,
.boton-tabla,
.catalogos a,
.acciones a,
.fila a.boton,
header a.boton {
    font-size: 10pt !important;
    line-height: 1.25 !important;
    padding: 6px 10px !important;
    min-height: 30px;
    max-width: 100%;
    border-radius: 6px;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Los enlaces para volver, cancelar y otras acciones siguen siendo botones. */
a.boton { display: inline-flex !important; align-items: center; justify-content: center; gap: 4px; }
button { vertical-align: middle; }
/* No afectar enlaces normales, botones de cierre del navegador ni controles de impresión. */
@media print { button, a.boton { min-height: auto; } }


/* DON MAMINO - ACCIONES SMALL V2 */
/* Enlaces de navegación y acciones presentados como botones compactos. */
a.boton, a.boton-tabla, a.dm-accion-small,
header a[href]:not(.home-v29-card),
button:not(.home-v29-icon), input[type="submit"], input[type="button"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10pt !important;
  line-height: 1.25 !important;
  padding: 6px 10px !important;
  min-height: 30px;
  max-width: 100%;
  border-radius: 6px;
  white-space: normal;
  text-decoration: none !important;
  vertical-align: middle;
}
a.boton:not(.secundario):not(.boton-secundario),
a.dm-accion-small:not(.secundario):not(.boton-secundario),
header a[href]:not(.secundario):not(.boton-secundario):not(.home-v29-card) {
  background: #6a341c;
  color: white;
  border: 1px solid #6a341c;
}
a.boton.secundario, a.boton.boton-secundario,
a.dm-accion-small.secundario, a.dm-accion-small.boton-secundario {
  background: #eee;
  color: #222;
  border: 1px solid #bbb;
}
@media print { a.dm-accion-small { display: none !important; } }

/* DM_PROVEEDORES_ALINEACION_IZQUIERDA_INICIO */
/* Caja Chica y Orden de Trabajo: opciones del buscador de proveedores. */
#proveedor_sugerencias .cc-opcion,
.cc-sugerencias .cc-opcion,
.proveedor-sugerencias-v14 .proveedor-opcion-v14 {
    text-align: left !important;
    text-align-last: left !important;
    justify-content: flex-start !important;
    padding-left: 12px;
}
/* DM_PROVEEDORES_ALINEACION_IZQUIERDA_FIN */


/* DM_PROVEEDORES_LEFT_V2_INICIO */
.ot-form #proveedor_sugerencias_v14 .proveedor-opcion-v14,
.ot-form .proveedor-sugerencias-v14 .proveedor-opcion-v14,
#caja_chica_form #proveedor_sugerencias .cc-opcion,
#caja_chica_form .cc-sugerencias .cc-opcion{
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: left !important;
    text-align-last: left !important;
    width: 100% !important;
    padding-left: 12px !important;
}
/* DM_PROVEEDORES_LEFT_V2_FIN */
