/* Sinergia Visual Refresh 2026
   Capa de estilo global para modernizar interfaces sin tocar lógica. */

:root {
  --sg-bg-a: #f5eeff;
  --sg-bg-b: #ecdefe;
  --sg-surface: #ffffff;
  --sg-surface-2: #faf6ff;
  --sg-primary: #6a1b9a;
  --sg-primary-2: #7e35b7;
  --sg-primary-3: #4a148c;
  --sg-border: #dcc9f0;
  --sg-text: #261336;
  --sg-text-soft: #6e5a7f;
  --sg-success: #2e7d32;
  --sg-danger: #c62828;
  --sg-shadow-lg: 0 20px 45px rgba(74, 20, 140, 0.18);
  --sg-shadow-md: 0 10px 24px rgba(74, 20, 140, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Montserrat, "Segoe UI", Tahoma, sans-serif;
  color: var(--sg-text);
  background:
    radial-gradient(circle at 10% 5%, rgba(126, 53, 183, 0.24), transparent 34%),
    radial-gradient(circle at 93% 7%, rgba(106, 27, 154, 0.16), transparent 31%),
    linear-gradient(140deg, var(--sg-bg-a) 0%, var(--sg-bg-b) 100%);
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  color: var(--sg-primary-3);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.5rem);
  margin-top: 0.8rem;
  margin-bottom: 1rem;
}

.container,
main,
.content,
.wrapper,
.section,
.card,
.panel,
.box,
.modal-content,
.filtros-container,
.filters,
.toolbar,
.form-container,
.resumen-container {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 255, 0.94));
  border: 1px solid rgba(220, 201, 240, 0.85);
  border-radius: 16px;
  box-shadow: var(--sg-shadow-md);
}

button,
.btn,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  background: linear-gradient(135deg, var(--sg-primary) 0%, var(--sg-primary-2) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(106, 27, 154, 0.22);
  transition: transform 0.16s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgba(106, 27, 154, 0.28);
}

button:active,
.btn:active {
  transform: translateY(0);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  color: var(--sg-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #a67ace;
  box-shadow: 0 0 0 4px rgba(106, 27, 154, 0.12);
}

a {
  color: var(--sg-primary);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--sg-primary-3);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sg-shadow-md);
}

th {
  background: linear-gradient(135deg, #6a1b9a 0%, #8b49bf 100%);
  color: #fff;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

th,
td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(220, 201, 240, 0.72);
}

tbody tr:nth-child(even) {
  background: #fbf8ff;
}

tbody tr:hover {
  background: #f3ebff;
}

/* Tabulator */
.tabulator {
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--sg-shadow-lg);
}

.tabulator .tabulator-header {
  background: linear-gradient(135deg, #6a1b9a, #8e44ad);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.tabulator .tabulator-row:nth-child(even) {
  background: #fbf8ff;
}

.tabulator .tabulator-footer {
  background: #f7efff;
  border-top: 1px solid var(--sg-border);
}

/* Sidebar */
.sidebar {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #7c2eb2 0%, #5e178f 46%, #461070 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 10px 0 30px rgba(42, 8, 70, 0.3);
}

.sidebar a {
  border-radius: 10px;
  margin: 2px 10px;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.17);
  transform: translateX(4px);
}

.openbtn,
#openSidebarBtn {
  background: linear-gradient(135deg, #7e57c2, #6a1b9a);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(64, 18, 103, 0.34);
}

/* Badges / estados comunes */
.estado-ok,
.badge-ok,
.success {
  color: var(--sg-success);
  font-weight: 700;
}

.estado-error,
.badge-error,
.error {
  color: var(--sg-danger);
  font-weight: 700;
}

/* SweetAlert */
.swal2-popup {
  border-radius: 16px;
  border: 1px solid var(--sg-border);
  box-shadow: var(--sg-shadow-lg);
}

.swal2-confirm {
  background: linear-gradient(135deg, var(--sg-primary), var(--sg-primary-2)) !important;
  border: none !important;
  border-radius: 10px !important;
}

/* Animaciones sutiles */
@keyframes sgFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container,
main,
.section,
.card,
.panel,
.modal-content,
.filtros-container,
.tabulator,
table {
  animation: sgFadeUp 320ms ease both;
}

@media (max-width: 900px) {
  .container,
  main {
    padding-left: 12px;
    padding-right: 12px;
  }

  button,
  .btn,
  input[type="button"],
  input[type="submit"] {
    width: 100%;
    max-width: none;
  }

  .modal-content,
  .filtros-container,
  .section,
  .card,
  .panel {
    border-radius: 12px;
  }
}

/* Capa extra para pantallas con estilos inline heredados */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%),
    radial-gradient(circle at 50% 120%, rgba(106, 27, 154, 0.08), transparent 38%);
  pointer-events: none;
  z-index: -1;
}

header,
.topbar,
.hero,
.hero-section,
.banner,
.encabezado,
.header {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #6a1b9a 0%, #7e35b7 52%, #4a148c 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--sg-shadow-lg);
}

.login-container,
.auth-card,
.form-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 244, 255, 0.96)) !important;
  border: 1px solid rgba(220, 201, 240, 0.9) !important;
  border-radius: 22px !important;
  box-shadow: 0 26px 60px rgba(74, 20, 140, 0.2) !important;
  backdrop-filter: blur(6px);
}

.login-container h1,
.login-container h2,
.login-container h3 {
  color: var(--sg-primary-3) !important;
}

.login-container input,
.login-container select,
.login-container textarea {
  min-height: 46px;
}

.sound-btn,
.cta-button,
.primary-action {
  background: linear-gradient(135deg, #6a1b9a, #8d47c4) !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 30px rgba(74, 20, 140, 0.3) !important;
}

.modal-content,
.modal-dialog,
.swal2-popup,
.dialog,
.popup {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 255, 0.95)) !important;
  border: 1px solid rgba(220, 201, 240, 0.9) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 48px rgba(74, 20, 140, 0.18) !important;
}

.toolbar,
.filters,
.filtros-container,
.acciones,
.acciones-barra,
.search-bar {
  padding: 16px !important;
  gap: 12px !important;
}

.tabulator .tabulator-header .tabulator-col,
th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.tabulator-row,
tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.tabulator-row:hover,
tbody tr:hover {
  transform: translateY(-1px);
}

.card,
.panel,
.section,
.box,
.kpi,
.stat-card,
.metric-card {
  position: relative;
  overflow: hidden;
}

.card::before,
.panel::before,
.section::before,
.box::before,
.kpi::before,
.stat-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #6a1b9a, #ad7dd7);
}

.sidebar a,
nav a,
.menu a {
  font-weight: 600;
}

@media (min-width: 901px) {
  .login-container {
    padding: 34px !important;
  }

  .toolbar,
  .filters,
  .filtros-container {
    border-radius: 18px !important;
  }
}
