* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f2f6f0;
  color: #141a14;
}

.container { max-width:1200px; margin:0 auto; padding:16px; display:none; }

.app-header {
  background: #ffffff;
  border: 1px solid #dce8d6;
  border-bottom: 3px solid #7cc24e;
  color: #141a14;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(30,60,25,.06);
}

.app-header h1 { font-size:1.3rem; font-weight:600; }

.header-brand { display:flex; align-items:center; gap:14px; }
.header-brand img {
  height:48px;
  width:auto;
  max-width:230px;
  object-fit:contain;
  display:block;
  flex:0 0 auto;
}
.header-brand h1 { line-height:1.1; }

.header-tabs { display:flex; gap:4px; flex-wrap:wrap; }
.tab-btn {
  padding:6px 16px;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-weight:600;
  font-size:.8rem;
  background:rgba(255,255,255,.15);
  color:rgba(255,255,255,.7);
  transition:all .2s;
}
.tab-btn:hover { background:rgba(255,255,255,.25); color:#fff; }
.tab-activo { background:#fff; color:#141a14; }
.tab-activo:hover { background:#fff; color:#141a14; filter:none; }

.header-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
  flex:1 1 auto;
  min-width:0;
}
.header-actions button { padding:6px 12px; font-size:.78rem; }

.menu-wrap { position:relative; display:inline-block; }
.menu-btn {
  padding:6px 12px;
  font-size:.78rem;
  background:#5ea832;
  color:#fff;
}
.menu-btn:hover { background:#4e9127; }
.menu-dropdown {
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  display:none;
  flex-direction:column;
  min-width:210px;
  background:#fff;
  border:1px solid #e0e0e0;
  border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  padding:6px;
  z-index:1200;
}
.menu-dropdown.abierto { display:flex; }
.menu-dropdown button {
  display:block;
  width:100%;
  text-align:left;
  padding:9px 12px;
  font-size:.8rem;
  font-weight:600;
  background:transparent;
  color:#141a14;
  border:none;
  border-radius:6px;
  cursor:pointer;
}
.menu-dropdown button:hover { background:#f0f2f5; }
.menu-dropdown button:disabled { opacity:.5; cursor:default; }

button {
  padding:8px 18px;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-weight:600;
  font-size:.85rem;
  background:#5ea832;
  color:#fff;
  transition:all .2s;
}

button:hover { filter:brightness(1.07); }
button.small { padding:4px 12px; font-size:.8rem; }

.main-layout { display:grid; grid-template-columns:1fr; gap:20px; }
.sidebar { order:2; }
.content { order:1; }
.main-layout.layout-notas { grid-template-columns:280px 1fr; }
.main-layout.layout-notas .sidebar { order:1; }
.main-layout.layout-notas .content { order:2; }

.panel {
  background:#fff;
  border-radius:10px;
  padding:18px;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
  margin-bottom:16px;
}

.panel h3 {
  font-size:.95rem;
  color:#1a241a;
  margin-bottom:14px;
  padding-bottom:8px;
  border-bottom:1px solid #eceef2;
  display:flex;
  align-items:center;
  gap:6px;
}

.form-group { margin-bottom:10px; }
.form-group label {
  display:block;
  font-size:.78rem;
  font-weight:600;
  color:#555;
  margin-bottom:3px;
}
.form-group input, .form-group textarea {
  width:100%;
  padding:8px 10px;
  border:1px solid #d0d5dd;
  border-radius:6px;
  font-size:.85rem;
  transition:border .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline:none;
  border-color:#5ea832;
  box-shadow:0 0 0 2px rgba(124,194,78,.25);
}

.doc-buscar-wrap { display:flex; align-items:stretch; gap:6px; }
.doc-buscar-wrap input { flex:1; min-width:0; }
.btn-buscar-seniat {
  background:#3498db;
  color:#fff;
  border:none;
  border-radius:6px;
  padding:0 14px;
  font-size:1rem;
  cursor:pointer;
  transition:background .2s;
  flex-shrink:0;
}
.btn-buscar-seniat:hover { background:#2980b9; }
.btn-buscar-seniat:active { transform:scale(.96); }

.logo-upload { text-align:center; margin-bottom:12px; }
.logo-preview {
  width:120px; height:120px;
  border:2px dashed #ccc;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  margin:0 auto 6px;
  overflow:hidden;
  background:#fafafa;
  transition:border .2s;
}
.logo-preview:hover { border-color:#5ea832; }
.logo-preview img { max-width:100%; max-height:100%; object-fit:contain; }
.logo-preview span { color:#999; font-size:.8rem; }

.encabezado-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.nota-titulo { text-align:center; flex:1; }
.titulo-input {
  font-size:1.5rem;
  color:#1a241a;
  letter-spacing:2px;
  font-weight:800;
  text-align:center;
  border:none;
  background:transparent;
  width:100%;
  padding:4px;
  outline:none;
  font-family:inherit;
}
.titulo-input:focus { border-bottom:2px solid #5ea832; }
.nota-logo-display img { max-height:70px; max-width:140px; object-fit:contain; }

.encabezado-grid { display:grid; grid-template-columns:1fr 1fr 1fr 2fr; gap:12px; }
.cliente-grid { display:grid; grid-template-columns:2fr 1fr 2fr; gap:12px; }

.productos-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.productos-table th {
  background:#f6f8fa;
  padding:8px 6px;
  text-align:left;
  font-size:.75rem;
  text-transform:uppercase;
  color:#555;
  border-bottom:1px solid #e2e5e9;
}
.productos-table td { padding:6px; border-bottom:1px solid #eee; vertical-align:middle; }
.productos-table input[type="text"], .productos-table input[type="number"] {
  width:100%;
  padding:6px 8px;
  border:1px solid #d0d5dd;
  border-radius:4px;
  font-size:.82rem;
}
.productos-table input:focus { outline:none; border-color:#5ea832; }
.productos-table td.desc-cell { position:relative; }
.prod-autocomplete {
  position:absolute;
  top:100%;
  left:0;
  right:0;
  z-index:500;
  background:#fff;
  border:1px solid #d0d5dd;
  border-radius:6px;
  box-shadow:0 6px 18px rgba(0,0,0,.15);
  max-height:260px;
  overflow-y:auto;
  display:none;
}
.prod-autocomplete-item {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:7px 10px;
  cursor:pointer;
  font-size:.8rem;
  border-bottom:1px solid #f0f0f0;
}
.prod-autocomplete-item:hover { background:#eaf6ff; }
.prod-autocomplete-item:last-child { border-bottom:none; }
.pai-foto { width:32px; height:32px; object-fit:contain; border-radius:4px; background:#f6f6f6; flex-shrink:0; border:1px solid #eee; }
.pai-foto-vacia { width:32px; height:32px; display:flex; align-items:center; justify-content:center; background:#f6f6f6; border-radius:4px; font-size:1rem; flex-shrink:0; }
.pai-nombre { color:#141a14; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pai-sku {
  color:#999;
  font-size:.7rem;
  background:#f2f2f2;
  padding:1px 6px;
  border-radius:4px;
  white-space:nowrap;
  flex-shrink:0;
}
.preview-box { display:flex; gap:18px; align-items:flex-start; flex-wrap:wrap; }
.preview-img-wrap {
  width:200px; height:200px;
  background:#f6f6f6;
  border:1px solid #e3e3e3;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  flex-shrink:0;
}
.preview-img-wrap img { max-width:100%; max-height:100%; object-fit:contain; }
.preview-info { flex:1; min-width:200px; }
.preview-nombre { font-size:1.05rem; font-weight:700; color:#141a14; }
.preview-sku { font-size:.8rem; color:#888; margin:4px 0 12px; }
.preview-precios { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px; }
.preview-precio {
  background:#f8f9fa;
  border:1px solid #e5e5e5;
  border-radius:8px;
  padding:8px 12px;
  font-size:.9rem;
}
.preview-precio-label { font-size:.7rem; color:#888; display:block; margin-bottom:2px; }
.preview-precio b { color:#27ae60; }
.preview-cant { display:flex; align-items:center; gap:8px; }
.preview-cant label { font-size:.85rem; color:#555; }
.preview-cant input { width:70px; padding:6px 8px; border:1px solid #ccc; border-radius:6px; font-size:.9rem; }
.btn-agregar-preview { background:#27ae60 !important; }
.precio-cell { display:flex; align-items:center; gap:4px; }
.precio-cell select { padding:3px 2px; border:1px solid #ccc; border-radius:3px; font-size:.7rem; background:#fff; cursor:pointer; width:44px; flex-shrink:0; }
.precio-cell input { flex:1; min-width:0; }
.productos-table .btn-serial {
  background:#3498db;
  color:#fff;
  padding:4px 8px;
  font-size:.72rem;
  border-radius:4px;
}
.productos-table .btn-serial:hover { background:#2980b9; }
.productos-table .btn-remove {
  background:transparent;
  color:#5ea832;
  font-size:1.1rem;
  padding:2px 6px;
}
.productos-table .btn-remove:hover { background:#fee; }

.totales {
  margin-top:12px;
  margin-left:auto;
  width:280px;
}
.total-row {
  display:flex;
  justify-content:space-between;
  padding:3px 0;
  font-size:.75rem;
  color:#777;
}
.total-valor { display:flex; gap:4px; }
.total-final {
  font-size:1.55rem;
  font-weight:700;
  border-top:2px solid #141a14;
  padding-top:8px;
  margin-top:6px;
  color:#5ea832;
}
.currency-select {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin-top:6px;
  font-size:.82rem;
}
.currency-select label { color:#555; font-weight:600; }
.currency-select select {
  padding:4px 8px;
  border:1px solid #d0d5dd;
  border-radius:5px;
  font-size:.82rem;
  background:#fff;
  cursor:pointer;
}
.currency-select select:focus { outline:none; border-color:#5ea832; }

textarea { width:100%; padding:8px 10px; border:1px solid #d0d5dd; border-radius:6px; font-family:inherit; font-size:.85rem; resize:vertical; }
textarea:focus { outline:none; border-color:#5ea832; }

.iva-row { font-size:.78rem; color:#e67e22; padding:2px 0; }
.iva-toggle { margin-top:8px; text-align:right; font-size:.82rem; }
.iva-toggle label { display:inline-flex; align-items:center; gap:6px; cursor:pointer; color:#555; font-weight:600; }
.iva-toggle input[type="checkbox"] { width:16px; height:16px; cursor:pointer; accent-color:#5ea832; }

/* Modal */
.modal {
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,.5);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.modal-content {
  background:#fff;
  border-radius:12px;
  width:460px;
  max-height:80vh;
  display:flex;
  flex-direction:column;
  box-shadow:0 10px 40px rgba(0,0,0,.2);
}
.modal-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid #eee;
}
.modal-header h3 { margin:0; border:none; }
.modal-close { font-size:1.5rem; cursor:pointer; color:#999; }
.modal-close:hover { color:#5ea832; }
.modal-body { padding:16px 20px; overflow-y:auto; flex:1; }
.modal-footer { padding:12px 20px; border-top:1px solid #eee; text-align:right; }

.serial-input-group { display:flex; gap:8px; margin-bottom:12px; }
.serial-input-group input { flex:1; padding:8px 10px; border:1px solid #d0d5dd; border-radius:6px; font-size:.85rem; }
.serial-input-group input:focus { outline:none; border-color:#3498db; }
.serial-input-group button { background:#3498db; }
.serial-input-group button:hover { background:#2980b9; }

.serial-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.serial-table th { background:#f0f2f5; padding:6px; text-align:left; font-size:.75rem; color:#555; }
.serial-table td { padding:4px 6px; border-bottom:1px solid #eee; }
.serial-table .btn-remove-serial { background:transparent; color:#e74c3c; padding:2px 8px; font-size:.9rem; }
.serial-table .btn-remove-serial:hover { background:#fee; }

.serial-print { display:none; }
.desc-print { display:none; white-space:pre-wrap; word-break:break-word; font-size:.85rem; line-height:1.5; padding:6px 8px; width:100%; }

/* Notas list */
.notas-filtros { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.nota-filtro {
  width:100%;
  padding:8px 10px;
  border:1px solid #dde1e6;
  border-radius:8px;
  background:#fff;
  color:#555;
  font-size:.75rem;
  font-weight:600;
  cursor:pointer;
  transition:all .15s;
  text-align:center;
}
.nota-filtro:hover { border-color:#5ea832; color:#5ea832; }
.nota-filtro.activo { background:#5ea832; border-color:#5ea832; color:#fff; }
.notas-buscar {
  display:flex;
  gap:6px;
  align-items:center;
  margin-bottom:10px;
  position:relative;
}
#buscadorNotas {
  flex:1;
  min-width:0;
  padding:7px 10px;
  border:1px solid #d0d5dd;
  border-radius:6px;
  font-size:.8rem;
  margin-bottom:0;
}
#buscadorNotas:focus { outline:none; border-color:#5ea832; }
.fecha-buscador-wrap {
  position:relative;
  flex-shrink:0;
  display:flex;
  align-items:center;
}
#buscadorFecha {
  padding:6px 8px;
  border:1px solid #d0d5dd;
  border-radius:6px;
  font-size:.78rem;
  color:#333;
  background:#fff;
  padding-right:28px;
}
#buscadorFecha:focus { outline:none; border-color:#5ea832; }
#buscadorNotas.buscador-con-fecha { padding-left:8px; }
.btn-limpiar-fecha {
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  width:24px;
  height:24px;
  border-radius:50%;
  border:1px solid #e0e0e0;
  background:#f6f6f6;
  color:#8a8a8a;
  font-size:.9rem;
  line-height:1;
  cursor:pointer;
  display:none;
  padding:0;
  transition:all .2s;
  z-index:2;
}
.btn-limpiar-fecha:hover {
  background:#5ea832;
  border-color:#5ea832;
  color:#fff;
  transform:translateY(-50%) scale(1.08);
}
.notas-list { max-height:320px; overflow-y:auto; }
.nota-item {
  display:flex;
  align-items:center;
  gap:4px;
  padding:8px 6px;
  border-bottom:1px solid #f0f0f0;
  cursor:pointer;
  border-radius:4px;
  transition:background .15s;
}
.nota-item:hover { background:#f5f5f5; }
.nota-activa { background:#f1f9ec; border-left:3px solid #5ea832; }
.nota-convertida strong,
.nota-convertida .nota-item-cliente,
.nota-convertida .nota-item-fecha { text-decoration:line-through; color:#aaa !important; }
.nota-convertida .nota-item-fecha { text-decoration:none; color:#27ae60 !important; font-weight:600; }
.nota-convertida { opacity:.75; }
.nota-item-info { flex:1; min-width:0; }
.nota-item-info strong { display:block; font-size:.82rem; color:#141a14; }
.nota-item-cliente { display:block; font-size:.72rem; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nota-item-fecha { display:block; font-size:.7rem; color:#999; }
.nota-item-eliminar {
  background:transparent;
  color:#ccc;
  font-size:1.1rem;
  padding:2px 6px;
  border-radius:4px;
  flex-shrink:0;
}
.nota-item-eliminar:hover { color:#e74c3c; background:#fee; }
.nota-vacia { font-size:.8rem; color:#999; text-align:center; padding:16px 0; }

/* Calculadora % */
.calc-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.calc-grid .form-group { margin-bottom:0; }
.calc-resultado {
  margin-top:10px;
  padding:10px;
  background:#f8f9fa;
  border-radius:6px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.calc-label { font-size:.78rem; font-weight:600; color:#555; }
.calc-valor { font-size:1.2rem; font-weight:700; color:#5ea832; }

/* Inventario */
.inventario-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.inventario-header h3 { margin:0; border:none; padding:0; }
.inventario-acciones { display:flex; gap:8px; }
.inventario-info { font-size:.78rem; color:#7a828e; margin-bottom:12px; padding:10px 14px; background:#f6f8fa; border:1px solid #eef0f3; border-radius:8px; }
.inventario-toolbar { display:flex; gap:10px; margin-bottom:10px; flex-wrap:wrap; align-items:center; }
.inventario-toolbar input {
  flex:1;
  min-width:180px;
  padding:10px 14px;
  border:1px solid #dde1e6;
  border-radius:10px;
  font-size:.9rem;
  transition:border .2s, box-shadow .2s;
}
.inventario-toolbar input:focus { outline:none; border-color:#5ea832; box-shadow:0 0 0 3px rgba(124,194,78,.20); }
.inventario-toolbar select {
  padding:9px 12px;
  border:1px solid #dde1e6;
  border-radius:10px;
  font-size:.85rem;
  background:#fff;
  color:#333;
  cursor:pointer;
}
.inventario-toolbar select:focus { outline:none; border-color:#5ea832; }
#btnVistaInventario {
  width:40px;
  height:40px;
  border:1px solid #dde1e6;
  border-radius:10px;
  background:#fff;
  color:#555;
  font-size:1.05rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
}
#btnVistaInventario:hover { border-color:#5ea832; color:#5ea832; background:#f3faef; }
.inv-seleccion-bar {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
  padding:10px 12px;
  background:#fff8e1;
  border:1px solid #f0c24b;
  border-radius:8px;
  font-size:.85rem;
}
.inv-seleccion-bar span { font-weight:600; color:#6b4f00; }
.inv-seleccion-bar button { padding:6px 12px; border:none; border-radius:6px; font-size:.8rem; font-weight:600; cursor:pointer; }
.inv-seleccion-bar button:disabled { opacity:.45; cursor:not-allowed; }
#btnExportarSeleccion { background:#1a241a; color:#fff; }
#btnExportarSeleccion:hover:not(:disabled) { background:#5ea832; }
#btnExportarSeleccionCSV { background:#27ae60; color:#fff; }
#btnExportarSeleccionCSV:hover:not(:disabled) { background:#1e8449; }
.inv-seleccion-bar button:last-child { background:#eee; color:#333; }
.inv-seleccion-bar button:last-child:hover { background:#ddd; }
.inventario-toggle-cols { display:none; }
.btn-col-toggle { padding:4px 12px; border:1px solid #ccc; border-radius:6px; background:#f0f0f0; cursor:pointer; font-size:.8rem; color:#333; transition:all .2s; }
.btn-col-toggle:hover { background:#e0e0e0; }
.btn-col-toggle.btn-oculto { background:#5ea832; color:#fff; border-color:#5ea832; opacity:.7; }
.inv-foto { width:40px; height:40px; object-fit:cover; border-radius:4px; border:1px solid #ddd; }
.inv-foto-vacia { color:#ccc; font-size:.8rem; }
.col-eye { font-size:.7rem; font-weight:bold; color:#5ea832; margin-left:4px; }

.productos-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(185px, 1fr));
  gap:16px;
  margin-top:6px;
}
.prod-card {
  background:#fff;
  border:1px solid #eceef1;
  border-radius:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 1px 4px rgba(16,24,40,.05);
  transition:transform .18s, box-shadow .18s, border-color .18s;
  position:relative;
}
.prod-card:hover { transform:translateY(-3px); box-shadow:0 10px 24px rgba(16,24,40,.10); border-color:#dfe3e8; }
.prod-card.seleccionado { border-color:#f0c24b; box-shadow:0 0 0 2px rgba(240,194,75,.55); }
.prod-card-check {
  position:absolute;
  top:6px;
  right:40px;
  z-index:2;
  background:rgba(255,255,255,.92);
  border-radius:4px;
  padding:2px;
}
.prod-card-check input { width:18px; height:18px; cursor:pointer; accent-color:#f0c24b; }
.prod-card-foto {
  position:relative;
  aspect-ratio:1/1;
  background:linear-gradient(160deg,#fafbfc,#eef1f5);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  overflow:hidden;
}
.prod-card-foto img { width:100%; height:100%; object-fit:contain; display:block; background:#fff; padding:8px; box-sizing:border-box; }
.prod-card-foto-vacia {
  color:#c3c9d1;
  text-align:center;
  font-size:1.5rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
}
.prod-card-foto-vacia span { font-size:.58rem; color:#b6bcc4; font-weight:700; letter-spacing:.6px; text-transform:uppercase; }
.prod-card-info { padding:8px 10px 4px; cursor:pointer; flex:1; }
.prod-card-nombre {
  font-size:.82rem;
  font-weight:600;
  color:#141a14;
  line-height:1.25;
  height:2.5em;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.prod-card-sku { font-size:.7rem; color:#999; margin-top:2px; }
.prod-card-precio {
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 10px 0;
}
.prod-card-compra {
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px 10px 0;
  font-size:.68rem;
  color:#999;
}
.prod-card-compra label { font-size:.68rem; color:#999; white-space:nowrap; font-weight:600; }
.inv-precio-compra {
  width:64px;
  padding:3px 4px;
  border:1px solid #ccc;
  border-radius:4px;
  font-size:.75rem;
  color:#666;
}
.inv-precio-compra:focus { outline:none; border-color:#5ea832; background:#fff; }
.inv-precio-compra-view { font-size:.75rem; color:#7f8c8d; font-weight:600; }
body.rol-admin .inv-precio-compra-view { display:none; }
.prod-card-precios {
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px 10px 0;
  font-size:.68rem;
  color:#999;
  flex-wrap:wrap;
}
.prod-card-precios label { font-size:.62rem; color:#999; white-space:nowrap; font-weight:600; }
.inv-precio-p {
  width:58px;
  padding:3px 4px;
  border:1px solid #ccc;
  border-radius:4px;
  font-size:.72rem;
  color:#666;
}
.inv-precio-p:focus { outline:none; border-color:#2980b9; background:#fff; }
.prod-card-precios { display:none; }
.prod-card-precio-label {
  font-size:.62rem;
  font-weight:700;
  background:#27ae60;
  color:#fff;
  padding:1px 6px;
  border-radius:4px;
  text-transform:uppercase;
  letter-spacing:.4px;
  white-space:nowrap;
}
.prod-card-precio-val { font-size:.9rem; font-weight:700; color:#27ae60; flex:1; }
.prod-card-precio select {
  max-width:96px;
  border:1px solid #d5d5d5;
  border-radius:5px;
  background:#fff;
  color:#666;
  font-size:.7rem;
  padding:2px 4px;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 4px center;
  padding-right:14px;
}
.prod-card-precio select:hover { border-color:#27ae60; }
.prod-card-pie { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:8px 10px 10px; }
.prod-card-cant { font-size:.72rem; color:#666; display:flex; align-items:center; gap:4px; }
.prod-card-cant label { font-size:.68rem; color:#999; white-space:nowrap; }
.prod-card-cant .inv-cant { width:52px; padding:3px 4px; border:1px solid #ccc; border-radius:4px; font-size:.8rem; }
.btn-agregar {
  background:#3498db;
  color:#fff;
  border:none;
  border-radius:6px;
  padding:5px 10px;
  font-size:.75rem;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
.btn-agregar:hover { background:#2980b9; }
.prod-card-cam {
  position:absolute;
  bottom:6px;
  right:6px;
  width:30px;
  height:30px;
  border-radius:9px;
  border:none;
  background:transparent;
  color:#8a919b;
  font-size:1.05rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:.7;
  transition:all .15s;
  z-index:2;
}
.prod-card-cam:hover { opacity:1; color:#5ea832; background:rgba(255,255,255,.9); box-shadow:0 1px 5px rgba(0,0,0,.1); }
.prod-card-eliminar {
  position:absolute;
  top:6px;
  left:6px;
  width:26px;
  height:26px;
  border-radius:8px;
  border:none;
  background:transparent;
  color:#b6bcc4;
  font-size:1.05rem;
  font-weight:600;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transition:all .15s;
  z-index:2;
}
.prod-card:hover .prod-card-eliminar { opacity:.8; }
.prod-card-eliminar:hover { opacity:1; color:#e74c3c; background:rgba(255,245,245,.9); }
#productosTable.ocultar-seriales th:nth-child(6),
#productosTable.ocultar-seriales td:nth-child(6) { display:none; }
#notasView.modo-nota-entrega #productosTable th:nth-child(5),
#notasView.modo-nota-entrega #productosTable td:nth-child(5),
#notasView.modo-nota-entrega #productosTable th:nth-child(7),
#notasView.modo-nota-entrega #productosTable td:nth-child(7) { display:none !important; }
#notasView.modo-nota-entrega #productosTable th:nth-child(6),
#notasView.modo-nota-entrega #productosTable td:nth-child(6) { display:table-cell !important; }
#notasView.modo-nota-entrega #btnSeriales,
#notasView.modo-nota-entrega #eyeSeriales,
#notasView.modo-nota-entrega .totales,
#notasView.modo-nota-entrega .currency-select,
#notasView.modo-nota-entrega .iva-toggle,
#notasView.modo-nota-entrega #panelPagoCobro { display:none !important; }
.inventario-total { margin-top:12px; font-size:.9rem; color:#555; text-align:right; }
.inventario-total strong { color:#141a14; }

/* Vista lista */
.productos-grid.vista-lista { grid-template-columns:1fr; gap:8px; }
.productos-grid.vista-lista .prod-card { flex-direction:row; align-items:center; padding:8px 12px; gap:12px; overflow:visible; }
.productos-grid.vista-lista .prod-card-foto { width:52px; height:52px; min-width:52px; aspect-ratio:auto; border-radius:10px; }
.productos-grid.vista-lista .prod-card-foto img { padding:3px; }
.productos-grid.vista-lista .prod-card-info { flex:1; padding:0; }
.productos-grid.vista-lista .prod-card-nombre { height:auto; -webkit-line-clamp:1; }
.productos-grid.vista-lista .prod-card-precio { padding:0; gap:8px; min-width:170px; justify-content:flex-end; }
.productos-grid.vista-lista .prod-card-compra { display:flex; font-size:.72rem; color:#7f8c8d; white-space:nowrap; gap:4px; align-items:center; }
.productos-grid.vista-lista .prod-card-precios { padding:0; gap:4px; white-space:nowrap; }
.productos-grid.vista-lista .prod-card-pie { padding:0; gap:10px; }
.productos-grid.vista-lista .prod-card-check { position:static; background:none; padding:0; }
.productos-grid.vista-lista .prod-card-eliminar { top:50%; left:auto; right:6px; transform:translateY(-50%); }
.productos-grid.vista-lista .prod-card-cam { bottom:-6px; right:-6px; width:24px; height:24px; font-size:.85rem; }

/* Toasts */
.toast-container {
  position:fixed;
  bottom:24px;
  right:24px;
  z-index:2000;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:340px;
}
.toast {
  background:#141a14;
  color:#fff;
  padding:12px 16px;
  border-radius:10px;
  font-size:.86rem;
  box-shadow:0 8px 24px rgba(0,0,0,.22);
  border-left:4px solid #3498db;
  animation:toast-in .25s ease;
  opacity:1;
  transition:opacity .3s, transform .3s;
}
.toast-ok { border-left-color:#27ae60; }
.toast-error { border-left-color:#e74c3c; }
.toast-info { border-left-color:#3498db; }
.toast-ocultar { opacity:0; transform:translateX(20px); }
@keyframes toast-in {
  from { opacity:0; transform:translateX(30px); }
  to { opacity:1; transform:translateX(0); }
}

/* Modal de confirmación */
.confirm-content { width:400px; }
.confirm-content .modal-body { font-size:.92rem; color:#333; line-height:1.5; }
.confirm-content .btn-cancelar {
  background:#fff;
  border:1px solid #dde1e6;
  color:#555;
  padding:8px 16px;
  border-radius:8px;
  font-size:.85rem;
  cursor:pointer;
  margin-right:8px;
}
.confirm-content .btn-cancelar:hover { background:#f6f8fa; }
.confirm-content .btn-peligro {
  background:#5ea832;
  border:none;
  color:#fff;
  padding:8px 16px;
  border-radius:8px;
  font-size:.85rem;
  font-weight:600;
  cursor:pointer;
}
.confirm-content .btn-peligro:hover { background:#d63850; }

/* Spinner de carga */
.loading-overlay {
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(255,255,255,.85);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  z-index:3000;
}
.loading-overlay p { color:#555; font-size:.9rem; margin:0; }
.spinner {
  width:44px;
  height:44px;
  border:4px solid #eee;
  border-top-color:#5ea832;
  border-radius:50%;
  animation:spin .8s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#c8cdd4; border-radius:8px; }
::-webkit-scrollbar-thumb:hover { background:#a8afb8; }
* { scrollbar-width:thin; scrollbar-color:#c8cdd4 transparent; }

/* Print */
@media print {
  @page { margin: 12mm 14mm; }
  body { background:#fff; font-size:10px; color:#111; }
  .app-header, .sidebar, .header-actions { display:none !important; }
  .main-layout { display:block; }
  .container { max-width:100%; padding:0; margin:0; }

  /* Paneles sin recuadros - separación limpia */
  .panel {
    box-shadow:none;
    border:none;
    border-radius:0;
    padding:10px 0 !important;
    margin-bottom:2px !important;
    break-inside:avoid;
  }
  .panel h3 {
    font-size:9px !important;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#555 !important;
    border-bottom:1px solid #bbb !important;
    padding-bottom:3px;
    margin-bottom:8px;
  }

  /* Encabezado de la nota */
  .nota-encabezado {
    border-bottom:2px solid #222 !important;
    padding-bottom:10px !important;
    margin-bottom:10px !important;
  }
  .encabezado-top {
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    margin-bottom:10px;
    border:none !important;
  }
  .titulo-input {
    font-size:20px !important;
    border:none !important;
    letter-spacing:2px;
    color:#111 !important;
    text-align:left;
    padding:0;
  }
  .nota-logo-display img { max-height:55px; }
  .encabezado-grid { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:4px 14px; }
  .nota-encabezado .form-group { margin-bottom:2px; }
  .nota-encabezado input { font-size:10px !important; padding:1px 0 !important; border:none !important; background:transparent !important; font-weight:600; color:#222; }
  .nota-encabezado select {
    font-size:10px !important;
    padding:1px 0 !important;
    border:none !important;
    background:transparent !important;
    font-weight:700;
    color:#222;
    -webkit-appearance:none;
    appearance:none;
  }
  .nota-encabezado label { font-size:8px !important; color:#888; text-transform:uppercase; letter-spacing:.5px; }

  /* Cliente */
  .cliente-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:4px 14px; }
  .cliente-grid input { font-size:10px !important; padding:1px 0 !important; border:none !important; background:transparent !important; }
  .cliente-grid .form-group { margin-bottom:2px; }
  .cliente-grid label { font-size:8px !important; color:#888; text-transform:uppercase; letter-spacing:.5px; }

  /* Tabla de productos */
  .productos-table { width:100%; table-layout:fixed; }
  .productos-table thead { display:table-header-group; }
  .productos-table th {
    background:#fff !important;
    color:#333 !important;
    border-top:1px solid #222 !important;
    border-bottom:1px solid #222 !important;
    padding:4px 3px !important;
    font-size:8px !important;
    text-transform:uppercase;
    letter-spacing:.5px;
  }
  .productos-table td {
    padding:3px 3px !important;
    font-size:10px !important;
    border-bottom:1px solid #eee;
  }
  .productos-table th:nth-child(1) { width:5%; }
  .productos-table th:nth-child(2) { display:none; }
  .productos-table th:nth-child(3) { width:38%; }
  .productos-table th:nth-child(4) { width:8%; }
  .productos-table th:nth-child(5) { width:18%; }
  .productos-table th:nth-child(6) { width:13%; }
  .productos-table th:nth-child(7) { width:15%; }
  .productos-table th:nth-child(8) { width:2%; display:none; }
  #productosBody td:nth-child(2) { display:none !important; }
  #productosBody td:nth-child(8) { display:none !important; }
  #productosBody tr:last-child td { border-bottom:none; }
  #productosBody tfoot { display:none; }

  .modal { display:none !important; }
  button { display:none !important; }
  .btn-serial { display:none !important; }
  .serial-print { display:block !important; font-size:10px !important; color:#333; word-break:break-all; }
  .desc-print { display:block !important; white-space:pre-wrap; word-break:break-word; line-height:1.3; font-size:10px !important; }
  .prod-desc { display:none !important; }
  .prod-sku { display:none !important; }
  .prod-tipo-precio { display:none !important; }
  .precio-cell { display:table-cell !important; }
  .precio-cell select { display:none !important; }
  .precio-cell input { width:90% !important; border:none !important; background:transparent !important; padding:1px !important; box-shadow:none !important; font-size:10px !important; }
  .productos-table input[type="number"] { -webkit-appearance:textfield; appearance:textfield; width:85% !important; border:none !important; background:transparent !important; padding:1px !important; box-shadow:none !important; }
  .productos-table input[type="number"]::-webkit-inner-spin-button,
  .productos-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }

  /* Totales */
  .totales { width:auto; max-width:280px; margin-left:auto; margin-top:14px; font-size:11px !important; }
  .totales .total-row { font-size:10px !important; color:#333 !important; padding:3px 0 !important; }
  .total-final {
    color:#111 !important;
    font-size:16px !important;
    font-weight:700;
    border-top:2px solid #222 !important;
    padding-top:6px;
    margin-top:6px;
  }
  .iva-toggle { display:none !important; }
  .iva-row { color:#111 !important; font-size:9px !important; padding:1px 0 !important; }

  /* Notas adicionales */
  textarea { border:none !important; resize:none !important; font-size:10px !important; padding:2px 0 !important; }

  /* Controles que no van en el documento */
  .currency-select, .iva-toggle, .btn-col-toggle { display:none !important; }
  .pago-grid select, #monedaSelect, #tasaBcvInput {
    border:none !important; background:transparent !important;
    font-size:10px !important; font-weight:600; padding:1px 0 !important;
    -webkit-appearance:none; appearance:none;
  }
  .calcular-quince { display:none !important; }
  .quince-row { border-top:1px dashed #999 !important; }

  .logo-upload { display:none !important; }
  .content { width:100% !important; max-width:100% !important; padding:0 !important; margin:0 !important; }

  /* Modo impresion con template (imprimirFormato) */
  body.modo-impresion > *:not(#printTemplate) { display:none !important; }
  body.modo-impresion #printTemplate { display:block !important; }
  .sep-line { display:none !important; }
}

.login-overlay {
  position:fixed; inset:0; z-index:9999;
  background:linear-gradient(135deg, rgba(243,250,238,0.92), rgba(225,244,213,0.92));
  backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
}
.login-box {
  background:#fff; border-radius:14px; padding:40px 32px 32px;
  width:340px; max-width:90vw; text-align:center;
  border:1.5px solid #cbe6ba;
  box-shadow:0 12px 36px rgba(30,60,25,0.12);
  animation:fadeIn .3s ease;
}
.login-box .login-icon { font-size:48px; margin-bottom:8px; }
.login-box .login-logo { display:flex; justify-content:center; margin-bottom:10px; }
.login-box .login-logo-icon { font-size:48px; line-height:1; }
.login-box .login-logo img { max-width:200px; max-height:80px; object-fit:contain; }
.login-box h2 { color:#1a241a; margin:0 0 20px; font-size:1.3rem; }
.login-box input {
  display:block; width:100%; box-sizing:border-box;
  padding:10px 14px; margin-bottom:12px;
  border:1px solid #ddd; border-radius:6px;
  font-size:1rem; outline:none;
}
.login-box select {
  display:block; width:100%; box-sizing:border-box;
  padding:10px 14px; margin-bottom:12px;
  border:1px solid #ddd; border-radius:6px;
  font-size:1rem; outline:none; background:#fff; color:#1a241a;
}
.login-box input:focus, .login-box select:focus { border-color:#5ea832; }
.login-label { display:block; text-align:left; font-size:.8rem; color:#666; margin-bottom:4px; font-weight:600; }
.login-box button {
  width:100%; padding:10px; background:#5ea832; color:#fff;
  border:none; border-radius:6px; font-size:1rem; cursor:pointer;
  font-weight:600; transition:background .2s;
}
.login-box button:hover { background:#4c8c26; }
.login-error { color:#e74c3c; font-size:.9rem; margin:8px 0 0; min-height:1.2em; }
@keyframes fadeIn { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }

/* ===== ROLES ===== */
body.rol-vendedor .admin-only { display:none !important; }

/* ===== MODAL USUARIOS ===== */
.usuarios-content { width:620px; }
.usuarios-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.usuarios-table th, .usuarios-table td { border:1px solid #eef0f3; padding:8px 10px; text-align:left; }
.usuarios-table th { background:#1a241a; color:#fff; }
.usuarios-table tr:nth-child(even) { background:#f8f9fb; }
.usuarios-acciones { white-space:nowrap; }
.badge-yo { font-size:.7rem; background:#e8f8f0; color:#27ae60; border-radius:4px; padding:1px 6px; margin-left:4px; }
.usuario-form {
  margin-top:14px; padding:14px 16px;
  background:#f8f9fb; border:1px solid #eef0f3; border-radius:8px;
}
.usuario-form h4 { margin:0 0 10px; color:#1a241a; }
.usuario-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; }
.empresa-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 16px; }
.usuario-form-acciones { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }

/* ===== PAGO / COBRO ===== */
.pago-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px 14px; margin-top:8px; }
.pago-grid .form-group label { display:block; font-size:.75rem; color:#7f8c8d; margin-bottom:4px; }
.pago-grid select { width:100%; padding:7px 10px; border:1px solid #d5d8dc; border-radius:6px; font-size:.9rem; }

/* ===== VENTAS ===== */
.ventas-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.ventas-acciones { display:flex; flex-wrap:wrap; gap:8px; }
.ventas-acciones select { padding:6px 10px; border:1px solid #d5d8dc; border-radius:6px; font-size:.85rem; }
.ventas-acciones button { font-size:.8rem; padding:6px 12px; }
.ventas-resumen { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:14px; }
.ventas-card {
  flex:1 1 200px; min-width:200px; padding:14px 16px;
  background:linear-gradient(135deg, #4a4a4a, #6b6b6b);
  color:#fff; border-radius:10px;
}
.ventas-card-titulo { font-size:.75rem; text-transform:uppercase; letter-spacing:1px; opacity:.85; }
.ventas-card-monto { font-size:1.5rem; font-weight:700; margin:4px 0; }
.ventas-card-sub { font-size:.78rem; opacity:.8; }
.ventas-card-pendiente { background:linear-gradient(135deg, #1b4320, #388e3c); }
.ventas-vacio { color:#7f8c8d; padding:20px; text-align:center; }
.ventas-fila-nc td { background:#fff6e6; color:#8a5a00; }
.ventas-seccion { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#7f8c8d; margin:12px 0 6px; }
.ventas-fila { display:flex; justify-content:space-between; gap:10px; padding:5px 0; border-bottom:1px dashed #eef0f3; font-size:.9rem; }
.ventas-fila span:first-child { color:#2c3e50; }
.ventas-fila span:last-child { font-weight:600; }
.ventas-bs-detalle { margin-bottom:14px; }
.ventas-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.ventas-table th, .ventas-table td { border:1px solid #eef0f3; padding:8px 10px; text-align:left; }
.ventas-table th { background:#4a4a4a; color:#fff; }
.ventas-table tr:nth-child(even) { background:#f8f9fb; }
.ventas-table tbody tr { cursor:pointer; }
.ventas-table tbody tr:hover { background:#eef4ff; }

/* ===== PUNTOS DE VENTA ===== */
.pos-hint { font-size:.8rem; color:#7f8c8d; margin-bottom:12px; }
.pos-fila { display:flex; justify-content:space-between; align-items:center; padding:8px 10px; border:1px solid #eef0f3; border-radius:8px; margin-bottom:8px; }
.pos-fila span { font-size:.9rem; }
.pos-fila button { font-size:.75rem; padding:4px 10px; background:#e74c3c; }
.pos-input-group { display:flex; gap:8px; margin-top:12px; }
.pos-input-group input { flex:1; padding:8px 10px; border:1px solid #d5d8dc; border-radius:6px; font-size:.9rem; }

/* ===== DASHBOARD ===== */
.dashboard-bienvenida { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
.dashboard-bienvenida h3 { margin:0; border:none; padding:0; font-size:1.1rem; }
.dashboard-fecha-texto { font-size:.85rem; color:#7f8c8d; font-weight:600; }

.dashboard-nav {
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:16px;
  margin-bottom:16px;
}
.dash-nav-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid #eceef1;
  border-radius:14px;
  padding:20px 12px;
  cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,.07);
  transition:transform .18s, box-shadow .18s;
  color:#141a14;
}
.dash-nav-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.12); border-color:#7cc24e; }
.dash-nav-icon { font-size:1.8rem; line-height:1; }
.dash-nav-label { font-size:.88rem; font-weight:700; }

.dashboard-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; margin-bottom:16px; }
.dashboard-grid-2 { grid-template-columns:1fr; }
.dash-card {
  background:#fff; border-radius:14px; padding:18px;
  box-shadow:0 2px 10px rgba(0,0,0,.07);
  display:flex; align-items:center; gap:14px;
  transition:transform .18s, box-shadow .18s;
  border:1px solid #eceef1;
}
.dash-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.12); }
.dash-card-icon {
  width:52px; height:52px; flex-shrink:0;
  border-radius:12px; display:flex; align-items:center; justify-content:center;
  font-size:1.5rem;
}
.dash-card-info { flex:1; min-width:0; }
.dash-card-titulo { font-size:.72rem; text-transform:uppercase; letter-spacing:.6px; color:#7f8c8d; font-weight:700; }
.dash-card-monto { font-size:1.5rem; font-weight:700; margin:3px 0; color:#141a14; }
.dash-card-sub { font-size:.75rem; color:#999; }

.dash-ventas .dash-card-icon { background:#e8f8f0; color:#27ae60; }
.dash-ventas-mes .dash-card-icon { background:#eaf2ff; color:#2980b9; }
.dash-pendiente .dash-card-icon { background:#fff3e0; color:#f39c12; }
.dash-uso-interno .dash-card-icon { background:#efe7ff; color:#7d3c98; }
.dash-inventario .dash-card-icon { background:#fff8e1; color:#f39c12; }
.dash-caja .dash-card-icon { background:#f0e6ff; color:#8e44ad; }
.dash-compras .dash-card-icon { background:#e8f5e0; color:#5ea832; }

.dash-card-caja-grid {
  display:flex; flex-wrap:wrap; gap:8px; margin-top:6px;
}
.dash-caja-item {
  flex:1 1 90px; text-align:center; padding:8px 6px;
  background:#f8f9fa; border:1px solid #eef0f3; border-radius:8px;
}
.dash-caja-item-monto { font-size:1rem; font-weight:700; }
.dash-caja-item-label { font-size:.65rem; color:#999; text-transform:uppercase; letter-spacing:.5px; }

.dash-lista-item {
  display:flex; align-items:center; gap:10px;
  padding:9px 4px; border-bottom:1px solid #f0f0f0;
  font-size:.85rem;
}
.dash-lista-item:last-child { border-bottom:none; }
.dash-lista-num { font-weight:700; color:#1a241a; flex-shrink:0; }
.dash-lista-cliente { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#555; }
.dash-lista-fecha { font-size:.72rem; color:#999; flex-shrink:0; }
.dash-lista-monto { font-weight:700; color:#27ae60; white-space:nowrap; flex-shrink:0; }
.dash-lista-vacio { color:#999; text-align:center; padding:18px 0; font-size:.85rem; }

/* ===== COMPRAS ===== */
.compras-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; }
.compras-header h3 { margin:0; border:none; padding:0; }
.compras-acciones { display:flex; gap:8px; }
.compras-acciones button { font-size:.8rem; padding:6px 12px; }
.compra-form-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.compra-form-acciones { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.compra-form-acciones .btn-cancelar { background:#fff; border:1px solid #dde1e6; color:#555; padding:8px 16px; border-radius:8px; font-size:.85rem; cursor:pointer; }
.compra-form-acciones .btn-cancelar:hover { background:#f6f8fa; }

.caja-chica-grid { display:flex; flex-wrap:wrap; gap:14px; margin-bottom:14px; }
.caja-card {
  flex:1 1 180px; min-width:160px; padding:16px;
  border-radius:12px; color:#fff; text-align:center;
  box-shadow:0 2px 8px rgba(0,0,0,.1);
}
.caja-card-bs { background:linear-gradient(135deg, #4a4a4a, #6b6b6b); }
.caja-card-usd { background:linear-gradient(135deg, #163619, #2e7d32); }
.caja-card-usdt { background:#111; }
.caja-card-titulo { font-size:.72rem; text-transform:uppercase; letter-spacing:1px; opacity:.85; }
.caja-card-monto { font-size:1.4rem; font-weight:700; margin:4px 0; }
.caja-chica-config { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:12px; margin-top:10px; }
.caja-chica-config .form-group input { width:100%; padding:8px 10px; border:1px solid #d0d5dd; border-radius:6px; font-size:.85rem; }
.caja-chica-config .form-group input:focus { outline:none; border-color:#5ea832; }

.compras-lista-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; }
.compras-lista-header h3 { margin:0; border:none; padding:0; }
.compras-filtros { display:flex; gap:8px; flex-wrap:wrap; }
.compras-filtros input, .compras-filtros select { padding:7px 10px; border:1px solid #d5d8dc; border-radius:6px; font-size:.82rem; }
.compras-filtros input:focus, .compras-filtros select:focus { outline:none; border-color:#5ea832; }
.compras-resumen { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:14px; }
.compras-resumen-card {
  flex:1 1 140px; min-width:120px; padding:12px;
  background:#f8f9fa; border:1px solid #eef0f3; border-radius:8px; text-align:center;
}
.compras-resumen-card-titulo { font-size:.7rem; text-transform:uppercase; color:#7f8c8d; letter-spacing:.5px; }
.compras-resumen-card-monto { font-size:1.1rem; font-weight:700; color:#141a14; margin:2px 0; }
.compras-resumen-card-sub { font-size:.72rem; color:#999; }

.compras-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.compras-table th, .compras-table td { border:1px solid #eef0f3; padding:8px 10px; text-align:left; }
.compras-table th { background:#4a4a4a; color:#fff; }
.compras-table tr:nth-child(even) { background:#f8f9fb; }
.compras-table tbody tr { cursor:pointer; }
.compas-table tbody tr:hover { background:#eef4ff; }
.compras-table .btn-remove {
  background:transparent; color:#5ea832; font-size:1rem; padding:2px 6px; border-radius:4px;
}
.compras-table .btn-remove:hover { background:#fee; }
.compras-table .btn-edit {
  background:transparent; color:#3498db; font-size:.85rem; padding:2px 8px; border-radius:4px;
}
.compras-table .btn-edit:hover { background:#eef4ff; }

.badge-pago {
  display:inline-block; padding:2px 8px; border-radius:10px; font-size:.72rem; font-weight:600; color:#fff;
}
.badge-pago-bolivares { background:#27ae60; }
.badge-pago-dolares { background:#2980b9; }
.badge-pago-usdt { background:#8e44ad; }

/* ===== TABLET ===== */
@media (max-width:900px) {
  .dashboard-grid { grid-template-columns:1fr 1fr; }
  .dashboard-grid-2 { grid-template-columns:1fr; }
  .dashboard-nav { grid-template-columns:repeat(2, 1fr); }
  .pago-grid { grid-template-columns:1fr 1fr; }
  .app-header {
    flex-wrap:wrap;
    gap:10px;
    padding:12px 16px;
  }
  .app-header h1 { width:100%; font-size:1.1rem; }
  .header-tabs { width:100%; justify-content:center; }
  .header-actions {
    width:100%;
    flex-wrap:wrap;
    justify-content:center;
    gap:6px;
  }
  .header-actions button { font-size:.75rem; padding:6px 12px; }
  .encabezado-grid { grid-template-columns:1fr 1fr; }
  .cliente-grid { grid-template-columns:1fr 1fr; }
  .totales { width:100%; }
}

/* ===== MOVIL ===== */
@media (max-width:600px) {
  .container { padding:8px; }
  .app-header { border-radius:8px; padding:10px 12px; margin-bottom:12px; }
  .app-header h1 { font-size:.95rem; }
  .header-tabs button { font-size:.7rem; padding:5px 10px; }
  .header-actions { gap:4px; }
  .header-actions button { font-size:.7rem; padding:5px 8px; border-radius:4px; }
  .panel { padding:12px; border-radius:8px; }
  .panel h3 { font-size:.85rem; }

  .encabezado-grid { grid-template-columns:1fr; gap:8px; }
  .cliente-grid { grid-template-columns:1fr; gap:8px; }
  .dashboard-grid { grid-template-columns:1fr; gap:10px; }
  .dashboard-nav { grid-template-columns:1fr 1fr; gap:10px; }
  .dash-card-monto { font-size:1.3rem; }
  .pago-grid { grid-template-columns:1fr; gap:8px; }
  .titulo-input { font-size:1rem; letter-spacing:1px; }
  .nota-logo-display img { max-height:50px; max-width:100px; }

  .productos-table { font-size:.75rem; }
  .productos-table th { font-size:.65rem; padding:6px 4px; }
  .productos-table td { padding:4px; }
  .productos-table input[type="text"],
  .productos-table input[type="number"] { font-size:.75rem; padding:5px 4px; }

  .prod-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }

  .totales { width:100%; }
  .total-row { font-size:.75rem; }
  .total-final { font-size:1.2rem; }

  .modal-content { width:95vw; max-height:90vh; border-radius:8px; }
  .modal-header { padding:12px 16px; }
  .modal-body { padding:12px 16px; }

  .inventario-header { flex-direction:column; align-items:stretch; }
  .inventario-acciones { flex-wrap:wrap; }
  .inventario-acciones button { font-size:.75rem; padding:5px 10px; }
  .productos-grid { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:10px; }

  button { padding:8px 14px; font-size:.82rem; }
  button.small { padding:4px 10px; font-size:.75rem; }

  .login-box { padding:24px 20px 20px; width:95vw; }
  .login-box h2 { font-size:1.1rem; }
  .login-box input { font-size:.9rem; padding:8px 12px; }
}
