/* ECUES - APP.CSS ORGANIZADO */
/* Estructura: base > componentes > tema > responsive */

/* BASE */
:root {
  --navy: #132f58;
  --navy-dark: #0d274a;
  --navy-deep: #09223f;
  --blue: #315f92;
  --blue-light: #eaf1f7;
  --orange: #ff6412;
  --orange-dark: #ef4f00;
  --orange-soft: #fff0e7;
  --same-green: #009640;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-soft: #edf3f7;
  --text: #102a4d;
  --text-secondary: #5d7189;
  --border: #dbe5ed;
  --positive: #159447;
  --negative: #d73a32;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 6px 18px rgba(27, 55, 84, 0.08);
  color-scheme: light;
  --theme-bg: #eef3f7;
  --theme-surface: #ffffff;
  --theme-surface-2: #f6f9fb;
  --theme-text: #102a4d;
  --theme-muted: #5d7189;
  --theme-border: #dbe5ed;
  --theme-grid: #e5ebf0;
  --theme-shadow: 0 8px 24px rgba(18, 43, 71, 0.07);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #eef3f7;
  color: var(--text);
  font-family: "Archivo", sans-serif;
  font-size: 12px;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

/* HEADER */
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #f5f8fa;
  border-bottom: 1px solid #dde5ec;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 40px;
  object-fit: contain;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}

.brand-same {
  color: var(--same-green);
  font-size: 24px;
  font-weight: 800;
}

.brand-separator {
  color: #22334b;
  font-size: 24px;
  font-weight: 400;
}

.brand-ecues {
  color: #0f2139;
  font-size: 24px;
  font-weight: 200;
}

.brand-subtitle {
  margin-top: 3px;
  color: #45576c;
  font-size: 10px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.theme-switch {
  width: 70px;
  height: 36px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 3px;
  overflow: hidden;
  border: 1px solid #d8e2e9;
  border-radius: 22px;
  background: #edf2f5;
  box-shadow: 0 4px 14px rgba(20, 45, 72, 0.06);
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  width: 31px;
  height: 30px;
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent !important;
  color: #7b8fa0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.theme-icon.active {
  background: transparent;
  color: var(--same-green);
}

.language-menu {
  position: relative;
  z-index: auto;
}

.language-menu-trigger {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 9px;
  border: 1px solid #d9e3eb;
  border-radius: 20px;
  background: #ffffff;
  color: #18344f;
  box-shadow: 0 4px 14px rgba(20, 45, 72, 0.08);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.language-menu-trigger:hover {
  border-color: #bfd0dc;
  box-shadow: 0 6px 18px rgba(20, 45, 72, 0.12);
  transform: translateY(-1px);
}

.language-menu.open .language-menu-trigger {
  border-color: rgba(0, 166, 81, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.08), 0 8px 22px rgba(20, 45, 72, 0.12);
}

.language-trigger-flag {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.language-trigger-code {
  min-width: 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.language-menu-chevron {
  margin-left: 1px;
  color: #60778d;
  font-size: 9px;
  transition: transform 0.18s ease;
}

.language-menu.open .language-menu-chevron {
  transform: rotate(180deg);
}

.language-menu-dropdown {
  width: 222px;
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2400;
  padding: 8px;
  border: 1px solid #dce6ed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(20, 45, 72, 0.16);
}

.language-menu.open .language-menu-dropdown {
  display: block;
  animation: languageMenuIn 0.16s ease;
}

.language-menu-title {
  padding: 8px 10px 7px;
  color: #18344f;
  font-size: 12px;
  font-weight: 800;
}

.language-menu-option {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #29455f;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.language-menu-option:hover {
  background: #f3f7f9;
}

.language-menu-option.active {
  background: rgba(0, 166, 81, 0.07);
  color: #008a46;
}

.language-option-flag {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  font-size: 21px;
  line-height: 1;
}

.language-option-label {
  font-size: 12px;
  font-weight: 400;
}

.language-menu-option.active .language-option-label {
  font-weight: 700;
}

.language-option-check {
  color: var(--same-green);
  font-size: 12px;
  text-align: center;
}

.language-trigger-flag img, .language-option-flag img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.language-trigger-flag, .language-option-flag {
  border: 1px solid rgba(24, 52, 79, 0.08);
  background: #ffffff;
}

.theme-switch-indicator {
  width: 30px;
  height: 30px;
  position: absolute;
  top: 2px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(20, 45, 72, 0.14);
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.24s ease;
}

.theme-switch[data-theme="dark"] .theme-switch-indicator {
  transform: translateX(32px);
  background: #172d49;
}

.theme-icon.dark.active {
  color: #dfe9ff;
}

.theme-icon:hover {
  transform: scale(1.06);
}

@keyframes languageMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

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

/* HERO Y PERIODO */
.hero {
  position: relative;
  z-index: 2;
  padding: 24px 42px;
  background: radial-gradient(
        circle at 48% 0%,
        rgba(63, 104, 151, 0.28),
        transparent 38%
      ),
      linear-gradient(115deg, #14345f 0%, #0f2d54 100%);
  color: #ffffff;
  overflow: visible;
}

.hero::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 18px;
  z-index: 0;
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1.5fr;
  gap: 12px;
  align-items: stretch;
  z-index: 10;
}

.hero-title {
  padding-top: 0px;
  grid-column: 1 / 3;
}

.hero-title h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.8px;
}

.hero-title p {
  margin: 9px 0 0;
  color: #e4edf7;
  font-size: 14px;
}

.period-card {
  min-height: 132px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 13px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(11, 45, 85, 0.28);
  box-shadow: 0 8px 24px rgba(4, 17, 34, 0.08);
  grid-column: 3 / 5;
}

.period-card-header {
  min-height: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.period-card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.period-card-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 15px;
}

.period-card-heading > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.period-card-heading strong {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 6px;
}

.period-card-heading span {
  color: #cbd8e5;
  font-size: 12px;
  font-weight: 400;
}

.period-live-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
  color: #cbd8e5;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.period-live-status > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #1bc56b;
  box-shadow: 0 0 0 3px rgba(27, 197, 107, 0.08);
}

.period-live-status i {
  color: #94abc0;
  font-size: 10px;
}

.period-types {
  --period-index: 0;
  width: 100%;
  height: 37px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 10px 0 20px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.period-types::before {
  content: "";
  width: calc((100% - 6px) / 4);
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff7928, #f05400);
  box-shadow: 0 2px 8px rgba(255, 95, 14, 0.3);
  transform: translateX(calc(var(--period-index) * 100%));
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.segmented-control {
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.period-types .segment {
  position: relative;
  width: 100%;
  z-index: 1;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7e0eb;
  font-size: 12px;
  font-weight: 700;
  transition: color 0.2s ease,
      background 0.2s ease;
}

.period-types .segment:not(.active):not(:disabled):hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.period-types .segment.active {
  background: transparent;
  color: #ffffff !important;
  box-shadow: none;
}

.period-types .segment.active:hover {
  background: transparent;
  color: #ffffff;
}

.period-types .segment:disabled {
  cursor: default;
  opacity: 0.5;
}

.period-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.period-content {
  width: 100%;
  flex: 0 0 auto;
  position: relative;
  min-height: 58px;
  overflow: visible;
}

.period-panel {
  width: 100%;
  transition: opacity 0.18s ease,
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.period-panel.is-leaving-left {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

.period-panel.is-leaving-right {
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
}

.period-panel.is-entering-right {
  opacity: 0;
  transform: translateX(12px);
}

.period-panel.is-entering-left {
  opacity: 0;
  transform: translateX(-12px);
}

.period-panel.is-active {
  opacity: 1;
  transform: translateX(0);
}

.filter-group {
  min-width: 0;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  color: #e7edf4;
  font-size: 12px;
  font-weight: 600;
}

.period-fields-semestral, .period-fields-anual {
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 10px;
}

.period-panel[hidden] {
  display: none;
}

.period-auto-field {
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.period-auto-field[hidden] {
  display: none;
}

.period-auto-field span {
  color: #b8c9d9;
  font-size: 10px;
  font-weight: 600;
}

.period-auto-field strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-error-modal {
  max-width: 430px;
  padding: 31px 32px 27px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
  text-align: center;
}

.period-error-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px auto 17px;
  border-radius: 50%;
  background: #fff2e9;
  color: var(--orange);
  font-size: 22px;
}

.period-error-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 21px;
  font-weight: 800;
}

.period-error-heading p {
  margin: 8px 0 22px;
  color: #718398;
  font-size: 10px;
  line-height: 1.55;
}

.period-error-button {
  margin-top: 0;
}

.period-types.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.period-fields-manual {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.period-manual-date {
  display: grid;
  grid-template-columns: 0.62fr 1.18fr 0.82fr;
  gap: 8px;
}

/* INFORME */
.report-card {
  min-height: 132px;
  height: 100%;
  display: grid;
  grid-template-columns: 48px 1fr 52px;
  gap: 13px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  grid-column: 5;
  background: linear-gradient(135deg, #ff892f 0%, #ff6513 42%, #f45106 72%, #d94300 100%);
  box-shadow: 0 12px 30px rgba(218, 73, 0, 0.2);
}

.report-card::after {
  content: "";
  width: 180px;
  height: 180px;
  position: absolute;
  top: -92px;
  right: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.report-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 35px;
}

.report-content h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
}

.report-content p {
  margin: 0 0 11px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.45;
}

.report-actions {
  display: flex;
  gap: 12px;
}

.report-button {
  min-width: 132px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.report-button i {
  font-size: 10px;
}

.report-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 28px;
  opacity: 0.16;
}

.report-bars span {
  width: 9px;
  border-radius: 2px 2px 0 0;
  background: #ffffff;
}

.report-bars span:nth-child(1) {
  height: 20px;
}

.report-bars span:nth-child(2) {
  height: 38px;
}

.report-bars span:nth-child(3) {
  height: 56px;
}

.report-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,0.07) 43%, transparent 69%),
      radial-gradient(circle at 95% 2%, rgba(255,255,255,0.10), transparent 34%);
}

.report-card > * {
  position: relative;
  z-index: 1;
}

/* KPI Y RESUMEN */
.hero-top, .summary-grid {
  position: relative !important;
  z-index: 2;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1.5fr;
  gap: 12px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.kpi-card, .map-card {
  min-height: 86px;
  border-radius: 10px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 3px 8px rgba(1, 15, 32, 0.06);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 24px;
}

.kpi-label {
  display: block;
  margin-bottom: 4px;
  color: #435874;
  font-size: 14px;
  font-weight: 600;
}

.kpi-value-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-value-row strong {
  color: #112c51;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.variation {
  display: flex;
  flex-direction: column;
  font-weight: 700;
}

.variation span {
  font-size: 12px;
}

.variation span i {
  margin-right: 2px;
  font-size: 9px;
}

.variation small {
  margin-top: 2px;
  color: #64758a;
  font-size: 10px;
  font-weight: 500;
}

.variation.positive span {
  color: var(--positive);
}

.variation.negative span {
  color: var(--negative);
}

.frequency-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: nowrap;
}

.frequency-day {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.frequency-time {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.summary-grid .map-card {
  position: relative;
  min-height: 86px;
  overflow: hidden;
  border-radius: 10px;
  background-image: linear-gradient(
        90deg,
        rgba(8, 34, 65, 0.92) 0%,
        rgba(8, 34, 65, 0.72) 52%,
        rgba(8, 34, 65, 0.18) 100%
      ),
      url("../img/mapbtn-bgr.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 3px 8px rgba(1, 15, 32, 0.08);
}

.summary-grid .map-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
      90deg,
      rgba(5, 28, 55, 0.2) 0%,
      rgba(5, 28, 55, 0.04) 65%,
      transparent 100%
    );
}

.summary-grid .map-overlay {
  position: relative;
  z-index: 2;
  padding: 14px 16px;
}

.summary-grid .map-button {
  min-width: 265px;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid rgba(87, 156, 203, 0.42);
  border-radius: 7px;
  background: rgba(5, 31, 60, 0.88);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 18, 38, 0.16);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(2px);
  transition: background 0.18s ease,
      border-color 0.18s ease,
      transform 0.18s ease,
      box-shadow 0.18s ease;
}

.summary-grid .map-button:hover:not(:disabled) {
  border-color: rgba(112, 183, 228, 0.6);
  background: rgba(7, 39, 73, 0.96);
  box-shadow: 0 5px 14px rgba(0, 18, 38, 0.24);
}

.summary-grid .map-button:active:not(:disabled) {
  transform: translateY(0);
}

.summary-grid .map-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.summary-grid .map-button-icon {
  font-size: 16px;
}

.summary-grid .map-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.18s ease;
}

.summary-grid .map-button:hover:not(:disabled) .map-arrow {
  transform: translateX(4px);
}

.summary-grid .map-overlay p {
  margin: 6px 0 0 8px;
  color: rgba(232, 241, 249, 0.9);
  font-size: 10px;
  text-shadow: 0 1px 2px rgba(0, 17, 35, 0.4);
}

.summary-grid .map-pin {
  display: none;
}

/* DASHBOARD */
.dashboard {
  padding: 24px 42px;
  background: linear-gradient(180deg, #edf3f7 0%, #e9f0f5 100%);
  position: relative;
  z-index: 1;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  height: 238px;
  padding: 14px 14px 10px;
  overflow: hidden;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(18, 43, 71, 0.04);
}

.chart-header {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.chart-title-icon {
  width: 18px;
  color: #315f92;
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
}

.chart-title h3 {
  margin: 0;
  color: #183a62;
  font-size: 14px;
  font-weight: 800;
}

.chart-actions {
  display: flex;
  gap: 8px;
}

.chart-actions button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #eff4f7;
  color: #315778;
  font-size: 10px;
}

.chart-actions button:hover {
  background: #e2ebf1;
  color: var(--navy);
}

.chart {
  width: 100%;
  height: calc(100% - 28px);
}

/* FOOTER - COMPONENTE GLOBAL */
.footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 40px;
  border-top: 1px solid #e3ebf0;
  background: #f9fbfc;
  color: #435b75;
  font-size: 10px;
  font-weight: 600;
}

.footer-brand {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.footer-logo {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.footer-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.footer-team {
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.updated {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #556b82;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* USUARIO */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 8px 3px 3px;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.user-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar.admin {
  border-color: #bfd7f5;
  background: #dbeaff;
  color: #245faf;
  box-shadow: 0 0 0 3px rgba(36, 95, 175, 0.06);
}

.user-avatar.editor {
  border-color: #ffcba8;
  background: #ffe7d7;
  color: #c95b14;
  box-shadow: 0 0 0 3px rgba(201, 91, 20, 0.06);
}

.user-avatar-initial {
  display: block;
  color: inherit;
  font: inherit;
  line-height: 1;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  color: #18344f;
  font-size: 12px;
  font-weight: 700;
}

.user-role {
  margin-top: 1px;
  color: #7b8d9f;
  font-size: 10px;
}

.user-chevron {
  color: #71879a;
  font-size: 9px;
}

.user-dropdown {
  min-width: 230px;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2400;
  padding: 8px;
  border: 1px solid #dce6ed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(20, 45, 72, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease,
      transform 0.16s ease,
      visibility 0.16s ease;
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 7px;
  color: #29455f;
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
}

.user-dropdown a:hover {
  background: #f0f5f8;
}

.user-dropdown i {
  width: 15px;
  color: var(--same-green);
  text-align: center;
}

.user-form-modal {
  max-width: 500px;
  padding: 30px 32px 26px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
}

.user-modal-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto 16px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 21px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.user-select {
  padding: 0;
}

.user-dropdown-separator {
  height: 1px;
  margin: 7px 5px;
  background: #e4ebf0;
}

.user-dropdown-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #29455f;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.user-dropdown-action:hover {
  background: #f0f5f8;
}

.user-dropdown-action i {
  width: 15px;
  color: var(--same-green);
  text-align: center;
}

.user-dropdown-logout {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
  transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.user-dropdown-logout i {
  color: #d92d20;
  transition: color 0.22s ease;
}

.user-dropdown-logout:hover {
  background: #fff0ee;
  color: #c6281d;
  box-shadow: inset 0 0 0 1px rgba(217, 45, 32, 0.10);
}

.user-dropdown-logout:hover i {
  color: #c6281d;
}

/* MODALES */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  background: rgba(6, 21, 39, 0.62);
  backdrop-filter: blur(0);
  transition: opacity 0.24s ease,
      visibility 0.24s ease,
      backdrop-filter 0.24s ease;
  pointer-events: none;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-open {
  visibility: visible;
  opacity: 1;
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.modal-panel {
  width: 100%;
  max-height: calc(100dvh - 32px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.975);
  transform-origin: center center;
  transition: opacity 0.24s ease,
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.is-open .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-close {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f8;
  color: #71869a;
  font-size: 10px;
  transition: background 0.18s ease,
      color 0.18s ease,
      transform 0.18s ease;
}

.modal-close:hover {
  background: #e5edf2;
  color: var(--navy);
  transform: rotate(90deg);
}

body.modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-compensation, 0px);
}

/* LOGIN */
.login-modal {
  max-width: 420px;
  padding: 32px 34px 25px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
}

.login-modal::before {
  content: "";
  width: 190px;
  height: 190px;
  position: absolute;
  top: -120px;
  left: -90px;
  border-radius: 50%;
  background: rgba(0, 150, 64, 0.055);
  pointer-events: none;
}

.auth-brand {
  width: max-content;
  display: grid;
  grid-template-columns: 72px 1px 72px;
  align-items: center;
  gap: 18px;
  margin: 2px auto 22px;
}

.auth-brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-brand-logo {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.auth-brand-item > span {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
}

.auth-brand-same > span {
  color: var(--same-green);
}

.auth-brand-ecues > span {
  color: var(--text);
}

html[data-theme="dark"] .auth-brand-ecues > span {
  color: #eef4f8;
}

.auth-brand-separator {
  width: 1px;
  height: 77px;
  display: block;
  background: #cfd9e1;
}

.login-heading {
  margin-bottom: 25px;
  text-align: center;
}

.login-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.login-heading p {
  margin: 7px 0 0;
  color: #718398;
  font-size: 12px;
  line-height: 1.5;
}

.login-modal-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  padding: 11px 12px;
  border: 1px solid #f0c0bc;
  border-radius: 9px;
  background: #fff4f3;
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.login-modal-error[hidden] {
  display: none;
}

.login-field {
  margin-bottom: 17px;
}

.login-field label {
  display: block;
  margin: 0 0 7px;
  color: #324d68;
  font-size: 14px;
  font-weight: 600;
}

.login-input {
  height: 42px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d7e2e9;
  border-radius: 10px;
  background: #fbfcfd;
  transition: border-color 0.18s ease,
      background 0.18s ease,
      box-shadow 0.18s ease;
}

.login-input:focus-within {
  border-color: rgba(0, 150, 64, 0.65);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.08);
}

.login-input-icon {
  width: 43px;
  height: 100%;
  flex: 0 0 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8195a8;
  font-size: 14px;
}

.login-input input {
  width: 100%;
  height: 100%;
  padding: 0 12px 0 0;
  border: 0;
  background: transparent;
  color: #18344f;
  outline: none;
  font-size: 12px;
}

.login-input input::placeholder {
  color: #a3b0bc;
}

.password-toggle {
  width: 42px;
  height: 100%;
  flex: 0 0 42px;
  border: 0;
  background: transparent;
  color: #8ba0b2;
  font-size: 14px;
}

.password-toggle:hover {
  color: var(--navy);
}

.login-submit {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 7px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #00a348, #008b3d);
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(0, 150, 64, 0.18);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease,
      box-shadow 0.18s ease,
      filter 0.18s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 150, 64, 0.23);
  filter: brightness(1.02);
}

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

.login-submit:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.login-submit i {
  font-size: 10px;
  transition: transform 0.18s ease;
}

.login-submit:hover i {
  transform: translateX(2px);
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid #edf1f4;
  color: #8799a9;
  font-size: 12px;
  font-weight: 500;
}

.login-footer i {
  color: var(--same-green);
  font-size: 9px;
}

.auth-modal-body {
  width: 100%;
  overflow: hidden;
  transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-modal-track {
  width: 200%;
  display: flex;
  align-items: flex-start;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-slide {
  width: 50%;
  flex: 0 0 50%;
  padding: 0 1px;
}

.login-modal.password-step .auth-modal-track {
  transform: translateX(-50%);
}

.password-rules {
  display: grid;
  gap: 7px;
  margin: 4px 0 19px;
  padding: 0;
  list-style: none;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c43c32;
  font-size: 10px;
  font-weight: 600;
  transition: color 0.18s ease;
}

.password-rules li i {
  font-size: 7px;
}

.password-rules li.valid {
  color: #19824a;
}

.password-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.password-status.pending {
  color: var(--orange-dark);
}

.password-status.ok {
  color: #19824a;
}

.password-status i {
  font-size: 10px;
}

.login-field label span {
  color: #8c9dac;
  font-size: 10px;
  font-weight: 500;
}

.login-input.user-select {
  position: relative;
  overflow: visible;
}

.login-input.user-select > .login-input-icon, .login-input.user-select > .user-select-chevron {
  display: none;
}

/* ADMINISTRACION */
.admin-login-trigger {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #d6e1e8;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.18s ease,
      border-color 0.18s ease,
      box-shadow 0.18s ease;
}

.admin-login-trigger:hover {
  border-color: var(--orange-dark);
  background: var(--orange-dark);
  box-shadow: 0 4px 10px rgba(255, 100, 18, 0.18);
}

.admin-login-trigger:active {
  box-shadow: 0 2px 6px rgba(255, 100, 18, 0.14);
}

.admin-page {
  min-height: calc(100vh - 124px);
  padding: 32px 48px 40px;
  background: #eef3f7;
}

.admin-page-branded {
  background: linear-gradient(rgba(238, 243, 247, 0.91), rgba(238, 243, 247, 0.91)),
      url("../img/admin-same-bg.png") center center / cover no-repeat;
}

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-page-header h1 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-page-header p {
  margin: 7px 0 0;
  color: #6e8296;
  font-size: 12px;
}

.admin-primary-button {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(255, 100, 18, 0.14);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.18s ease,
      box-shadow 0.18s ease;
}

.admin-primary-button:hover {
  background: var(--orange-dark);
  box-shadow: 0 5px 12px rgba(255, 100, 18, 0.2);
}

.users-card {
  overflow: hidden;
  border: 1px solid #dfe7ed;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(22, 49, 77, 0.05);
}

.users-table-wrap {
  overflow-x: auto;
}

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

.users-table th {
  padding: 13px 18px;
  border-bottom: 1px solid #e5ebef;
  background: #f6f9fb;
  color: #698095;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.users-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf1f4;
  color: #324c65;
  font-size: 12px;
}

.users-table tbody tr:last-child td {
  border-bottom: 0;
}

.users-table tbody tr {
  transition: background 0.16s ease;
}

.users-table tbody tr:hover {
  background: #fafcfd;
}

.users-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.users-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.users-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.users-identity strong {
  display: block;
  color: #173552;
  font-size: 12px;
  font-weight: 800;
}

.users-identity small {
  display: block;
  margin-top: 3px;
  color: #8294a5;
  font-size: 10px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.role-badge.admin {
  border-color: #cfe0f7;
  background: #e8f1ff;
  color: #245faf;
}

.role-badge.editor {
  border-color: #ffd6bc;
  background: #fff0e5;
  color: #c95b14;
}

/* USUARIOS - AVATAR SEGUN ROL */
.users-table tbody tr:has(.role-badge.admin) .users-avatar {
  border: 1px solid #bfd7f5;
  background: #dbeaff;
  color: #245faf;
  box-shadow: 0 0 0 3px rgba(36, 95, 175, 0.06);
}

.users-table tbody tr:has(.role-badge.editor) .users-avatar {
  border: 1px solid #ffcba8;
  background: #ffe7d7;
  color: #c95b14;
  box-shadow: 0 0 0 3px rgba(201, 91, 20, 0.06);
}

html[data-theme="dark"] .users-table tbody tr:has(.role-badge.admin) .users-avatar {
  border-color: rgba(143, 193, 255, 0.24);
  background: #173f70;
  color: #8fc1ff;
  box-shadow: 0 0 0 3px rgba(116, 178, 255, 0.05);
}

html[data-theme="dark"] .users-table tbody tr:has(.role-badge.editor) .users-avatar {
  border-color: rgba(255, 173, 120, 0.24);
  background: #55301d;
  color: #ffad78;
  box-shadow: 0 0 0 3px rgba(255, 155, 92, 0.05);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-badge.active {
  color: #168049;
}

.status-badge.active span {
  background: #22a761;
  box-shadow: 0 0 0 3px rgba(34, 167, 97, 0.1);
}

.status-badge.inactive {
  color: #8796a4;
}

.status-badge.inactive span {
  background: #a8b4be;
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.presence-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.presence-badge.online {
  color: #168049;
}

.presence-badge.online .presence-dot {
  background: #22a761;
  box-shadow: 0 0 0 3px rgba(34, 167, 97, 0.1);
  animation: presence-online-pulse 1.8s ease-in-out infinite;
}

@keyframes presence-online-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(34, 167, 97, 0.08);
  }

  50% {
    opacity: 0.72;
    transform: scale(0.88);
    box-shadow: 0 0 0 6px rgba(34, 167, 97, 0.02);
  }
}


@media (prefers-reduced-motion: reduce) {
  .presence-badge.online .presence-dot {
    animation: none;
  }
}

.presence-badge.offline {
  color: #8796a4;
}

.presence-badge.offline .presence-dot {
  background: #8e9ca8;
  box-shadow: none;
}

.last-access {
  color: #6f8294 !important;
  font-size: 12px !important;
}

.users-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.users-actions form {
  margin: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: #eff4f7;
  color: #46637e;
  font-size: 12px;
  transition: background 0.16s ease,
      color 0.16s ease,
      box-shadow 0.16s ease;
}

.icon-button:hover {
  background: #e2ebf1;
  color: var(--navy);
}

.icon-button.danger:hover {
  background: #fff0ef;
  color: #c43c32;
}

.icon-button.success:hover {
  background: #edf8f2;
  color: #19824a;
}

.admin-table-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border: 1px solid #e5ebef;
  background: #fbfcfd;
}

.admin-results-count {
  color: #667d92;
  font-size: 12px;
  font-weight: 600;
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-page-button {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #d8e3ea;
  border-radius: 7px;
  background: #ffffff;
  color: #466078;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-page-button:hover {
  border-color: #b9cad6;
  background: #f4f8fa;
  color: var(--navy);
}

.admin-page-button.active {
  border-color: var(--same-green);
  background: var(--same-green);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 150, 64, 0.18);
}

.admin-page-button.arrow {
  min-width: 32px;
  padding: 0;
}

.admin-page-button.disabled {
  border-color: #e4eaee;
  background: #f6f8fa;
  color: #b4c0c9;
  cursor: default;
}

.admin-page-ellipsis {
  min-width: 24px;
  color: #8193a3;
  font-size: 12px;
  text-align: center;
}

.admin-listing {
  position: relative;
}

.admin-listing > .users-card, .admin-listing > .admin-table-footer {
  transition: opacity 0.18s ease,
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.admin-listing.is-loading {
  pointer-events: none;
}

.admin-listing.has-skeleton > .users-card, .admin-listing.has-skeleton > .admin-table-footer {
  opacity: 0;
}

.admin-content-enter {
  opacity: 0 !important;
  transform: translateX(16px);
}

.admin-skeleton-overlay {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease,
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.admin-skeleton-overlay.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.admin-skeleton-overlay.is-leaving {
  opacity: 0;
  transform: translateX(-8px);
}

.admin-skeleton-card {
  flex: 0 1 auto;
  overflow: hidden;
  border: 1px solid #dfe7ed;
  border-radius: 10px 10px 0 0;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(22, 49, 77, 0.05);
}

.admin-skeleton-head, .admin-skeleton-row {
  display: grid;
  align-items: center;
}

.admin-skeleton-head {
  min-height: 36px;
  border-bottom: 1px solid #e5ebef;
  background: #f7f9fb;
}

.admin-skeleton-row {
  min-height: var(--skeleton-row-height, 48px);
  border-bottom: 1px solid #e8eef2;
  background: #ffffff;
}

.admin-skeleton-row:last-child {
  border-bottom: 0;
}

.admin-skeleton-head-cell, .admin-skeleton-cell {
  min-width: 0;
  padding: 8px 14px;
}

.admin-skeleton-head-cell {
  display: flex;
  align-items: center;
}

.admin-skeleton-cell {
  display: flex;
  align-items: center;
}

.admin-skeleton-leading {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-skeleton-circle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
}

.admin-skeleton-lines {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-skeleton-bar, .admin-skeleton-pill, .admin-skeleton-circle, .admin-skeleton-action, .admin-skeleton-page {
  position: relative;
  overflow: hidden;
  background: #e7edf2;
}

.admin-skeleton-bar::after, .admin-skeleton-pill::after, .admin-skeleton-circle::after, .admin-skeleton-action::after, .admin-skeleton-page::after {
  content: "";
  width: 46%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -55%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
  transform: skewX(-18deg);
  animation: admin-skeleton-shimmer 1.15s ease-in-out infinite;
}

.admin-skeleton-bar {
  width: var(--skeleton-width, 62%);
  height: 10px;
  display: block;
  border-radius: 999px;
}

.admin-skeleton-bar.strong {
  height: 11px;
}

.admin-skeleton-bar.small {
  height: 8px;
}

.admin-skeleton-pill {
  width: var(--skeleton-width, 54%);
  height: 22px;
  display: block;
  border-radius: 6px;
}

.admin-skeleton-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.admin-skeleton-action {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 8px;
}

.admin-skeleton-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 12px;
  border: 1px solid #dfe7ed;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fbfcfd;
}

.admin-skeleton-footer-left {
  max-width: 210px;
}

.admin-skeleton-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-skeleton-page {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 7px;
}

@keyframes admin-skeleton-shimmer {
  0% {
    left: -55%;
  }

  100% {
    left: 115%;
  }
}

/* IMPORTACION */
.import-modal {
  max-width: 620px;
  padding: 32px 34px 25px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
}

.import-modal-body {
  width: 100%;
  overflow: hidden;
  transition: height 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.import-track {
  width: 500%;
  display: flex;
  align-items: flex-start;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.import-slide {
  width: 20%;
  flex: 0 0 20%;
  padding: 0 1px;
}

.import-modal[data-step="0"] .import-track {
  transform: translateX(0);
}

.import-modal[data-step="1"] .import-track {
  transform: translateX(-20%);
}

.import-modal[data-step="2"] .import-track {
  transform: translateX(-40%);
}

.import-modal[data-step="3"] .import-track {
  transform: translateX(-60%);
}

.import-modal[data-step="4"] .import-track {
  transform: translateX(-80%);
}

.import-file-zone {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  border: 1.5px dashed #bdcbd7;
  border-radius: 12px;
  background: #f8fafb;
  color: #647b90;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease,
      background 0.18s ease,
      box-shadow 0.18s ease;
}

.import-file-zone:hover, .import-file-zone.dragging {
  border-color: var(--same-green);
  background: #f3faf6;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.06);
}

.import-file-zone input {
  display: none;
}

.import-file-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #eaf6ef;
  color: var(--same-green);
  font-size: 20px;
}

.import-file-zone strong {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.import-file-zone span {
  font-size: 10px;
}

.import-file-zone small {
  color: #94a5b4;
  font-size: 10px;
}

.import-processing-slide {
  padding-top: 12px;
  text-align: center;
}

.processing-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 20px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 27px;
}

.import-progress {
  height: 8px;
  position: relative;
  overflow: hidden;
  margin: 30px 0 12px;
  border-radius: 8px;
  background: #e8eef2;
}

.import-progress.indeterminate span {
  width: 36%;
  height: 100%;
  position: absolute;
  left: -36%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--orange), #ff934f);
  animation: import-progress 1.15s ease-in-out infinite;
}

.processing-status {
  margin-bottom: 28px;
  color: #718398;
  font-size: 10px;
  font-weight: 600;
}

.import-result-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 11px 13px;
  border-radius: 10px;
}

.import-result-status.success {
  border: 1px solid #a9dcc0;
  background: #edf9f2;
  color: #167542;
}

.import-result-status.warning {
  border: 1px solid #f1d09a;
  background: #fff8eb;
  color: #a65a00;
}

.import-result-status.error {
  border: 1px solid #efbbb7;
  background: #fff2f1;
  color: #b42318;
}

.import-result-status > i {
  font-size: 24px;
}

.import-result-status div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-result-status strong {
  font-size: 12px;
}

.import-result-status span {
  font-size: 10px;
}

.import-result-heading {
  margin-bottom: 18px;
}

.import-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.import-kpi {
  padding: 15px 10px;
  border: 1px solid #e1e8ed;
  border-radius: 10px;
  background: #f8fafb;
  text-align: center;
}

.import-kpi strong {
  display: block;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
}

.import-kpi span {
  display: block;
  margin-top: 3px;
  color: #778b9d;
  font-size: 10px;
  font-weight: 400;
}

.import-summary, .import-complete-detail {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #e3eaf0;
  border-radius: 10px;
  background: #e3eaf0;
}

.import-summary div, .import-complete-detail div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 12px;
  background: #ffffff;
}

.import-summary span, .import-complete-detail span {
  color: #75899b;
  font-size: 12px;
}

.import-summary strong, .import-complete-detail strong {
  color: #29445f;
  font-size: 10px;
  font-weight: 700;
}

.import-previous {
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid #f1d09a;
  border-radius: 10px;
  background: #fff8eb;
}

.import-actions {
  display: flex;
  gap: 10px;
}

.import-secondary-button {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid #d5e0e8;
  border-radius: 10px;
  background: #ffffff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.import-confirm-button {
  flex: 1;
  margin-top: 0;
}

.import-complete-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 20px;
  border-radius: 50%;
  background: #eaf7f0;
  color: #19824a;
  font-size: 28px;
}

.import-file-zone.selected {
  border-style: solid;
  border-color: var(--same-green);
  background: #f3faf6;
}

.import-file-zone.selected .import-file-icon {
  background: var(--same-green);
  color: #ffffff;
}

.import-previous-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  color: #9a5a09;
  font-size: 12px;
}

.import-compare {
  display: grid;
  gap: 7px;
}

.import-compare div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.import-compare span {
  color: #8a765c;
  font-size: 10px;
}

.import-compare strong {
  color: #654a27;
  font-size: 10px;
  text-align: right;
}

.import-validation {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #e1e8ed;
  border-radius: 10px;
  background: #f8fafb;
}

.import-validation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.import-validation-title span {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.import-validation-title strong {
  color: #19824a;
  font-size: 10px;
  font-weight: 600;
}

.import-validation-title strong.error {
  color: #b42318;
}

.import-validation-title strong.warning {
  color: #b86c06;
}

.import-validation-title strong.success {
  color: #19824a;
}

.import-validation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.import-validation-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f4faf6;
}

.import-validation-item-wide {
  grid-column: 1 / -1;
}

.import-validation-item > i {
  color: #19824a;
  font-size: 16px;
}

.import-validation-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-validation-item strong {
  color: #29445f;
  font-size: 12px;
  font-weight: 700;
}

.import-validation-item span {
  color: #778b9d;
  font-size: 10px;
}

.import-validation-item.warning {
  border-color: #f0d49f;
  background: #fff9ed;
}

.import-validation-item.warning > i {
  color: #b86c06;
}

.import-validation-item.error {
  border-color: #efc0bc;
  background: #fff4f3;
}

.import-validation-item.error > i {
  color: #c43c32;
}

.import-validation-details {
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 12px;
  padding: 12px 8px 0 0;
  border-top: 1px solid #e3eaf0;
  scrollbar-width: thin;
  scrollbar-color: #bdcbd7 transparent;
}

.import-validation-details[hidden] {
  display: none;
}

.import-validation-details::-webkit-scrollbar {
  width: 6px;
}

.import-validation-details::-webkit-scrollbar-track {
  background: transparent;
}

.import-validation-details::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #bdcbd7;
}

.import-validation-details::-webkit-scrollbar-thumb:hover {
  background: #9eafbd;
}

.import-validation-problem {
  margin-top: 9px;
}

.import-validation-problem:first-child {
  margin-top: 0;
}

.import-validation-problem > strong {
  display: block;
  margin-bottom: 5px;
  color: #b42318;
  font-size: 12px;
}

.import-validation-problem ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-validation-problem li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #687d90;
  font-size: 10px;
}

.import-validation-problem li span:last-child {
  flex: 0 0 auto;
  font-weight: 700;
}

.import-confirm-button:disabled {
  background: #b9c7bf;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  filter: none;
}

.import-problem-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.import-problem-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-problem-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.import-problem-count {
  min-width: 22px;
  color: #687d90;
  font-weight: 700;
  text-align: right;
}

.import-resolve-button {
  height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #d7e2e9;
  border-radius: 6px;
  background: #ffffff;
  color: #315f92;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease,
      border-color 0.16s ease,
      color 0.16s ease;
}

.import-resolve-button:hover {
  border-color: rgba(0, 150, 64, 0.3);
  background: #f2faf6;
  color: var(--same-green);
}

.import-resolve-button i {
  font-size: 10px;
}

@keyframes import-progress {
  0% {
    left: -36%;
  }

  100% {
    left: 100%;
  }
}

/* RESOLUCION CENTRO ASISTENCIAL */
.centro-modal {
  max-width: 560px;
  padding: 30px 32px 26px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
}

.centro-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.centro-form-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.center-admin-modal > form {
  margin-right: -8px;
  padding-right: 8px;
}

.center-admin-modal > .login-footer {
  flex: 0 0 auto;
}

.centro-preview {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 166, 81, 0.18);
  border-radius: 10px;
  background: rgba(0, 166, 81, 0.055);
}

.centro-preview-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(0, 166, 81, 0.11);
  color: var(--same-green);
  font-size: 14px;
}

.centro-preview-content {
  min-width: 0;
}

.centro-preview span {
  display: block;
  margin-bottom: 2px;
  color: #6d8396;
  font-size: 10px;
  font-weight: 600;
}

.centro-preview strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.centro-preview small {
  display: block;
  margin-top: 3px;
  color: #8295a6;
  font-size: 10px;
  line-height: 1.35;
}

.centro-tags {
  min-height: 46px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #d7e2e9;
  border-radius: 10px;
  background: #fbfcfd;
  transition: border-color 0.18s ease,
      background 0.18s ease,
      box-shadow 0.18s ease;
}

.centro-tags:focus-within {
  border-color: rgba(0, 150, 64, 0.65);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.08);
}

.centro-tags-list {
  display: contents;
}

.centro-tag {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 6px;
  background: #eaf1f7;
  color: #294b6c;
  font-size: 10px;
  font-weight: 700;
}

.centro-tag button {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8093a5;
  font-size: 9px;
}

.centro-tag button:hover {
  color: #b42318;
}

.centro-tags input {
  min-width: 130px;
  flex: 1 1 130px;
  height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #18344f;
  outline: none;
  font-size: 12px;
}

.centro-tags input::placeholder {
  color: #a3b0bc;
}

.centro-admin-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid #f0d49f;
  border-radius: 10px;
  background: #fff9ed;
  color: #8a590b;
}

.centro-admin-warning[hidden] {
  display: none;
}

.centro-admin-warning > i {
  margin-top: 2px;
  color: #b86c06;
  font-size: 14px;
}

.centro-admin-warning div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.centro-admin-warning strong {
  font-size: 10px;
  font-weight: 700;
}

.centro-admin-warning span {
  color: #947346;
  font-size: 10px;
  line-height: 1.4;
}

.user-form-modal, .centro-modal, .ampliacion-modal {
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-form-modal > form, .centro-modal > form, .ampliacion-modal > form {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #b8c7d2 transparent;
}

.user-form-modal > form::-webkit-scrollbar, .centro-modal > form::-webkit-scrollbar, .ampliacion-modal > form::-webkit-scrollbar {
  width: 8px;
}

.user-form-modal > form::-webkit-scrollbar-track, .centro-modal > form::-webkit-scrollbar-track, .ampliacion-modal > form::-webkit-scrollbar-track {
  background: transparent;
}

.user-form-modal > form::-webkit-scrollbar-thumb, .centro-modal > form::-webkit-scrollbar-thumb, .ampliacion-modal > form::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b8c7d2;
  background-clip: padding-box;
}

.modal-field-help {
  display: block;
  margin: 5px 2px 0;
  color: #8295a6;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}

/* RESOLUCION AMPLIACION */
.ampliacion-modal {
  max-width: 620px;
  padding: 30px 32px 26px;
  overflow: hidden;
  border: 1px solid rgba(218, 229, 237, 0.9);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 75px rgba(4, 18, 34, 0.28);
}

.ampliacion-origin {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid #d7e2e9;
  border-radius: 10px;
  background: #f7fafb;
}

.ampliacion-origin span {
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.ampliacion-participantes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 10px;
}

.ampliacion-participantes-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ampliacion-participantes-header strong {
  color: #324d68;
  font-size: 12px;
  font-weight: 600;
}

.ampliacion-participantes-header span {
  color: #8c9dac;
  font-size: 10px;
}

.ampliacion-add-button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #d7e2e9;
  border-radius: 7px;
  background: #ffffff;
  color: #315f92;
  font-size: 10px;
  font-weight: 700;
}

.ampliacion-add-button:hover {
  border-color: rgba(0, 150, 64, 0.3);
  background: #f2faf6;
  color: var(--same-green);
}

.ampliacion-participantes {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.ampliacion-participante-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px 34px;
  gap: 8px;
  align-items: center;
  position: relative;
}

.ampliacion-select {
  height: 42px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  border: 1px solid #d7e2e9;
  border-radius: 9px;
  background: #fbfcfd;
}

.ampliacion-select:focus-within {
  border-color: rgba(0, 150, 64, 0.65);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.08);
}

.login-input.user-select > .ecues-select, .ampliacion-select > .ecues-select {
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
}

.ampliacion-select .ecues-select-trigger {
  min-height: 40px;
  padding: 0 10px;
  font-size: 10px;
}

.ampliacion-participante-row:has(.ecues-select.open) {
  z-index: 1400;
}

/* SELECT ECUES */
.period-card, .period-content, .filter-group, .ecues-select.open {
  position: relative !important;
  z-index: 5 !important;
}

.period-content .ecues-select.open {
  z-index: 1800;
}

.ecues-select {
  width: 100%;
  min-height: 40px;
  position: relative;
  z-index: 1;
  border: 1px solid #d7e2e9;
  border-radius: 9px;
  background: #fbfcfd;
  transition: border-color 0.18s ease,
      background 0.18s ease,
      box-shadow 0.18s ease;
}

.ecues-select:focus-within {
  border-color: rgba(0, 150, 64, 0.65);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.08);
}

html[data-theme="light"] .ecues-select {
  border-color: #d7e2e9;
  background: #fbfcfd;
}

html[data-theme="light"] .ecues-select:hover {
  border-color: #cbd9e2;
  background: #ffffff;
}

html[data-theme="light"] .ecues-select-trigger {
  color: #18344f;
  font-size: 12px;
  font-weight: 400;
}

html[data-theme="light"] .ecues-select-trigger i {
  color: #8195a8;
}

.ecues-select.open {
  z-index: 1500;
}

.ecues-select.disabled {
  opacity: 0.58;
}

.ecues-select-native {
  width: 1px !important;
  height: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

.ecues-select-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #18344f;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.ecues-select-trigger:disabled {
  cursor: default;
}

.ecues-select-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecues-select-trigger i {
  flex: 0 0 auto;
  color: #8ba0b2;
  font-size: 9px;
  transition: transform 0.18s ease;
}

.ecues-select.open .ecues-select-trigger i {
  transform: rotate(180deg);
}

.ecues-select-menu {
  width: 100%;
  max-height: 240px;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 1600;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d7e2e9;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 42, 69, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
  transition: opacity 0.16s ease,
      transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.18s;
  scrollbar-width: thin;
  scrollbar-color: #c1ced8 transparent;
}

.ecues-select.open .ecues-select-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.16s ease,
      transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
}

/* SELECT ECUES - MENU CERRADO FUERA DEL OVERFLOW */
.ecues-select-menu:not(.ecues-select-menu-portal) {
  display: none;
}

.ecues-select-menu.ecues-select-menu-portal {
  display: block;
}

/* SELECT ECUES - PORTAL GLOBAL */
.ecues-select-menu.ecues-select-menu-portal {
  width: auto;
  position: fixed;
  top: auto;
  left: auto;
  z-index: 3800;
  margin: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
}

.ecues-select-menu.ecues-select-menu-portal.opens-up {
  transform: translateY(6px) scale(0.985);
  transform-origin: bottom center;
}

.ecues-select-menu.ecues-select-menu-portal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.16s ease,
      transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
}

.ecues-select-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #29445f;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease,
      color 0.14s ease;
}

.ecues-select-option:hover:not(:disabled) {
  background: #f0f5f8;
  color: var(--navy);
}

.ecues-select-option.selected {
  background: #eef8f2;
  color: #08763f;
  font-weight: 700;
}

.ecues-select-option.selected::after {
  content: "";
  color: var(--same-green);
  font-family: "Font Awesome 6 Free";
  font-size: 9px;
  font-weight: 900;
}

.ecues-select-option:disabled {
  color: #b0bcc6;
  cursor: default;
  opacity: 0.6;
}

.login-input.user-select .ecues-select-trigger {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
}

.filter-group > .ecues-select, .filter-group > [data-semester-calendar-secondary] > .ecues-select, .filter-group > [data-annual-calendar-secondary] > .ecues-select {
  width: 100%;
  height: 39px;
  min-height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.filter-group > .ecues-select:focus-within, .filter-group > [data-semester-calendar-secondary] > .ecues-select:focus-within, .filter-group > [data-annual-calendar-secondary] > .ecues-select:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.filter-group > .ecues-select .ecues-select-trigger, .filter-group > [data-semester-calendar-secondary] > .ecues-select .ecues-select-trigger, .filter-group > [data-annual-calendar-secondary] > .ecues-select .ecues-select-trigger {
  min-height: 37px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.filter-group > .ecues-select .ecues-select-trigger i, .filter-group > [data-semester-calendar-secondary] > .ecues-select .ecues-select-trigger i, .filter-group > [data-annual-calendar-secondary] > .ecues-select .ecues-select-trigger i {
  color: #d3dce6;
}

[data-semester-calendar-secondary], [data-annual-calendar-secondary] {
  width: 100%;
  height: 39px;
}

.period-manual-date .ecues-select {
  width: 100%;
  height: 39px;
  min-height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.period-manual-date .ecues-select:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.period-manual-date .ecues-select .ecues-select-trigger {
  min-height: 37px;
  padding: 0 10px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.period-manual-date .ecues-select .ecues-select-trigger i {
  color: #d3dce6;
}

/* MODAL DE GRAFICOS */
.chart-modal[hidden] {
  display: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease,
      visibility 0.22s ease;
}

.chart-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 28, 48, 0.58);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.chart-modal.is-open .chart-modal-backdrop {
  opacity: 1;
}

.chart-modal-dialog {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 92vh;
  background: #fff;
  border: 1px solid #dde5ec;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(10, 34, 60, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.22s ease,
      transform 0.22s ease;
}

.chart-modal.is-open .chart-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chart-modal-header {
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5ebf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 3;
}

.chart-modal-header .chart-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chart-modal-header .chart-title h3 {
  margin: 0;
  color: #0b2d55;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.chart-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-modal-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid #dce4eb;
  border-radius: 8px;
  background: #fff;
  color: #315f92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s ease,
      border-color 0.15s ease,
      color 0.15s ease;
}

.chart-modal-actions button:hover {
  background: #f3f7fa;
  border-color: #c8d4df;
  color: #0b2d55;
}

.chart-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.chart-modal-canvas {
  width: 100%;
  height: 620px;
  min-height: 420px;
}

body.chart-modal-open {
  overflow: hidden;
}

.chart-modal-footer {
  min-height: 46px;
  padding: 10px 18px;
  border-top: 1px solid #e5ebf0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  position: relative;
  z-index: 3;
}

.chart-modal-footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.chart-modal-footer-brand img {
  width: auto;
  height: 24px;
  display: block;
}

.chart-modal-footer-ecues {
  color: #0b2d55;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.chart-modal-footer-separator {
  color: #a7b4c0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

.chart-modal-footer-text {
  color: #516b85;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
}

.chart-modal-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.05;
}

.chart-modal-watermark img {
  width: 420px;
  max-width: 38vw;
  height: auto;
  display: block;
}

/* MAPA INTERACTIVO */
.map-page {
  width: 100%;
  height: calc(100vh - 124px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(
        circle at 48% 0%,
        rgba(63, 104, 151, 0.28),
        transparent 38%
      ),
      linear-gradient(115deg, #14345f 0%, #0f2d54 100%);
  padding: 20px 20px 0;
  transition: background 0.24s ease, color 0.24s ease;
}

.map-page-header {
  min-height: auto;
  display: flex;
  justify-content: space-between;
  margin: 0;
  align-items: center;
  gap: 20px;
  padding: 0 12px 14px;
}

.map-page-heading {
  flex: 1 1 auto;
  margin: 0;
}

.map-page-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.8px;
}

.map-page-heading p {
  margin: 9px 0 0;
  color: #e4edf7;
  font-size: 14px;
}

.map-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 42px;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 0;
}

.map-commune-filter {
  position: relative;
  flex: 0 0 178px;
  z-index: 2000;
  width: 184px;
  height: 42px;
  flex-basis: 170px;
}

.map-commune-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e0eb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  transition: background 0.18s ease,
      border-color 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  height: 42px;
  border-radius: 9px;
}

.map-commune-trigger:hover, .map-commune-filter.open .map-commune-trigger {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.map-commune-trigger > i:first-child {
  flex: 0 0 auto;
  color: #ffffff;
  font-size: 10px;
}

.map-commune-trigger > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-commune-chevron {
  flex: 0 0 auto;
  color: #cbd8e5;
  font-size: 9px;
  transition: transform 0.18s ease;
}

.map-commune-filter.open .map-commune-chevron {
  transform: rotate(180deg);
}

.map-commune-menu {
  width: 210px;
  max-height: min(520px, calc(100vh - 150px));
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 2100;
  overflow: hidden;
  border: 1px solid #d7e2e9;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(6, 25, 45, 0.24);
}

.map-commune-menu[hidden] {
  display: none;
}

.map-commune-action {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 0;
  background: #ffffff;
  color: #29445f;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.map-commune-action:hover {
  background: #f0f5f8;
  color: var(--navy);
}

.map-commune-action > i {
  width: 14px;
  color: var(--same-green);
  font-size: 10px;
  text-align: center;
}

.map-commune-action-hide {
  border-top: 1px solid #e7edf1;
  color: #6a7d90;
}

.map-commune-action-hide > i {
  color: #8798a7;
}

.map-commune-options {
  max-height: 330px;
  overflow-y: auto;
  padding: 5px;
  border-top: 1px solid #e7edf1;
  border-bottom: 1px solid #e7edf1;
  scrollbar-width: thin;
  scrollbar-color: #c1ced8 transparent;
}

.map-commune-options::-webkit-scrollbar {
  width: 6px;
}

.map-commune-options::-webkit-scrollbar-track {
  background: transparent;
}

.map-commune-options::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #c1ced8;
}

.map-commune-option {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 7px;
  border-radius: 8px;
  color: #29445f;
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: background 0.14s ease,
      color 0.14s ease;
}

.map-commune-option:hover {
  background: #f0f5f8;
  color: var(--navy);
}

.map-commune-option input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-commune-check {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd7e0;
  border-radius: 5px;
  background: #ffffff;
  color: transparent;
  font-size: 8px;
  transition: background 0.14s ease,
      border-color 0.14s ease,
      color 0.14s ease;
}

.map-commune-option input:checked + .map-commune-check {
  border-color: var(--same-green);
  background: var(--same-green);
  color: #ffffff;
}

.map-commune-option input:focus-visible + .map-commune-check {
  box-shadow: 0 0 0 3px rgba(0, 150, 64, 0.16);
}

.map-type-filter {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.04);
  height: 42px;
  border-radius: 9px;
}

.map-type-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #d7e0eb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 6px;
}

.map-type-filter-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.map-type-filter-button.active {
  background: linear-gradient(135deg, #ff7928, #f05400);
  color: #ffffff !important;
  box-shadow: 0 3px 9px rgba(255, 95, 14, 0.3);
}

.map-summary {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 42px;
  padding: 2px 9px;
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.map-summary-item {
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 32px;
  gap: 10px;
}

.map-summary-icon {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ffffff;
  color: var(--same-green);
  font-size: 12px;
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.map-summary-item div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.map-summary-item strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.map-summary-item span:last-child {
  color: #e4edf7;
  font-size: 10px;
  line-height: 1.1;
}

.map-toolbar-separator {
  width: 1px;
  flex: 0 0 1px;
  background: rgba(255, 255, 255, 0.22);
  height: 30px;
  margin: 0 1px;
}

.map-header-actions {
  height: 42px;
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.map-header-actions.segmented-control {
  height: 42px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.map-header-actions .map-header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #d7e0eb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  min-height: 34px;
  border-radius: 6px;
}

.map-header-actions .map-header-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.map-header-actions .map-header-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.map-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease,
      border-color 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
  height: 42px;
  border-radius: 9px;
  font-weight: 600;
}

.map-back-button:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(4, 20, 38, 0.18);
}

.map-back-button i {
  transition: transform 0.2s ease;
}

.map-back-button:hover i {
  transform: translateX(-4px);
}

.map-page .map-card {
  position: relative;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 8px 24px rgba(18, 43, 71, 0.09);
}

.map-page .map-card::before, .map-page .map-card::after {
  content: none;
}

.map-container-wrap {
  position: relative;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background: #e9eef1;
  transition: background 0.24s ease;
}

.incident-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-loading, .map-error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: rgba(247, 249, 250, 0.92);
  color: var(--text);
  text-align: center;
}

.map-loading[hidden], .map-error[hidden], .map-status-dot[hidden], [data-map-status][hidden] {
  display: none;
}

.map-loading strong, .map-error strong {
  font-size: 15px;
  font-weight: 700;
}

.map-loading span, .map-error span {
  max-width: 420px;
  color: var(--text-secondary);
  font-size: 10px;
}

.map-loading-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  border: 3px solid rgba(0, 150, 64, 0.16);
  border-top-color: var(--same-green);
  border-radius: 50%;
  animation: map-spin 0.7s linear infinite;
}

.map-error-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(190, 52, 52, 0.08);
  color: #be3434;
  font-size: 16px;
}

.map-retry-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: var(--same-green);
  color: #ffffff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.map-card-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 10px;
}

.map-card-footer > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.incident-map .leaflet-tile-pane {
  transition: filter 0.24s ease;
}

.incident-map .leaflet-control-zoom a {
  color: #44515d;
  font-family: Archivo, sans-serif;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-bottom-color: rgba(41, 68, 91, 0.12);
  background: rgba(255, 255, 255, 0.96);
}

.incident-map .leaflet-control-layers {
  border: 0;
  border-radius: 9px;
  box-shadow: 0 3px 14px rgba(25, 37, 48, 0.16);
  font-family: Archivo, sans-serif;
}

.incident-map .leaflet-control-layers-expanded {
  padding: 12px 14px;
  color: #44515d;
  font-size: 10px;
}

.ecues-cluster {
  border: 0;
  background: transparent;
}

.ecues-cluster-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(40, 48, 55, 0.45);
  border-radius: 50%;
  color: #25303a;
  font-size: 10px;
  font-weight: 800;
  border-width: 2px;
  box-shadow: 0 4px 11px rgba(20, 28, 35, 0.28);
}

.ecues-cluster-none {
  background: #aeb7bf;
  color: #fff;
}

.ecues-map-marker {
  border: 0;
  background: transparent;
}

.ecues-map-marker-dot {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(31, 41, 49, 0.68);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(20, 28, 35, 0.28);
}

.map-comuna-number {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.map-comuna-number span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(37, 48, 58, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #34414c;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 7px rgba(31, 41, 49, 0.12);
}

.map-legend {
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: #44515d;
  box-shadow: 0 3px 14px rgba(25, 37, 48, 0.16);
  font-family: Archivo, sans-serif;
  width: 166px;
  padding: 12px 13px;
}

.map-legend strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.map-legend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 7px;
}

.map-legend-grid span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 400;
}

.map-legend-grid i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 1px solid rgba(40, 48, 55, 0.2);
  border-radius: 2px;
}

.incident-map .leaflet-popup-content-wrapper {
  border-radius: 10px;
  font-family: Archivo, sans-serif;
}

.incident-map .leaflet-popup-content {
  margin: 15px 16px;
}

.map-popup-date {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 11px;
  color: #79848d;
  font-size: 10px;
}

.map-popup-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.map-popup-address > i {
  margin-top: 2px;
  color: #00945f;
}

.map-popup-address div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-popup-address strong {
  color: #34414c;
  font-size: 10px;
  font-weight: 700;
}

.map-popup-address span {
  color: #7a858e;
  font-size: 10px;
}

.map-popup-type {
  margin-bottom: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(0, 148, 95, 0.07);
  color: #08764e;
  font-size: 10px;
  font-weight: 700;
}

.map-popup-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}

.map-popup-stats div {
  padding: 7px 8px;
  border: 1px solid #e6eaed;
  border-radius: 6px;
}

.map-popup-stats span {
  display: block;
  margin-bottom: 2px;
  color: #8a949c;
  font-size: 9px;
}

.map-popup-stats strong {
  color: #34414c;
  font-size: 10px;
  font-weight: 700;
}

.map-popup-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.map-popup-participant {
  padding: 4px 6px;
  border-radius: 5px;
  background: #f1f4f6;
  color: #58656f;
  font-size: 9px;
  font-weight: 600;
}

.map-popup-muted {
  color: #929ba2;
  font-size: 9px;
}

.map-popup-coordinates {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #edf0f2;
  color: #9aa2a8;
  font-size: 9px;
  text-align: right;
}

body:has(.map-page) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body:has(.map-page) .app-shell {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body:has(.map-page) .app-shell > .topbar, body:has(.map-page) .app-shell > .footer {
  flex: 0 0 auto;
}

body:has(.map-page) .app-shell > main {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
}

body:has(.map-page) .map-page {
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.map-type-filter-button.active:hover {
  background: linear-gradient(135deg, #ff7928, #f05400);
  color: #ffffff;
}

.map-header-actions, .map-header-actions.segmented-control {
  height: 42px;
  border-radius: 9px;
}

.incident-map .leaflet-control-zoom, .incident-map .leaflet-control-layers, .map-legend {
  overflow: hidden;
  border: 1px solid rgba(41, 68, 91, 0.13);
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(25, 37, 48, 0.13);
}

.incident-map .leaflet-control-layers-toggle {
  width: 42px;
  height: 42px;
  background-size: 22px 22px;
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

/* MODAL DE INFORME */
.report-modal[hidden] {
  display: none;
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease,
      visibility 0.22s ease;
}

.report-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.report-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 28, 48, 0.68);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.report-modal.is-open .report-modal-backdrop {
  opacity: 1;
}

.report-modal-dialog {
  width: min(1600px, calc(100vw - 48px));
  height: calc(100vh - 48px);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d7e1e8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(5, 24, 44, 0.32);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.22s ease,
      transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-modal.is-open .report-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.report-modal-header {
  min-height: 62px;
  flex: 0 0 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid #e2e9ee;
  background: #ffffff;
}

.report-modal-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.report-modal-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #edf7f1;
  color: var(--same-green);
  font-size: 15px;
}

.report-modal-title-wrap {
  min-width: 0;
}

.report-modal-title-wrap h3 {
  margin: 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-modal-title-wrap span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #718398;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-modal-actions button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d9e2e9;
  border-radius: 8px;
  background: #ffffff;
  color: #315f92;
  font-size: 10px;
  font-weight: 700;
  transition: background 0.16s ease,
      border-color 0.16s ease,
      color 0.16s ease;
}

.report-modal-actions button:hover {
  border-color: #c5d2dc;
  background: #f3f7fa;
  color: var(--navy);
}

.report-modal-download {
  padding: 0 12px;
}

.report-modal-close {
  width: 34px;
  padding: 0;
}

.report-modal-body {
  min-height: 0;
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: #e8edf1;
}

.report-modal-body iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #e8edf1;
}

.report-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: #f4f7f9;
  color: #607387;
  text-align: center;
}

.report-modal-loading[hidden] {
  display: none;
}

.report-modal-loading strong {
  margin-top: 3px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.report-modal-loading span {
  color: #7b8d9f;
  font-size: 10px;
}

.report-modal-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 150, 64, 0.14);
  border-top-color: var(--same-green);
  border-radius: 50%;
  animation: report-modal-spin 0.7s linear infinite;
}

body.report-modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-compensation, 0px);
}

body, .topbar, .hero, .dashboard, .footer, .kpi-card, .chart-card, .period-card, .language-menu-trigger, .language-menu-dropdown, .modal-panel, .ecues-select, .ecues-select-trigger, .ecues-select-menu, .report-modal-dialog, .chart-modal-dialog {
  transition: background-color 0.24s ease,
      background 0.24s ease,
      color 0.24s ease,
      border-color 0.24s ease,
      box-shadow 0.24s ease;
}

@keyframes report-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

/* TOASTS */
.ecues-toast-container {
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 3900;
  pointer-events: none;
}

.ecues-toast {
  --toast-color: #2f80ed;
  --toast-soft: #edf5ff;
  --toast-duration: 5000ms;
  min-height: 78px;
  display: grid;
  grid-template-columns: 5px 42px minmax(0, 1fr) 28px;
  align-items: center;
  column-gap: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe7ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(24, 52, 78, 0.16);
  opacity: 0;
  transform: translateX(22px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.ecues-toast.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.ecues-toast.is-leaving {
  opacity: 0;
  transform: translateX(18px) scale(0.985);
}

.ecues-toast.success {
  --toast-color: #00a651;
  --toast-soft: #eaf8f0;
}

.ecues-toast.error {
  --toast-color: #e53935;
  --toast-soft: #fff0ef;
}

.ecues-toast.warning {
  --toast-color: #f59e0b;
  --toast-soft: #fff7e8;
}

.ecues-toast.info {
  --toast-color: #2f80ed;
  --toast-soft: #edf5ff;
}

.ecues-toast-accent {
  width: 5px;
  height: 100%;
  align-self: stretch;
  background: var(--toast-color);
}

.ecues-toast-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--toast-soft);
  color: var(--toast-color);
  font-size: 16px;
}

.ecues-toast-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 14px 0;
}

.ecues-toast-title {
  color: #173552;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.ecues-toast-message {
  color: #72869a;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.ecues-toast-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  margin-top: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6f8498;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ecues-toast-close:hover {
  background: #f1f5f8;
  color: #29455f;
}

.ecues-toast-progress {
  height: 3px;
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 17px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

.ecues-toast-progress::after {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--toast-color);
  transform-origin: left center;
  animation: ecues-toast-progress var(--toast-duration) linear forwards;
}

.ecues-toast.is-paused .ecues-toast-progress::after {
  animation-play-state: paused;
}

@keyframes ecues-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* COOKIE CONSENT */
.cookie-consent {
  width: min(680px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 4200;
  padding: 16px 18px;
  border: 1px solid rgba(23, 53, 82, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #173552;
  box-shadow: 0 18px 48px rgba(20, 46, 72, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translate(-50%, 14px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.cookie-consent.is-leaving {
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.99);
}

.cookie-consent-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 166, 81, 0.10);
  color: #009b4c;
  font-size: 16px;
}

.cookie-consent-copy {
  min-width: 0;
}

.cookie-consent-copy strong {
  display: block;
  margin-bottom: 4px;
  color: #173552;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.cookie-consent-copy p {
  margin: 0;
  color: #6e8294;
  font-size: 10px;
  line-height: 1.45;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-consent-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.cookie-consent-button:hover {
  transform: translateY(-1px);
}

.cookie-consent-button.secondary {
  border: 1px solid #d4e0e8;
  background: #f8fafc;
  color: #35546e;
}

.cookie-consent-button.secondary:hover {
  border-color: #b9cbd7;
  background: #f1f5f8;
  color: #173552;
}

.cookie-consent-button.primary {
  border: 1px solid #00a651;
  background: #00a651;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 166, 81, 0.20);
}

.cookie-consent-button.primary:hover {
  border-color: #00964a;
  background: #00964a;
  box-shadow: 0 8px 19px rgba(0, 166, 81, 0.25);
}

/* MODALES ADMIN - ENCABEZADO COMPACTO */
.user-form-modal > .modal-close,
.centro-modal:not(.center-admin-modal) > .modal-close,
.ampliacion-modal:not(.event-admin-modal) > .modal-close {
  top: 22px;
  right: 24px;
}

.user-form-modal > .user-modal-icon,
.centro-modal:not(.center-admin-modal) > .user-modal-icon,
.ampliacion-modal:not(.event-admin-modal) > .user-modal-icon {
  width: 42px;
  height: 42px;
  position: absolute;
  top: 28px;
  left: 28px;
  margin: 0;
  font-size: 16px;
}

.user-form-modal > .login-heading,
.centro-modal:not(.center-admin-modal) > .login-heading,
.ampliacion-modal:not(.event-admin-modal) > .login-heading {
  min-height: 42px;
  margin: 0 0 20px;
  padding: 0 48px 0 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.user-form-modal > .login-heading h2,
.centro-modal:not(.center-admin-modal) > .login-heading h2,
.ampliacion-modal:not(.event-admin-modal) > .login-heading h2 {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.2px;
}

.user-form-modal > .login-heading p,
.centro-modal:not(.center-admin-modal) > .login-heading p,
.ampliacion-modal:not(.event-admin-modal) > .login-heading p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.user-form-modal > .login-modal-error,
.centro-modal:not(.center-admin-modal) > .login-modal-error,
.ampliacion-modal:not(.event-admin-modal) > .login-modal-error {
  margin-top: 2px;
}

/* MODAL USUARIOS - ESPACIADO 30PX */
.user-form-modal:not(.participant-modal) > .login-heading {
  margin-bottom: 30px;
}

.user-form-modal:not(.participant-modal) > form {
  scrollbar-gutter: auto;
}

.user-form-modal:not(.participant-modal) > form > .login-submit {
  margin-top: 13px;
}

/* TEMA CLARO / OSCURO */
/* TEMA - CORE */
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #071725;
  --theme-surface: #0d2233;
  --theme-surface-2: #11293c;
  --theme-text: #edf4f9;
  --theme-muted: #98adbd;
  --theme-border: #234158;
  --theme-grid: #233e53;
  --theme-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

/* TEMA - HEADER / USUARIO */
html[data-theme="dark"] .topbar {
  border-bottom-color: #173247;
  background: #061722;
}

html[data-theme="dark"] .brand-separator, html[data-theme="dark"] .brand-ecues, html[data-theme="dark"] .user-name {
  color: #eef4f8;
}

html[data-theme="dark"] .brand-subtitle, html[data-theme="dark"] .user-role, html[data-theme="dark"] .user-chevron {
  color: #8fa5b6;
}

html[data-theme="dark"] .language-menu-trigger {
  border-color: #244258;
  background: #0e2536;
  color: #eaf2f8;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.17);
}

html[data-theme="dark"] .language-menu-chevron {
  color: #8ea5b8;
}

html[data-theme="dark"] .language-menu-dropdown, html[data-theme="dark"] .user-dropdown {
  border-color: #234158;
  background: #0d2233;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .language-menu-title {
  color: #eaf2f8;
}

html[data-theme="dark"] .user-dropdown-separator {
  background: #223e52;
}

html[data-theme="dark"] .user-avatar.admin {
  border-color: rgba(143, 193, 255, 0.24);
  background: #173f70;
  color: #8fc1ff;
  box-shadow: 0 0 0 3px rgba(116, 178, 255, 0.05);
}

html[data-theme="dark"] .user-avatar.editor {
  border-color: rgba(255, 173, 120, 0.24);
  background: #55301d;
  color: #ffad78;
  box-shadow: 0 0 0 3px rgba(255, 155, 92, 0.05);
}

html[data-theme="dark"] .language-menu-option, html[data-theme="dark"] .user-dropdown a, html[data-theme="dark"] .user-dropdown-action {
  color: #c8d7e5;
}

html[data-theme="dark"] .language-menu-option:hover, html[data-theme="dark"] .user-dropdown a:hover, html[data-theme="dark"] .user-dropdown-action:hover {
  background: #142e42;
}

html[data-theme="dark"] .user-dropdown-logout {
  background: transparent;
  color: #eef4f8;
  box-shadow: none;
}

html[data-theme="dark"] .user-dropdown-logout i {
  color: #ff6b6b;
}

html[data-theme="dark"] .user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ff7b7b;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.16);
}

html[data-theme="dark"] .user-dropdown-logout:hover i {
  color: #ff7b7b;
}

html[data-theme="dark"] .language-menu-option.active {
  background: rgba(0, 166, 81, 0.13);
  color: #3bd77e;
}

/* TEMA - HERO / PERIODO */
html[data-theme="light"] .hero::after {
  background: linear-gradient(
      to bottom,
      rgba(18, 43, 68, 0.10) 0%,
      rgba(18, 43, 68, 0.045) 42%,
      rgba(18, 43, 68, 0) 100%
    );
}

html[data-theme="dark"] .hero::after {
  background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.30) 0%,
      rgba(0, 0, 0, 0.12) 42%,
      rgba(0, 0, 0, 0) 100%
    );
}

html[data-theme="light"] .hero {
  position: relative;
  background: linear-gradient(90deg, rgba(246, 250, 252, 0.94) 0%, rgba(239, 246, 250, 0.88) 48%, rgba(234, 243, 248, 0.92) 100%),
      url("../img/hero-same-bg.jpg") center 45% / cover no-repeat;
  color: #102a4d;
}

html[data-theme="light"] .hero-title h1 {
  color: #102a4d;
}

html[data-theme="light"] .hero-title p {
  color: #536d85;
}

html[data-theme="dark"] .hero {
  position: relative;
  background: linear-gradient(90deg, rgba(5, 21, 34, 0.95) 0%, rgba(5, 25, 41, 0.88) 50%, rgba(5, 23, 37, 0.93) 100%),
      url("../img/hero-same-bg.jpg") center 46% / cover no-repeat;
  color: #ffffff;
}

html[data-theme="dark"] .hero-title p {
  color: #c5d4df;
}

html[data-theme="light"] .period-card {
  border-color: rgba(39, 73, 105, 0.16);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(40, 73, 101, 0.09);
  backdrop-filter: blur(5px);
}

html[data-theme="light"] .period-card-heading strong {
  color: #173552;
}

html[data-theme="light"] .period-card-heading span, html[data-theme="light"] .period-live-status {
  color: #6b7f92;
}

html[data-theme="light"] .period-types, html[data-theme="light"] .segmented-control {
  border-color: #d2dfe8;
  background: rgba(231, 239, 245, 0.72);
}

html[data-theme="light"] .period-types .segment {
  color: #31506f;
}

html[data-theme="light"] .period-types .segment:not(.active):not(:disabled):hover {
  background: rgba(255, 255, 255, 0.72);
  color: #102a4d;
}

html[data-theme="light"] .filter-group label {
  color: #29455f;
}

html[data-theme="light"] .period-auto-field {
  border-color: #d2dfe8;
  background: rgba(255, 255, 255, 0.72);
  color: #173552;
}

html[data-theme="light"] .period-auto-field strong {
  color: #173552;
}

html[data-theme="light"] .period-auto-field span {
  color: #71879a;
}

html[data-theme="dark"] .period-card {
  border-color: rgba(87, 133, 166, 0.28);
  background: rgba(12, 39, 59, 0.76);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] .period-types, html[data-theme="dark"] .segmented-control {
  border-color: rgba(118, 156, 184, 0.26);
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="light"] .filter-group > .ecues-select, html[data-theme="light"] .filter-group > [data-semester-calendar-secondary] > .ecues-select, html[data-theme="light"] .filter-group > [data-annual-calendar-secondary] > .ecues-select, html[data-theme="light"] .period-manual-date .ecues-select {
  border-color: #cfdae3;
  background: rgba(255,255,255,0.82);
}

html[data-theme="light"] .filter-group > .ecues-select .ecues-select-trigger, html[data-theme="light"] .filter-group > [data-semester-calendar-secondary] > .ecues-select .ecues-select-trigger, html[data-theme="light"] .filter-group > [data-annual-calendar-secondary] > .ecues-select .ecues-select-trigger, html[data-theme="light"] .period-manual-date .ecues-select .ecues-select-trigger {
  color: #173552;
}

html[data-theme="dark"] .filter-group > .ecues-select, html[data-theme="dark"] .filter-group > [data-semester-calendar-secondary] > .ecues-select, html[data-theme="dark"] .filter-group > [data-annual-calendar-secondary] > .ecues-select, html[data-theme="dark"] .period-manual-date .ecues-select {
  border-color: #315069;
  background: rgba(15, 43, 63, 0.84);
}

html[data-theme="dark"] .filter-group > .ecues-select .ecues-select-trigger, html[data-theme="dark"] .filter-group > [data-semester-calendar-secondary] > .ecues-select .ecues-select-trigger, html[data-theme="dark"] .filter-group > [data-annual-calendar-secondary] > .ecues-select .ecues-select-trigger, html[data-theme="dark"] .period-manual-date .ecues-select .ecues-select-trigger {
  color: #edf4f9;
}

html[data-theme="dark"] .login-modal, html[data-theme="dark"] .user-form-modal, html[data-theme="dark"] .import-modal, html[data-theme="dark"] .period-error-modal, html[data-theme="dark"] .report-modal-dialog, html[data-theme="dark"] .chart-modal-dialog {
  border-color: #28455a;
  background: #0d2233;
  color: #edf4f9;
}

html[data-theme="dark"] .login-heading h2, html[data-theme="dark"] .period-error-heading h2 {
  color: #edf4f9;
}

html[data-theme="dark"] .login-heading p, html[data-theme="dark"] .period-error-heading p {
  color: #91a7b8;
}

html[data-theme="light"] .map-commune-trigger, html[data-theme="light"] .map-type-filter, html[data-theme="light"] .map-header-actions, html[data-theme="light"] .map-header-actions.segmented-control {
  border-color: #d4e1e9;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 13px rgba(18, 43, 71, 0.05);
}

html[data-theme="dark"] .map-commune-trigger, html[data-theme="dark"] .map-type-filter, html[data-theme="dark"] .map-header-actions, html[data-theme="dark"] .map-header-actions.segmented-control {
  border-color: #294b63;
  background: rgba(13, 35, 52, 0.76);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12);
}

/* TEMA - DASHBOARD */
html[data-theme="light"] .dashboard {
  background: linear-gradient(180deg, #edf3f7 0%, #e8f0f5 100%);
}

html[data-theme="light"] .kpi-card, html[data-theme="light"] .chart-card {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 5px 18px rgba(18, 43, 71, 0.055);
}

html[data-theme="light"] .summary-grid .map-card {
  border: 1px solid #dce7ee;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 252, 0.92) 50%, rgba(239, 246, 250, 0.64) 100%),
      url("../img/mapbtn-bgr.png");
  box-shadow: 0 5px 18px rgba(18, 43, 71, 0.055);
}

html[data-theme="light"] .summary-grid .map-card::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.18), transparent 72%);
}

html[data-theme="light"] .summary-grid .map-button {
  border-color: #d6e4ec;
  background: rgba(255, 255, 255, 0.91);
  color: #153755;
  box-shadow: 0 5px 15px rgba(18, 43, 71, 0.08);
  backdrop-filter: blur(5px);
}

html[data-theme="light"] .summary-grid .map-button:hover:not(:disabled) {
  border-color: rgba(0, 150, 64, 0.35);
  background: #ffffff;
  color: #102a4d;
  box-shadow: 0 7px 18px rgba(18, 43, 71, 0.12);
}

html[data-theme="light"] .summary-grid .map-button-icon {
  color: var(--same-green);
}

html[data-theme="light"] .summary-grid .map-overlay p {
  color: #647a8e;
  text-shadow: none;
}

html[data-theme="dark"] .dashboard {
  background: linear-gradient(180deg, #071725 0%, #061522 100%);
}

html[data-theme="dark"] .kpi-card, html[data-theme="dark"] .chart-card {
  border: 1px solid #1c3b51;
  background: linear-gradient(180deg, #0d2233 0%, #0b1f2f 100%);
  color: #edf4f9;
  box-shadow: 0 11px 28px rgba(0, 0, 0, 0.17);
}

html[data-theme="dark"] .kpi-label, html[data-theme="dark"] .kpi-value-row strong, html[data-theme="dark"] .chart-title h3 {
  color: #edf4f9;
}

html[data-theme="dark"] .kpi-icon {
  background: rgba(255, 100, 18, 0.13);
  color: #ff812f;
}

html[data-theme="dark"] .chart-title-icon {
  color: #82c9ff;
}

html[data-theme="dark"] .chart-actions button {
  background: #122d41;
  color: #9cc8e7;
}

html[data-theme="dark"] .chart-actions button:hover {
  background: #19394f;
  color: #ffffff;
}

html[data-theme="dark"] .summary-grid .map-card {
  border: 1px solid #1c4057;
  background-image: linear-gradient(90deg, rgba(5, 25, 40, 0.97) 0%, rgba(5, 30, 47, 0.82) 56%, rgba(5, 28, 45, 0.28) 100%),
      url("../img/mapbtn-bgr.png");
  box-shadow: 0 11px 28px rgba(0, 0, 0, 0.17);
}

html[data-theme="dark"] .summary-grid .map-button {
  border-color: #2f5c79;
  background: rgba(8, 35, 54, 0.88);
  color: #ffffff;
}

html[data-theme="dark"] .summary-grid .map-button:hover:not(:disabled) {
  border-color: #4f82a3;
  background: rgba(12, 45, 68, 0.96);
}

html[data-theme="dark"] .summary-grid .map-button-icon {
  color: #1ee27a;
}

html[data-theme="dark"] .summary-grid .map-overlay p {
  color: #a9bdca;
}

/* TEMA - FOOTER */
html[data-theme="dark"] .footer {
  border-top-color: #173247;
  background: #061722;
  color: #9eb1c0;
}

html[data-theme="dark"] .updated {
  color: #8fa5b6;
}

/* TEMA - SELECTS */
html[data-theme="dark"] .ecues-select {
  border-color: #29475d;
  background: #0a1c2b;
  box-shadow: none;
}

html[data-theme="dark"] .ecues-select:hover {
  border-color: #355a72;
  background: #0d2233;
}

html[data-theme="dark"] .ecues-select:focus-within, html[data-theme="dark"] .ecues-select.open {
  border-color: rgba(0, 166, 81, 0.72);
  background: #0d2233;
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.10);
}

html[data-theme="dark"] .ecues-select-trigger {
  border-color: transparent;
  background: transparent;
  color: #d6e3ec;
}

html[data-theme="dark"] .ecues-select-trigger:hover {
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .ecues-select-trigger i {
  color: #8fa5b6;
}

html[data-theme="dark"] .ecues-select.disabled {
  background: #0a1c2b;
}

html[data-theme="dark"] .ecues-select-menu {
  border-color: #29465c;
  background: #102638;
  box-shadow: 0 17px 36px rgba(0, 0, 0, 0.28);
  scrollbar-color: #35566d transparent;
}

html[data-theme="dark"] .ecues-select-option {
  color: #c9d7e3;
}

html[data-theme="dark"] .ecues-select-option:hover:not(:disabled) {
  background: #142e42;
  color: #eaf2f8;
}

html[data-theme="dark"] .ecues-select-option.selected {
  background: rgba(0, 166, 81, 0.12);
  color: #39d77d;
}

html[data-theme="dark"] .ecues-select-option.selected:hover:not(:disabled) {
  background: rgba(0, 166, 81, 0.16);
  color: #39d77d;
}

html[data-theme="dark"] .ecues-select-option:focus-visible {
  outline: 0;
  background: #142e42;
  color: #eaf2f8;
}

/* TEMA - IMPORTACION */
html[data-theme="dark"] .import-file-zone {
  border-color: #35566d;
  background: #0a1c2b;
  color: #91a7b8;
}

html[data-theme="dark"] .import-file-zone:hover, html[data-theme="dark"] .import-file-zone.dragging {
  border-color: rgba(0, 166, 81, 0.72);
  background: rgba(0, 166, 81, 0.07);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.08);
}

html[data-theme="dark"] .import-file-icon {
  background: rgba(0, 166, 81, 0.12);
  color: #42d985;
}

html[data-theme="dark"] .import-file-zone strong {
  color: #eaf2f8;
}

html[data-theme="dark"] .import-file-zone span {
  color: #91a7b8;
}

html[data-theme="dark"] .import-file-zone small {
  color: #6f8798;
}

html[data-theme="dark"] .import-file-zone.selected {
  border-color: #00a651;
  background: rgba(0, 166, 81, 0.08);
}

html[data-theme="dark"] .import-file-zone.selected .import-file-icon {
  background: #00a651;
  color: #ffffff;
}

html[data-theme="dark"] .processing-icon {
  background: rgba(255, 100, 18, 0.12);
  color: #ff8a42;
}

html[data-theme="dark"] .import-progress {
  background: #183448;
}

html[data-theme="dark"] .processing-status {
  color: #8fa5b6;
}

html[data-theme="dark"] .import-result-status.success {
  border-color: rgba(45, 184, 104, 0.34);
  background: rgba(36, 163, 91, 0.11);
  color: #62dc98;
}

html[data-theme="dark"] .import-result-status.warning {
  border-color: rgba(224, 160, 57, 0.34);
  background: rgba(196, 126, 20, 0.11);
  color: #efbb62;
}

html[data-theme="dark"] .import-result-status.error {
  border-color: rgba(229, 72, 77, 0.36);
  background: rgba(229, 72, 77, 0.10);
  color: #ff8f94;
}

html[data-theme="dark"] .import-kpi {
  border-color: #29475d;
  background: #0a1c2b;
}

html[data-theme="dark"] .import-kpi strong {
  color: #edf4f9;
}

html[data-theme="dark"] .import-kpi span {
  color: #8399aa;
}

html[data-theme="dark"] .import-summary, html[data-theme="dark"] .import-complete-detail {
  border-color: #29475d;
  background: #29475d;
}

html[data-theme="dark"] .import-summary div, html[data-theme="dark"] .import-complete-detail div {
  background: #0a1c2b;
}

html[data-theme="dark"] .import-summary span, html[data-theme="dark"] .import-complete-detail span {
  color: #8399aa;
}

html[data-theme="dark"] .import-summary strong, html[data-theme="dark"] .import-complete-detail strong {
  color: #e6f0f6;
}

html[data-theme="dark"] .import-previous {
  border-color: rgba(224, 160, 57, 0.34);
  background: rgba(196, 126, 20, 0.10);
}

html[data-theme="dark"] .import-previous-title {
  color: #efbb62;
}

html[data-theme="dark"] .import-compare span {
  color: #a99b85;
}

html[data-theme="dark"] .import-compare strong {
  color: #ecd3a9;
}

html[data-theme="dark"] .import-secondary-button {
  border-color: #315069;
  background: #0a1c2b;
  color: #dbe7ef;
}

html[data-theme="dark"] .import-secondary-button:hover {
  border-color: #426781;
  background: #10283a;
  color: #ffffff;
}

html[data-theme="dark"] .import-complete-icon {
  background: rgba(0, 166, 81, 0.12);
  color: #42d985;
}

html[data-theme="dark"] .import-validation {
  border-color: #29475d;
  background: #0a1c2b;
}

html[data-theme="dark"] .import-validation-title span {
  color: #e6f0f6;
}

html[data-theme="dark"] .import-validation-title strong {
  color: #62dc98;
}

html[data-theme="dark"] .import-validation-title strong.error {
  color: #ff8f94;
}

html[data-theme="dark"] .import-validation-title strong.warning {
  color: #efbb62;
}

html[data-theme="dark"] .import-validation-title strong.success {
  color: #62dc98;
}

html[data-theme="dark"] .import-validation-item {
  border-color: rgba(45, 184, 104, 0.24);
  background: rgba(36, 163, 91, 0.075);
}

html[data-theme="dark"] .import-validation-item > i {
  color: #52d78b;
}

html[data-theme="dark"] .import-validation-item strong {
  color: #dfeaf2;
}

html[data-theme="dark"] .import-validation-item span {
  color: #8ca2b3;
}

html[data-theme="dark"] .import-validation-item.warning {
  border-color: rgba(224, 160, 57, 0.34);
  background: rgba(196, 126, 20, 0.10);
}

html[data-theme="dark"] .import-validation-item.warning > i {
  color: #e7a83e;
}

html[data-theme="dark"] .import-validation-item.error {
  border-color: rgba(229, 72, 77, 0.34);
  background: rgba(229, 72, 77, 0.09);
}

html[data-theme="dark"] .import-validation-item.error > i {
  color: #ff7379;
}

html[data-theme="dark"] .import-validation-details {
  border-top-color: #29475d;
  scrollbar-color: #3d6078 transparent;
}

html[data-theme="dark"] .import-validation-details::-webkit-scrollbar-thumb {
  background: #3d6078;
}

html[data-theme="dark"] .import-validation-details::-webkit-scrollbar-thumb:hover {
  background: #50758e;
}

html[data-theme="dark"] .import-validation-problem > strong {
  color: #ff858a;
}

html[data-theme="dark"] .import-validation-problem li {
  color: #9cb0bf;
}

html[data-theme="dark"] .import-problem-count {
  color: #aabcca;
}

html[data-theme="dark"] .import-resolve-button {
  border-color: #315069;
  background: #102638;
  color: #82bff0;
}

html[data-theme="dark"] .import-resolve-button:hover {
  border-color: rgba(0, 166, 81, 0.42);
  background: rgba(0, 166, 81, 0.10);
  color: #42d985;
}

html[data-theme="dark"] .import-confirm-button:disabled {
  background: #254033;
  color: #83998c;
}

/* TEMA - MODALES */
html[data-theme="dark"] .modal-close, html[data-theme="dark"] .report-modal-close {
  background: #142e42;
  color: #a9bdca;
}

html[data-theme="dark"] .login-input {
  border-color: #29475c;
  background: #0a1c2b;
}

html[data-theme="dark"] .login-input input, html[data-theme="dark"] .login-field label {
  color: #eaf2f8;
}

html[data-theme="dark"] .centro-modal, html[data-theme="dark"] .ampliacion-modal {
  border-color: #28455a;
  background: #0d2233;
  color: #edf4f9;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .login-heading h2 {
  color: #edf4f9;
}

html[data-theme="dark"] .login-heading p {
  color: #91a7b8;
}

html[data-theme="dark"] .login-field label {
  color: #d8e5ee;
}

html[data-theme="dark"] .login-field label span {
  color: #8197a8;
}

html[data-theme="dark"] .login-input:focus-within {
  border-color: rgba(0, 166, 81, 0.72);
  background: #0d2233;
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.10);
}

html[data-theme="dark"] .login-input-icon, html[data-theme="dark"] .password-toggle {
  color: #7f9ab0;
}

html[data-theme="dark"] .login-input input {
  color: #e6f0f6;
}

html[data-theme="dark"] .login-input input::placeholder {
  color: #617d91;
}

html[data-theme="dark"] .login-modal-error {
  border-color: rgba(229, 72, 77, 0.32);
  background: rgba(229, 72, 77, 0.10);
  color: #ff9a9e;
}

html[data-theme="dark"] .login-footer {
  border-top-color: #254257;
  color: #8399aa;
}

html[data-theme="dark"] .centro-preview {
  border-color: #28455a;
  background: #0a1c2b;
}

html[data-theme="dark"] .centro-preview span {
  color: #8197a8;
}

html[data-theme="dark"] .centro-preview strong {
  color: #e6f0f6;
}

html[data-theme="dark"] .centro-tags {
  border-color: #29475c;
  background: #0a1c2b;
}

html[data-theme="dark"] .centro-tags:focus-within {
  border-color: rgba(0, 166, 81, 0.72);
  background: #0d2233;
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.10);
}

html[data-theme="dark"] .centro-tag {
  background: #142e42;
  color: #b8cad7;
}

html[data-theme="dark"] .centro-tag button {
  color: #718da1;
}

html[data-theme="dark"] .centro-tag button:hover {
  color: #ff8589;
}

html[data-theme="dark"] .centro-tags input {
  color: #e6f0f6;
}

html[data-theme="dark"] .centro-tags input::placeholder {
  color: #617d91;
}

html[data-theme="dark"] .centro-admin-warning {
  border-color: rgba(245, 158, 11, 0.30);
  background: rgba(245, 158, 11, 0.09);
  color: #f5c96c;
}

html[data-theme="dark"] .centro-admin-warning > i {
  color: #f0b94d;
}

html[data-theme="dark"] .centro-admin-warning span {
  color: #b9a27a;
}

html[data-theme="dark"] .ampliacion-origin {
  border-color: #29475c;
  background: #0a1c2b;
}

html[data-theme="dark"] .ampliacion-origin span {
  color: #e6f0f6;
}

html[data-theme="dark"] .ampliacion-participantes-header strong {
  color: #d8e5ee;
}

html[data-theme="dark"] .ampliacion-participantes-header span {
  color: #8197a8;
}

html[data-theme="dark"] .ampliacion-add-button {
  border-color: #29475c;
  background: #102638;
  color: #8fb9d6;
}

html[data-theme="dark"] .ampliacion-add-button:hover {
  border-color: rgba(0, 166, 81, 0.38);
  background: rgba(0, 166, 81, 0.10);
  color: #42d985;
}

html[data-theme="dark"] .ampliacion-select {
  border-color: #29475c;
  background: #0a1c2b;
}

html[data-theme="dark"] .ampliacion-select:focus-within {
  border-color: rgba(0, 166, 81, 0.72);
  background: #0d2233;
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.10);
}

html[data-theme="dark"] .center-admin-modal, html[data-theme="dark"] .ampliacion-modal, html[data-theme="dark"] .audit-detail-modal {
  scrollbar-width: thin;
  scrollbar-color: #49657a #0a1c2b;
}

html[data-theme="dark"] .center-admin-modal::-webkit-scrollbar, html[data-theme="dark"] .ampliacion-modal::-webkit-scrollbar, html[data-theme="dark"] .audit-detail-modal::-webkit-scrollbar {
  width: 10px;
}

html[data-theme="dark"] .center-admin-modal::-webkit-scrollbar-track, html[data-theme="dark"] .ampliacion-modal::-webkit-scrollbar-track, html[data-theme="dark"] .audit-detail-modal::-webkit-scrollbar-track {
  background: #0a1c2b;
}

html[data-theme="dark"] .center-admin-modal::-webkit-scrollbar-thumb, html[data-theme="dark"] .ampliacion-modal::-webkit-scrollbar-thumb, html[data-theme="dark"] .audit-detail-modal::-webkit-scrollbar-thumb {
  border: 2px solid #0a1c2b;
  border-radius: 999px;
  background: #49657a;
}

html[data-theme="dark"] .center-admin-modal::-webkit-scrollbar-thumb:hover, html[data-theme="dark"] .ampliacion-modal::-webkit-scrollbar-thumb:hover, html[data-theme="dark"] .audit-detail-modal::-webkit-scrollbar-thumb:hover {
  background: #5b788e;
}

/* TEMA - ADMINISTRACION */
html[data-theme="dark"] .admin-page {
  background: #071725;
}

html[data-theme="dark"] .admin-page-branded {
  background: linear-gradient(rgba(7, 23, 37, 0.92), rgba(7, 23, 37, 0.92)),
      url("../img/admin-same-bg.png") center center / cover no-repeat;
}

html[data-theme="dark"] .admin-page-header h1 {
  color: #edf4f9;
}

html[data-theme="dark"] .admin-page-header p {
  color: #95aabb;
}

html[data-theme="dark"] .users-card {
  border-color: #203d52;
  background: #0d2233;
}

html[data-theme="dark"] .users-table th {
  border-bottom-color: #244157;
  background: #11293c;
  color: #91a8b9;
}

html[data-theme="dark"] .users-table td {
  border-bottom-color: #18364b;
  color: #c8d7e5;
}

html[data-theme="dark"] .users-table tbody tr:hover {
  background: #122b3e;
}

html[data-theme="dark"] .users-identity strong {
  color: #edf4f9;
}

html[data-theme="dark"] .users-identity small {
  color: #8fa5b6;
}

html[data-theme="dark"] .role-badge.admin {
  border-color: rgba(116, 178, 255, 0.24);
  background: rgba(65, 139, 230, 0.14);
  color: #74b2ff;
}

html[data-theme="dark"] .role-badge.editor {
  border-color: rgba(255, 155, 92, 0.24);
  background: rgba(255, 118, 37, 0.14);
  color: #ff9b5c;
}

html[data-theme="dark"] .last-access {
  color: #8fa5b6 !important;
}

html[data-theme="dark"] .presence-badge.online {
  color: #31c878;
}

html[data-theme="dark"] .presence-badge.online .presence-dot {
  background: #31c878;
  box-shadow: 0 0 0 3px rgba(49, 200, 120, 0.1);
}

html[data-theme="dark"] .presence-badge.offline {
  color: #7f93a3;
}

html[data-theme="dark"] .presence-badge.offline .presence-dot {
  background: #667d8f;
}

html[data-theme="dark"] .icon-button {
  border: 1px solid #29475c;
  background: #102638;
  color: #8faec4;
  box-shadow: none;
}

html[data-theme="dark"] .icon-button:hover {
  border-color: #365970;
  background: #142e42;
  color: #eaf2f8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .icon-button.danger:hover {
  border-color: rgba(229, 72, 77, 0.34);
  background: rgba(229, 72, 77, 0.12);
  color: #ff8589;
}

html[data-theme="dark"] .icon-button.success:hover {
  border-color: rgba(0, 166, 81, 0.34);
  background: rgba(0, 166, 81, 0.13);
  color: #42d985;
}

html[data-theme="dark"] .icon-button:disabled {
  border-color: #223e52;
  background: #0d2233;
  color: #587287;
  opacity: 0.62;
  cursor: default;
  box-shadow: none;
}

html[data-theme="dark"] .admin-table-footer {
  border-color: #28455a;
  background: #0a1c2b;
}

html[data-theme="dark"] .admin-results-count {
  color: #91a6b6;
}

html[data-theme="dark"] .admin-page-button {
  border-color: #2a485e;
  background: #0d2233;
  color: #b8cad7;
}

html[data-theme="dark"] .admin-page-button:hover {
  border-color: #3f6179;
  background: #142e42;
  color: #eef5f9;
}

html[data-theme="dark"] .admin-page-button.active {
  border-color: var(--same-green);
  background: var(--same-green);
  color: #ffffff;
}

html[data-theme="dark"] .admin-page-button.disabled {
  border-color: #243e52;
  background: #0b1d2b;
  color: #567083;
}

html[data-theme="dark"] .admin-page-ellipsis {
  color: #71899a;
}

html[data-theme="dark"] .admin-skeleton-card {
  border-color: #28455a;
  background: #0d2233;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .admin-skeleton-head {
  border-color: #28455a;
  background: #10283b;
}

html[data-theme="dark"] .admin-skeleton-row {
  border-color: #203c50;
  background: #0d2233;
}

html[data-theme="dark"] .admin-skeleton-footer {
  border-color: #28455a;
  background: #0a1c2b;
}

html[data-theme="dark"] .admin-skeleton-bar, html[data-theme="dark"] .admin-skeleton-pill, html[data-theme="dark"] .admin-skeleton-circle, html[data-theme="dark"] .admin-skeleton-action, html[data-theme="dark"] .admin-skeleton-page {
  background: #1c394d;
}

html[data-theme="dark"] .admin-skeleton-bar::after, html[data-theme="dark"] .admin-skeleton-pill::after, html[data-theme="dark"] .admin-skeleton-circle::after, html[data-theme="dark"] .admin-skeleton-action::after, html[data-theme="dark"] .admin-skeleton-page::after {
  background: linear-gradient(90deg, transparent, rgba(123, 163, 190, 0.2), transparent);
}

/* TEMA - MAPA */
html[data-theme="light"] .incident-map .leaflet-tile-pane {
  filter: none;
}

html[data-theme="dark"] .incident-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.72) contrast(1.12) saturate(0.82);
}

html[data-theme="light"] .map-page {
  background: linear-gradient(180deg, #f7fafc 0%, #edf4f8 100%);
}

html[data-theme="light"] .map-page-heading h1 {
  color: #102a4d;
}

html[data-theme="light"] .map-page-heading p {
  color: #536d85;
}

html[data-theme="light"] .map-summary {
  border: 1px solid #d7e3eb;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(18, 43, 71, 0.07);
}

html[data-theme="light"] .map-summary-icon {
  background: #edf8f2;
  color: var(--same-green);
}

html[data-theme="light"] .map-summary-item strong {
  color: #102a4d;
}

html[data-theme="light"] .map-summary-item span:last-child {
  color: #657b90;
}

html[data-theme="light"] .map-toolbar-separator {
  background: #d3e0e9;
}

html[data-theme="light"] .map-commune-trigger {
  color: #294b6c;
}

html[data-theme="light"] .map-commune-trigger > i:first-child {
  color: #587897;
}

html[data-theme="light"] .map-commune-chevron {
  color: #71889d;
}

html[data-theme="light"] .map-commune-trigger:hover, html[data-theme="light"] .map-commune-filter.open .map-commune-trigger {
  border-color: #b9cbd7;
  background: #ffffff;
  color: #102a4d;
  box-shadow: 0 6px 16px rgba(18, 43, 71, 0.09);
}

html[data-theme="light"] .map-type-filter-button {
  color: #294b6c;
}

html[data-theme="light"] .map-type-filter-button:not(.active):hover {
  background: #eef4f7;
  color: #102a4d;
}

html[data-theme="light"] .map-header-actions .map-header-button {
  color: #294b6c;
}

html[data-theme="light"] .map-header-actions .map-header-button:hover:not(:disabled) {
  background: #eef4f7;
  color: #102a4d;
}

html[data-theme="light"] .map-back-button {
  border-color: #d4e1e9;
  background: #ffffff;
  color: #173552;
  box-shadow: 0 4px 13px rgba(18, 43, 71, 0.05);
}

html[data-theme="light"] .map-back-button:hover {
  border-color: #bfd0dc;
  background: #ffffff;
  color: #102a4d;
  box-shadow: 0 6px 17px rgba(18, 43, 71, 0.11);
}

html[data-theme="light"] .map-page .map-card {
  border-color: #d6e2ea;
  background: #ffffff;
}

html[data-theme="light"] .map-container-wrap {
  background: #e9f1f5;
}

html[data-theme="light"] .map-loading, html[data-theme="light"] .map-error {
  background: rgba(248, 251, 253, 0.94);
}

html[data-theme="dark"] .map-page {
  background: linear-gradient(180deg, #081b2b 0%, #071725 100%);
}

html[data-theme="dark"] .map-page-heading h1 {
  color: #f3f7fa;
}

html[data-theme="dark"] .map-page-heading p {
  color: #b9cad7;
}

html[data-theme="dark"] .map-summary {
  border: 1px solid #27465c;
  background: rgba(13, 34, 51, 0.74);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .map-summary-icon {
  background: #f7fafc;
  color: var(--same-green);
}

html[data-theme="dark"] .map-summary-item strong {
  color: #f2f7fa;
}

html[data-theme="dark"] .map-summary-item span:last-child {
  color: #a9bdca;
}

html[data-theme="dark"] .map-toolbar-separator {
  background: #2b4b62;
}

html[data-theme="dark"] .map-commune-trigger {
  color: #d3e0e9;
}

html[data-theme="dark"] .map-commune-trigger > i:first-child {
  color: #dfeaf1;
}

html[data-theme="dark"] .map-commune-chevron {
  color: #8fa8ba;
}

html[data-theme="dark"] .map-commune-trigger:hover, html[data-theme="dark"] .map-commune-filter.open .map-commune-trigger {
  border-color: #3b617a;
  background: #102a3d;
  color: #ffffff;
}

html[data-theme="dark"] .map-type-filter-button {
  color: #c7d6e2;
}

html[data-theme="dark"] .map-type-filter-button:not(.active):hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

html[data-theme="dark"] .map-header-actions .map-header-button {
  color: #d0dce6;
}

html[data-theme="dark"] .map-header-actions .map-header-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

html[data-theme="dark"] .map-back-button {
  border-color: #dfe7ed;
  background: #f8fafc;
  color: #173552;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .map-back-button:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #102a4d;
  box-shadow: 0 7px 19px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .map-page .map-card {
  border-color: #1f4258;
  background: #081b2b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .map-container-wrap {
  background: #071a29;
}

html[data-theme="dark"] .map-loading, html[data-theme="dark"] .map-error {
  background: rgba(7, 23, 37, 0.94);
  color: #edf4f9;
}

html[data-theme="dark"] .map-loading span, html[data-theme="dark"] .map-error span {
  color: #98adbd;
}

html[data-theme="dark"] .map-commune-menu {
  border-color: #28475d;
  background: #0d2233;
  box-shadow: 0 17px 36px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .map-commune-action {
  background: #0d2233;
  color: #c9d7e3;
}

html[data-theme="dark"] .map-commune-action:hover, html[data-theme="dark"] .map-commune-option:hover {
  background: #163247;
  color: #ffffff;
}

html[data-theme="dark"] .map-commune-action-hide, html[data-theme="dark"] .map-commune-options {
  border-color: #244157;
}

html[data-theme="dark"] .map-commune-option {
  color: #c9d7e3;
}

html[data-theme="dark"] .map-commune-check {
  border-color: #456176;
  background: #10283a;
}

html[data-theme="dark"] .map-commune-options::-webkit-scrollbar-thumb {
  background: #456176;
}

html[data-theme="dark"] .incident-map .leaflet-control-zoom, html[data-theme="dark"] .incident-map .leaflet-control-layers, html[data-theme="dark"] .map-legend {
  border-color: #31536a;
  background: rgba(9, 30, 45, 0.94);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .incident-map .leaflet-control-zoom a {
  border-bottom-color: #294a60;
  background: rgba(13, 37, 54, 0.96);
  color: #e6eef4;
}

html[data-theme="dark"] .incident-map .leaflet-control-zoom a:hover {
  background: #17364b;
  color: #ffffff;
}

html[data-theme="dark"] .incident-map .leaflet-control-layers-expanded, html[data-theme="dark"] .map-legend {
  color: #d7e3eb;
}

html[data-theme="dark"] .incident-map .leaflet-control-layers-list {
  color: #d7e3eb;
}

html[data-theme="dark"] .map-comuna-number span {
  border-color: #38566b;
  background: rgba(10, 31, 46, 0.9);
  color: #e7eef4;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .ecues-cluster-circle {
  border-color: rgba(232, 240, 245, 0.42);
  color: #14202a;
}

html[data-theme="dark"] .ecues-map-marker-dot {
  border-color: rgba(238, 244, 248, 0.66);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .incident-map .leaflet-popup-content-wrapper, html[data-theme="dark"] .incident-map .leaflet-popup-tip {
  background: #0d2233;
  color: #eaf2f8;
}

html[data-theme="dark"] .incident-map .leaflet-popup-content-wrapper {
  border: 1px solid #29465c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .map-popup-date, html[data-theme="dark"] .map-popup-address span, html[data-theme="dark"] .map-popup-stats span, html[data-theme="dark"] .map-popup-muted, html[data-theme="dark"] .map-popup-coordinates {
  color: #91a7b8;
}

html[data-theme="dark"] .map-popup-address strong, html[data-theme="dark"] .map-popup-stats strong {
  color: #edf4f9;
}

html[data-theme="dark"] .map-popup-type {
  background: rgba(0, 166, 81, 0.12);
  color: #42d982;
}

html[data-theme="dark"] .map-popup-stats div {
  border-color: #29465c;
  background: #10283a;
}

html[data-theme="dark"] .map-popup-participant {
  background: #183247;
  color: #c9d7e3;
}

html[data-theme="dark"] .map-popup-coordinates {
  border-top-color: #29465c;
}

/* TEMA - TOASTS */
html[data-theme="dark"] .ecues-toast {
  border-color: #28455a;
  background: rgba(10, 28, 43, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .ecues-toast.success {
  --toast-soft: rgba(0, 166, 81, 0.14);
}

html[data-theme="dark"] .ecues-toast.error {
  --toast-soft: rgba(229, 57, 53, 0.14);
}

html[data-theme="dark"] .ecues-toast.warning {
  --toast-soft: rgba(245, 158, 11, 0.14);
}

html[data-theme="dark"] .ecues-toast.info {
  --toast-soft: rgba(47, 128, 237, 0.14);
}

html[data-theme="dark"] .ecues-toast-title {
  color: #e7f0f6;
}

html[data-theme="dark"] .ecues-toast-message {
  color: #9fb1bf;
}

html[data-theme="dark"] .ecues-toast-close {
  color: #8fa5b6;
}

html[data-theme="dark"] .ecues-toast-close:hover {
  background: #142e42;
  color: #e7f0f6;
}

html[data-theme="dark"] .ecues-toast-progress {
  background: #20394c;
}

/* TEMA - COOKIES */
html[data-theme="dark"] .cookie-consent {
  border-color: #29475c;
  background: rgba(13, 34, 51, 0.96);
  color: #eaf2f8;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .cookie-consent-icon {
  background: rgba(0, 166, 81, 0.14);
  color: #42d985;
}

html[data-theme="dark"] .cookie-consent-copy strong {
  color: #edf4f9;
}

html[data-theme="dark"] .cookie-consent-copy p {
  color: #91a7b8;
}

html[data-theme="dark"] .cookie-consent-button.secondary {
  border-color: #29475c;
  background: #102638;
  color: #b9cad6;
}

html[data-theme="dark"] .cookie-consent-button.secondary:hover {
  border-color: #3b617a;
  background: #142e42;
  color: #ffffff;
}

/* TEMA - OTROS */
html[data-theme="dark"] body {
  background: var(--theme-bg);
  color: var(--theme-text);
}

html[data-theme="dark"] .variation small {
  color: #8ca2b4;
}

html[data-theme="dark"] .user-modal-icon {
  background: rgba(255, 100, 18, 0.14);
  color: #ff8f50;
}

/* TEMA - MODALES / CENTROS */
html[data-theme="dark"] .user-form-modal > form, html[data-theme="dark"] .centro-modal > form, html[data-theme="dark"] .ampliacion-modal > form {
  scrollbar-color: #49657a transparent;
}

html[data-theme="dark"] .user-form-modal > form::-webkit-scrollbar-thumb, html[data-theme="dark"] .centro-modal > form::-webkit-scrollbar-thumb, html[data-theme="dark"] .ampliacion-modal > form::-webkit-scrollbar-thumb {
  background: #49657a;
  background-clip: padding-box;
}

html[data-theme="dark"] .modal-field-help {
  color: #8197a9;
}

html[data-theme="dark"] .centro-preview {
  border-color: rgba(66, 217, 133, 0.18);
  background: rgba(0, 166, 81, 0.07);
}

html[data-theme="dark"] .centro-preview-icon {
  background: rgba(0, 166, 81, 0.14);
  color: #42d985;
}

html[data-theme="dark"] .centro-preview span, html[data-theme="dark"] .centro-preview small {
  color: #8fa5b6;
}

html[data-theme="dark"] .centro-preview strong {
  color: #edf4f9;
}

/* MODALES - NORMALIZACION DE CAMPOS */
.modal-panel .login-field label {
  font-size: 14px;
}

.modal-panel .login-input input, .modal-panel .login-input.user-select .ecues-select-trigger, .modal-panel .centro-tags input {
  font-size: 12px;
}

.modal-panel .modal-field-help {
  font-size: 10px;
}

/* RESPONSIVE */


@media (max-height: 850px) {
  /* IMPORTACION */
  [data-import-modal] {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .import-modal {
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
  }

  .import-modal-body {
    min-height: 0;
    max-height: calc(100dvh - 96px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #9db0bf transparent;
  }

  .import-modal-body::-webkit-scrollbar {
    width: 6px;
  }

  .import-modal-body::-webkit-scrollbar-track {
    background: transparent;
  }

  .import-modal-body::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #9db0bf;
  }

  html[data-theme="dark"] .import-modal-body {
    scrollbar-color: #3d6078 transparent;
  }

  html[data-theme="dark"] .import-modal-body::-webkit-scrollbar-thumb {
    background: #3d6078;
  }

  .import-validation-details {
    max-height: 110px;
  }
}


@media (max-width: 700px) {
  /* IMPORTACION */
  [data-import-modal] {
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
  }

  .import-modal {
    width: 100%;
    max-width: 620px;
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    padding: 50px 16px 18px;
    border-radius: 16px;
  }

  .import-modal > .modal-close {
    top: 12px;
    right: 12px;
  }

  .import-modal-body {
    min-height: 0;
    max-height: calc(100dvh - 88px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #9db0bf transparent;
  }

  .import-modal-body::-webkit-scrollbar {
    width: 5px;
  }

  .import-modal-body::-webkit-scrollbar-track {
    background: transparent;
  }

  .import-modal-body::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #9db0bf;
  }

  html[data-theme="dark"] .import-modal-body {
    scrollbar-color: #3d6078 transparent;
  }

  html[data-theme="dark"] .import-modal-body::-webkit-scrollbar-thumb {
    background: #3d6078;
  }

  /* En mobile no usamos el carrusel horizontal de 500%.
     Se muestra únicamente el paso activo para evitar fugas laterales. */
  .import-track {
    width: 100%;
    display: block;
    transform: none !important;
    transition: none;
  }

  .import-slide {
    width: 100%;
    display: none;
    padding: 0;
  }

  .import-modal[data-step="0"] [data-import-slide="select"],
  .import-modal[data-step="1"] [data-import-slide="analyzing"],
  .import-modal[data-step="2"] [data-import-slide="result"],
  .import-modal[data-step="3"] [data-import-slide="importing"],
  .import-modal[data-step="4"] [data-import-slide="complete"] {
    display: block;
  }

  .import-slide .user-modal-icon {
    margin-top: 0;
  }

  .import-result-status {
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 11px 12px;
  }

  .import-result-status > i {
    margin-top: 1px;
    font-size: 21px;
  }

  .import-result-heading {
    margin-bottom: 15px;
  }

  .import-result-heading p {
    overflow-wrap: anywhere;
  }

  .import-kpis {
    gap: 8px;
    margin-bottom: 14px;
  }

  .import-kpi {
    padding: 12px 7px;
  }

  .import-kpi strong {
    font-size: 18px;
  }

  .import-summary, .import-complete-detail {
    margin-bottom: 15px;
  }

  .import-summary div, .import-complete-detail div {
    gap: 10px;
    padding: 9px 10px;
  }

  .import-validation {
    margin-bottom: 15px;
    padding: 12px;
  }

  .import-validation-title {
    align-items: flex-start;
    gap: 8px;
  }

  .import-validation-title span {
    font-size: 13px;
  }

  .import-validation-title strong {
    flex: 0 0 auto;
    padding-top: 2px;
    font-size: 10px;
    text-align: right;
  }

  .import-validation-grid {
    gap: 7px;
  }

  .import-validation-item {
    min-width: 0;
    gap: 7px;
    padding: 8px;
  }

  .import-validation-item strong {
    font-size: 11px;
  }

  .import-validation-item span {
    font-size: 9px;
    line-height: 1.25;
  }

  .import-validation-details {
    max-height: 180px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .import-validation-problem > strong {
    font-size: 11px;
  }

  .import-validation-problem li {
    align-items: center;
    gap: 8px;
  }

  .import-problem-main {
    min-width: 0;
  }

  .import-problem-actions {
    gap: 6px;
  }

  .import-resolve-button {
    height: 28px;
    padding: 0 8px;
  }

  .import-actions {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    margin-top: 2px;
    padding-top: 10px;
    background: #ffffff;
  }

  html[data-theme="dark"] .import-actions {
    background: #0d2233;
  }

  .import-secondary-button, .import-confirm-button {
    min-width: 0;
    height: 44px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .import-processing-slide {
    min-height: 330px;
    display: none;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 8px;
  }

  .import-modal[data-step="1"] .import-processing-slide[data-import-slide="analyzing"],
  .import-modal[data-step="3"] .import-processing-slide[data-import-slide="importing"] {
    display: flex;
  }

  .import-processing-slide .processing-icon {
    margin-top: 0;
  }

  .import-processing-slide .import-progress {
    width: 100%;
  }

  .import-complete-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 16px;
  }

  .import-slide > .login-footer {
    margin-top: 16px;
    padding-top: 14px;
  }
}

@media (max-width: 420px) {
  /* IMPORTACION */
  .import-modal {
    padding-left: 13px;
    padding-right: 13px;
  }

  .import-kpis {
    gap: 6px;
  }

  .import-kpi {
    padding: 11px 5px;
  }

  .import-kpi strong {
    font-size: 17px;
  }

  .import-kpi span {
    font-size: 9px;
  }

  .import-validation {
    padding: 10px;
  }

  .import-validation-item {
    padding: 7px;
  }

  .import-validation-item > i {
    font-size: 14px;
  }

  .import-validation-problem li {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .import-problem-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .import-actions {
    flex-direction: column;
  }

  .import-secondary-button, .import-confirm-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  /* COOKIE CONSENT */
  .cookie-consent {
    width: calc(100vw - 24px);
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    bottom: 12px;
    padding: 14px;
  }

  .cookie-consent-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .cookie-consent-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .cookie-consent-button {
    flex: 1 1 0;
  }
}


@media (max-width: 680px) {
  /* TOASTS */
  .ecues-toast-container {
    width: auto;
    top: 82px;
    right: 12px;
    left: 12px;
  }

  .ecues-toast {
    grid-template-columns: 5px 38px minmax(0, 1fr) 28px;
    column-gap: 10px;
  }
}


@media (prefers-reduced-motion: reduce) {
  /* HEADER */
  body, .topbar, .hero, .dashboard, .footer, .kpi-card, .chart-card, .period-card, .theme-switch-indicator {
    transition: none !important;
  }

  /* ADMINISTRACION */
  .admin-listing > .users-card, .admin-listing > .admin-table-footer, .admin-skeleton-overlay {
    transition: none;
  }

  .admin-content-enter {
    transform: none;
  }

  .admin-skeleton-bar::after, .admin-skeleton-pill::after, .admin-skeleton-circle::after, .admin-skeleton-action::after, .admin-skeleton-page::after {
    animation: none;
  }

  /* SELECT ECUES */
  .ecues-select-menu {
    transition: none;
  }

  /* MODAL DE GRAFICOS */
  .chart-modal {
    transition: none;
  }

  .chart-modal-backdrop {
    transition: none;
  }

  .chart-modal-dialog {
    transition: none;
  }

  /* MODAL DE INFORME */
  .report-modal, .report-modal-backdrop, .report-modal-dialog {
    transition: none;
  }

  .report-modal-spinner {
    animation-duration: 1.4s;
  }

  /* COOKIE CONSENT */
  .cookie-consent, .cookie-consent-button {
    transition: none;
  }
}
