/* Component Library: Cards, Badges, Buttons, Tables, Forms, Modals */

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-sky), transparent);
  opacity: 0.7;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stat-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.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-subtle);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-online {
  background: var(--status-online-bg);
  color: var(--status-online);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #025091);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}


/* Data Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: var(--table-th-bg);
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--table-hover-bg);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

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

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-sky);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  animation: slideToast 0.25s ease-out;
}

.toast.success { border-left-color: var(--status-online); }
.toast.danger { border-left-color: var(--status-danger); }

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Pagination Component Styles
   ========================================================================== */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.pagination-limit-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pagination-limit-select {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  width: auto;
  min-width: 60px;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-page-indicator {
  font-size: 0.82rem;
  color: var(--text-main);
  padding: 0 0.5rem;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Auth Modal & Login Styles
   ========================================================================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.1);
}

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

.demo-logins-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

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

.btn-demo-user {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-demo-user strong {
  color: var(--accent-sky);
}

.btn-demo-user:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-sky);
  color: #fff;
}

.user-profile {
  cursor: pointer;
  position: relative;
}

.btn-logout-header {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-logout-header:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Invoice Document & Receipt Styles (High Fidelity A4 & POS Thermal)
   ========================================================================== */

.modal-dialog.modal-dialog-xl {
  max-width: 880px;
}

.modal-dialog.modal-dialog-lg {
  max-width: 720px;
}

.invoice-preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.invoice-actions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.invoice-paper-doc {
  background: #ffffff;
  color: #0f172a;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.invoice-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.invoice-doc-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invoice-brand-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: -0.5px;
}

.invoice-brand-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.invoice-doc-meta {
  text-align: right;
}

.invoice-doc-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-mono);
}

.invoice-stamp-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  margin-top: 0.4rem;
}

.invoice-stamp-paid {
  background: #ecfdf5;
  color: #059669;
  border: 2px solid #059669;
}

.invoice-stamp-pending {
  background: #fffbeb;
  color: #d97706;
  border: 2px solid #d97706;
}

.invoice-stamp-overdue {
  background: #fef2f2;
  color: #dc2626;
  border: 2px solid #dc2626;
}

.invoice-stamp-canceled {
  background: #f1f5f9;
  color: #64748b;
  border: 2px solid #64748b;
}

.invoice-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.invoice-party-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

.invoice-party-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0284c7;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.invoice-party-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.invoice-party-detail {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.2rem;
}

.invoice-table-doc {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.invoice-table-doc th {
  background: #f1f5f9;
  color: #334155;
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #cbd5e1;
}

.invoice-table-doc td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.invoice-totals-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.invoice-totals-box {
  width: 320px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  color: #475569;
}

.invoice-total-row.grand-total {
  border-top: 2px solid #cbd5e1;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.invoice-bank-footer {
  border-top: 1px dashed #cbd5e1;
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.invoice-banks-list {
  font-size: 0.78rem;
  color: #475569;
}

.invoice-banks-list strong {
  color: #0f172a;
}

.invoice-qr-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

/* POS Thermal Receipt View (80mm) */
.invoice-pos-ticket {
  max-width: 340px;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  padding: 1.5rem 1rem;
  font-family: 'JetBrains Mono', monospace, Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  border: 1px dashed #cbd5e1;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.pos-header {
  text-align: center;
  border-bottom: 1px dashed #000;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.pos-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.pos-divider {
  border-top: 1px dashed #000;
  margin: 0.5rem 0;
}

.pos-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.pos-row.bold {
  font-weight: 800;
  font-size: 0.9rem;
}

.code-script-box {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  white-space: pre-wrap;
  max-height: 380px;
  overflow-y: auto;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   FACTURACIÓN ELECTRÓNICA e-CF / e-NCF (LEY 32-23 DGII)
   -------------------------------------------------------------------------- */
.ecf-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #065f46;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.ecf-security-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 800;
  color: #0f172a;
  font-size: 0.82rem;
}

.ecf-ncf-highlight {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.5px;
}

.ecf-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.ecf-qr-img {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 2px;
  background: #ffffff;
}

.ecf-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* --------------------------------------------------------------------------
   CONTRATO DE SERVICIO (A4 / PDF FORMAL)
   -------------------------------------------------------------------------- */
.contract-paper-doc {
  background: #ffffff;
  color: #0f172a;
  max-width: 840px;
  margin: 0 auto;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.contract-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.contract-brand-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: -0.5px;
}

.contract-brand-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.contract-number-badge {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-align: right;
  font-family: var(--font-mono);
}

.contract-doc-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  letter-spacing: 0.5px;
  margin: 1.25rem 0;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.contract-section {
  margin-bottom: 1.25rem;
}

.contract-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.3rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.contract-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}

.contract-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem 1rem;
}

.contract-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.contract-field-value {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 600;
}

.contract-tech-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.85rem;
  margin: 0.75rem 0;
}

.contract-clauses-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.74rem;
  color: #334155;
  line-height: 1.55;
  text-align: justify;
  max-height: 220px;
  overflow-y: auto;
}

.contract-clauses-box ol {
  padding-left: 1.2rem;
  margin: 0;
}

.contract-clauses-box li {
  margin-bottom: 0.45rem;
}

.contract-signatures-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
}

.contract-sig-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contract-sig-line {
  width: 80%;
  border-top: 1px solid #334155;
  margin: 2.5rem auto 0.4rem auto;
}

.contract-official-stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border: 2px dashed #0284c7;
  border-radius: 50%;
  color: #0284c7;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-8deg);
  margin-bottom: -15px;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   ORDEN DE INSTALACIÓN / TRABAJO TÉCNICA (OT FIELD WORK ORDER)
   -------------------------------------------------------------------------- */
.work-order-paper-doc {
  background: #ffffff;
  color: #0f172a;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.wo-checklist-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}

.wo-checklist-table th, .wo-checklist-table td {
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.wo-checklist-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

/* --------------------------------------------------------------------------
   MAPA & INTERACCIÓN CLIENTES
   -------------------------------------------------------------------------- */
.map-kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.map-kpi-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.custom-nap-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-client-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.custom-client-pin:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   NOC Real-Time WebSockets & Notifications Components
   ========================================================================== */

/* 1. NOC Live Status Badge */
.noc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
  user-select: none;
}

.noc-live-badge.status-connected {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.noc-live-badge.status-connecting {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.noc-live-badge.status-disconnected {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.live-dot.pulse {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 1.8s infinite;
}

.live-dot.spin {
  background: #f59e0b;
  animation: pulseYellow 1.2s infinite;
}

.live-dot.off {
  background: #ef4444;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseYellow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 2. Notification Dropdown Wrapper & Bell Button */
.notification-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-btn {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.notification-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--accent-sky);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 3. Notification Dropdown Panel */
.notification-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--bg-card-solid);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notification-panel-header {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.15);
}

.notif-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.notif-action-btn:hover {
  color: var(--accent-sky);
  background: var(--bg-hover);
}

.notification-panel-body {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notification-empty {
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
}

.notif-item {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.notif-item:hover {
  background: var(--bg-hover);
}

.notif-item.unread {
  background: rgba(56, 189, 248, 0.05);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-sky);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-input);
  color: var(--accent-sky);
}

.notif-item.success .notif-item-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.notif-item.warning .notif-item-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.notif-item.danger .notif-item-icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.notif-item.critical .notif-item-icon { background: rgba(239, 68, 68, 0.25); color: #ef4444; }

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.notif-item-msg {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.notif-item-meta {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.notification-panel-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

/* 4. Rich Floating Toasts */
.rich-toast {
  background: var(--bg-card-solid);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-sky);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 340px;
  max-width: 90vw;
  cursor: pointer;
  position: relative;
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s, box-shadow 0.2s;
}

.rich-toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.rich-toast.success { border-left-color: #10b981; }
.rich-toast.warning { border-left-color: #f59e0b; }
.rich-toast.danger, .rich-toast.critical { border-left-color: #ef4444; }

.rich-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.rich-toast.success .rich-toast-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.rich-toast.warning .rich-toast-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.rich-toast.danger .rich-toast-icon, .rich-toast.critical .rich-toast-icon { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.rich-toast.info .rich-toast-icon { background: rgba(56, 189, 248, 0.15); color: var(--accent-sky); }

.rich-toast-body {
  flex: 1;
  min-width: 0;
}

.rich-toast-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.rich-toast-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.rich-toast-time {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.rich-toast-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.15s;
}

.rich-toast-close:hover {
  color: var(--text-main);
}

@keyframes slideToastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideToastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ==========================================================================
   MARCA DE AGUA DEL SISTEMA & REGISTRO DE VERSIONES / MEJORAS (CHANGELOG)
   ========================================================================== */

@keyframes watermarkPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 6px #10b981); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.system-watermark {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 10020;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.28);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), 0 0 14px rgba(56, 189, 248, 0.15);
  cursor: pointer;
  user-select: none;
  opacity: 0.88;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

[data-theme="light"] .system-watermark {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 12px rgba(14, 165, 233, 0.15);
}

.system-watermark:hover,
.system-watermark:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 28px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.3);
  outline: none;
}

.watermark-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
}

.watermark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: watermarkPulse 2.5s infinite ease-in-out;
  flex-shrink: 0;
}

.watermark-brand {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}

[data-theme="light"] .watermark-brand {
  color: #0f172a;
}

.watermark-divider {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

[data-theme="light"] .watermark-divider {
  background: rgba(0, 0, 0, 0.15);
}

.watermark-version {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-sky);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.watermark-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 6px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.watermark-icon {
  width: 13px;
  height: 13px;
  color: #f59e0b;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.system-watermark:hover .watermark-icon {
  transform: rotate(20deg) scale(1.15);
}

/* Modal de Registro de Versiones y Mejoras */
.changelog-modal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.version-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .version-hero-card {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-color: rgba(14, 165, 233, 0.25);
}

.version-hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8, #10b981);
}

.version-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 280px;
}

.version-hero-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.version-hero-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.version-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.version-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.version-specs-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.version-spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-sans);
}

.version-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.version-release-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  transition: border-color var(--transition-fast);
}

.version-release-block.version-card-current {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

[data-theme="light"] .version-release-block.version-card-current {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(14, 165, 233, 0.35);
}

.version-release-header {
  margin-bottom: 1rem;
}

.version-tag-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.version-number {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

[data-theme="light"] .version-number {
  color: #0f172a;
}

.version-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.version-release-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.version-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.version-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.version-category-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

[data-theme="light"] .version-category-card {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.08);
}

.version-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-category-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.version-category-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.changelog-check-icon {
  width: 14px;
  height: 14px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
  .system-watermark {
    bottom: 12px;
    right: 12px;
  }
  .watermark-content {
    padding: 5px 10px;
    gap: 6px;
  }
  .watermark-brand {
    display: none;
  }
  .watermark-divider {
    display: none;
  }
  .version-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  .version-quick-actions {
    width: 100%;
    justify-content: stretch;
  }
  .version-quick-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .version-categories-grid {
    grid-template-columns: 1fr;
  }
}




