/* ==== RESET ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: #f4f6f9;
  color: #333;
}

/* ==== SIDEBAR ==== */
.sidebar {
  width: 230px;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a2540, #0f172a);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-top: 12px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.35);
  font-size: 0.8rem;
  transition: width 0.25s ease;
}

/* ==== SIDEBAR COLAPSADO ==== */
.sidebar.collapsed {
  width: 54px;
  overflow: hidden;
}
.sidebar.collapsed .logo-img { display: none; }
.sidebar.collapsed .logo-texto { display: none; }
.sidebar.collapsed .logo-area { justify-content: center; padding: 0 0 12px; }
.sidebar.collapsed .sidebar-toggle-btn { margin-left: 0; }
.sidebar.collapsed .header-left span { display: none; }
.sidebar.collapsed .arrow { display: none; }
.sidebar.collapsed .submenu-arrow { display: none; }
.sidebar.collapsed .submenu-label { display: none; }
.sidebar.collapsed .submenu { max-height: 0 !important; }
.sidebar.collapsed .submenu-nested { max-height: 0 !important; }
.sidebar.collapsed .menu-header { justify-content: center; padding: 10px 8px; }
.sidebar.collapsed .header-left { gap: 0; justify-content: center; }
.sidebar.collapsed .header-left i { font-size: 0.92rem; width: auto; }

/* ==== BOTÓN TOGGLE SIDEBAR ==== */
.sidebar-toggle-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px 7px;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}
.sidebar-toggle-btn:hover {
  color: #7dd3fc;
  background: rgba(56,189,248,0.1);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.logo-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-texto {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.logo-titulo {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.01em;
}

.logo-version {
  font-size: 0.65rem;
  color: #475569;
  letter-spacing: 0.04em;
}

.menu {
  list-style: none;
  padding: 6px 0;
}

.menu-item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: background 0.2s, color 0.2s;
}

.menu-header:hover,
.menu-header.activo {
  background: rgba(56,189,248,0.08);
  color: #7dd3fc;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-left i {
  color: #38bdf8;
  font-size: 0.75rem;
  width: 14px;
  text-align: center;
}

.arrow {
  font-size: 0.6rem;
  color: #475569;
  transition: transform 0.25s;
}

.menu-item.open .arrow {
  transform: rotate(90deg);
}

/* ==== SUBMENU ==== */
.submenu {
  background: rgba(0,0,0,0.12);
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.menu-item.open .submenu {
  max-height: 600px;
}

.submenu > li[data-section] {
  padding: 7px 14px 7px 32px;
  font-size: 0.78rem;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s, color 0.18s;
  border-left: 2px solid transparent;
}

.submenu > li[data-section] i {
  font-size: 0.72rem;
  width: 13px;
  text-align: center;
  color: #475569;
}

.submenu > li[data-section]:hover {
  background: rgba(56,189,248,0.08);
  color: #7dd3fc;
  border-left-color: rgba(56,189,248,0.3);
}

.submenu > li[data-section].activo {
  background: rgba(56,189,248,0.12);
  color: #38bdf8;
  border-left-color: #38bdf8;
}

/* Etiqueta de sección dentro del submenú */
.submenu-label {
  padding: 10px 14px 3px 14px !important;
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: #334155 !important;
  cursor: default !important;
  pointer-events: none;
  display: block !important;
  border-left: none !important;
}

/* ==== SUBMENÚ ANIDADO ==== */
.submenu-group {
  padding: 0 !important;
  cursor: default !important;
  display: block !important;
  border-left: none !important;
}
.submenu-group:hover {
  background: none !important;
  color: inherit !important;
  border-left-color: transparent !important;
}

.submenu-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px 7px 32px;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.submenu-group-header:hover {
  background: rgba(56,189,248,0.07);
  color: #7dd3fc;
}
.submenu-group-header .header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.submenu-group-header .header-left i {
  font-size: 0.7rem;
  width: 13px;
  text-align: center;
  color: #475569;
}

.submenu-arrow {
  font-size: 0.55rem;
  color: #475569;
  transition: transform 0.25s;
}
.submenu-group.open .submenu-arrow {
  transform: rotate(90deg);
}

.submenu-nested {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: rgba(0,0,0,0.1);
}
.submenu-group.open .submenu-nested {
  max-height: 300px;
}
.submenu-nested li {
  padding: 6px 14px 6px 46px;
  font-size: 0.74rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}
.submenu-nested li i {
  font-size: 0.65rem;
  width: 12px;
  text-align: center;
}
.submenu-nested li:hover {
  background: rgba(56,189,248,0.07);
  color: #7dd3fc;
  border-left-color: rgba(56,189,248,0.25);
}
.submenu-nested li.activo {
  background: rgba(56,189,248,0.1);
  color: #38bdf8;
  border-left-color: #38bdf8;
}

/* ==== CONTENIDO PRINCIPAL ==== */
.contenido {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 60px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* Título dinámico del topbar */
.topbar-titulo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  margin-right: 20px;
}

.topbar-modulo {
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-seccion {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e40af;
  letter-spacing: 0.03em;
  padding: 6px 24px 6px 14px;
  border-left: 3px solid #7dd3fc;
  background: linear-gradient(90deg, #e0f2fe 0%, #f0f9ff 45%, transparent 100%);
  border-radius: 0 8px 8px 0;
  flex: 1;
  display: none;
}

.topbar-seccion.visible {
  display: block;
}

.user-info {
  color: #475569;
  font-size: 0.9rem;
}

.user-info i {
  color: #38bdf8;
  margin-right: 6px;
}

#contenido {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 20px 25px;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card h2 {
  color: #1e3a8a;
  margin-bottom: 8px;
}
/* ==== FORMULARIO ABM CLIENTE ==== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 15px;
  margin-bottom: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.form-group label {
  margin-bottom: 4px;
  color: #4b5563;
}

.form-group input {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
}

.form-group input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.form-group-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* ==== BOTONES ==== */
.acciones {
  margin: 12px 0 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background-color: #e5e7eb;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:hover {
  background-color: #d4d4d8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(148, 163, 184, 0.5);
}

.btn.primario {
  background-color: #38bdf8;
  border-color: #0ea5e9;
  color: #0f172a;
}

.btn.primario:hover {
  background-color: #0ea5e9;
}

.btn.peligro {
  background-color: #ef4444;
  border-color: #b91c1c;
  color: #fef2f2;
}

.btn.peligro:hover {
  background-color: #dc2626;
}

.btn.secundario {
  background-color: #e0f2fe;
  border-color: #38bdf8;
  color: #075985;
}

/* ==== TABLA CLIENTES ==== */
.tabla-wrapper {
  margin-top: 10px;
  overflow-x: auto;
}

#tabla-clientes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#tabla-clientes thead {
  background-color: #e5e7eb;
}

#tabla-clientes th,
#tabla-clientes td {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  text-align: left;
}

#tabla-clientes tbody tr:hover {
  background-color: #f3f4f6;
  cursor: pointer;
}

#tabla-clientes tbody tr.fila-seleccionada {
  background-color: #dbeafe;
}
/* Campo solo lectura para N° Asiento */
.solo-lectura-asiento {
  background-color: #e0f2ff;  /* celeste claro */
  color: #003366;
  border: 1px solid #99c4ff;
  cursor: default;
  pointer-events: none;       /* no permite click ni foco con el mouse */
}
.input-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-mini {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.campo-info {
  min-height: 1.6rem;
  padding: 0.2rem 0.4rem;
  background-color: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #1f2933;
}
.btn-mini {
  background-color: #0078ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 14px;
}
.btn-mini:hover {
  background-color: #005fcc;
}
.btn-seleccionar {
  text-align: center;
  width: 40px;
}

/* ==== TALLER INGRESO - GRILLA COMPACTA ==== */
/* === TALLER INGRESO === */
.ing-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 14px;
}

.ing-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

/* compatibilidad con clase anterior */
.ing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 14px;
}

.ing-seccion-titulo {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 3px;
  margin-bottom: 8px;
}

.ing-field {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}

.ing-field label {
  color: #4b5563;
  margin-bottom: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ing-field input,
.ing-field select,
.ing-field textarea {
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-size: 0.83rem;
  width: 100%;
  box-sizing: border-box;
}

.ing-field input:focus,
.ing-field select:focus,
.ing-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.ing-readonly {
  background-color: #f8fafc !important;
  color: #64748b;
  cursor: default;
}

.ing-numero {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 700;
  font-size: 0.95rem !important;
  letter-spacing: 0.05em;
}

.ing-span2 { grid-column: span 2; }
.ing-span4 { grid-column: span 4; }

.ing-con-btn {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.ing-con-btn input {
  flex: 1;
  min-width: 0;
  border-radius: 5px 0 0 5px !important;
  border-right: none !important;
}

.ing-con-btn input:focus {
  border-right: none !important;
  position: relative;
  z-index: 1;
}

.ing-btn-buscar {
  flex-shrink: 0;
  padding: 0 9px;
  background: #3b82f6;
  color: #fff;
  border: 1px solid #3b82f6;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ing-btn-buscar:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.82rem;
}

/* ==== ABM DOS PANELES ==== */
.abm-card {
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.abm-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  border-radius: 7px;
  padding: 7px 14px;
}
.abm-panel {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

/* Panel izquierdo — formulario */
.abm-form-panel {
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  overflow-y: auto;
}

.abm-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px 10px;
  width: 400px;
  align-content: start;
  font-size: 0.82rem;
}
.abm-span2 { grid-column: span 2; }
.abm-span3 { grid-column: span 3; }
.abm-span4 { grid-column: span 4; }

/* Panel derecho — tabla */
.abm-tabla-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.abm-buscar {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.82rem;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.abm-tabla-scroll {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.abm-tabla-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.abm-tabla-scroll thead {
  background-color: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}
.abm-tabla-scroll th,
.abm-tabla-scroll td {
  padding: 5px 7px;
  border: 1px solid #d1d5db;
  text-align: left;
}
.abm-tabla-scroll tbody tr:hover {
  background-color: #f3f4f6;
  cursor: pointer;
}
.abm-tabla-scroll tbody tr.fila-seleccionada {
  background-color: #dbeafe;
}

/* ==== CAJA DIARIA ==== */
.caja-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  overflow: hidden;
}
.caja-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.caja-titulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}
.caja-periodo-badge {
  display: inline-block;
  margin-left: 10px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  padding: 1px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.caja-hist-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}

/* Contenedor tabla */
.caja-tabla-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.caja-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}
.caja-tabla thead tr {
  background: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 2;
}
.caja-tabla th,
.caja-tabla td {
  padding: 4px 7px;
  border: 1px solid #d1d5db;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caja-tabla th.nt,
.caja-tabla td.nt {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.caja-tabla tbody tr.caja-data-row:hover { background: #f3f4f6; }
.caja-tabla tbody tr.fila-seleccionada   { background: #dbeafe !important; }
.caja-tabla tbody tr.caja-cierre-row td {
  background: #fef3c7;
  border-top: 2px solid #fbbf24;
  border-bottom: 2px solid #fbbf24;
  color: #92400e;
  font-style: italic;
  font-size: .82rem;
}
.caja-tabla tfoot tr.caja-totales td {
  background: #e5e7eb;
  border-top: 2px solid #94a3b8;
  font-weight: 700;
}
.saldo-cel   { font-weight: 600; }
.saldo-total { font-size: 0.88rem; font-weight: 700; }

/* Cabeceras y celdas de Ganancias (verde) y Saldo (celeste) */
.caja-tabla thead th[style*="#dcfce7"],
.caja-tabla thead th[style*="#bae6fd"] {
  position: sticky; top: 0; z-index: 2;
}

/* Fila de entrada */
.caja-input-row td {
  background: #f0f9ff;
  padding: 2px 3px;
  border-bottom: 3px solid #3b82f6 !important;
}
.caja-input-row.editando td {
  background: #fffbeb;
  border-bottom: 3px solid #f59e0b !important;
}
.ci {
  width: 100%;
  border: 1px solid #93c5fd;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 0.81rem;
  background: #fff;
  outline: none;
}
.ci:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px #bfdbfe; }
.ni { text-align: right; }

/* Botones de acción en filas */
.acciones-cel { text-align: center; white-space: nowrap; }
.btn-accion {
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.85rem;
  line-height: 1;
  transition: background 0.15s;
}
.btn-accion.ok     { color: #16a34a; }
.btn-accion.ok:hover { background: #dcfce7; }
.btn-accion.cancel { color: #dc2626; }
.btn-accion.cancel:hover { background: #fee2e2; }
.btn-accion.edit   { color: #2563eb; }
.btn-accion.edit:hover { background: #dbeafe; }
.btn-accion.delete { color: #dc2626; }
.btn-accion.delete:hover { background: #fee2e2; }

/* Barra extra (USD / cotiz / ganancias) */
.caja-extra-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  margin-top: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.caja-extra-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.caja-extra-bar label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: #475569;
}
.ci-extra {
  width: 90px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 0.8rem;
  text-align: right;
}
.ci-extra:focus { border-color: #3b82f6; outline: none; }

/* ==== MODAL GENÉRICO ==== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 18px 20px 14px;
  width: 720px;
  max-width: 95vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.btn-modal-close {
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-modal-close:hover { background: #f1f5f9; color: #1e293b; }
.modal-tabla-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
}

/* Campo Art USD + botón en la fila de entrada */
.ci-art-wrap {
  display: flex;
  gap: 3px;
  align-items: center;
}
.ci-art-wrap .ci { flex: 1; min-width: 0; }
.btn-art-open {
  flex-shrink: 0;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  border-radius: 3px;
  cursor: pointer;
  padding: 3px 5px;
  font-size: 0.85rem;
  line-height: 1;
  color: #2563eb;
}
.btn-art-open:hover { background: #dbeafe; }

/* ==================================================================
   FACTURA DE VENTA
   ================================================================== */
.vf-card {
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
}

/* Filas de cabecera y cliente */
.vf-fila {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 9px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* Campo genérico dentro de fila */
.vf-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.vf-field label,
.vf-field-lbl {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vf-field input {
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.84rem;
}
.vf-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

/* Input + botón lupa en la misma línea */
.vf-input-btn-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.vf-input-btn-group input {
  flex: 1;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.84rem;
}

/* Botones A / B / C */
.vf-tipo-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.vf-tipo-btns {
  display: flex;
  gap: 2px;
}
.vf-tipo-btn {
  width: 36px;
  height: 30px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  color: #475569;
  transition: background .15s, color .15s;
}
.vf-tipo-btn.activo {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}
.vf-tipo-btn:hover:not(.activo) { background: #dbeafe; }

/* Panel artículos */
.vf-items-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  min-height: 0;
}
.vf-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.vf-items-table thead {
  background: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1;
}
.vf-items-table thead th {
  padding: 5px 8px;
  font-weight: 600;
  color: #374151;
  text-align: left;
  white-space: nowrap;
}
.vf-items-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}
.vf-items-table tbody tr:hover { background: #f0f9ff; }
.vf-items-table tbody td { padding: 5px 8px; }

/* Fila de ingreso rápido */
.vf-input-row td {
  padding: 4px 4px;
  background: #f8fafc;
  border-top: 2px solid #3b82f6;
}
.vf-input-row td input {
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: .82rem;
  height: 28px;
  background: #fff;
}
.vf-input-row td input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Pie: observación + totales */
.vf-footer {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 9px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.vf-footer > div:first-child input {
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: .84rem;
}
.vf-totales {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 230px;
}
.vf-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .84rem;
  color: #374151;
}
.vf-total-row span:last-child {
  font-weight: 600;
  min-width: 110px;
  text-align: right;
}
.vf-total-final {
  border-top: 2px solid #1e3a8a;
  padding-top: 5px;
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
}

/* ============================================================
   TALLER ADMINISTRACIÓN
   ============================================================ */

/* Tabs */
.tadm-tab {
  padding: 5px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #f1f5f9;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tadm-tab:hover { background: #e2e8f0; }
.tadm-tab-activo { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }

/* Tabla */
.tadm-tabla { width: 100%; border-collapse: collapse; font-size: 12px; }
.tadm-tabla th {
  background: #1e3a8a; color: #fff;
  padding: 7px 10px; text-align: left;
  white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .4px;
}
.tadm-tabla td { padding: 6px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
.tadm-tabla tbody tr:hover { background: #f0f4ff; }

/* Botón estado en tabla */
.tadm-btn-estado {
  border: none; border-radius: 12px;
  padding: 3px 12px; font-size: 11px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: opacity .15s;
}
.tadm-btn-estado:hover { opacity: .85; }

/* Overlay modal */
.tadm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
}

/* Modal */
.tadm-modal {
  background: #fff;
  border-radius: 10px;
  width: 860px; max-width: 96vw;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}

/* Header modal */
.tadm-modal-header {
  background: #1e3a8a; color: #fff;
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.tadm-modal-nro  { font-size: 15px; font-weight: 700; margin-right: 14px; }
.tadm-modal-fecha { font-size: 12px; opacity: .8; }
.tadm-modal-cerrar {
  background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; line-height: 1;
  padding: 0 4px;
}

/* Body modal: dos columnas */
.tadm-modal-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  overflow-y: auto; flex: 1;
}
.tadm-modal-col { padding: 16px 18px; }
.tadm-modal-col:first-child { border-right: 1px solid #e5e7eb; }

.tadm-modal-sec-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 5px; margin-bottom: 10px;
}

/* Campos solo lectura */
.tadm-modal-field-ro {
  display: flex; gap: 8px; margin-bottom: 6px; font-size: 12px;
}
.tadm-ro-lbl { width: 110px; flex-shrink: 0; color: #6b7280; font-weight: 600; }
.tadm-ro-val { flex: 1; color: #111; }

/* Campos editables */
.tadm-modal-field { margin-bottom: 10px; display: flex; flex-direction: column; gap: 3px; }
.tadm-modal-field label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #6b7280;
}
.tadm-modal-field input,
.tadm-modal-field textarea,
.tadm-modal-field select {
  padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px;
  font-size: 12px; font-family: inherit; color: #111;
  width: 100%;
}
.tadm-modal-field textarea { resize: vertical; }
.tadm-modal-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Estado */
.tadm-modal-estado-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.tadm-modal-estado-lbl { font-size: 11px; font-weight: 700; color: #374151; }
.tadm-modal-estado-btn {
  border-radius: 8px; padding: 5px 16px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.tadm-modal-estado-btn:hover { opacity: .85; }

/* Repuestos */
.tadm-modal-repuestos {
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  max-height: 280px;
  overflow-y: auto;
}
.tadm-rep-search-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.tadm-rep-drop {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #cbd5e1; border-top: none;
  border-radius: 0 0 6px 6px; z-index: 9999;
  max-height: 200px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.tadm-rep-drop-item {
  display: flex; align-items: center;
  padding: 7px 10px; cursor: pointer; font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.tadm-rep-drop-item:hover { background: #eff6ff; }

/* Footer modal */
.tadm-modal-footer {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 18px; border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}
