/* ==========================================================================
   Eneon Dashboard — Pure SaaS Design System (Stripe / Linear / Vercel)
   Completely standalone: Zero dependency on Tailwind. Works with Bootstrap 5.
   ========================================================================== */

/* Canvas de fondo y ajuste de márgenes del layout */
.dashboard-shell {
  background-color: #f8fafc !important;
  min-height: 100vh;
}

.page-content.dashboard-shell {
  padding-top: calc(70px + 12px) !important; /* Más cercano al topbar superior */
  padding-left: 16px !important;
  padding-right: 16px !important;
  padding-bottom: 2rem !important;
}

@media (max-width: 768px) {
  .page-content.dashboard-shell {
    padding-top: calc(70px + 8px) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* Tipografía base */
.saas-title {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Tarjetas SaaS y Contenedores
   -------------------------------------------------------------------------- */
.saas-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.saas-card-hover:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
}

/* Cabecera integrada de tarjeta */
.saas-card-header {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.saas-card-body {
  padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   Badges de Iconos en Cabeceras
   -------------------------------------------------------------------------- */
.saas-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.saas-icon-badge.primary {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.saas-icon-badge.indigo {
  background-color: #eef2ff;
  color: #4f46e5;
  border: 1px solid #e0e7ff;
}

.saas-icon-badge.emerald {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #d1fae5;
}

.saas-icon-badge.rose {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #ffe4e6;
}

/* --------------------------------------------------------------------------
   Botones Estilo SaaS
   -------------------------------------------------------------------------- */
.saas-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff !important;
  background-color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.saas-btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.saas-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569 !important;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}

.saas-btn-outline:hover {
  background-color: #f8fafc;
  color: #0f172a !important;
  border-color: #cbd5e1;
}

.saas-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 0.35rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.saas-btn-ghost:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.saas-btn-ghost.is-danger:hover {
  background-color: #fef2f2;
  color: #ef4444;
}

/* --------------------------------------------------------------------------
   Cajas de Agrupación de Datos (Ficha de Cliente)
   Superficies blancas con bordes suaves para contraste limpio estilo SaaS
   -------------------------------------------------------------------------- */
.saas-section-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.95rem;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.02);
}

.saas-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Cuadrículas CSS Puras (sin depender de Tailwind) */
.saas-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1.25rem;
}

.saas-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem 1.25rem;
}

@media (max-width: 768px) {
  .saas-grid-2, .saas-grid-3 {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

.saas-grid-span-2 {
  grid-column: span 2 / span 2;
}

@media (max-width: 768px) {
  .saas-grid-span-2 {
    grid-column: span 1 / span 1;
  }
}

/* Campo Clave-Valor Minimalista con Contraste Fuerte */
.saas-kv {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.saas-kv-label {
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b; /* Slate 500 contrastado */
}

.saas-kv-value {
  font-size: 0.9125rem; /* ~14.5px */
  font-weight: 700;
  color: #0f172a; /* Slate 900 negro profundo */
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.35;
}

.saas-kv-value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.saas-kv-empty {
  color: #cbd5e1;
  font-style: italic;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Puntos de Suministro & CUPS Cards
   -------------------------------------------------------------------------- */
.saas-supply-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.02);
}

.saas-supply-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.saas-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.saas-action-btn:hover {
  background-color: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.saas-badge-status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px; /* rounded-full */
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
}

.saas-badge-status.active {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.saas-badge-status.suspended {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.saas-cups-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  margin-top: 0.45rem;
}

.saas-cups-pill.electric {
  background-color: #fefce8; /* Amarillo ultra-tenue */
  color: #854d0e;
  border: 1px solid #fef08a;
}

.saas-cups-pill.gas {
  background-color: #fff1f2; /* Carmesí ultra-tenue */
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.saas-copy-btn {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.saas-copy-btn:hover {
  opacity: 1;
}

/* Botón Añadir Punto al Final de la Lista */
.saas-add-item-btn {
  width: 100%;
  border: 1.5px dashed #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-top: 0.5rem;
}

.saas-add-item-btn:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.saas-toggle-more-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  transition: color 0.15s ease;
}

.saas-toggle-more-btn:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Menú Desplegable Flotante (...)
   -------------------------------------------------------------------------- */
.saas-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.saas-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: 170px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  padding: 0.25rem;
  z-index: 1050;
}

.saas-dropdown-btn {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.saas-dropdown-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.saas-dropdown-btn.danger {
  color: #e11d48;
}

.saas-dropdown-btn.danger:hover {
  background-color: #fff1f2;
  color: #be123c;
}

/* --------------------------------------------------------------------------
   Notas y Observaciones
   -------------------------------------------------------------------------- */
.saas-note-box {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Hero Bar del Cliente
   -------------------------------------------------------------------------- */
.saas-hero-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .saas-hero-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.saas-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
}

.saas-cif-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Tarjetas de Documentos y Contactos
   -------------------------------------------------------------------------- */
.saas-contact-card, .saas-bank-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  transition: all 0.15s ease-in-out;
}

.saas-contact-card:hover, .saas-bank-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

.saas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.25rem 1.5rem;
}

.saas-empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   SaaS Modal Design System (Stripe / Linear style)
   -------------------------------------------------------------------------- */
.saas-modal-dialog {
  max-width: 900px;
}

.saas-modal-dialog-sm {
  max-width: 520px;
}

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

.saas-modal-content {
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2) !important;
  overflow: hidden;
  background-color: #ffffff;
}

.saas-modal-header {
  padding: 1.15rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.saas-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.saas-modal-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-top: 0.15rem;
}

.saas-modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.saas-modal-close-btn:hover {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.saas-modal-body {
  padding: 1.5rem !important;
  background-color: #ffffff;
}

/* Segmented Tabs SaaS */
.saas-modal-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 4px;
  background-color: #f1f5f9;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.saas-modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.saas-modal-tab:hover {
  color: #0f172a;
}

.saas-modal-tab.active {
  background-color: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.saas-modal-tab-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background-color: #e2e8f0;
  color: #475569;
}

.saas-modal-tab.active .saas-modal-tab-badge {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* Form Controls SaaS */
.saas-form-group {
  margin-bottom: 1rem;
}

.saas-form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.saas-form-control,
.saas-form-select {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0.5rem 0.75rem !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  transition: all 0.15s ease-in-out !important;
  width: 100%;
}

.saas-form-control:focus,
.saas-form-select:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.saas-form-control.is-invalid,
.saas-form-select.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.saas-form-control:disabled,
.saas-form-control[readonly],
.saas-form-select:disabled {
  background-color: #f8fafc !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed;
}

/* Modal Footer SaaS */
.saas-modal-footer {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

/* Action button small in table */
.saas-action-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s ease-in-out;
}

.saas-action-btn-sm:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.saas-action-btn-sm.success:hover {
  background-color: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.saas-action-btn-sm.danger:hover {
  background-color: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

