@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

/* --------------------------------------------------------------
   Global theme
-------------------------------------------------------------- */
:root {
  --color-bg: #020b1f;
  --color-bg-alt: #08142d;
  --color-surface: rgba(10, 20, 45, 0.82);
  --color-surface-strong: rgba(14, 28, 63, 0.92);
  --color-surface-soft: rgba(9, 18, 39, 0.68);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-heading: #f1f6ff;
  --color-text: rgba(222, 233, 255, 0.92);
  --color-muted: rgba(169, 192, 230, 0.72);
  --color-accent: #00f2ff;
  --color-accent-alt: #47ffd9;
  --color-highlight: #4d7cff;
  --color-danger: #ff667a;
  --color-warning: #ffb35c;
  --shadow-xl: 0 40px 85px -40px rgba(6, 18, 70, 0.8);
  --shadow-lg: 0 32px 60px -32px rgba(0, 10, 40, 0.7);
  --shadow-md: 0 18px 36px -22px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 10px 22px -16px rgba(0, 0, 0, 0.45);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --blur-strong: saturate(220%) blur(28px);
  --blur-light: saturate(180%) blur(20px);
  --font-base: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --container-width: min(1300px, calc(100% - 48px));
  --side-nav-width: 340px;
  --nav-shift-offset: 0px;
  --transition: all 0.25s ease;
  --transition-slow: all 0.45s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100%;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar global - WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(2, 11, 31, 0.4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.6), rgba(71, 255, 217, 0.5));
  border-radius: 10px;
  border: 2px solid rgba(2, 11, 31, 0.4);
  box-shadow: 0 0 8px rgba(0, 242, 255, 0.3), inset 0 0 4px rgba(71, 255, 217, 0.2);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.85), rgba(71, 255, 217, 0.8));
  box-shadow: 0 0 16px rgba(0, 242, 255, 0.5), inset 0 0 6px rgba(71, 255, 217, 0.3);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body::before {
  top: -30%;
  right: -15%;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.35) 0%, rgba(0, 138, 255, 0.05) 60%, transparent 75%);
  filter: blur(12px);
}

body::after {
  bottom: -25%;
  left: -18%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(71, 255, 217, 0.32) 0%, rgba(4, 14, 40, 0.1) 65%, transparent 80%);
  filter: blur(18px);
}

main,
.header,
.footer,
.container,
.portal-layout,
.login-page {
  position: relative;
  z-index: 1;
}

main {
  flex: 1 0 auto;
  display: flex;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

a:hover {
  color: var(--color-highlight);
}

p {
  margin: 0;
  color: var(--color-text);
  font-size: 0.98rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 2.8vw, 3rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.18;
}

h3 {
  font-size: clamp(1.25rem, 1.5vw, 1.6rem);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.container {
  width: var(--container-width);
  margin: 80px auto 0;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  transform: translateX(var(--nav-shift-offset));
  flex: 1 0 auto;
}

.header {
  width: var(--container-width);
  margin: 32px auto 0;
  padding: 18px clamp(22px, 4vw, 34px);
  border-radius: var(--radius-xl);
  background: linear-gradient(130deg, rgba(5, 16, 42, 0.88) 0%, rgba(9, 26, 63, 0.72) 55%, rgba(14, 32, 71, 0.65) 100%);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-strong);
  top: 24px;
  transition: var(--transition-slow);
  transform: translateX(var(--nav-shift-offset));
}

/* --------------------------------------------------------------
   Side navigation
-------------------------------------------------------------- */
.side-nav-toggle {
  position: fixed;
  left: 18px;
  top: 26px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  min-width: 130px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.08), rgba(71, 255, 217, 0.2));
  color: var(--color-heading);
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--blur-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1;
}

.side-nav-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 242, 255, 0.32);
}

.side-nav-toggle .burger {
  position: relative;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}

.side-nav-toggle .burger::before,
.side-nav-toggle .burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

.side-nav-toggle .burger::before {
  top: -6px;
}

.side-nav-toggle .burger::after {
  top: 6px;
}

.side-nav-toggle span.label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--side-nav-width);
  z-index: 140;
  pointer-events: none;
  height: 100vh;
}

.side-nav-edge {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 100vh;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 200;
  opacity: 0;
  transition: var(--transition-slow);
}

.side-nav-edge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(-85%);
  transition: var(--transition-slow);
}

body.nav-open .side-nav-edge,
body.nav-shift .side-nav-edge {
  display: none;
}

.side-nav-edge:hover {
  opacity: 1;
}

.side-nav-edge:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.side-nav-panel {
  width: 100%;
  height: 100%;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-lg);
  padding: 90px 18px 24px;
  transform: translateX(-110%);
  transition: var(--transition-slow);
  pointer-events: auto;
  backdrop-filter: var(--blur-light);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) rgba(14, 28, 63, 0.4);
}

.side-nav-panel::-webkit-scrollbar {
  width: 8px;
}

.side-nav-panel::-webkit-scrollbar-track {
  background: rgba(14, 28, 63, 0.4);
  border-radius: 10px;
}

.side-nav-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.5), rgba(71, 255, 217, 0.4));
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.15);
}

.side-nav.is-open {
  pointer-events: auto;
}

.side-nav.is-open .side-nav-panel {
  transform: translateX(0);
}

.side-nav.is-pinned {
  pointer-events: auto;
}

.side-nav.is-pinned .side-nav-panel {
  box-shadow: var(--shadow-md);
}

.side-nav-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.side-nav-header h4 {
  font-size: 1rem;
  margin: 0;
  letter-spacing: 0.02em;
}

.side-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav-list li {
  width: 100%;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.side-nav-link small {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.side-nav-link .bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-strong);
  box-shadow: 0 0 0 6px rgba(0, 242, 255, 0.06);
  transition: var(--transition);
  flex-shrink: 0;
}

.side-nav-link:hover {
  background: rgba(0, 242, 255, 0.08);
  color: var(--color-heading);
  border-color: rgba(0, 242, 255, 0.16);
}

.side-nav-link:hover .bullet {
  background: var(--color-accent);
  box-shadow: 0 0 0 8px rgba(0, 242, 255, 0.1);
}

.side-nav-link.is-active {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.14), rgba(77, 124, 255, 0.12));
  color: var(--color-heading);
  border-color: rgba(0, 242, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(0, 242, 255, 0.12);
}

.side-nav-link.is-active .bullet {
  background: var(--color-accent);
  box-shadow: 0 0 0 10px rgba(0, 242, 255, 0.14);
}

.side-nav-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(0, 242, 255, 0.08), rgba(2, 11, 31, 0.88));
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-slow);
  z-index: 130;
}

.side-nav-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

.section-hidden {
  display: none !important;
}

body.no-side-nav .header,
body.no-side-nav .container,
body.no-side-nav .footer {
  transform: none;
}

body.no-side-nav .portal-layout {
  margin-left: auto;
  margin-right: auto;
}

body.login-page.no-side-nav {
  justify-content: center;
  align-items: center;
}

/* Portal pages always centered */
.portal-layout {
  margin-left: auto;
  margin-right: auto;
}

/* Shift content when nav is visible */
body.nav-shift {
  --nav-shift-offset: calc(var(--side-nav-width) / 2);
}

@media (max-width: 768px) {
  .side-nav-toggle {
    top: 18px;
    left: 12px;
  }

  .side-nav {
    top: 0;
  }

  .side-nav-panel {
    width: calc(100vw - 60px);
    max-width: 340px;
    padding-top: 96px;
  }
}

@media (min-width: 1100px) {
  .side-nav {
    top: 0;
  }

  .side-nav-backdrop {
    display: none;
  }

  .side-nav-toggle.is-hidden {
    opacity: 0;
    pointer-events: none;
  }

  .side-nav.is-pinned .side-nav-panel {
    transform: translateX(0);
  }
}

.header .brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.12), rgba(0, 102, 255, 0.48));
  border: 1px solid rgba(0, 168, 255, 0.28);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 0 14px rgba(0, 252, 255, 0.18);
}

.brand-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-heading .panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
}

.brand-heading .panel-name {
  font-size: 1.65rem;
  color: var(--color-heading);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 242, 255, 0.12);
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(0, 242, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.8);
}

.footer {
  width: var(--container-width);
  margin: 0 auto 8px;
  margin-bottom: 0px;
  margin-top: 50px;
  border-radius: var(--radius-xl);
  padding: 22px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--color-muted);
  background: rgba(6, 16, 42, 0.5);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--blur-light);
  transition: var(--transition-slow);
  transform: translateX(var(--nav-shift-offset));
}

.footer span {
  color: var(--color-accent);
  font-weight: 600;
}

.btn,
button,
input[type="button"],
input[type="submit"] {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font-base);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #04132f;
  background: linear-gradient(120deg, var(--color-accent) 0%, #008cff 100%);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after,
button::after,
input[type="button"]::after,
input[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.32), transparent 58%);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:hover::after,
button:hover::after,
input[type="button"]:hover::after,
input[type="submit"]:hover::after {
  opacity: 1;
}

.btn:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-compact,
button.btn-compact {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
}

.btn-ghost,
button.btn-ghost {
  background: rgba(5, 16, 42, 0.6);
  color: var(--color-heading);
  border: 1px solid rgba(0, 242, 255, 0.2);
  box-shadow: inset 0 0 16px rgba(0, 242, 255, 0.12);
}

.btn-ghost::after {
  display: none;
}

.btn-ghost:hover {
  background: rgba(5, 16, 42, 0.85);
  border-color: rgba(0, 242, 255, 0.36);
  color: var(--color-accent);
}

.btn-secundario,
button.btn-secundario {
  background: linear-gradient(120deg, rgba(77, 124, 255, 0.14), rgba(0, 242, 255, 0.1));
  border: 1px solid rgba(77, 124, 255, 0.32);
  color: var(--color-heading);
  box-shadow: none;
}

.btn-secundario:hover {
  background: linear-gradient(120deg, rgba(77, 124, 255, 0.28), rgba(0, 242, 255, 0.16));
}

.btn-rojo,
button.btn-rojo {
  background: linear-gradient(120deg, rgba(255, 102, 122, 0.92), rgba(255, 72, 118, 0.85));
  color: #fff;
  box-shadow: 0 16px 35px -18px rgba(255, 75, 110, 0.55);
}

.btn-rojo:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 40px -18px rgba(255, 75, 110, 0.7);
}

.btn-caducar {
  width: 100px;
  margin: 5%;
}

.btn-borrar {
  width: 100px;
  margin: 5%;
}

#btnFiltrar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 242, 255, 0.14);
  border: 1px solid rgba(0, 242, 255, 0.22);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-alt);
  box-shadow: 0 0 8px rgba(71, 255, 217, 0.8);
}

form {
  display: grid;
  gap: 18px;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(5, 14, 34, 0.75);
  color: var(--color-heading);
  font-family: var(--font-base);
  font-size: 0.98rem;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: rgba(180, 198, 232, 0.55);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 242, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.12);
  outline: none;
}

select {
  appearance: none;
  background-image: linear-gradient(135deg, rgba(71, 255, 217, 0.28), rgba(0, 242, 255, 0.18));
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1px 100%;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.form-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 6px;
}

.status-message {
  min-height: 1.2rem;
  color: var(--color-heading);
  font-weight: 500;
}

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.categoria-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(5, 14, 34, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.categoria-item input {
  width: 18px;
  height: 18px;
}

section {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-light);
  overflow: hidden;
  position: relative;
}

section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(71, 255, 217, 0.06), rgba(0, 242, 255, 0) 55%);
  pointer-events: none;
}

section>* {
  position: relative;
  z-index: 2;
}

section>h2,
section>h3 {
  margin-bottom: 12px;
}

section>p {
  color: var(--color-muted);
  margin-bottom: 20px;
}

.panel {
  background: var(--color-surface-strong);
  border-color: var(--color-border-strong);
  overflow: hidden;
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: center;
  padding: clamp(32px, 4vw, 48px);
  background: linear-gradient(120deg, rgba(5, 20, 52, 0.95) 10%, rgba(0, 76, 140, 0.7) 65%, rgba(4, 20, 46, 0.85) 100%);
  border: 1px solid rgba(0, 242, 255, 0.22);
  box-shadow: var(--shadow-xl);
  min-height: 630px;
}
.hero-card .hero-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-card .hero-text p {
  color: rgba(211, 228, 255, 0.82);
  font-size: 1rem;
}

.hero-card .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  position: relative;
  min-height: 100%;
  width: 90%;
  justify-content: center;
  border-radius: 32px;
  overflow: hidden;
  margin: 0 auto;
  margin-left: 45px;

  /* ✅ Imagen principal */
  background: url('../assets/img/telecom_hero.webp') center/cover no-repeat;
}

/* ✨ Brillo superior */
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: radial-gradient(circle at top, rgba(0, 242, 255, 0.3), rgba(0, 242, 255, 0) 70%);
  filter: blur(60px);
  z-index: 2;
  pointer-events: none;
}

/* 🔷 Marco translúcido */
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 28px;
  background: rgba(6, 24, 60, 0.35);
  border: 1px solid rgba(0, 242, 255, 0.25);
  box-shadow: inset 0 0 22px rgba(0, 242, 255, 0.15);
  z-index: 4;
  /* ← elevado para quedar sobre las estrellas */
  pointer-events: none;
}

/* 🌠 Capa de estrellas */
.hero-visual .stars {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 3;
  /* Entre before (2) y after (4) */
  pointer-events: none;
}

/* ✨ Estrellas */
.hero-visual .star {
  position: absolute;
  bottom: -5px;
  width: 3px;
  height: 3px;
  background: #00f2ff;
  border-radius: 50%;
  opacity: 0;
  animation: rise var(--dur, 5s) ease-in-out infinite;
  box-shadow: 0 0 6px #00f2ff, 0 0 12px rgba(0, 242, 255, 0.6);
}

/* 🌌 Movimiento vertical visible */
@keyframes rise {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  70% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-180px);
    /* 👈 movimiento real en píxeles visibles */
    opacity: 0;
  }
}


.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-top: none;
}

#btnAddNFCStatus {
  margin: none;
}

.insight-item {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(4, 16, 42, 0.6);
  border: 1px solid rgba(0, 242, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.insight-item span, strong{
  text-align: center;
}

.insight-item strong {
  font-size: 1.4rem;
  color: var(--color-heading);
}

.insight-item span {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

thead {
  background: linear-gradient(135deg, rgba(0, 76, 140, 0.48), rgba(0, 242, 255, 0.2));
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.95rem;
}

th {
  font-weight: 600;
  color: rgba(226, 238, 255, 0.95);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:nth-child(odd) {
  background: rgba(5, 14, 35, 0.55);
}

tbody tr:nth-child(even) {
  background: rgba(4, 12, 30, 0.65);
}

tbody tr:hover {
  transform: translateY(-2px);
  background: rgba(0, 242, 255, 0.08);
}

tbody td {
  color: rgba(213, 227, 255, 0.9);
}

tbody td a {
  color: var(--color-accent);
}

tbody td a:hover {
  color: var(--color-highlight);
}

tbody td button {
  margin-right: 8px;
}

tbody td button:last-child {
  margin-right: 0;
}

.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabla-responsive {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tabla-responsive table {
  min-width: 1024px;
  table-layout: auto;
}

.pagination-controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.pagination-controls button {
  min-width: 42px;
  padding: 8px 14px;
}

@media (max-width: 1100px) {
  .tabla-responsive {
    overflow-x: visible;
  }

  #tablaIncidencias thead,
  #tablaIncidenciasProveedor thead {
    display: none;
  }

  #tablaIncidencias tbody,
  #tablaIncidenciasProveedor tbody {
    display: grid;
    gap: 18px;
  }

  #tablaIncidencias tr,
  #tablaIncidenciasProveedor tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 18px;
    padding: 18px;
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 18px;
    background: rgba(4, 13, 33, 0.75);
  }

  #tablaIncidencias td,
  #tablaIncidenciasProveedor td {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  #tablaIncidencias td::before,
  #tablaIncidenciasProveedor td::before {
    content: attr(data-label);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(180, 198, 232, 0.7);
  }

  #tablaIncidencias .cell-scroll,
  #tablaIncidenciasProveedor .cell-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  #tablaIncidencias .btn,
  #tablaIncidencias button:not(.info-trigger),
  #tablaIncidenciasProveedor .btn,
  #tablaIncidenciasProveedor button:not(.info-trigger) {
    width: 100%;
    justify-content: center;
  }
}

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.filtros label {
  margin-right: 8px;
}

#tablaIncidencias select option {
  background-color: rgba(5, 14, 34, 0.75);
  color: white;
}

.cell-scroll {
  display: block;
  max-height: 90px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.5) rgba(2, 11, 31, 0.3);
}

.cell-scroll::-webkit-scrollbar {
  width: 8px;
}

.cell-scroll::-webkit-scrollbar-track {
  background: rgba(2, 11, 31, 0.3);
  border-radius: 10px;
}

.cell-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.6), rgba(71, 255, 217, 0.5));
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 242, 255, 0.12);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-danger {
  background: rgba(255, 102, 122, 0.16);
  color: var(--color-danger);
}

.badge-success {
  background: rgba(71, 255, 217, 0.16);
  color: var(--color-accent-alt);
}

.badge-neutral {
  background: rgba(77, 124, 255, 0.16);
  color: var(--color-highlight);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.form-inline>* {
  flex: 1 1 180px;
}

.form-inline button {
  flex: none;
}

.card-subtitle {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 20, 0.75);
  backdrop-filter: blur(24px);
  z-index: 1000;
}

.modal.oculto {
  display: none;
}

.modal-contenido {
  width: min(520px, 100%);
  background: var(--color-surface-strong);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-strong);
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow-xl);
  display: grid;
}

.modal-contenido h3 {
  font-size: 1.4rem;
}

.modal-contenido.galeria-modal {
  width: min(1100px, 100%);
  height: min(1000px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) rgba(20, 28, 40, 0.4);
}

.modal-contenido.galeria-modal::-webkit-scrollbar {
  width: 8px;
}

.modal-contenido.galeria-modal::-webkit-scrollbar-track {
  background: rgba(20, 28, 40, 0.4);
  border-radius: 10px;
}

.modal-contenido.galeria-modal::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.6), rgba(71, 255, 217, 0.5));
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.2);
}

.modal-galeria-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-galeria-header h3 {
  margin: 6px 0 0;
}

.modal-detalle-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 0 6px;
}

.modal-detalle-info div {
  background: rgba(4, 13, 33, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.modal-detalle-info div p {
  margin: 0;
  color: var(--color-heading);
}

.detalle-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(180, 198, 232, 0.75);
}

.modal-detalle-descripcion {
  background: rgba(4, 13, 33, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
}

.modal-detalle-descripcion p {
  margin: 0;
  color: var(--color-heading);
  white-space: pre-wrap;
  line-height: 1.45;
}

.descripcion-larga {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) rgba(4, 13, 33, 0.4);
}

.descripcion-larga::-webkit-scrollbar {
  width: 6px;
}

.descripcion-larga::-webkit-scrollbar-track {
  background: rgba(4, 13, 33, 0.4);
  border-radius: 10px;
}

.descripcion-larga::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.55), rgba(71, 255, 217, 0.45));
  border-radius: 10px;
}

.detalle-note {
  display: block;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.galeria-imagenes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) rgba(4, 13, 33, 0.4);
}

.galeria-imagenes::-webkit-scrollbar {
  width: 6px;
}

.galeria-imagenes::-webkit-scrollbar-track {
  background: rgba(4, 13, 33, 0.4);
  border-radius: 10px;
}

.galeria-imagenes::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.55), rgba(71, 255, 217, 0.45));
  border-radius: 10px;
}

.galeria-imagenes figure {
  background: rgba(4, 13, 33, 0.85);
  border: 1px solid rgba(0, 242, 255, 0.1);
  border-radius: 18px;
  min-width: 70%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.galeria-imagenes img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.galeria-imagenes figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  gap: 10px;
}

.galeria-imagenes .empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.galeria-imagenes figcaption a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.galeria-imagenes figcaption a:hover {
  text-decoration: underline;
}

.visor-contenido {
  width: min(960px, 100%);
  background: var(--color-surface-strong);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-strong);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow-xl);
  display: grid;
  gap: 12px;
}

.visor-contenido img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: #000;
}

.visor-pie {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--color-muted);
}

.visor-pie a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.visor-pie a:hover {
  text-decoration: underline;
}

.visor-cerrar {
  justify-self: end;
}

.app-user .modal-contenido.galeria-modal {
  height: auto;
}

.app-user .modal-contenido.galeria-modal .galeria-imagenes {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
}

.app-provider .modal-contenido.galeria-modal {
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}

.app-provider .modal-contenido.galeria-modal .galeria-imagenes {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
}

.app-admin .modal-contenido.galeria-modal {
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}

.app-admin .modal-contenido.galeria-modal .galeria-imagenes {
  max-height: none;
  height: auto;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}
.galeria-upload {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(6, 16, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.galeria-upload .input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.galeria-upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* MODAL GENERAL */
.chat-modal {
  padding: 0px;
  width: min(1100px, 100%);
  height: min(1000px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0d141c;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  background: linear-gradient(135deg, rgba(7, 94, 84, 0.9), rgba(11, 20, 25, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-comunidad {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
}

.chat-titulo {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #f7fbff;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.info-trigger {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  background: rgba(0, 242, 255, 0.12);
  border-color: rgba(0, 242, 255, 0.3);
  color: var(--color-accent);
}

.info-trigger:hover {
  background: rgba(0, 242, 255, 0.2);
  color: var(--color-heading);
}

.titulo-controles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.titulo-controles select {
  min-width: 170px;
}

.titulo-detalle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.titulo-detalle .cell-scroll {
  flex: 1;
}

.chat-info {
  padding: 18px 26px;
  background: rgba(15, 22, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7dfec;
  display: grid;
  gap: 6px;
}

.chat-info strong {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.chat-info p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-info.oculto {
  display: none;
}

.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.4) rgba(15, 22, 30, 0.6);
}

.chat-mensajes::-webkit-scrollbar {
  width: 8px;
}

.chat-mensajes::-webkit-scrollbar-track {
  background: rgba(15, 22, 30, 0.6);
  border-radius: 10px;
}

.chat-mensajes::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.55), rgba(11, 169, 131, 0.5));
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.15);
}

.chat-mensaje {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  background: rgba(32, 44, 51, 0.92);
  color: #e9eef4;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-mensaje.propio {
  background: linear-gradient(135deg, #0ba983, #0e695c);
  color: #e9faf5;
  align-self: flex-end;
}

.chat-mensaje .meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chat-mensaje.propio .meta {
  color: rgba(255, 255, 255, 0.85);
}

.chat-mensaje p {
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  gap: 12px;
  padding: 18px 26px 26px;
  background: rgba(6, 12, 18, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 14px 16px;
  resize: none;
  min-height: 90px;
  transition: border 0.2s, background 0.2s;
}

.chat-form textarea:focus {
  border-color: rgba(7, 94, 84, 0.9);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.chat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.btn-chat,
.btn-chat-historial {
  min-width: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  line-height: 1;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
}

.btn-chat:disabled,
.btn-chat-historial:disabled {
  height: 44px;
}

/* Ocultar historial en la vista de proveedor */
#tablaIncidenciasProveedor .btn-chat-historial {
  display: none;
}

/* badge-chat deshabilitado */

.acciones-modal {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.msg {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  background: rgba(5, 14, 34, 0.75);
  border: 1px solid rgba(0, 242, 255, 0.15);
  color: var(--color-muted);
}

.msg.ok {
  background: rgba(71, 255, 217, 0.12);
  color: var(--color-accent-alt);
  border-color: rgba(71, 255, 217, 0.24);
}

.msg.error {
  background: rgba(255, 102, 122, 0.12);
  color: var(--color-danger);
  border-color: rgba(255, 102, 122, 0.24);
}

/* Historial de chat (admin) */
.chat-historial {
  padding: 18px 26px 24px;
  background: rgba(10, 16, 24, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.chat-historial-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-historial-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}

.chat-historial-list {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 100%;
  height: 100%;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.3) rgba(10, 16, 24, 0.4);
}

.chat-historial-list::-webkit-scrollbar {
  width: 6px;
}

.chat-historial-list::-webkit-scrollbar-track {
  background: rgba(10, 16, 24, 0.4);
  border-radius: 10px;
}

.chat-historial-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.45), rgba(11, 169, 131, 0.4));
  border-radius: 10px;
}

.sesion-card {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e7ecf5;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease;
}

.sesion-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 242, 255, 0.28);
}

.sesion-card.activo {
  border-color: rgba(0, 242, 255, 0.45);
  background: rgba(0, 242, 255, 0.08);
}

.sesion-card__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.sesion-card__meta {
  font-size: 0.85rem;
  color: rgba(231, 236, 245, 0.75);
}

.sesion-card__estado {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.sesion-card__estado.estado-activo {
  background: rgba(14, 112, 91, 0.18);
  color: #3bd9b0;
  border: 1px solid rgba(59, 217, 176, 0.4);
}

.sesion-card__estado.estado-cerrado {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(231, 236, 245, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-historial-mensajes {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  min-height: 180px;
  max-height: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.3) rgba(10, 16, 24, 0.4);
}

.chat-historial-mensajes::-webkit-scrollbar {
  width: 6px;
}

.chat-historial-mensajes::-webkit-scrollbar-track {
  background: rgba(10, 16, 24, 0.4);
  border-radius: 10px;
}

.chat-historial-mensajes::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.45), rgba(11, 169, 131, 0.4));
  border-radius: 10px;
}

.chat-mensaje.historial {
  max-width: 100%;
  background: rgba(47, 62, 78, 0.65);
  align-self: stretch;
}

/* --------------------------------------------------------------
   Login and portal access
-------------------------------------------------------------- */
body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 60px);
}

.portal-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(28px, 5vw, 48px);
  width: min(1120px, 100%);
}

.brand-panel {
  background: linear-gradient(140deg, rgba(5, 18, 48, 0.95) 10%, rgba(0, 72, 150, 0.85) 55%, rgba(5, 18, 48, 0.92) 100%);
  border-radius: var(--radius-xl);
  padding: clamp(32px, 6vw, 52px);
  border: 1px solid rgba(0, 242, 255, 0.22);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -140px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.28), transparent 65%);
  filter: blur(12px);
}

.brand-panel .chip {
  align-self: flex-start;
}

.brand-panel h1 {
  max-width: 26ch;
}

.brand-panel p {
  max-width: 36ch;
  color: rgba(217, 230, 255, 0.88);
  font-size: 1rem;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(213, 227, 255, 0.88);
  font-weight: 500;
}

.feature-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.68);
}

.portal-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 5vw, 38px);
  display: grid;
  gap: 26px;
  backdrop-filter: var(--blur-light);
}

.portal-card .card-header {
  display: grid;
  gap: 10px;
}

.portal-card .card-header p {
  color: var(--color-muted);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.input-field {
  display: grid;
  gap: 6px;
}

.input-field label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.support-links {
  display: flex;
  padding-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.support-links a {
  color: var(--color-accent);
}

.support-links a:hover {
  color: var(--color-highlight);
}

/* --------------------------------------------------------------
   Incidences, codes and forms
-------------------------------------------------------------- */
#formIncidencia {
  margin-bottom: 28px;
}

#formIncidencia button {
  justify-self: end;
}

table.incidencias select {
  min-width: 140px;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 242, 255, 0.1);
  color: var(--color-heading);
  border: 1px solid rgba(0, 242, 255, 0.25);
  border-radius: var(--radius-sm);
}

table.incidencias select:focus {
  border-color: rgba(0, 242, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.12);
}

#tablaProveedores tbody td:last-child {
  min-width: 180px;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(0, 242, 255, 0.18);
  background: rgba(5, 16, 42, 0.5);
  color: var(--color-muted);
  text-align: center;
  font-weight: 500;
}

#tablaCodigos td:nth-child(4) {
  font-weight: 600;
}

.panel #tablaCodigos {
  width: 100%;
  /* se adapta al ancho del panel */
  table-layout: fixed;
  /* evita que las celdas fuercen más ancho */
  border-collapse: collapse;
  margin-top: 15px;
}

.panel #tablaCodigos th,
.panel #tablaCodigos td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

#adminImagenesInput,
#inc_imagenes {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px dashed #2d3748;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f1729, #111a2f);
  color: #e5ecff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  font-weight: 600;
}
#adminImagenesInput:hover,
#inc_imagenes:hover {
  border-color: #5cc4ff;
  box-shadow: 0 10px 25px rgba(92, 196, 255, 0.12);
}

#adminImagenesInput:focus,
#inc_imagenes:focus {
  outline: none;
  border-color: #8cf0ff;
  box-shadow: 0 0 0 3px rgba(140, 240, 255, 0.25);
  transform: translateY(-1px);
}

#adminImagenesInput::-webkit-file-upload-button,
#inc_imagenes::-webkit-file-upload-button,
#adminImagenesInput::file-selector-button,
#inc_imagenes::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(120deg, #3b82f6, #22d3ee);
  color: #0b1220;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#adminImagenesInput::-webkit-file-upload-button:hover,
#inc_imagenes::-webkit-file-upload-button:hover,
#adminImagenesInput::file-selector-button:hover,
#inc_imagenes::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.3);
  filter: brightness(1.05);
}
#adminImagenesInput::-webkit-file-upload-button:active,
#inc_imagenes::-webkit-file-upload-button:active,
#adminImagenesInput::file-selector-button:active,
#inc_imagenes::file-selector-button:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Texto y helper */
.input-field small,
.form-note {
  color: #9fb5d8;
}

/* --------------------------------------------------------------
   Responsive adjustments
-------------------------------------------------------------- */
@media (max-width: 1024px) {

  .header,
  .footer,
  .container {
    width: min(100% - 36px, 1024px);
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .brand-panel {
    border-radius: var(--radius-lg);
  }

  section {
    border-radius: var(--radius-lg);
  }

  .hero-card {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 820px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }

  body.login-page {
    padding: 24px;
  }

  .brand-panel,
  .portal-card {
    padding: 28px;
  }

  .header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-pill {
    align-self: stretch;
  }
}

@media (max-width: 720px) {
  .container {
    margin-top: 50px;
    gap: 24px;
  }
  .body {
    margin-left: 0px;
    margin-right: 0px;
    padding-left: 0%;
    padding-right: 0%;
  }
  .hero-card {
    min-height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    height: auto;
  }

  .hero-visual,
  .insight-item {
    display: none;
  }

  .insight-grid {
    display: none;
  }

  h3,
  h2 {
    padding-top: 8px;
  }

  .portal-layout {
    height: 100%;
    align-items: center;
  }

  .brand-panel {
    display: none;
  }

  .portal-card {
    height: 80%;
    vertical-align: middle;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  table {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: none;
    box-shadow: none;
  }

  tbody tr {
    margin-bottom: 18px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 242, 255, 0.12);
    box-shadow: var(--shadow-sm);
  }

  tbody td {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 6px;
    align-items: start;
    padding: 14px 18px;
    font-size: 0.96rem;
    color: rgba(213, 227, 255, 0.88);
    word-break: break-word;
  }

  tbody td::before {
    content: attr(data-label);
    position: static;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    font-weight: 600;
    white-space: nowrap;
    word-break: normal;
  }

  tbody td select,
  tbody td button,
  tbody td .estado {
    align-self: flex-start;
  }

  tbody td select {
    width: 100%;
  }

  tbody td .estado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 242, 255, 0.12);
    border: 1px solid rgba(0, 242, 255, 0.24);
    font-weight: 600;
    letter-spacing: 0.0em;
    text-transform: capitalize;
  }

  tbody td button {
    margin-top: 10px;
  }

  tbody td[data-label="Acciones"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 18px;
  }

  tbody td[data-label="Acciones"]::before {
    flex: 0 0 100%;
    margin-bottom: 4px;
  }

  tbody td[data-label="Acciones"] button {
    flex: 1 1 calc(50% - 10px);
    min-width: calc(50% - 10px);
    max-width: calc(90%);
    margin-top: 0;
  }

  .pagination-controls {
    justify-content: center;
    margin-top: 0px;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .support-links button {
    width: 100%;
    justify-content: center;
  }

  .chat-modal {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 900px) {
  .chat-historial-grid {
    grid-template-columns: 1fr;
  }

  .chat-historial-list {
    max-height: 220px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .header {
    padding: 18px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .portal-card,
  .brand-panel {
    padding: 24px;
  }

  .footer {
    padding: 18px;
  }
}

/* Ajustes adicionales responsive para vistas generadas vía JS (tablas/modales) */
@media (max-width: 960px) {
  .hero-card {
    grid-template-columns: 1fr;
    height: auto;
  }

  .hero-visual {
    min-height: 280px;
  }

  .form-inline {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tabla-responsive table {
    min-width: 840px;
  }

  .modal-contenido.galeria-modal {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .tabla-responsive table {
    min-width: 100%;
  }

  .table-actions {
    flex-direction: column;
  }

  .galeria-imagenes {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }
}

/* Ocultar scrollbars en móviles */
@media (max-width: 720px) {
  body {
    scrollbar-width: none;
    margin-top: 20px;
  }
  
  body::-webkit-scrollbar {
    display: none;
  }

  /* Ajustar textos dentro de tarjetas móviles */
  #tablaIncidencias td .cell-scroll,
  #tablaIncidenciasProveedor td .cell-scroll {
    max-width: 100%;
    overflow: visible;
    word-break: break-word;
    white-space: normal;
    padding-right: 0;
    margin-right: 0;
  }

  /* Ocultar header fuera de inicio */
  body.hide-header-mobile .header {
    display: none;
  }

  /* Contenedor a ancho completo en móvil */
  .container, .footer, .header {
    margin-left: 5px;
    margin-right: 5px;
    width: 98%;
  }

  /* Compactar cabecera de chat en móvil */
  .chat-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .chat-header .chat-titulo {
    display: none;
  }

  .chat-header-actions .btn,
  .chat-header-actions .btn-ghost,
  .chat-header-actions .btn-icon {
    padding: 8px 10px;
    min-width: auto;
  }

  section {
    padding: clamp(5px, 3vw, 36px);
  }

    body.login-page {
    padding: 5px;
  }
  .portal-card,
  .brand-panel {
    padding: 15px;
  }
}
