/* ==========================================================================
   DentalQuote PRO - Design System & Stylesheet (Tablet-First & Desktop)
   Clinical, Modern, Crisp, High-Contrast & Tactile
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-elevated: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Primary & Medical Accents */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;

  --teal-accent: #0d9488;
  --teal-light: #ccfbf1;

  --success: #10b981;
  --success-dark: #059669;
  --success-light: #d1fae5;

  --warning: #f59e0b;
  --warning-light: #fef3c7;

  --danger: #ef4444;
  --danger-light: #fee2e2;

  --whatsapp: #25d366;
  --whatsapp-hover: #1ebd5a;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Icons sizing defaults */
svg.lucide,
i[data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
  vertical-align: middle;
}

.icon-tiny {
  width: 15px !important;
  height: 15px !important;
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.navbar {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-container {
  background: #ffffff;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  padding: 4px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand-company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #38bdf8;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: block;
}

.badge-pro {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
}

/* Navbar Metrics: Tasa, Scanner, Seller */
.nav-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Rates Widget Container (BCV Dólar, BCV Euro, Binance USDT) */
.rates-widget-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

.rates-pills-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rate-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #f8fafc;
  font-family: inherit;
  outline: none;
  user-select: none;
}

.rate-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.rate-pill.active {
  background: rgba(14, 165, 233, 0.18);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35), inset 0 0 6px rgba(56, 189, 248, 0.15);
}

.rate-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.tag-bcv {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-eur {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.tag-binance {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.rate-pill-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.rate-pill.active .rate-pill-val {
  color: #38bdf8;
}

.btn-refresh-rates {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-refresh-rates:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-refresh-rates.spinning #iconRefreshRates {
  animation: spinRate 0.75s linear infinite;
}

@keyframes spinRate {
  100% { transform: rotate(360deg); }
}

.rates-time-text {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}

.tasa-active-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  padding-left: 0.65rem;
}

.tasa-active-legend {
  font-size: 0.7rem;
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
}

.tasa-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
  transition: border-color 0.2s;
}

.tasa-input-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.currency-prefix {
  font-size: 0.78rem;
  color: #38bdf8;
  font-weight: 700;
}

.tasa-input-wrap input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  width: 78px;
  text-align: right;
  outline: none;
}

/* Scanner Indicator */
.scanner-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
}

.status-pulse {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.scanner-icon {
  color: #34d399;
  width: 18px;
  height: 18px;
}

.status-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a7f3d0;
}

/* Seller Pill */
.seller-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.seller-pill:hover {
  background: rgba(255, 255, 255, 0.14);
}

.seller-avatar {
  background: #0284c7;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seller-avatar svg {
  width: 16px;
  height: 16px;
}

.seller-details {
  display: flex;
  flex-direction: column;
}

.seller-label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.seller-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.btn-icon-switch {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.btn-icon-switch:hover {
  color: #ffffff;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-body {
  padding: 1.25rem;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.tab-view {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Workspace Grid (Main 2 columns) */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.workspace-sidebar {
  position: sticky;
  top: 5rem;
}

/* ==========================================================================
   Cards & Panels
   ========================================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-icon {
  color: var(--primary);
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   1. Customer Search & Info Panel
   ========================================================================== */
.client-search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.cedula-input-group {
  display: flex;
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cedula-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.select-prefix {
  background: #f8fafc;
  border: none;
  border-right: 2px solid var(--border-color);
  padding: 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.input-cedula {
  flex: 1;
  border: none;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.client-info-display {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.client-badge-avatar {
  background: #10b981;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.client-info-details {
  flex: 1;
}

.client-name-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.client-fullname {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #065f46;
}

.badge-especialidad {
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.badge-cedula {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.client-meta-row {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: #047857;
  flex-wrap: wrap;
}

.client-meta-row span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Not Found Alert */
.client-not-found {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  gap: 1rem;
  margin-top: 0.75rem;
}

.client-not-found .alert-icon {
  color: #d97706;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.client-not-found .alert-content {
  flex: 1;
}

.client-not-found .alert-content strong {
  color: #92400e;
  font-size: 0.95rem;
  display: block;
}

.client-not-found .alert-content p {
  color: #b45309;
  font-size: 0.85rem;
}

/* ==========================================================================
   2. Barcode Scanning Toolbar (Tactile & Fast)
   ========================================================================== */
.scanner-toolbar-card {
  background: #0f172a;
  color: #ffffff;
  padding: 1rem 1.25rem;
  border-color: #1e293b;
}

.scanner-input-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.scanner-input-wrap {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 2px solid #38bdf8;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.85rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.scanner-input-wrap:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.45);
}

.scanner-icon-pulse {
  color: #38bdf8;
  margin-right: 0.6rem;
  display: flex;
  align-items: center;
}

.input-barcode {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
}

.input-barcode::placeholder {
  color: #64748b;
  font-size: 0.95rem;
}

.btn-clear-input {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.btn-clear-input:hover {
  color: #ffffff;
}

.scanner-tools {
  display: flex;
  gap: 0.5rem;
}

.btn-tool {
  background: #334155;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-tool:hover {
  background: #475569;
}

.scan-feedback-banner {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #a7f3d0;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   3. Items Table & Touch Counters
   ========================================================================== */
.table-currency-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.switch-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.currency-toggle-group {
  display: flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: var(--radius-md);
}

.btn-curr-toggle {
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.btn-curr-toggle.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.items-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.85rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.items-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  vertical-align: middle;
}

.items-table tr:hover {
  background-color: #f8fafc;
}

/* Table Item Elements */
.item-desc-cell {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 600;
  color: var(--text-main);
}

.item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
}

.item-barcode-tag {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Currency selector per item */
.item-currency-select {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: #f0fdf4;
  outline: none;
  cursor: pointer;
}

/* Quantity Touch Control (+ / -) */
.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 2px;
  width: 120px;
  margin: 0 auto;
}

.btn-step {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: #ffffff;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.btn-step:active {
  background: var(--primary);
  color: white;
  transform: scale(0.95);
}

.qty-input {
  width: 48px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 1.05rem;
  outline: none;
}

/* Item Discount Input */
.item-discount-input {
  width: 65px;
  text-align: center;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  outline: none;
}

.item-subtotal-cell {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.subtotal-primary {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
}

.subtotal-secondary {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-delete-row {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-delete-row:hover {
  background: #ef4444;
  color: white;
}

/* Empty Cart State */
.empty-cart-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.empty-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.empty-icon-wrap svg {
  width: 34px;
  height: 34px;
}

.empty-cart-state h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-cart-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Sidebar: Totals, Discounts & Tactile Action Buttons
   ========================================================================== */
.totals-card {
  background: #ffffff;
  border-top: 4px solid var(--primary);
}

.correlativo-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #334155;
}

.totals-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.total-label {
  color: var(--text-muted);
  font-weight: 600;
}

.total-values {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.val-usd {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.05rem;
}

.val-bs {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Discount Block */
.discount-block {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.discount-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.discount-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.max-seller-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.discount-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-discount {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  outline: none;
}

.discount-addon {
  font-weight: 700;
  color: var(--text-muted);
}

.btn-supervisor-unlock {
  background: #e2e8f0;
  color: #475569;
  border: none;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-supervisor-unlock.unlocked {
  background: #10b981;
  color: white;
}

.discount-amount-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 600;
}

/* IVA Toggle */
.iva-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-right: 0.5rem;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.iva-label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.iva-amount-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.divider-totals {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

/* Highlighted Final Totals */
.total-highlight-row {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.usd-highlight {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.usd-highlight .highlight-currency {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38bdf8;
  display: block;
}

.usd-highlight .highlight-note {
  font-size: 0.72rem;
  color: #94a3b8;
}

.usd-highlight .highlight-amount {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

.bs-highlight {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1.5px solid #a7f3d0;
  color: #065f46;
}

.bs-highlight .highlight-currency {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #047857;
  display: block;
}

.bs-highlight .highlight-note {
  font-size: 0.72rem;
  color: #059669;
}

.bs-highlight .highlight-amount {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #065f46;
}

/* Notes Block */
.notes-block {
  margin-top: 0.5rem;
}

.notes-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.input-notes {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  resize: none;
}

/* Tactile Action Buttons */
.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-touch-large {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-action-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-action-primary:active {
  transform: translateY(1px);
}

.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.btn-action-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-color);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-secondary:hover {
  background: #e2e8f0;
}

.btn-action-whatsapp {
  background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-hover));
  color: #ffffff;
  border: none;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
}

.btn-action-whatsapp:hover {
  background: #1ebd5a;
  transform: translateY(-1px);
}

.btn-action-share {
  background: #6366f1;
  color: #ffffff;
  border: none;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.btn-action-share:hover {
  background: #4f46e5;
}

.btn-action-success {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-pill-subtle {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: #475569;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-pill-subtle:hover {
  background: #e2e8f0;
}

.btn-reset-quote {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  cursor: pointer;
}

.btn-reset-quote:hover {
  color: var(--danger);
}

/* ==========================================================================
   Full Tab Views (Historial, Catálogo, Clientes, Config)
   ========================================================================== */
.full-tab-card {
  min-height: 600px;
}

.history-filters,
.catalog-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  min-width: 260px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

.badge-status-done {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Settings & Upload */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1000px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card .settings-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-help {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.upload-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.upload-icon {
  background: #e0f2fe;
  color: #0284c7;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-info {
  flex: 1;
}

.upload-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.upload-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-file-upload {
  background: #0284c7;
  color: white;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.demo-data-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-info strong {
  display: block;
  color: #166534;
}

.demo-info span {
  font-size: 0.82rem;
  color: #15803d;
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-card.modal-compact {
  max-width: 420px;
}

.modal-card.modal-large {
  max-width: 820px;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-title h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-icon {
  color: var(--primary);
}

.modal-icon.icon-warning {
  color: var(--warning);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-form,
.modal-body {
  padding: 1.25rem;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-cancel {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: #475569;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

/* Supervisor Keypad */
.pin-input-wrap {
  margin-bottom: 1rem;
}

.pin-input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.8em;
  font-size: 1.8rem;
  font-weight: 800;
  padding: 0.65rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.btn-key {
  height: 58px;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-key:active {
  background: var(--primary);
  color: white;
  transform: scale(0.96);
}

.btn-key.key-clear {
  color: var(--danger);
  font-weight: 800;
}

.btn-key.key-enter {
  background: #10b981;
  color: white;
  border-color: #059669;
}

/* Vendedor Selection Grid */
.vendedores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-seller-card {
  padding: 1rem;
  border: 2px solid var(--border-color);
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-seller-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.custom-vendedor-row {
  display: flex;
  gap: 0.5rem;
}

.custom-vendedor-row input {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* Modal Search Large */
.search-box-large {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f1f5f9;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-box-large input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 1.05rem;
  outline: none;
}

.modal-results-scroll {
  max-height: 420px;
  overflow-y: auto;
}

/* Preview Modal */
.preview-body {
  padding: 1.5rem;
  background: #ffffff;
  font-size: 0.92rem;
}

.preview-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: slideInRight 0.25s ease forwards;
  max-width: 360px;
}

.toast.toast-success {
  border-left: 4px solid #10b981;
}

.toast.toast-error {
  border-left: 4px solid #ef4444;
}

.toast.toast-info {
  border-left: 4px solid #0284c7;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Seller Profile & Cards
   ========================================================================== */
.seller-active-quote-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  gap: 0.65rem;
}

.seller-quote-icon {
  background: #10b981;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seller-quote-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.seller-quote-label {
  font-size: 0.7rem;
  color: #047857;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.seller-quote-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #065f46;
}

.btn-change-seller-inline {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-change-seller-inline:hover {
  background: #10b981;
  color: #ffffff;
}

.seller-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.4rem;
}

.btn-seller-card.active .seller-card-avatar {
  background: #0284c7;
  color: #ffffff;
}

.seller-table-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 9px;
  border-radius: var(--radius-full);
}

.badge-vendedor-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* Item Code Badge in Quote Table */
.item-code-badge {
  font-family: monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Edit Mode Banner */
.edit-mode-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: slideDown 0.25s ease;
}

.edit-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.edit-icon {
  color: #b45309;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.edit-mode-banner strong {
  font-size: 1rem;
  color: #92400e;
  display: block;
}

#editQuoteNumberBadge {
  background: #92400e;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

.edit-banner-sub {
  font-size: 0.82rem;
  color: #b45309;
}

.btn-cancel-edit {
  background: #ffffff;
  border: 1.5px solid #d97706;
  color: #b45309;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-cancel-edit:hover {
  background: #d97706;
  color: #ffffff;
}

.btn-action-edit {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}

.btn-action-edit:hover {
  background: #b45309;
  transform: translateY(-1px);
}

/* Facturación & Bloqueo de Presupuestos */
.badge-status-facturado {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.btn-action-bill {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  color: #047857;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-action-bill:hover {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-action-locked {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #64748b;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-action-locked:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.billed-lock-banner {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.billed-lock-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.billed-lock-banner-left .lock-icon {
  width: 32px;
  height: 32px;
  color: #15803d;
  background: #ffffff;
  padding: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.billed-lock-banner strong {
  color: #14532d;
  font-size: 0.95rem;
  display: block;
}

.billed-lock-banner span {
  color: #15803d;
  font-size: 0.82rem;
}

.btn-reopen-bill {
  background: #ffffff;
  border: 1.5px solid #f87171;
  color: #dc2626;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-reopen-bill:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ============================================================ */
/* LOGIN OVERLAY & SESSION MANAGEMENT                           */
/* ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #0f172a 0%, #020617 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
}

.login-logo-wrap {
  display: inline-flex;
  padding: 8px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.login-brand-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.2rem 0;
  letter-spacing: -0.02em;
}

.login-company-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.login-prompt {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

/* User Selection Grid */
.login-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.user-card-login {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.user-card-login:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: #f0fdf4;
}

.user-card-login.selected {
  border-color: var(--primary);
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.user-card-login.admin-card.selected {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.user-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.user-card-login strong {
  font-size: 0.95rem;
  color: var(--text-main);
  display: block;
}

.user-role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-pill-facturador {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.role-pill-ejecutivo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* PIN section */
.login-pin-section {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selected-user-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.selected-user-indicator i {
  color: var(--primary);
  width: 24px;
  height: 24px;
}

.selected-user-indicator .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.selected-user-indicator strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

.selected-user-indicator .role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
}

.pin-entry-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pin-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.pin-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.pin-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pin-input-box input {
  width: 160px;
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  font-family: monospace;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
}

.btn-clear-pin {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-pin:hover {
  background: #fee2e2;
  color: #dc2626;
}

.pin-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Touch Keypad */
.login-keypad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 0.65rem;
}

.btn-login-key {
  height: 52px;
  font-size: 1.35rem;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-login-key:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-login-key:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

.btn-login-key.key-clear {
  color: #dc2626;
  font-size: 1.1rem;
}

.btn-login-key.key-backspace {
  color: #b45309;
  font-size: 1.2rem;
}

.btn-login-submit {
  width: 100%;
  max-width: 280px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-login-submit:active {
  transform: translateY(0);
}

/* Nav Session & Logout */
.btn-nav-logout {
  background: #fee2e2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-nav-logout:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.user-role-badge-nav {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.user-role-badge-nav.badge-facturador {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.user-role-badge-nav.badge-ejecutivo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}