/* ==========================================================
   estilos.css  -  Listado de facturas / cotizaciones
   Consolida todos los <style> de la vista. No cambia ids ni clases.
   ========================================================== */

/* ---------- Variables ---------- */
:root {
    --c-navy: #1e3a5f;
    --c-navy-2: #1f4e79;
    --c-blue: #2563eb;
    --c-blue-soft: #eff6ff;
    --c-text: #334155;
    --c-muted: #64748b;
    --c-border: #d9e0ea;
    --c-bg-input: #f8fafc;
    --shadow-card: 0 2px 14px rgba(15, 23, 42, .08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ==========================================================
   BASE
   ========================================================== */
.datepicker > div { display: inherit; }

.row { border-bottom-style: solid; }
.vista-cot .row { border-bottom: none !important; }
#dialogoDocumentos .row { border-bottom: none; }

.isDisabled { cursor: not-allowed; opacity: .5; }

a[aria-disabled="true"] {
    color: currentColor;
    display: inline-block;   /* bug IE11 / Edge */
    pointer-events: none;
    text-decoration: none;
}

/* los filtros quedan por encima de cualquier elemento que se les traslape */
.vista-cot > .row { position: relative; z-index: 5; }
.vista-cot > .row + .row { z-index: 4; }

/* ==========================================================
   FILTROS (tarjeta)
   ========================================================== */
.vista-cot > .row {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 14px 15px 4px;
    margin: 10px 0 12px !important;
}
/* la fila de botones va sin tarjeta */
.vista-cot > .row + .row {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0 0 12px !important;
}

.vista-cot .form-group { margin-bottom: 10px; }

.vista-cot label {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 4px;
}
.vista-cot label .fa { color: #3b82f6; margin-right: 4px; }

/* ==========================================================
   INPUTS Y COMBOS
   ========================================================== */
.vista-cot .form-control {
    height: 38px;
    font-size: 13px;
    color: var(--c-text) !important;
    background-color: var(--c-bg-input);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.vista-cot .form-control:hover { border-color: #93c5fd; }
.vista-cot .form-control:focus {
    background-color: #fff;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    outline: 0;
}
.vista-cot .form-control::placeholder { color: #94a3b8; }

.vista-cot select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2364748b' stroke-width='2' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* ==========================================================
   BOTONES
   ========================================================== */
.vista-cot .btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.vista-cot > .row .btn { margin: 0 6px 8px 0; }
.vista-cot .btn:hover,
.vista-cot .btn:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, .22);
    filter: brightness(1.07);
}
.vista-cot .btn:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(15, 23, 42, .2); }
.vista-cot .btn[disabled],
.vista-cot .btn.disabled { opacity: .55; transform: none; box-shadow: none; filter: none; }
.vista-cot .btn .fa { font-size: 14px !important; margin-right: 5px; color: #fff !important; }

.vista-cot .btn-primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.vista-cot .btn-success { background: linear-gradient(135deg, #10b981, #047857); }
.vista-cot .btn-warning { background: linear-gradient(135deg, #fbbf24, #d97706); }
.vista-cot .btn-danger  { background: linear-gradient(135deg, #f87171, #dc2626); }
.vista-cot .btn-info    { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.vista-cot .btn-default { background: linear-gradient(135deg, #64748b, #334155); }

/* ==========================================================
   FILA DE BOTONES + BUSCADOR
   ========================================================== */
.vista-cot .fila-acciones-tabla {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    border: none !important;
}

.vista-cot .acciones-tabla {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.vista-cot .grupo-botones {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.vista-cot .grupo-botones .btn { margin: 0 !important; }

/* buscador a la derecha */
.vista-cot .buscador-tabla {
    display: flex;
    align-items: center;
    height: 38px;
    margin-left: 15px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .1);
    border-radius: var(--radius-sm);
}
.vista-cot .buscador-label {
    height: 38px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-navy), var(--c-navy-2));
    color: #fff;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.vista-cot .buscador-label .fa { margin: 0 !important; color: #fff !important; font-size: 14px; }

.vista-cot #buscarTablaCotizaciones {
    width: 230px;
    height: 38px;
    margin: 0 !important;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: none;
    font-size: 13px;
}
.vista-cot #buscarTablaCotizaciones:focus {
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* ocultar el buscador / toolbar nativo de bootstrap-table */
.vista-cot .fixed-table-toolbar .bs-bars,
.vista-cot .fixed-table-toolbar .columns,
.vista-cot .fixed-table-toolbar .search,
.vista-cot .fixed-table-toolbar .pull-left.search,
#tablaCotizaciones ~ .fixed-table-toolbar .pull-left.search,
.fixed-table-toolbar .pull-left.search {
    display: none !important;
}

/* ==========================================================
   TABLA (compacta)
   ========================================================== */
.bootstrap-table .fixed-table-container {
    border: none !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: #fff;
}
/* si no cabe, la tabla se desplaza horizontalmente */
.bootstrap-table .fixed-table-body { overflow-x: auto; }

#tablaCotizaciones { margin-bottom: 0; }

/* encabezado */
#tablaCotizaciones thead th,
#tablaCotizaciones thead th .th-inner {
    background: linear-gradient(135deg, var(--c-navy), var(--c-navy-2));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    border: none !important;
    vertical-align: middle;
}
#tablaCotizaciones thead th { padding: 0; }
#tablaCotizaciones thead th .th-inner { padding: 9px 20px 9px 6px !important; }
#tablaCotizaciones thead th .fa { margin-right: 5px; opacity: .9; }

/* celdas: menos espacio entre renglones */
#tablaCotizaciones tbody td {
    font-size: 11px;
    line-height: 1.3;
    color: var(--c-text);
    padding: 5px 6px !important;
    vertical-align: middle !important;
    border-top: 1px solid #eef2f7 !important;
}

/* filas alternas */
#tablaCotizaciones.table-striped > tbody > tr:nth-of-type(odd) {
    box-shadow: none;
    border-bottom: none;
    background: #fff;
}
#tablaCotizaciones > tbody > tr:nth-of-type(even) { background: #fafbfd; }
#tablaCotizaciones > tbody > tr { transition: background .15s ease; }
#tablaCotizaciones > tbody > tr:hover { background: var(--c-blue-soft) !important; }
#tablaCotizaciones > tbody > tr.selected td { background: #dbeafe !important; }

/* UUID (col 7): chico y en varias líneas */
#tablaCotizaciones tbody td:nth-child(7) {
    font-size: 10px;
    max-width: 150px;
    white-space: normal;
    word-break: break-all;
}

/* Concepto (col 8) y Motivo (col 12): varias líneas */
#tablaCotizaciones tbody td:nth-child(8),
#tablaCotizaciones tbody td:nth-child(12) {
    max-width: 160px;
    white-space: normal;
    word-break: break-word;
}

/* iconos de la columna Acciones */
#tablaCotizaciones tbody td:last-child a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0 1px !important;
    border-radius: var(--radius-sm);
    color: #475569;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
#tablaCotizaciones tbody td:last-child a:hover {
    background: #e0e7ff;
    color: #1d4ed8;
    transform: scale(1.12);
    text-decoration: none;
}

/* ==========================================================
   PAGINACIÓN
   ========================================================== */
.fixed-table-pagination { padding: 4px 12px; font-size: 12px; }
.pagination > li > a {
    border: none;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    padding: 5px 11px;
    font-size: 12px;
    color: #475569;
}
.pagination > li > a:hover { background: #e0e7ff; color: #1d4ed8; }
.pagination > .active > a,
.pagination > .active > a:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: #fff !important;
}

/* ==========================================================
   BADGES DE ESTADO (opcional)
   ========================================================== */
.badge-estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-estado.pendiente  { background: #fef3c7; color: #92400e; }
.badge-estado.autorizado { background: #d1fae5; color: #065f46; }
.badge-estado.rechazado  { background: #fee2e2; color: #991b1b; }
.badge-estado.cancelado  { background: #e2e8f0; color: #475569; }
.badge-estado.info       { background: #dbeafe; color: #1e40af; }

/* ==========================================================
   MODALES
   ========================================================== */
#dialogoDocumentos .modal-dialog { margin: 0 auto; }

.modal-documentos { width: 95%; max-width: 1400px; }
.modal-documentos .modal-content { border-radius: 10px; }
.modal-documentos .modal-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}
.modal-documentos .form-control { height: 38px; font-size: 14px; }
.modal-documentos label { font-weight: 600; color: #444; }
.modal-documentos .panel { margin-bottom: 15px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.modal-documentos .panel-heading { font-weight: bold; }

.vista-cot.modal .modal-header,
.vista-cot .modal-header {
    border-radius: var(--radius) var(--radius) 0 0;
}
.vista-cot .modal-body { background: #fff; }
.vista-cot .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    border-radius: 0 0 var(--radius) var(--radius);
}
.vista-cot .panel {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.vista-cot .panel-heading {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    padding: 8px 14px;
}
.vista-cot .panel-primary > .panel-heading {
    background: linear-gradient(135deg, var(--c-navy), var(--c-navy-2));
    border: none;
}

/* ==========================================================
   CELULAR / TABLET
   ========================================================== */
@media (max-width: 991px) {
    .vista-cot .acciones-tabla { flex-direction: column; align-items: stretch; }
    .vista-cot .grupo-botones { width: 100%; }
    .vista-cot .buscador-tabla { width: 100%; margin: 10px 0 0 0; }
    .vista-cot #buscarTablaCotizaciones { width: 100%; }
}