:root {
  --bg: #eef6ff;
  --bg-2: #dff1ff;
  --text: #10233b;
  --brand: #2563eb;
  --brand-2: #38bdf8;
  --muted: #4a6480;
  --card: #ffffff;
  --shadow-soft: 0 12px 28px rgba(37, 99, 235, 0.12);
  --shadow-hover: 0 16px 32px rgba(56, 189, 248, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top right, #c8e7ff 0%, transparent 35%),
    radial-gradient(circle at bottom left, #d6ecff 0%, transparent 30%),
    linear-gradient(170deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(1050px, 92%);
  margin: 0 auto;
}

.auth-main .container.container--dashboard {
  width: min(1720px, 97%);
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(239, 247, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #cde5ff;
  z-index: 20;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.9rem 0;
}

.dash-header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.dash-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.dash-nav-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  color: var(--brand);
  transition: color 0.2s ease;
}

.dash-nav-icon path,
.dash-nav-icon circle,
.dash-nav-icon rect {
  stroke: currentColor;
}

.dash-nav-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.dash-nav-btn:hover .dash-nav-icon {
  color: var(--brand);
}

.dash-nav-btn--active {
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  border-color: transparent;
  color: #fff;
}

.dash-nav-btn--active .dash-nav-icon {
  color: #e8f0ff;
}

.dash-nav-btn--active:hover {
  color: #fff;
}

.dash-nav-btn--active:hover .dash-nav-icon {
  color: #fff;
}

/* Botones pill + icono (dashboard: cabecera, clima, panel) */
.site-header .dash-header-nav > .button,
.dashboard-layout .button,
.dashboard-layout .clima-preset,
.dashboard-layout .cob-year-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-radius: 9999px;
  margin-top: 0;
  vertical-align: middle;
}

.site-header .dash-header-nav > .button.button-add {
  padding: 0.38rem 0.78rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.button.button-add .dash-nav-icon,
.clima-preset.button .dash-nav-icon,
.cob-year-nav.button .dash-nav-icon {
  color: var(--brand);
}

.button.button-add:hover .dash-nav-icon,
.clima-preset.button:hover .dash-nav-icon,
.cob-year-nav.button:hover:not(:disabled) .dash-nav-icon {
  color: var(--brand);
}

.button:not(.button-add):not(.custom-panel-remove) .dash-nav-icon {
  color: rgba(255, 255, 255, 0.95);
}

.custom-panel-remove.button .dash-nav-icon {
  color: #b91c1c;
}

.custom-panel-remove.button:hover .dash-nav-icon {
  color: #991b1b;
}

.nav-wrap h1 {
  margin: 0;
  color: #0f4fd8;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(15, 79, 216, 0.45));
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  position: relative;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 0.2rem 0.1rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.28rem;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

nav a:hover {
  color: var(--brand);
  transform: translateY(-2px);
}

nav a:hover::after {
  transform: scaleX(1);
}

.section {
  padding: 4.5rem 0;
  position: relative;
  overflow: clip;
}

.hero-carousel {
  background: linear-gradient(140deg, #f7fbff 0%, #e6f4ff 100%);
  border: 1px solid #c9e4ff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 0 0 0.85rem;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  position: relative;
  min-height: min(68vh, 540px);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #d9f0ff 0%, #c8eaff 55%, #e8f7ff 100%);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slide.is-active {
  opacity: 1;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(1.08) contrast(1.02);
}

.slide-caption {
  position: absolute;
  inset: auto 1.2rem 1.2rem 1.2rem;
  z-index: 2;
  background: linear-gradient(140deg, rgba(8, 25, 51, 0.78), rgba(17, 95, 194, 0.55));
  border: 1px solid rgba(188, 225, 255, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(4px);
}

.slide-caption h2 {
  margin: 0;
  color: #e8f5ff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  font-size: clamp(1.2rem, 3.2vw, 2rem);
  opacity: 0;
  transform: translateY(10px);
}

.slide-caption p {
  margin: 0.35rem 0 0;
  color: #dff2ff;
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  opacity: 0;
  transform: translateY(10px);
}

.slide-caption small {
  display: block;
  margin-top: 0.35rem;
  color: #c3e7ff;
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(10px);
}

.slide.is-active .slide-caption h2 {
  animation: textIn 0.75s ease 0.2s forwards;
}

.slide.is-active .slide-caption p {
  animation: textIn 0.75s ease 0.35s forwards;
}

.slide.is-active .slide-caption small {
  animation: textIn 0.75s ease 0.5s forwards;
}

.carousel-dots {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin: 0.9rem 0 0.45rem;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: #96cfff;
  opacity: 0.6;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.carousel-dots button.is-active {
  background: #1f7fe8;
  opacity: 1;
  transform: scale(1.25);
}

.hero-domain {
  display: table;
  margin: 0.1rem auto 0;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #2f5f92;
  background: rgba(231, 246, 255, 0.85);
  border: 1px solid rgba(156, 204, 240, 0.55);
  box-shadow: 0 3px 10px rgba(58, 121, 186, 0.14);
}

.section h3 {
  margin-top: 0;
  font-size: 1.8rem;
  color: #1047b7;
}

.alt {
  background: linear-gradient(180deg, rgba(199, 233, 255, 0.15), rgba(255, 255, 255, 0));
}

.section .container {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section .container:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

#equipos .container,
#contacto .container,
#ingresar .container,
.alt .container {
  background: var(--card);
  border: 1px solid #d1e8ff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

#equipos .container:hover {
  transform: none;
  box-shadow: var(--shadow-soft);
}

.catalog-title {
  margin: 2rem 0 0.35rem;
  font-size: 1.35rem;
  color: #1047b7;
}

.catalog-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (max-width: 700px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #cfe6ff;
  background: linear-gradient(145deg, #fbfdff 0%, #eef6ff 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
  border-color: #a8d4ff;
}

.product-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #d9f0ff, #e8f5ff);
  border: 1px solid #c5e3ff;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-name {
  margin: 0;
  font-size: 1rem;
  color: #0f4fd8;
  line-height: 1.25;
}

.product-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #c8dff5;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.product-price {
  font-weight: 800;
  font-size: 1rem;
  color: #0b3d8a;
  letter-spacing: 0.02em;
}

.button-cart {
  margin-top: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.button-add {
  margin-top: 0;
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  white-space: nowrap;
  line-height: 1.2;
  background: transparent;
  color: #1f5fbf;
  border: 1px solid #7eb8f0;
  box-shadow: none;
}

.button-add:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: #4f9ae8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

ul {
  padding-left: 1.1rem;
}

.button {
  display: inline-block;
  margin-top: 0.8rem;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.button:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.32);
}

.site-footer {
  border-top: 1px solid #cfe7ff;
  padding: 1rem 0;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
}

@keyframes textIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .nav-wrap {
    flex-direction: column;
    gap: 0.6rem;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .carousel-track {
    min-height: 380px;
  }

  .hero-domain {
    font-size: 0.66rem;
  }

  .product-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .product-thumb {
    flex: none;
    width: 100%;
    max-width: 160px;
    height: 120px;
  }

  .product-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .product-actions {
    flex-wrap: nowrap;
  }

  .button-cart,
  .button-add {
    padding: 0.26rem 0.48rem;
    font-size: 0.66rem;
  }
}

/* --- Auth / Dashboard --- */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.auth-shell {
  max-width: 480px;
}

.auth-card {
  background: var(--card);
  border: 1px solid #d1e8ff;
  border-radius: 14px;
  padding: 1.5rem 1.35rem 1.75rem;
  box-shadow: var(--shadow-soft);
}

.dashboard-card {
  max-width: 560px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.auth-tab {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid #b8d9f5;
  border-radius: 8px;
  background: #eef6ff;
  color: #1a4a7a;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-tab.is-active {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

.auth-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: #1047b7;
}

.auth-panel h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
  color: #1047b7;
}

.auth-form label {
  display: block;
  margin-bottom: 0.85rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #b8d4ef;
  border-radius: 8px;
  font-size: 1rem;
  background: #fbfdff;
}

.auth-form .button {
  margin-top: 0.5rem;
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.auth-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 1rem;
}

.auth-divider {
  border: 0;
  border-top: 1px dashed #c8dff5;
  margin: 1.25rem 0;
}

.auth-msg {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.auth-msg--ok {
  background: #e3f5e8;
  color: #1b5e2a;
  border: 1px solid #a8dcb5;
}

.auth-msg--error {
  background: #fdeaea;
  color: #8b1c1c;
  border: 1px solid #f0b4b4;
}

.dash-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 1rem 0;
}

.dash-dl dt {
  margin: 0;
  font-weight: 700;
  color: #1047b7;
}

.dash-dl dd {
  margin: 0;
  color: var(--text);
}

.site-header nav .button {
  margin-top: 0;
}

/* --- Dashboard layout + gauges --- */
.dashboard-layout {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.dashboard-status {
  text-align: center;
  color: var(--muted);
}

.dashboard-panels {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.dash-panel[hidden] {
  display: none !important;
}

.dashboard-h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
  color: #1e3a5f;
}

.dashboard-h3:first-of-type {
  margin-top: 0.5rem;
}

.dashboard-h3--variables-title {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  border-bottom: 1px solid rgba(30, 58, 95, 0.12);
  padding-bottom: 0.35rem;
}

.dashboard-user-device-block {
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.dashboard-user-device-block .dashboard-h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e40af;
}

.dashboard-user-device-block .clima-field--usuario-mac {
  margin-bottom: 0;
}

.dashboard-user-device-block .clima-field--usuario-desc {
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.dashboard-user-device-block .clima-field--usuario-mac-alta {
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.dashboard-user-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin-top: 0.75rem;
  align-items: center;
}

.dashboard-user-device-actions .button {
  margin-top: 0;
}

.dashboard-user-device-hint {
  margin-top: 0.55rem;
  margin-bottom: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.button-danger-outline {
  background: #fff;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.55);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.12);
}

.button-danger-outline:hover {
  background: #fef2f2;
  color: #991b1b;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.18);
}

.clima-field--usuario-mac-alta {
  max-width: 28rem;
}

.dashboard-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.clima-field--usuario-mac {
  max-width: 28rem;
  margin-bottom: 0.25rem;
}

.clima-field--usuario-desc {
  max-width: 28rem;
  margin-bottom: 0.25rem;
}

.clima-field--usuario-desc .clima-input {
  width: 100%;
  box-sizing: border-box;
}

.dash-device-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 0.9rem;
}

.dash-device-list li {
  margin-bottom: 0.35rem;
}

.dash-device-list-empty {
  list-style: none;
  padding-left: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dash-device-list-empty code {
  font-size: 0.8rem;
}

.dash-var-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.45rem 1rem;
  margin: 0 0 0.5rem;
  max-width: 42rem;
}

.dash-var-panel label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text);
}

.dash-var-panel--rich label.dash-var-option {
  align-items: flex-start;
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
}

.dash-var-panel--rich label.dash-var-option:hover {
  background: rgba(37, 99, 235, 0.06);
}

.dash-var-option__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.dash-var-option__code {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #1e40af;
}

.dash-var-option__name {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

.clima-table .th-var {
  text-align: left;
  vertical-align: bottom;
  min-width: 4.5rem;
}

.clima-table .th-var__code {
  display: block;
  font-weight: 700;
  font-size: 0.72rem;
  color: #1e40af;
  letter-spacing: 0.03em;
}

.clima-table .th-var__desc {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.15rem;
  line-height: 1.2;
}

.dash-var-panel-msg {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.dash-var-panel-msg--err {
  color: #b45309;
}

.dash-device-config-url {
  font-size: 0.78rem;
  word-break: break-all;
  max-width: 42rem;
}

.dash-device-config-url code {
  font-size: 0.76rem;
}

.dash-var-unified-wrap {
  margin-top: 0.5rem;
  max-width: 56rem;
}

.dash-unified-mac-hint {
  margin: 0;
}

.dash-unified-device-row {
  margin-bottom: 0.75rem;
}

.dash-device-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 28rem;
}

.dash-device-name-field span {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.dash-unified-table-scroll {
  overflow-x: auto;
  margin-bottom: 0.65rem;
}

.dash-unified-vars-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-unified-vars-table th,
.dash-unified-vars-table td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
  text-align: left;
}

.dash-unified-vars-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

.dash-unified-th-cb,
.dash-unified-td-cb {
  width: 3.25rem;
  text-align: center !important;
  white-space: nowrap;
}

.dash-unified-td-cb input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.dash-unified-td-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.dash-unified-vars-table .clima-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dash-unified-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-etiquetas-editor-wrap {
  margin-top: 0.5rem;
  max-width: 52rem;
}

.dash-etiquetas-mac-hint {
  margin: 0;
}

.dash-etiquetas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.dash-etiquetas-table th,
.dash-etiquetas-table td {
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  text-align: left;
}

.dash-etiquetas-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

.dash-etiq-code {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #1e40af;
}

.dash-etiquetas-table .clima-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dash-etiquetas-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: #1047b7;
}

.dashboard-user-card {
  padding-bottom: 1.25rem;
}

.dashboard-user-card .dash-dl--inline {
  padding: 0.65rem 0 0.15rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 0.15rem;
}

.dashboard-user-card .button {
  margin-top: 0;
  flex-shrink: 0;
  align-self: flex-start;
}

.dashboard-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dash-dl--inline {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.dashboard-gauges-card {
  max-width: none;
  width: 100%;
}

.gauges-header {
  margin-bottom: 1rem;
}

.gauges-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  color: #1047b7;
}

.gauges-date {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-transform: capitalize;
}

.gauges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 900px) {
  .gauges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.gauge-card {
  background: linear-gradient(165deg, #ffffff 0%, #f0f8ff 42%, #e8f4fc 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 1.15rem 1rem 1.1rem;
  text-align: center;
  box-shadow:
    0 4px 6px rgba(37, 99, 235, 0.04),
    0 12px 28px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gauge-card:focus-within {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.gauge-card--round:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 12px rgba(37, 99, 235, 0.06),
    0 20px 36px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.gauge-card--compass {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .gauge-card--compass {
    grid-column: span 1;
  }
}

.gauge-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: #1e40af;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gauge-svg-wrap {
  max-width: 220px;
  margin: 0 auto;
}

.gauge-svg-wrap--round {
  max-width: 200px;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.12));
}

.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge-svg--round {
  overflow: visible;
}

.gauge-face {
  stroke: rgba(147, 197, 253, 0.55);
  stroke-width: 1.25;
}

.gauge-hub {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.25));
}

.gauge-tick-mark {
  stroke: rgba(30, 64, 175, 0.35);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.gauge-tick-label {
  font-size: 8.5px;
  fill: #64748b;
  font-weight: 600;
}

.gauge-current {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0891b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
  cursor: help;
  border-radius: 8px;
  padding: 0.15rem 0.25rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

.gauge-ultimo-line {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: help;
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  margin-left: -0.35rem;
  margin-right: -0.35rem;
}

.gauge-ultimo-line .gauge-ultimo {
  color: #047857;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: help;
}

.compass-ultimo-line {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: help;
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
}

.compass-ultimo {
  color: #047857;
  font-weight: 700;
  cursor: help;
}

.gauge-minmax {
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.45rem;
  margin-top: 0.15rem;
  border-top: 1px solid rgba(186, 230, 253, 0.8);
}

.gauge-mm-cell {
  flex: 1;
  min-width: 0;
  cursor: help;
  padding: 0.45rem 0.4rem 0.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(147, 197, 253, 0.55);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gauge-mm-cell:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.gauge-mm-cell--compass {
  text-align: left;
}

.gauge-mm-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gauge-minmax strong {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: help;
}

.gauge-needle-legend {
  margin: 0.4rem 0 0;
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.compass-svg,
.compass-svg--polished {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 16px rgba(37, 99, 235, 0.14));
}

.compass-outer-ring {
  fill: #f1f5f9;
  stroke: #93c5fd;
  stroke-width: 1.5;
}

.compass-degree-tick {
  stroke: rgba(30, 58, 138, 0.35);
  stroke-width: 1;
}

.compass-degree-tick--major {
  stroke: rgba(29, 78, 216, 0.55);
  stroke-width: 1.8;
}

.compass-needle-red {
  fill: #dc2626;
  stroke: #991b1b;
  stroke-width: 0.5;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.compass-needle-gray {
  fill: #94a3b8;
  stroke: #64748b;
  stroke-width: 0.5;
}

.compass-cap {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.3));
}

.compass-n {
  font-size: 19px;
  font-weight: 800;
  fill: #1d4ed8;
}

.compass-ew {
  font-size: 17px;
  font-weight: 800;
  fill: #1e3a5f;
}

.compass-sub {
  font-size: 11px;
  fill: #475569;
  font-weight: 700;
}

.compass-readout {
  margin: 0.55rem 0 0.25rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: #0b3d8a;
  cursor: help;
  border-radius: 10px;
  padding: 0.15rem 0.35rem;
  display: inline-block;
}

.compass-degrees {
  display: inline-block;
  margin-right: 0.35rem;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.compass-cardinal {
  color: #0891b2;
  font-size: 1.15rem;
  font-weight: 800;
}

.compass-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.gauge-minmax--compass {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 0.45rem;
}

.gauges-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.gauges-disclaimer code {
  font-size: 0.7rem;
  background: #e8f2fc;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}

@media (max-width: 520px) {
  .gauges-grid {
    grid-template-columns: 1fr;
  }

  .gauge-card--compass {
    grid-column: 1;
  }

  .gauge-current {
    font-size: 1.6rem;
  }
}

/* --- Dashboard: clima (filtros, graficos, tabla) --- */
.dashboard-clima-toolbar-card,
.dashboard-cobertura-card,
.dashboard-clima-charts-card,
.dashboard-clima-table-card {
  max-width: none;
  width: 100%;
}

.clima-toolbar-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: #1047b7;
}

.clima-toolbar-help {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.clima-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.clima-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}

.clima-field span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clima-input {
  min-width: 12rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}

.clima-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.clima-preset {
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.clima-msg {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.clima-msg--err {
  color: #b91c1c;
}

.clima-msg--ok {
  color: #0f766e;
}

.clima-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #1047b7;
}

.cobertura-toolbar-row {
  align-items: flex-end;
}

.cob-year-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.cob-year-lbl {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  min-width: 3.5rem;
  text-align: center;
}

.cob-year-nav {
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.cob-year-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cob-year-nav:disabled .dash-nav-icon {
  opacity: 0.55;
}

.clima-table-actions {
  margin-bottom: 0.65rem;
}

.gantt-year-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  box-sizing: border-box;
}

.gantt-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 4px;
  width: 100%;
  min-width: 0;
}

.gantt-row--months {
  margin-bottom: 6px;
}

.gantt-row-label {
  width: 10rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  line-height: 14px;
  display: flex;
  align-items: center;
}

.gantt-row-label--code {
  /* Misma anchura que .gantt-row-label para alinear el carril de días */
  justify-content: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: #1e40af;
  cursor: help;
}

.gantt-row-label--muted {
  color: #94a3b8;
  font-weight: 600;
}

.gantt-row-track {
  flex: 1;
  display: flex;
  gap: 1px;
  min-width: 0;
}

.gantt-row-track--months {
  align-items: stretch;
}

.gantt-months {
  display: flex;
  width: 100%;
  min-height: 1.1rem;
}

.gantt-month-cell {
  font-size: 0.58rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  line-height: 1.15;
  padding: 2px 1px 0;
  border-left: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-month-cell:first-child {
  border-left: none;
}

.gantt-cell {
  flex: 1;
  min-width: 0;
  height: 14px;
  border-radius: 1px;
  box-sizing: border-box;
}

.gantt-cell--empty {
  background: #ebedf0;
  outline: 1px solid rgba(0, 0, 0, 0.04);
}

.cobertura-lead {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.cobertura-empty,
.cobertura-loading {
  margin: 0;
  padding: 0.75rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.cobertura-err {
  color: #b91c1c;
}

.cobertura-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.cobertura-total-num {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.cobertura-total-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.cobertura-aviso {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #0f766e;
  line-height: 1.4;
}

.cobertura-scroll {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  max-width: 100%;
  align-items: flex-start;
}

.cobertura-week-col.cobertura-week-col--dow {
  flex-shrink: 0;
  align-items: stretch;
}

.cobertura-month-slot--empty .cobertura-month-lbl--placeholder {
  color: transparent;
}

.cobertura-dow {
  box-sizing: border-box;
  min-width: 1.75rem;
  width: 100%;
  flex: 0 0 11px;
  height: 11px;
  min-height: 11px;
  max-height: 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
  text-align: right;
  padding-right: 3px;
  overflow: hidden;
}

.cobertura-weeks {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.cobertura-week-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.cobertura-month-slot {
  flex: 0 0 14px;
  height: 14px;
  min-height: 14px;
  max-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  line-height: 1;
  padding: 0;
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  min-width: 11px;
}

.cobertura-month-lbl {
  white-space: nowrap;
  line-height: 1;
  display: block;
}

.cobertura-week-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 0 0 auto;
}

.cobertura-week-stack > .cobertura-cell {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  min-height: 11px;
  max-height: 11px;
}

.cobertura-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.cobertura-cell--out {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  opacity: 0.35;
}

.cobertura-cell--var {
  outline: 1px solid rgba(15, 23, 42, 0.08);
}

.cobertura-block-title {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cobertura-vars-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.cobertura-cal-heatmaps {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
}

.cobertura-block-title--cal {
  margin-top: 0;
}

.cobertura-cal-lead {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.cob-heatmap-cal-root {
  width: 100%;
}

.cobertura-range-hint--sub {
  margin-bottom: 0;
}

.cobertura-vars-section--nested {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.cobertura-vars-lead {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.cobertura-var-block {
  margin-bottom: 1.1rem;
}

.cobertura-var-title {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.cobertura-var-desc {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.cobertura-var-legend-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
}

.cobertura-var-legend-wrap--hue {
  flex-direction: column;
  align-items: stretch;
}

.cobertura-var-legend-cap {
  flex-shrink: 0;
  max-width: 4.5rem;
  line-height: 1.2;
  align-self: center;
}

.cobertura-var-legend-stack {
  flex: 1;
  min-width: 7rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cobertura-var-legend-hue-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cobertura-var-legend {
  width: 100%;
  height: 8px;
  border-radius: 3px;
  outline: 1px solid rgba(15, 23, 42, 0.12);
}

.cobertura-var-legend--hue {
  background: linear-gradient(
    90deg,
    hsl(0, 74%, 44%),
    hsl(60, 74%, 44%),
    hsl(120, 74%, 44%),
    hsl(180, 74%, 44%),
    hsl(240, 74%, 44%),
    hsl(300, 74%, 44%),
    hsl(360, 74%, 44%)
  );
}

.cobertura-var-legend-lbls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.6rem;
  color: #64748b;
  gap: 0.25rem;
}

.cobertura-l0 {
  background: #ebedf0;
  outline: 1px solid rgba(0, 0, 0, 0.04);
}

.cobertura-l1 {
  background: #9be9a8;
}

.cobertura-l2 {
  background: #40c463;
}

.cobertura-l3 {
  background: #30a14e;
}

.cobertura-l4 {
  background: #216e39;
}

.cobertura-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cobertura-legend-cells {
  display: flex;
  gap: 3px;
  align-items: stretch;
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}

.cobertura-legend-cells > .cobertura-cell {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 12px;
  flex-shrink: 1;
}

.cobertura-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}

.cobertura-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cobertura-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cobertura-stat-val {
  font-size: 0.92rem;
  color: #0f172a;
}

.cobertura-stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.cobertura-range-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.clima-charts-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.clima-charts-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
}

.clima-chart-panel {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(165deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  padding: 0.55rem 0.65rem 0.65rem;
  box-sizing: border-box;
}

.clima-chart-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.25rem;
}

.clima-chart-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1047b7;
}

.clima-chart-winbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.clima-winbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.28rem 0.5rem;
  min-width: 2.4rem;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.45);
  background: #fff;
  color: #1e40af;
  cursor: pointer;
  line-height: 1.2;
}

.clima-winbtn .dash-nav-icon {
  width: 0.82rem;
  height: 0.82rem;
  flex-shrink: 0;
  color: var(--brand);
}

.clima-winbtn:hover {
  background: #e0f2fe;
}

.clima-winbtn--on {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-color: #1d4ed8;
}

.clima-winbtn--on .dash-nav-icon {
  color: #e8f0ff;
}

.clima-chart-micro {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  color: #0f766e;
  line-height: 1.35;
}

.clima-chart-zoomlegend {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.35;
}

.clima-chart-stack {
  width: 100%;
  box-sizing: border-box;
}

.clima-chart-canvas {
  position: relative;
  width: 100%;
  height: min(340px, 55vw);
  min-height: 260px;
}

.clima-chart-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.clima-chart-navigator {
  position: relative;
  width: 100%;
  padding-bottom: 0.15rem;
  margin-top: 0.15rem;
  user-select: none;
  touch-action: none;
}

.clima-chart-navigator-lane {
  position: relative;
  width: 100%;
  height: 28px;
}

.clima-chart-navigator-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 0;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.1);
  cursor: pointer;
}

.clima-chart-navigator-window {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  height: 100%;
  min-width: 28px;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(29, 78, 216, 0.88);
  cursor: grab;
}

.clima-chart-navigator-window:active {
  cursor: grabbing;
}

.clima-chart-navigator-window:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

.clima-chart-navigator-drag {
  display: block;
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  bottom: 0;
}

.clima-chart-navigator-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  border-radius: 6px;
  background: rgba(29, 78, 216, 0.42);
  cursor: ew-resize;
  z-index: 2;
}

.clima-chart-navigator-handle--left {
  left: 0;
}

.clima-chart-navigator-handle--right {
  right: 0;
}

.clima-chart-navigator-micro {
  margin: 0.35rem 0 0;
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.35;
}

.clima-table-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
}

.clima-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.clima-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e0f2fe;
  color: #0f172a;
  text-align: left;
  padding: 0.55rem 0.65rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  white-space: nowrap;
}

.clima-table tbody td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.clima-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.85);
}

.clima-tabla-vacio {
  text-align: center;
  color: var(--muted);
  padding: 1.25rem !important;
}

.gauges-disclaimer--subtle {
  font-size: 0.72rem;
  color: var(--muted);
}

/* —— Panel personalizado (grilla medidores / gráficos) —— */
.dashboard-custom-panel-card {
  padding: 1rem 1.15rem 1.25rem;
}

.custom-panel-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.custom-panel-head {
  margin: 0;
}

.custom-panel-save-msg.custom-panel-save-ok {
  color: #0f766e;
}

.custom-panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 720px) {
  .custom-panel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.custom-panel-cell {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-sizing: border-box;
}

.custom-panel-cell--collapsed {
  border-color: rgba(148, 163, 184, 0.32);
}

.custom-panel-cell--expanded {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.custom-panel-cell-topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.45rem;
  min-height: 2.35rem;
}

.custom-panel-cell-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.custom-panel-cell-expanded {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.custom-panel-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  padding-top: 0.35rem;
}

.panel-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.panel-icon-btn svg {
  display: block;
  flex-shrink: 0;
}

.panel-icon-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.panel-icon-btn--danger:hover {
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
}

.panel-icon-btn--edit-subtle {
  opacity: 0.38;
  color: #64748b;
}

.panel-icon-btn--edit-subtle:hover {
  opacity: 1;
  color: #1d4ed8;
}

.panel-icon-btn--toggle {
  color: #64748b;
}

.panel-icon-btn--toggle:hover {
  color: #0f172a;
}

.custom-panel-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.custom-panel-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.custom-panel-field .clima-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-panel-remove {
  align-self: flex-start;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.72rem;
  background: #fff;
  border: 1px solid rgba(185, 28, 28, 0.45);
  color: #b91c1c;
}

.custom-panel-remove:hover {
  background: #fef2f2;
}

.custom-panel-cell-body {
  min-height: 4rem;
  min-width: 0;
}

.panel-cell-placeholder {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.panel-cell-placeholder--muted {
  text-align: center;
  padding: 1rem 0;
  color: #cbd5e1;
}

.panel-widget-mount--gauge .gauge-card {
  margin: 0 auto;
  max-width: 100%;
}

.panel-widget-mount--gauge .gauge-needle-legend {
  display: none;
}

.panel-widget-mount--gauge .compass-subtitle {
  font-size: 0.62rem;
}

.panel-widget-mount--chart {
  position: relative;
  width: 100%;
  /* Antes ~220px; ahora más alto y proporcional al viewport (máx. 420px) */
  min-height: 300px;
  height: clamp(300px, 48vh, 420px);
  display: flex;
  flex-direction: column;
}

.clima-chart-stack--panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.clima-chart-stack--panel .panel-chart-canvas-inner {
  flex: 1;
  min-height: 0;
}

.panel-chart-canvas-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.panel-chart-canvas-inner canvas {
  display: block;
  max-width: 100%;
  height: 100% !important;
}

.gauge-card--mini-stat {
  padding: 0.65rem 0.75rem 0.75rem;
  max-width: 100%;
}

.gauge-mini-stat-main {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.gauge-mini-stat-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.gauge-mini-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.72rem;
  color: #475569;
}

.custom-panel-vista-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.85rem;
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.custom-panel-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}

.custom-panel-field--inline span {
  margin: 0;
  white-space: nowrap;
}

.custom-panel-field--inline .clima-input {
  min-width: 9rem;
}

.custom-panel-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

/* Asa de arrastre: mismo tratamiento visual que .panel-icon-btn--edit-subtle */
.custom-panel-drag-track {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #64748b;
  opacity: 0.38;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.custom-panel-drag-track:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  opacity: 1;
}

.custom-panel-drag-track:active {
  cursor: grabbing;
}

.custom-panel-cell--dragging .custom-panel-drag-track {
  cursor: grabbing;
  opacity: 1;
  color: #1d4ed8;
}

.custom-panel-drag-grip {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 -4px 0 currentColor,
    0 4px 0 currentColor;
}

.custom-panel-cell--dragging {
  opacity: 0.55;
  outline: 2px dashed #2563eb;
}
