/* ============================================================
   TecnoSport — Windows Vista Aero Style
   (basado en el sistema visual de TecnoParts: rojo/azul marino,
   paneles con brillo superior, botones en relieve, menú superior)
   ============================================================ */

:root {
  --win-bg: #e9ecef;
  --win-fg: #000000;
  --win-title: #C24700;
  --win-title-text: #ffffff;
  --win-hover: #C24700;
  --win-hover-text: #ffffff;
  --win-disabled: #6c757d;
  --win-border-light: #ffffff;
  --win-border-dark: #adb5bd;
  --win-border-darker: #6c757d;
  --win-input-bg: #ffffff;
  --win-panel-bg: #f8f9fa;
  --win-font-ui: "Segoe UI", "Microsoft Sans Serif", system-ui, sans-serif;
  --win-font-mono: Consolas, "Courier New", monospace;

  --accent-red: #dc2626;
  --accent-red-light: #fecaca;
  --accent-red-bg: #fef2f2;
  --accent-green: #008000;
  --accent-orange: #ff8000;
  --accent-blue: #0000ff;
  --blue-bg: #eef1fa;
  --blue-light: #d7dff5;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-width: 1024px;
  font-family: var(--win-font-ui);
  font-size: 13px;
  color: var(--win-fg);
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  overflow: hidden;
}

html, body, h1, h2, h3, h4, h5, h6, p, label, th, td, button, a, span, div {
  text-transform: uppercase;
}
input, textarea, select { text-transform: uppercase; }
input::placeholder, textarea::placeholder { text-transform: none; opacity: 0.7; }
input[type="email"] { text-transform: lowercase; }

a { color: inherit; text-decoration: none; }

/* ── Ventana principal ── */
.win-window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--win-bg);
  border: 1px solid var(--win-border-dark);
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Barra de título ── */
.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 8px;
  background: linear-gradient(180deg, #2B1400 0%, #4A1F00 50%, #8A3800 100%);
  color: var(--win-title-text);
  font-weight: bold;
  font-size: 13px;
  user-select: none;
  flex-shrink: 0;
  border-radius: 12px 12px 0 0;
}
.win-titlebar .title-text { display: flex; align-items: center; gap: 6px; }
.win-titlebar .title-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.win-titlebar .title-controls { display: flex; gap: 4px; }
.win-titlebar .win-btn-control {
  width: 22px; height: 20px; line-height: 18px; text-align: center; font-size: 11px;
  font-family: var(--win-font-ui);
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 50%, #dee2e6 100%);
  color: var(--win-fg);
  border: 1px solid var(--win-border-dark);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
.win-titlebar .win-btn-control:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f4 50%, #e8eaed 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}
.win-titlebar .win-btn-control:active {
  background: linear-gradient(180deg, #dee2e6 0%, #e9ecef 50%, #f1f3f4 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* ── Barra de menú ── */
.win-menubar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 6px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid var(--win-border-dark);
  flex-shrink: 0;
  user-select: none;
}
.win-menu {
  position: relative;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 20px;
  border: 1px solid transparent;
  border-radius: 6px;
}
.win-menu:hover, .win-menu.active, .win-menu.kbd-focus {
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, var(--win-title) 100%);
  color: var(--win-hover-text);
  border: 1px solid var(--win-title);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
}
.win-menu.active { background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%); }
/* kbd-focus: menu resaltado por teclado (Alt) pero sin abrir el submenu
   todavia -- distinto de .active, que si lo abre. */
.win-menu.kbd-focus { background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, var(--win-title) 100%); }

.win-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid var(--win-border-dark);
  padding: 4px;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  border-radius: 10px;
}
.win-menu.active .win-submenu { display: block; }
.win-submenu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 4px 24px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--win-fg);
  position: relative;
  border-radius: 6px;
}
.win-submenu-item:hover {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: var(--win-hover-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.win-submenu-item.selected {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: var(--win-hover-text);
  outline: 2px solid var(--accent-red);
  outline-offset: -2px;
}
.win-submenu-item .shortcut { margin-left: 24px; font-size: 12px; color: var(--win-fg); }
.win-submenu-item:hover .shortcut { color: var(--win-hover-text); }

.win-separator {
  height: 1px;
  margin: 4px 6px;
  background: linear-gradient(90deg, transparent 0%, var(--win-border-dark) 50%, transparent 100%);
  border: none;
}

/* ── Barra de herramientas ── */
.win-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid var(--win-border-dark);
  flex-shrink: 0;
}
.win-toolbar .win-button { height: 26px; padding: 3px 12px; font-size: 12px; }

/* ── Contenido ── */
.win-content { flex: 1 1 auto; overflow: auto; padding: 12px; background: var(--win-bg); position: relative; }

/* ── Botones ── */
.win-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 16px;
  font-family: var(--win-font-ui);
  font-size: 13px;
  color: var(--win-fg);
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 50%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
.win-button:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f4 50%, #e8eaed 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}
/* outline:none arriba saca el foco nativo del navegador -- sin esto, no
   se puede ver cual boton quedo enfocado al navegar con el teclado
   (ej. flechas entre opciones de moneda, Tab entre botones de un modal). */
.win-button:focus-visible {
  box-shadow: 0 0 0 2px var(--win-title), 0 2px 6px rgba(0,0,0,0.1);
}
.win-button:active, .win-button.pressed {
  background: linear-gradient(180deg, #dee2e6 0%, #e9ecef 50%, #f1f3f4 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  padding: 6px 15px 4px 17px;
}
.win-button:disabled, .win-button.disabled {
  color: var(--win-disabled);
  cursor: default;
  background: linear-gradient(180deg, #f1f3f4 0%, #e8eaed 100%);
  box-shadow: none;
}
.win-button-sm { padding: 3px 10px; font-size: 12px; height: 24px; }
.win-button-lg { padding: 10px 24px; font-size: 14px; }

.win-button-primary {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: var(--win-title-text);
  border: 1px solid var(--win-title);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
}
.win-button-primary:hover {
  background: linear-gradient(180deg, #E86A00 0%, #4A1F00 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
}
.win-button-primary:active {
  background: linear-gradient(180deg, #8A3800 0%, #2B1400 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.win-button-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 50%, #dee2e6 100%);
  color: var(--win-fg);
  border: 1px solid var(--win-border-dark);
}
.win-button-success {
  background: linear-gradient(180deg, #00a000 0%, #008000 50%, #006000 100%);
  color: #ffffff; border: 1px solid #006000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
}
.win-button-success:hover {
  background: linear-gradient(180deg, #00b000 0%, #009000 50%, #007000 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}
.win-button-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
  color: #ffffff; border: 1px solid #991b1b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
}
.win-button-danger:hover {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #b91c1c 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ── Inputs ── */
.win-input, .win-select, .win-textarea {
  font-family: var(--win-font-ui);
  font-size: 13px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  color: var(--win-fg);
  border: 2px solid var(--win-border-dark);
  border-radius: 8px;
  outline: none;
  width: 100%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8);
}
.win-input:focus, .win-select:focus, .win-textarea:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15), inset 0 2px 4px rgba(0,0,0,0.06);
}
.win-select {
  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='8'%3E%3Cpath d='M0 0h8L4 8z' fill='%23000'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 20px;
}
.win-textarea { resize: vertical; min-height: 60px; }

*:focus-visible { outline: 2px solid var(--accent-red); outline-offset: 2px; }

/* ── Paneles ── */
.win-panel {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 40%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.win-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}
.win-panel:last-child { margin-bottom: 0; }
.win-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  margin: -12px -12px 10px -12px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f4 50%, #e8eaed 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  min-height: 32px;
}
.win-panel-title { font-size: 14px; font-weight: bold; color: var(--win-title); margin: 0; }
.win-panel-inset {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8);
  padding: 12px;
}

/* ── Formularios ── */
.win-form-group { margin-bottom: 10px; }
.win-form-group:last-child { margin-bottom: 0; }
.win-label { display: block; font-size: 12px; font-weight: bold; margin-bottom: 4px; color: var(--win-fg); }
.win-form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.win-form-row label { min-width: 100px; text-align: right; font-size: 13px; white-space: nowrap; }
.win-form-row .win-input, .win-form-row .win-select { flex: 1; }
.win-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.win-form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.win-form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }

/* ── Tablas ── */
.win-table-container {
  overflow: auto;
  max-height: 480px;
  border-radius: 10px;
  border: 1px solid var(--win-border-dark);
  background: var(--win-input-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.win-table { width: 100%; border-collapse: collapse; font-family: var(--win-font-ui); font-size: 13px; background: var(--win-input-bg); }
.win-table th {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid var(--win-border-dark);
  padding: 6px 10px;
  text-align: left; font-weight: bold; white-space: nowrap;
  position: sticky; top: 0; z-index: 10;
}
.win-table th:first-child { border-radius: 10px 0 0 0; }
.win-table th:last-child { border-radius: 0 10px 0 0; }
.win-table td { border: 1px solid #dee2e6; padding: 5px 10px; }
.win-table tr:nth-child(even) { background: #f1f3f4; }
.win-table tr:hover { background: rgba(220, 38, 38, 0.08); }

/* ── Barra de estado ── */
.win-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 26px; padding: 0 10px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 1px solid var(--win-border-dark);
  flex-shrink: 0;
  font-size: 12px; white-space: nowrap; user-select: none;
}
.win-statusbar .status-section { display: flex; align-items: center; gap: 8px; min-width: 0; }
.win-statusbar .status-box {
  padding: 2px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 6px;
  min-width: 80px; text-align: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.win-statusbar .status-label { font-size: 11px; font-weight: bold; color: #495057; white-space: nowrap; }

/* ── Scrollbar ── */
.win-content::-webkit-scrollbar, .win-table-container::-webkit-scrollbar { width: 14px; height: 14px; }
.win-content::-webkit-scrollbar-track, .win-table-container::-webkit-scrollbar-track {
  background: #e9ecef; border-radius: 8px; border: 1px solid var(--win-border-dark);
}
.win-content::-webkit-scrollbar-thumb, .win-table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f8f9fa 0%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.win-content, .win-table-container { scrollbar-width: thin; scrollbar-color: var(--win-border-dark) #e9ecef; }

/* ── Modal ── */
.win-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  align-items: center; justify-content: center;
}
.win-modal-overlay.active { display: flex; }
.win-modal {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 40%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 15px;
  width: 640px; min-width: 320px; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
/* Modal Buscar Producto: mas ancho que el default para que la tabla y la
   foto grande (~300x300) entren sin scroll horizontal, ver producto_modal.js */
.win-modal.win-modal-ancho { width: 900px; max-height: 100vh; }
.win-modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 15px 15px 0 0;
  pointer-events: none;
}
.win-modal .win-titlebar { cursor: default; border-radius: 15px 15px 0 0; }
.win-modal-body { padding: 16px; overflow: auto; flex: 1; }
.win-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--win-border-dark);
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ── Toast ── */
.win-toast-container {
  position: fixed; top: 40px; right: 12px; z-index: 3000;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.win-toast {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; min-width: 220px; max-width: 360px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  font-size: 13px;
  pointer-events: auto;
  animation: toastSlide 0.2s ease-out;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  transition: opacity 0.3s, transform 0.3s;
}
.win-toast-success { border-left: 4px solid var(--accent-green); }
.win-toast-error   { border-left: 4px solid #ff0000; }
.win-toast-warning { border-left: 4px solid var(--accent-orange); }
.win-toast-info    { border-left: 4px solid var(--accent-blue); }
@keyframes toastSlide { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Badges ── */
.win-badge {
  display: inline-block; padding: 2px 6px; font-size: 11px; font-weight: bold;
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: var(--win-title-text);
  border: 1px solid var(--win-title);
  border-radius: 6px; line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.win-badge-success { background: linear-gradient(180deg, #00a000 0%, #008000 100%); color: #fff; border-color: #006000; }
.win-badge-warning { background: linear-gradient(180deg, #ff8000 0%, #cc6600 100%); color: #fff; border-color: #cc6600; }
.win-badge-danger  { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: #fff; border-color: #991b1b; }
.win-badge-info    { background: linear-gradient(180deg, #4169e1 0%, #0000cc 100%); color: #fff; border-color: #0000cc; }
.win-badge-secondary { background: linear-gradient(180deg, #adb5bd 0%, #6c757d 100%); color: #fff; border-color: #6c757d; }

/* ── Alertas ── */
.win-alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.win-alert-danger  { background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%); border: 1px solid var(--accent-red); color: #991b1b; }
.win-alert-success { background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%); border: 1px solid var(--accent-green); color: #006000; }
.win-alert-warning { background: linear-gradient(180deg, #fff3e0 0%, #ffe0b2 100%); border: 1px solid var(--accent-orange); color: #cc6600; }
.win-alert-info    { background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%); border: 1px solid var(--accent-blue); color: #0000cc; }

/* ── Grid ── */
.win-grid { display: grid; gap: 12px; }
.win-grid-2 { grid-template-columns: repeat(2, 1fr); }
.win-grid-3 { grid-template-columns: repeat(3, 1fr); }
.win-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Login ── */
.win-login { display: flex; align-items: center; justify-content: center; height: 100%; background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 50%, #ced4da 100%); }
.win-login-card {
  width: 456px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 40%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  position: relative; overflow: hidden;
}
.win-login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 15px 15px 0 0;
  pointer-events: none;
}
.win-login-body { padding: 29px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-img { max-width: 260px; width: 100%; height: auto; margin: 0 0 4px 0; }
.login-logo p { font-size: 14px; color: var(--win-disabled); margin: 0; }

/* ── Dashboard: stat cards ── */
.db-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.db-stats-row-8 { grid-template-columns: repeat(8, 1fr); }
.db-section-label-row { display: grid; grid-template-columns: repeat(2, 1fr); }
.db-stat-card {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 40%, #dee2e6 100%);
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.db-stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}
.db-stat-card .db-stat-icon { font-size: 15px; margin-bottom: 1px; }
.db-stat-card .db-stat-value { font-family: var(--win-font-mono); font-size: 14px; font-weight: bold; color: var(--win-title); margin: 1px 0; }
/* Gs. y U$S por separado (nunca sumados, son monedas distintas) -- el
   numero grande queda para Gs., el chico abajo para U$S. */
.db-stat-card .db-stat-value-multi { font-size: 12px; }
.db-stat-card .db-stat-value-sub { font-size: 10px; font-weight: normal; color: var(--win-fg); opacity: 0.75; margin-top: 1px; }
.db-stat-card .db-stat-label { font-size: 9.5px; color: var(--win-fg); line-height: 1.2; }
/* Card "combinada" (ej. credito por vencer + vencido en una sola) -- dos
   lineas de dato en vez de una, mismo alto que el resto de la fila. */
.db-stat-card .db-stat-value-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.db-stat-card .db-stat-value-row .valor-alerta { color: #c0392b; }
.db-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }

.db-section-label { font-size: 10.5px; font-weight: bold; color: var(--win-title); opacity: 0.8; margin: 6px 0 4px; letter-spacing: 0.3px; }
.db-section-label:first-child { margin-top: 0; }

/* Solo en el dashboard: el pie queda fijo abajo, pegado a la barra de
   estado, en vez de flotar justo debajo de la tabla de arriba. */
body.dashboard-page .win-content { display: flex; flex-direction: column; }
body.dashboard-page .db-footer-info { margin-top: auto; }

.db-footer-info { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--win-border-dark); text-align: center; font-size: 10.5px; color: var(--win-fg); opacity: 0.65; }
.db-footer-info a { color: inherit; text-decoration: underline; }
.db-footer-info strong { font-weight: bold; opacity: 1; }

.db-presupuestos-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.db-presupuesto-card {
  /* Blanco solido a proposito -- este card vive DENTRO de un .win-panel
     que ya tiene el degrade gris como fondo; si el card usara el mismo
     degrade quedaba invisible contra su propio contenedor. */
  background: #ffffff;
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.db-presupuesto-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.db-presupuesto-card .db-presupuesto-numero { font-family: var(--win-font-mono); font-weight: bold; color: var(--win-title); font-size: 13px; }
.db-presupuesto-card .db-presupuesto-cliente { font-size: 12px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-presupuesto-card .db-presupuesto-ref { font-size: 10px; color: var(--win-fg); opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-presupuesto-card .db-presupuesto-total { font-family: var(--win-font-mono); font-weight: bold; font-size: 13px; margin-top: 4px; }
.db-presupuesto-card .db-presupuesto-tel { font-size: 10px; color: var(--win-fg); opacity: 0.75; margin-top: 2px; }

/* Consignaciones sin confirmar: color segun cuanto falta para el
   vencimiento de esa consignacion puntual (fecha + validez_dias). */
.db-presupuesto-card.db-presupuesto-por-vencer { background: #fff8e6; border-color: #d4a017; }
.db-presupuesto-card.db-presupuesto-vencido { background: #fdecea; border-color: #c0392b; }
.db-presupuesto-card.db-presupuesto-vencido .db-presupuesto-total { color: #c0392b; }

/* ── Impresión ── */
@media print {
  html, body { background: #fff; overflow: visible; }
  .win-window { border: none; height: auto; overflow: visible; box-shadow: none; border-radius: 0; }
  .win-titlebar, .win-menubar, .win-toolbar, .win-statusbar, .win-toast-container, .win-modal-overlay { display: none !important; }
  .win-content { overflow: visible; padding: 0; background: #fff; }
  .win-panel, .win-panel-inset { border: 1px solid #000; break-inside: avoid; box-shadow: none; border-radius: 0; }
  .win-panel::before, .win-panel-inset::before { display: none; }
  .win-table { border: 1px solid #000; }
  .win-table th, .win-table td { border: 1px solid #000; }
  .win-button { display: none; }
}

/* ── Utilidades ── */
.hidden { display: none !important; }
.win-hidden { display: none !important; }
.win-text-center { text-align: center; }
.win-text-right { text-align: right; }
.win-text-left { text-align: left; }
.win-text-muted { color: var(--win-disabled); }
.font-mono { font-family: var(--win-font-mono); }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 4px; }
.gap-4 { gap: 8px; }
.mb-2 { margin-bottom: 4px; }
.mb-4 { margin-bottom: 8px; }
.mt-2 { margin-top: 4px; }
.mt-4 { margin-top: 8px; }

.win-search-bar { margin-bottom: 12px; display: flex; gap: 8px; }
.win-search-bar .win-input { flex: 1; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Calibración de impresión ── */
.coord-field {
  border: 1px solid var(--win-border-dark);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  transition: opacity 0.15s;
}
.coord-field-hidden { opacity: 0.45; }
.coord-subgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.coord-subgrid input { padding: 3px 5px; font-size: 11px; }
.coord-sublabel { display: block; font-size: 9px; font-weight: bold; color: var(--win-disabled); margin-bottom: 1px; text-align: center; }
.win-eye-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.win-eye-btn:hover { transform: scale(1.15); }

@media (max-width: 1023px) { html, body { min-width: 1024px; } }
@media (max-width: 900px) { .db-stats-row { grid-template-columns: repeat(2, 1fr); } .db-stats-row-8 { grid-template-columns: repeat(4, 1fr); } .db-two-col { grid-template-columns: 1fr; } }

/* ============================================================
   Pantalla de Facturación — estilo POS de TecnoParts
   ============================================================ */

body.fac-page .win-content { background: transparent !important; padding: 0 !important; }

.fac-timbrado-banner { margin: 0 0 10px; padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: bold; text-align: center; }
.fac-timbrado-banner-vencido { background: #f8d7da; color: #842029; border: 1px solid #f1aeb5; }
.fac-timbrado-banner-aviso { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; }

/* En Facturación (y sus modales) usamos SOLO azul -- sin acentos rojos,
   ni siquiera en el foco de los .win-input/.win-select genéricos. */
body.fac-page .win-input:focus,
body.fac-page .win-select:focus,
body.fac-page .win-textarea:focus {
  border-color: var(--win-title);
  box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.15), inset 0 2px 4px rgba(0,0,0,0.06);
}
body.fac-page .win-button-danger {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  border-color: var(--win-title);
}
body.fac-page .win-button-danger:hover {
  background: linear-gradient(180deg, #E86A00 0%, #4A1F00 100%);
}

.pos-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%), linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: white;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  height: 40px;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  position: relative;
  z-index: 10;
}
.pos-header .pos-brand { font-size: 15px; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.pos-header .pos-brand span { color: rgba(255,255,255,0.75); font-weight: normal; }
.pos-header .pos-info { color: rgba(255,255,255,0.8); font-size: 12px; }

.pos-layout { display: flex; gap: 12px; padding: 12px; box-sizing: border-box; }

.pos-panel {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #adb5bd;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
  overflow: hidden;
}
.pos-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 30%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 0;
}
.pos-panel > * { position: relative; z-index: 1; }

.pos-input-wrapper { display: flex; gap: 6px; align-items: center; }
.pos-input-wrapper .pos-input { flex: 1; min-width: 0; }
.pos-btn-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--win-border-dark);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 100%);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
.pos-btn-icon:hover { background: linear-gradient(180deg, #f8f9fa 0%, #dee2e6 100%); border-color: var(--win-title); }
.pos-btn-icon:active { background: linear-gradient(180deg, #e9ecef 0%, #ced4da 100%); box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); transform: translateY(1px); }

.pos-input-label { font-size: 11px; font-weight: bold; color: var(--win-title); letter-spacing: 0.5px; margin-bottom: 4px; }
.pos-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 2px solid var(--win-border-dark);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  outline: none;
  box-sizing: border-box;
  font-family: var(--win-font-ui);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.8);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pos-input:focus {
  border-color: var(--win-title);
  background: #ffffff;
  outline: 2px solid var(--win-title);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 0, 128, 0.15), inset 0 2px 4px rgba(0,0,0,0.06);
}
.pos-input-hint { font-size: 10px; color: var(--win-disabled); margin-top: 3px; }

.pos-table-container { overflow-y: auto; border-radius: 10px; border: 1px solid var(--win-border-dark); box-shadow: inset 0 2px 4px rgba(0,0,0,0.04); }
.pos-table { width: 100%; border-collapse: collapse; font-size: 12px; background: white; }
.pos-table thead th {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: white;
  padding: 8px 10px;
  text-align: left;
  font-weight: bold;
  font-size: 11px;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
.pos-table thead th:first-child { border-radius: 10px 0 0 0; }
.pos-table thead th:last-child { border-radius: 0 10px 0 0; }
.pos-table tbody td { padding: 7px 10px; border-bottom: 1px solid #e9ecef; }
.pos-table tbody tr:nth-child(even) { background: var(--blue-bg); }
.pos-table tbody tr:hover { background: var(--blue-light); }
.pos-table .pos-col-num { width: 30px; text-align: center; }
.pos-table .pos-col-codigo { width: 80px; }
.pos-table .pos-col-prod { min-width: 180px; }
.pos-table .pos-col-cant { width: 90px; text-align: center; white-space: nowrap; }
.pos-table .pos-col-precio { width: 100px; text-align: right; }
.pos-table .pos-col-iva { width: 60px; }
.pos-table .pos-col-total { width: 90px; text-align: right; }
.pos-table .pos-col-del { width: 30px; text-align: center; }
.pos-table .pos-empty { text-align: center; color: var(--win-disabled); padding: 40px 0; }
.pos-btn-cant { border: none; background: none; font-weight: bold; cursor: pointer; font-size: 14px; color: var(--win-title); }
.pos-btn-cant:hover { transform: scale(1.2); }

.pos-sidebar { width: 280px; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }

.pos-empresa { text-align: center; padding: 10px 8px; border-bottom: 3px solid var(--win-title); margin-bottom: 8px; }
.pos-empresa-nombre { font-size: 22px; font-weight: 900; color: #000000; letter-spacing: 0.5px; line-height: 1.2; }
.pos-empresa-dato { font-size: 13px; color: #000000; font-weight: 700; margin-top: 4px; letter-spacing: 0.3px; }

.pos-total-label { text-align: center; font-size: 16px; font-weight: 900; color: var(--win-title); margin-bottom: 8px; letter-spacing: 1px; }
.pos-total-gs {
  background: linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: #ffffff;
  border: 3px solid var(--win-title);
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  font-family: var(--win-font-mono);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.2);
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.pos-btn {
  border: 1px solid var(--win-border-dark);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  font-family: var(--win-font-ui);
  background: linear-gradient(180deg, #ffffff 0%, #e9ecef 50%, #dee2e6 100%);
  color: var(--win-fg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.15s;
}
.pos-btn:hover { background: linear-gradient(180deg, #ffffff 0%, #f1f3f4 50%, #e8eaed 100%); box-shadow: 0 3px 8px rgba(0,0,0,0.12); transform: translateY(-1px); }
.pos-btn:active { background: linear-gradient(180deg, #dee2e6 0%, #e9ecef 100%); box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }

.pos-btn-red-dark {
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%), linear-gradient(180deg, var(--win-title) 0%, #2B1400 100%);
  color: white;
  border: 1px solid rgba(0,0,0,0.2);
  text-shadow: 0 1px 0 rgba(0,0,0,0.2);
}
.pos-btn-red-dark:hover { background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%), linear-gradient(180deg, var(--win-title) 0%, #2B1400 100%); }

.pos-btn-finalizar {
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%), linear-gradient(180deg, var(--win-title) 0%, #8A3800 100%);
  color: white;
  font-size: 14px;
  padding: 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
  transition: all 0.15s;
  cursor: pointer;
  width: 100%;
}
.pos-btn-finalizar:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.2); transform: translateY(-2px); }
.pos-btn-finalizar:active { background: linear-gradient(180deg, #8A3800 0%, #2B1400 100%); box-shadow: inset 0 3px 8px rgba(0,0,0,0.2); transform: translateY(1px); }
.pos-btn-finalizar .pos-btn-sub { font-size: 10px; color: rgba(255,255,255,0.75); font-weight: normal; }

.pos-sep { height: 3px; background: linear-gradient(90deg, transparent 0%, var(--win-title) 50%, transparent 100%); margin: 8px 0; border: none; opacity: 0.6; }

.busqueda-fac-row:hover { background: var(--blue-light) !important; cursor: pointer; }
.busqueda-fac-row-selected { background: var(--win-title) !important; color: #fff !important; }

.cliente-final-row:hover { background: var(--blue-light); }

/* ── Boton flotante de WhatsApp ── */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  z-index: 2000;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }
