/* ===== Reset básico ===== */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #f5f6f8;
  color: #333;
}

/* ===== Título ===== */
h1 {
  margin-bottom: 16px;
  font-size: 24px;
}

.h1-container,
.cinta-container {
  width: 80%;
  margin: 0 auto;
}

/* ===== Contenedor de la tabla ===== */
.table-container {
  /* ALTO DEFINIDO */
  margin: 0 auto;
  background: lightgrey;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: auto;
}

.table-factura {
  width: 80%;
  height: 400px;
  font-size: 14px;
}

.table-empresa, .table-tipo-factura {
  height: 300px;
}

table {
  border-collapse: collapse;
  table-layout: fixed;
}

/* ===== Tabla ===== */
table.facturas {
  width: max-content;
}

table.empresa, table.tipo-factura{
  width: 100%;
}

/* ===== Celdas ===== */
th,
td {
  white-space: nowrap;
}

/* ===== Encabezado ===== */
th {
  text-align: center;
  background-color: #000;
  color: #fff;
}

/* ===== Filas ===== */
.tabla tbody tr {
  cursor: pointer;
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
}

.tabla tbody tr:hover {
  background: #eaeaea !important;
}


/* ===== Texto truncado ===== */
.cell {
  padding: 6px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remito */
.w_200 {
  width: 200px;
}

.w_160 {
  width: 160px;
}

.w_140 {
  width: 140px;
}

.w_120 {
  width: 120px;
}

.w_100 {
  width: 100px;
}

.w_p_20 {
  width: 20%;
}

.w_p_30 {
  width: 30%;
}

.w_p_40 {
  width: 40%;
}

.w_p_50 {
  width: 50%;
}

.auto {
  width: auto;
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}


/* ===== Botón inferior ===== */
.table-actions {
  padding: 12px 0;
  text-align: right;
}

.table-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.table-actions button:hover {
  background: #1e4fd8;
}


/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.active {
  display: flex;
}

/* ===== MODAL ===== */
.modal {
  background: #fff;
  width: 50%;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal h2 {
  text-align: center;
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: bold;
}

/* ===== FORM ===== */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.radio-form{
  display: flex;
  gap: 10px;
}

.form-group .label-form {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
}

.form-group .form-input,
.form-group .form-select {
  width: 100%;
  max-width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid black;
  border-radius: 5px;
  font-size: 14px;
}

/* ===== BUTTONS ===== */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel {
  background: #d0d0d0;
  color: #000;
}

.btn-save {
  background: #4caf50;
  color: #fff;
}

.btn-save:hover {
  background: #43a047;
}

/* ===== DEMO BUTTON ===== */
.open-btn {
  margin: 40px;
  padding: 10px 20px;
  font-size: 15px;
}

.money {
  position: relative;
}

.money input {
  text-align: end;
}

.money span {
  user-select: none;
  position: absolute;
  height: 0px;
  margin: 5px 8px;
  color: black;
}

.total-group {
  align-items: flex-end;
  text-align: right;
}

.calc {
  font-weight: bold;
  background-color: #92D050;
  color: black;
}

.search {
  width: 50%;
  position: relative;
}

.searcher {
  width: 100%;
  height: 36px;
  padding: 0 75px 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.check-content {
  position: absolute;
  right: 10px;
  font-size: 13px;
  gap: 2px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  cursor: pointer;
  display: flex;
}

.spacer {
  height: 12px;
}

.operations {
  display: flex;
  gap: 10px;
}

.action_btn {
  width: 36px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.action_btn:not(:disabled):hover {
  transform: scale(1.1);
}

.icon_btn {
  width: 24px;
  object-fit: contain;
}

.create { background: #1ED053; }
.edit { background: #f0ad4e; }
.delete { background: #dc3545; }
.restore { background: #20afa3 !important; }
.view { background: #007bff; }
.table { background: #1ac260; }

.actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.action_btn:disabled {
  background: #b5b5b5;
  cursor: auto;
  opacity: 0.6;
}

.btn-save:disabled {
  background: #b5b5b5;
  color: black;
  cursor: auto;
  opacity: 0.6;
}

.selected-row {
  background-color: #d0e7ff !important;
}

.spinner {
  border: 8px solid #f3f3f3;
  /* Fondo del spinner */
  border-top: 8px solid #3498db;
  /* Color de la parte giratoria */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* Ocultar spinner */
.hidden {
  display: none !important;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

#spinner-over {
  z-index: 1000;
  display: block;
}

.checker {
  cursor: pointer;
}

.deteler {
  max-width: 450px;
}

hr {
  border: none;
  height: 1px;
  background-color: #ddd;
  margin: 20px 0;
}

.del-tittle {
  font-weight: bold;
  font-size: 1.2em;
  text-align: left;
  color: #333;
}

.tabla tbody tr.hidden-row {
  background-color: #FFE6E6;
}

.tabla tbody tr.hidden-row:hover {
  background: #FFCCCC !important;
}

.hidden-row.selected-row {
  background-color: #febcbc !important;
}

.form-col{
  display: flex;
  gap: 20px;
}

.form-col > .form-group {
  flex: 1;
  min-width: 0;
}

.limit_txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.limit_space{
    width: 100%;
    max-width: 100%;
    height: 34px;
    font-size: 14px;
    display: flex;
    gap: 10px;
}

.limiter{
  min-width: 0;
  max-width: 100%;
}

.calc_cell{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}