/* =====================================
   GASTOS CONDUCTOR CSS AISLADO - GSX
   Cards + filtros + tabla + modal
===================================== */

/* =========================
   LAYOUT
========================= */
.gsx-layout {
  display: block;
}

.gsx-main {
  width: 100%;
  min-width: 0;
}

/* =========================
   HEADER
========================= */
.gsx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.gsx-header h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  color: #111827;
}

/* =========================
   BOTONES
========================= */
.gsx-btn {
  border: none;
  border-radius: 10px;
  height: 44px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.gsx-btn:hover {
  transform: translateY(-1px);
}

.gsx-btn-primary {
  background: #2f56a6;
  color: #fff;
}

.gsx-btn-primary:hover {
  background: #24468a;
}

.gsx-btn-danger {
  background: #ea4335;
  color: #fff;
}

.gsx-btn-danger:hover {
  background: #cf3528;
}

.gsx-btn-light {
  background: #eef2f7;
  color: #111827;
}

.gsx-btn-light:hover {
  background: #dde5ef;
}

/* =========================
   CARDS
========================= */
.gsx-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.gsx-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.gsx-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 14px 0 0 14px;
}

.gsx-total::before {
  background: #e74c3c;
}

.gsx-cantidad::before {
  background: #27ae60;
}

.gsx-promedio::before {
  background: #f39c12;
}

.gsx-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.gsx-card p {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #111827;
}

/* =========================
   FILTROS
========================= */
.gsx-filters-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.gsx-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

.gsx-field {
  display: flex;
  flex-direction: column;
}

.gsx-field label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.gsx-field input,
.gsx-field select,
.gsx-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.gsx-field textarea {
  min-height: 110px;
  resize: vertical;
}

.gsx-field input:focus,
.gsx-field select:focus,
.gsx-field textarea:focus {
  outline: none;
  border-color: #2f56a6;
  box-shadow: 0 0 0 3px rgba(47,86,166,.12);
}

/* =========================
   TABLA
========================= */
.gsx-table-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
}

.gsx-table-scroll {
  width: 100%;
  max-height: 560px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.gsx-table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.gsx-table-scroll::-webkit-scrollbar-thumb {
  background: #c7ced8;
  border-radius: 20px;
}

.gsx-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.gsx-table th {
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  white-space: nowrap;
}

.gsx-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f1;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.gsx-table tbody tr:hover {
  background: #fafafa;
}

.text-center {
  text-align: center;
  font-weight: 700;
}

/* última columna */
.gsx-table th:last-child,
.gsx-table td:last-child {
  text-align: center;
  width: 80px;
}

/* =========================
   MODAL
========================= */
.gsx-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.hidden {
  display: none !important;
}

.gsx-modal-box {
  background: #fff;
  width: min(94vw, 620px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.gsx-modal-box::-webkit-scrollbar {
  width: 8px;
}

.gsx-modal-box::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 20px;
}

.gsx-modal-header h3 {
  margin: 0 0 18px;
  font-size: 24px;
  color: #111827;
}

/* =========================
   FORM MODAL
========================= */
.gsx-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gsx-full {
  grid-column: span 2;
}

.gsx-modal-actions {
  grid-column: span 2;
  display: flex;
  margin-top: 8px;
}

.gsx-modal-actions .gsx-btn {
  width: 100%;
}

/* disabled */
.gsx-field input:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1024px) {
  .gsx-cards {
    grid-template-columns: 1fr;
  }

  .gsx-filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gsx-header {
    flex-direction: column;
    align-items: stretch;
  }

  .gsx-header h2 {
    font-size: 28px;
  }

  .gsx-header .gsx-btn,
  .gsx-btn {
    width: 100%;
  }

  .gsx-filters-grid {
    grid-template-columns: 1fr;
  }

  .gsx-form-grid {
    grid-template-columns: 1fr;
  }

  .gsx-full,
  .gsx-modal-actions {
    grid-column: span 1;
  }

  .gsx-table {
    min-width: 920px;
  }
}

@media (max-width: 480px) {
  .gsx-header h2 {
    font-size: 24px;
  }

  .gsx-filters-box,
  .gsx-table-card,
  .gsx-modal-box,
  .gsx-card {
    padding: 14px;
  }

  .gsx-card p {
    font-size: 20px;
  }
}

/* =====================================
   INLINE EDIT ELEGANTE
===================================== */

.gsx-table tr.gsx-editing {
  background: #f8fbff;
}

.gsx-table tr.gsx-editing td {
  border-bottom: 1px solid #dbeafe;
}

.gsx-inline-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  font-size: 14px;
  background: #ffffff;
  color: #111827;
  box-sizing: border-box;
  transition: .2s ease;
}

.gsx-inline-input:focus {
  outline: none;
  border-color: #2f56a6;
  box-shadow: 0 0 0 3px rgba(47,86,166,.12);
}

.gsx-inline-input.valor {
  max-width: 140px;
  text-align: right;
  font-weight: 700;
}

.gsx-inline-input.descripcion {
  min-width: 320px;
}

/* =====================================
   AJUSTE COMPACTO GASTOS CONDUCTOR
   AGREGAR AL FINAL
===================================== */

/* layout */
.gsx-layout{
  padding:14px !important;
}

/* header */
.gsx-header{
  gap:12px !important;
  margin-bottom:14px !important;
}

.gsx-header h2{
  font-size:28px !important;
}

/* botones */
.gsx-btn{
  height:34px !important;
  padding:0 14px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

/* =========================
   CARDS MÁS PEQUEÑAS
========================= */
.gsx-cards{
  gap:10px !important;
  margin-bottom:14px !important;
  grid-template-columns:repeat(3,1fr) !important;
}

.gsx-card{
  padding:12px 14px !important;
  border-radius:12px !important;
}

.gsx-card::before{
  width:4px !important;
}

.gsx-card h3{
  font-size:10px !important;
  margin-bottom:4px !important;
}

.gsx-card p{
  font-size:18px !important;
  line-height:1.2 !important;
}

/* =========================
   FILTROS MÁS COMPACTOS
========================= */
.gsx-filters-box{
  padding:14px !important;
  margin-bottom:14px !important;
}

.gsx-filters-grid{
  grid-template-columns:repeat(6,1fr) !important;
  gap:8px !important;
}

.gsx-field label{
  font-size:11px !important;
  margin-bottom:4px !important;
}

.gsx-field input,
.gsx-field select,
.gsx-field textarea{
  min-height:34px !important;
  height:34px !important;
  padding:0 10px !important;
  font-size:12px !important;
  border-radius:9px !important;
}

.gsx-field textarea{
  min-height:80px !important;
  padding:10px !important;
}

.gsx-filters-grid .gsx-btn{
  width:100% !important;
}

/* =========================
   TABLA MÁS COMPACTA
========================= */
.gsx-table-card{
  padding:12px !important;
}

.gsx-table-scroll{
  max-height:540px !important;
}

.gsx-table th{
  font-size:12px !important;
  padding:10px 12px !important;
}

.gsx-table td{
  font-size:12px !important;
  padding:10px 12px !important;
}

/* =========================
   INLINE EDIT MÁS PEQUEÑO
========================= */
.gsx-inline-input,
.gsx-table td input,
.gsx-table td select{
  height:28px !important;
  min-height:28px !important;
  padding:0 6px !important;
  font-size:11px !important;
  border-radius:7px !important;
}

.gsx-inline-input.valor{
  max-width:110px !important;
}

.gsx-inline-input.descripcion{
  min-width:220px !important;
}

/* =========================
   MODAL MÁS COMPACTO
========================= */
.gsx-modal-box{
  padding:18px !important;
}

.gsx-modal-header h3{
  font-size:22px !important;
}

.gsx-form-grid{
  gap:12px !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1400px){

  .gsx-filters-grid{
    grid-template-columns:repeat(3,1fr) !important;
  }

  .gsx-cards{
    grid-template-columns:repeat(2,1fr) !important;
  }
}

@media (max-width:768px){

  .gsx-filters-grid{
    grid-template-columns:1fr !important;
  }

  .gsx-cards{
    grid-template-columns:1fr !important;
  }

  .gsx-btn{
    width:100% !important;
  }
}

/* =====================================
   BUSCADOR MANIFIESTOS
===================================== */

.gc-autocomplete{
  position:relative;
  width:100%;
}

.gc-search-input{
  width:100%;
  height:44px;
  padding:0 14px;
  border:1px solid #d1d5db;
  border-radius:10px;
  font-size:14px;
  background:#fff;
  box-sizing:border-box;
}

.gc-search-input:focus{
  outline:none;
  border-color:#2f56a6;
  box-shadow:0 0 0 3px rgba(47,86,166,.12);
}

.gc-autocomplete-dropdown{
  position:absolute;
  top:48px;
  left:0;
  right:0;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:10px;
  overflow:hidden;
  max-height:260px;
  overflow-y:auto;
  z-index:99999;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.gc-autocomplete-item{
  padding:10px 14px;
  font-size:13px;
  line-height:1.4;
  cursor:pointer;
  border-bottom:1px solid #f3f4f6;
}

.gc-autocomplete-item:hover{
  background:#f5f7fb;
}

.gc-autocomplete-item strong{
  color:#111827;
  font-weight:700;
}

.gc-autocomplete-empty{
  padding:12px 14px;
  font-size:13px;
  color:#6b7280;
}

.hidden{
  display:none !important;
}

.btn-delete{

  color:#ef4444;

}

.btn-delete:hover{

  color:#dc2626;

}

.btn-icon.btn-delete,
.btn-icon.btn-delete i{
  color:#ef4444 !important;
}