@font-face {
  font-family: 'Audiowide';
  src: url('/font/Audiowide-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Audiowide';
  src: url('/font/Audiowide-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --unisolar-brand: #00c8ff;
  --unisolar-brand-bright: #00e8ff;
  --unisolar-brand-glow: rgba(0, 200, 255, 0.65);
}

.unisolar-brand {
  font-family: 'Audiowide', system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--unisolar-brand);
}

.unisolar-brand--inline {
  letter-spacing: 0.04em;
  font-size: 0.95em;
}

.unisolar-brand--login {
  display: inline-block;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.unisolar-brand--footer-copy {
  letter-spacing: 0.05em;
  font-size: 0.95em;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background-color: #0f172a;
  color: #e5e7eb;
}

#app {
  min-height: 100vh;
}

#app:has(.login-shell) {
  height: auto;
  min-height: 100vh;
  display: block;
}

#app:not(:has(.app-container)) {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.app-container--monitor {
  flex-direction: column;
  height: 100vh;
}

.monitor-fullpage-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: #020617;
  overflow: hidden;
}

.monitor-fullpage-loading__matrix {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.55;
  z-index: 0;
}

.monitor-fullpage-loading__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem 2rem;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.monitor-fullpage-loading__spinner {
  width: 52px;
  height: 52px;
}

.monitor-fullpage-loading__label {
  color: #cbd5e1;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.monitor-fullpage-loading__progress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(280px, 70vw);
}

.monitor-fullpage-loading__bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.monitor-fullpage-loading__bar-fill {
  height: 100%;
  width: 6%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
  transition: width 0.45s ease;
}

.monitor-fullpage-loading__pct {
  min-width: 2.6rem;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
}

.content--monitor {
  flex: 1;
  padding: 1rem;
  overflow: auto;
  min-height: 0;
}

.monitor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, #111827, #020617);
  border-bottom: 1px solid #1f2937;
}

.monitor-toolbar__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: calc(0.95rem * 1.15 * 1.2);
  font-weight: 500;
  color: #e5e7eb;
}

.monitor-toolbar__icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
  animation: monitor-toolbar-logo-glow 3s ease-in-out infinite;
  will-change: filter, transform;
}

@keyframes monitor-toolbar-logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(252, 211, 77, 0.45)) drop-shadow(0 0 10px rgba(34, 197, 94, 0.3));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(252, 211, 77, 0.85)) drop-shadow(0 0 18px rgba(34, 197, 94, 0.55))
      drop-shadow(0 0 24px rgba(96, 165, 250, 0.35));
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .monitor-toolbar__icon {
    animation: none;
  }
}

.monitor-toolbar__company {
  color: #fcd34d;
  font-weight: 700;
}

.monitor-toolbar__role-icon {
  display: none;
}

.monitor-toolbar__title-main {
  display: contents;
}

.monitor-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.monitor-toolbar__notifications {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  padding: 6px 12px;
  border: 2px solid rgba(148, 163, 184, 0.65);
  color: #cbd5e1;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  cursor: pointer;
  max-width: 100%;
  user-select: none;
}

.monitor-toolbar__notifications:hover:not(.monitor-toolbar__notifications--disabled) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

@media (hover: none) {
  .monitor-toolbar__notifications:hover:not(.monitor-toolbar__notifications--disabled) {
    border-color: rgba(148, 163, 184, 0.65);
    background: rgba(30, 41, 59, 0.6);
  }

  .monitor-toolbar__notifications:active:not(.monitor-toolbar__notifications--disabled) {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
  }
}

.monitor-toolbar__notifications--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.monitor-toolbar__notifications--denied {
  border-color: rgba(248, 113, 113, 0.55);
}

.monitor-toolbar__notifications-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid #64748b;
  border-radius: 4px;
  background: #0f172a;
  cursor: pointer;
  display: grid;
  place-content: center;
  box-sizing: border-box;
}

.monitor-toolbar__notifications-input:checked {
  background: #0ea5e9;
  border-color: #38bdf8;
}

.monitor-toolbar__notifications-input:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.monitor-toolbar__notifications-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.monitor-toolbar__notifications--on:not(.monitor-toolbar__notifications--disabled) {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(56, 189, 248, 0.1);
}

.monitor-toolbar__notifications--disabled .monitor-toolbar__notifications-input {
  cursor: not-allowed;
}

.monitor-toolbar__notifications-icon,
.monitor-toolbar__settings-icon {
  flex-shrink: 0;
  color: #7dd3fc;
}

.monitor-toolbar__settings-icon {
  display: block;
}

.monitor-toolbar__btn-refresh {
  border-color: #22c55e;
  color: #22c55e;
}

.monitor-toolbar__btn-refresh-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.monitor-toolbar__refresh-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.monitor-toolbar__btn-refresh.is-refreshing .monitor-toolbar__refresh-icon {
  animation: spin 0.85s linear infinite;
}

.monitor-toolbar__btn-refresh:disabled {
  opacity: 0.75;
  cursor: wait;
}

.monitor-toolbar__refresh-label {
  white-space: nowrap;
}

.monitor-toolbar__btn-logout-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.monitor-toolbar__logout-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.monitor-toolbar__logout-label {
  white-space: nowrap;
}

.monitor-toolbar__btn-refresh:hover {
  background: rgba(34, 197, 94, 0.12);
}

.monitor-toolbar__btn-logerr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  min-width: 36px;
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(30, 41, 59, 0.6);
}

.monitor-toolbar__btn-logerr-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.monitor-toolbar__logerr-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.monitor-toolbar__logerr-label {
  display: none;
  white-space: nowrap;
}

.monitor-toolbar__btn-logerr:hover {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.monitor-toolbar__btn-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  min-width: 36px;
  border-color: rgba(148, 163, 184, 0.65);
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.6);
}

.monitor-toolbar__btn-settings-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.monitor-toolbar__settings-label {
  display: none;
  white-space: nowrap;
}

.monitor-toolbar__btn-settings:hover {
  border-color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.monitor-toolbar__notifications-label {
  white-space: nowrap;
}

.monitor-settings-placeholder {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-modal--settings .admin-modal__body {
  max-height: min(78vh, 640px);
  overflow: auto;
}

.monitor-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.monitor-settings-panel {
  padding: 0.85rem 0.95rem;
  border: 1px solid #1f2937;
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.55);
}

.monitor-settings-panel--disabled {
  opacity: 0.55;
}

.monitor-settings-panel--disabled input {
  pointer-events: none;
}

.monitor-settings-panel__title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}

.monitor-settings-panel__hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.monitor-settings-panel__body .field {
  margin-bottom: 0.65rem;
}

.monitor-settings-panel__body .field:last-child {
  margin-bottom: 0;
}

.monitor-settings-form .field__group-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: #9ca3af;
  font-weight: 500;
}

.monitor-settings-form .radio-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  padding: 0.15rem 0;
}

.monitor-settings-report-freq {
  gap: 0.5rem 1.1rem;
}

.monitor-settings-form label.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  margin: 0;
  font-size: 0.9rem;
  color: #e5e7eb;
  cursor: pointer;
}

.monitor-settings-form .radio-label input[type='radio'] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
  accent-color: #38bdf8;
  cursor: pointer;
  box-sizing: border-box;
}

.monitor-settings-form label.monitor-settings-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  margin: 0;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.monitor-settings-form .monitor-settings-check input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
  accent-color: #38bdf8;
  cursor: pointer;
  box-sizing: border-box;
}

.monitor-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid #1f2937;
}

.monitor-toolbar__autorefresh {
  font-size: 0.8rem;
  padding: 6px 12px;
  border: 2px solid rgba(148, 163, 184, 0.65);
  color: #cbd5e1;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  cursor: pointer;
  max-width: 100%;
}

.monitor-toolbar__autorefresh:hover:not(:disabled) {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.monitor-toolbar__autorefresh:disabled {
  cursor: default;
}

.monitor-autorefresh-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#monitor-autorefresh-label {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sidebar {
  width: calc(225px * 0.75);
  flex-shrink: 0;
  font-size: 0.7rem;
  background: linear-gradient(180deg, #111827, #020617);
  border-right: 1px solid #1f2937;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.sidebar * {
  caret-color: transparent;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  text-align: center;
}

.sidebar-header .unisolar-app-icon--sidebar {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
}

.sidebar-header__title {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.sidebar-logo-home {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0.35rem;
}

.sidebar-logo-home img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
}

.sidebar-logo-home:hover {
  opacity: 0.92;
}

.sidebar-logo-home:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.menu {
  list-style: none;
  margin-top: 0.7rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
  color: #9ca3af;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.menu-label {
  flex: 1;
  min-width: 0;
}

.menu-item.active,
.menu-item:hover {
  background-color: #1f2937;
  color: #f9fafb;
}

.menu-divider {
  height: 0;
  margin: 0.55rem 0.25rem 0.5rem;
  padding: 0;
  border: none;
  border-top: 1px solid #334155;
  list-style: none;
  pointer-events: none;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  flex-shrink: 0;
}

.menu-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

/* Icona sole Fotovoltaico (SVG) */
.fotovoltaico-sun-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  display: inline-block;
  object-fit: contain;
}

.fotovoltaico-sun-icon--title {
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.12em;
}

.fotovoltaico-sun-icon--section {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.14em;
}

/* Upload logo brand (admin) */
.brand-logo-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px;
  border: 1px dashed #475569;
  border-radius: 8px;
  background: #0f172a;
}

.brand-logo-preview__img {
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}

.brand-logo-preview__empty {
  color: #94a3b8;
  font-size: 0.875rem;
}

.brand-logo-upload__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.brand-logo-upload__btn {
  cursor: pointer;
  margin: 0;
}

.brand-logo-upload__hint {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.brand-logo-upload__status {
  margin: 0;
  font-size: 0.8rem;
  color: #6ee7b7;
}

.brand-logo-upload__status--error {
  color: #f87171;
}

/* Pannelli "Energia Oggi" â€” bordo neon rotante (Fotovoltaico) */
.fotovoltaico-energia-oggi-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 2px;
  border-radius: 12px;
  min-width: 160px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.4),
    0 0 26px rgba(74, 222, 128, 0.22);
}

.fotovoltaico-energia-oggi-panel::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  height: 220%;
  transform: translate(-50%, -50%);
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    #1e293b 0deg,
    #1e293b 100deg,
    rgba(22, 101, 52, 0.85) 118deg,
    #22c55e 138deg,
    #86efac 158deg,
    #bbf7d0 170deg,
    #86efac 182deg,
    #22c55e 202deg,
    rgba(22, 101, 52, 0.85) 222deg,
    #1e293b 240deg,
    #1e293b 360deg
  );
  animation: fotovoltaico-neon-border-spin 2.6s linear infinite;
}

@keyframes fotovoltaico-neon-border-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.fotovoltaico-energia-oggi-panel__inner {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  background: #1e293b;
  border-radius: 10px;
  padding: 16px 24px;
  box-sizing: border-box;
}

/* Stessa animazione neon: riquadro header (potenza + energia oggi) */
.fotovoltaico-energia-oggi-panel--header {
  flex: 0 0 auto;
  align-self: stretch;
}

.fotovoltaico-energia-oggi-panel__inner--header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  justify-content: center;
  padding: 14px 18px;
  min-height: 100%;
  box-sizing: border-box;
}

/* Monitoraggio installatori: niente pannelli riassuntivi */
.content--monitor-installatore .monitor-summary,
.content--monitor-installatore .monitor-brand-cards {
  display: none !important;
}

/* Riepilogo header monitoraggio */
.monitor-summary {
  margin: 16px 0;
  padding: 12px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
}

.monitor-summary__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  width: 100%;
  box-sizing: border-box;
}

.monitor-summary__card {
  flex: 0 0 auto;
  box-sizing: border-box;
}

/* Card riepilogo per brand (Sunny / Huawei / ZCS) — stesso wrap sovrapponibile */
.monitor-brand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.monitor-brand-card {
  flex: 0 0 160px;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

.monitor-brand-cards > .fotovoltaico-energia-oggi-panel {
  flex: 0 0 160px;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  align-self: auto;
}

.monitor-stat-card {
  background: #1e293b;
  border-radius: 10px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.monitor-stat-card__label {
  color: #9ca3af;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.monitor-stat-card__label--consumo {
  color: #fde68a;
}

.monitor-stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.15;
}

.monitor-stat-card__value--nominal,
.monitor-stat-card__value--count {
  color: #e2e8f0;
}

.monitor-impianti-card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.monitor-impianti-card__metric {
  display: flex;
  flex-direction: column;
}

.monitor-impianti-card__metric--inv {
  padding-left: 16px;
  border-left: 1px solid #334155;
}

.monitor-stat-card__value--instant {
  color: #3b82f6;
}

.monitor-stat-card__value--energy {
  color: #10b981;
}

.monitor-stat-card__value--consumo {
  color: #fef08a;
}

.monitor-brand-card--placeholder {
  visibility: hidden;
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  aspect-ratio: auto !important;
  min-height: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  background: transparent;
  pointer-events: none;
}

.monitor-battery-panel__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: max-content;
  max-width: 100%;
}

.monitor-battery-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.monitor-battery-panel__body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.monitor-battery-panel__soc {
  font-size: 1.35rem;
  font-weight: 700;
  color: #a7f3d0;
  line-height: 1.1;
}

.monitor-battery-soc-unit {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.monitor-battery-panel__power {
  border-left: 1px solid #334155;
  padding-left: 12px;
  margin-left: 2px;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.monitor-plants-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.monitor-plants-table .plant-row-expand-hit {
  cursor: pointer;
}

.monitor-plants-table .plant-row-stato-cell[data-plant-errore-key] {
  cursor: pointer;
}

.monitor-planta-errore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.monitor-planta-errore-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 2px;
}

.monitor-plants-table {
  width: 100%;
  table-layout: fixed;
}

.monitor-plants-totals-row {
  border-top: 2px solid #334155;
  background: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
}

.monitor-plants-totals-row td {
  padding: 10px 12px;
}

.monitor-plants-totals-label {
  font-weight: 700;
  color: #94a3b8;
  text-align: right;
}

.monitor-summary__prelevato {
  background: #1e293b;
  border: 2px solid #eab308;
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 150px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.monitor-header-yearly {
  flex: 1 1 200px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.monitor-toolbar__title-text {
  min-width: 0;
}

.monitor-complessivi-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.monitor-complessivi-heading__label {
  line-height: 1.2;
}

.monitor-sommatoria-icon {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.monitor-sommatoria-icon--title {
  width: 1.75rem;
  height: 1.75rem;
}

.content--monitor .content-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.content--monitor .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Pannello Batteria ZCS: bordo in base allo stato (idle = statico; carica = neon verde; scarica = neon rosso) */
.fotovoltaico-batteria-panel--idle.fotovoltaico-energia-oggi-panel {
  box-shadow: none;
  background: #334155;
}
.fotovoltaico-batteria-panel--idle.fotovoltaico-energia-oggi-panel::before {
  display: none;
}

.fotovoltaico-batteria-panel--discharging.fotovoltaico-energia-oggi-panel {
  box-shadow:
    0 0 12px rgba(239, 68, 68, 0.45),
    0 0 26px rgba(248, 113, 113, 0.22);
}
.fotovoltaico-batteria-panel--discharging.fotovoltaico-energia-oggi-panel::before {
  background: conic-gradient(
    from 0deg,
    #1e293b 0deg,
    #1e293b 100deg,
    rgba(127, 29, 29, 0.88) 118deg,
    #ef4444 138deg,
    #fca5a5 158deg,
    #fecaca 170deg,
    #fca5a5 182deg,
    #ef4444 202deg,
    rgba(127, 29, 29, 0.88) 222deg,
    #1e293b 240deg,
    #1e293b 360deg
  );
  animation: fotovoltaico-neon-border-spin 2.6s linear infinite;
}

/* Pannello Rete ZCS: valore negativo = prelevato (neon rosso + sfondo rossiccio), positivo = ceduto (neon verde + sfondo verdastro) */
.fotovoltaico-rete-panel--idle.fotovoltaico-energia-oggi-panel {
  box-shadow: none;
  background: #334155;
}
.fotovoltaico-rete-panel--idle.fotovoltaico-energia-oggi-panel::before {
  display: none;
}
.fotovoltaico-rete-panel--idle .fotovoltaico-energia-oggi-panel__inner {
  background: #1e293b;
}

.fotovoltaico-rete-panel--import.fotovoltaico-energia-oggi-panel {
  box-shadow:
    0 0 12px rgba(239, 68, 68, 0.45),
    0 0 26px rgba(248, 113, 113, 0.22);
}
.fotovoltaico-rete-panel--import.fotovoltaico-energia-oggi-panel::before {
  background: conic-gradient(
    from 0deg,
    #1e293b 0deg,
    #1e293b 100deg,
    rgba(127, 29, 29, 0.88) 118deg,
    #ef4444 138deg,
    #fca5a5 158deg,
    #fecaca 170deg,
    #fca5a5 182deg,
    #ef4444 202deg,
    rgba(127, 29, 29, 0.88) 222deg,
    #1e293b 240deg,
    #1e293b 360deg
  );
  animation: fotovoltaico-neon-border-spin 2.6s linear infinite;
}
.fotovoltaico-rete-panel--import .fotovoltaico-energia-oggi-panel__inner {
  background: linear-gradient(160deg, rgba(127, 29, 29, 0.55) 0%, rgba(30, 41, 59, 0.98) 52%, #1e293b 100%);
}

.fotovoltaico-rete-panel--export.fotovoltaico-energia-oggi-panel {
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.4),
    0 0 26px rgba(74, 222, 128, 0.22);
}
.fotovoltaico-rete-panel--export.fotovoltaico-energia-oggi-panel::before {
  background: conic-gradient(
    from 0deg,
    #1e293b 0deg,
    #1e293b 100deg,
    rgba(22, 101, 52, 0.85) 118deg,
    #22c55e 138deg,
    #86efac 158deg,
    #bbf7d0 170deg,
    #86efac 182deg,
    #22c55e 202deg,
    rgba(22, 101, 52, 0.85) 222deg,
    #1e293b 240deg,
    #1e293b 360deg
  );
  animation: fotovoltaico-neon-border-spin 2.6s linear infinite;
}
.fotovoltaico-rete-panel--export .fotovoltaico-energia-oggi-panel__inner {
  background: linear-gradient(160deg, rgba(22, 101, 52, 0.5) 0%, rgba(30, 41, 59, 0.95) 52%, #1e293b 100%);
}

/* Pannello Consumo Tempo Reale: neon giallo animato + sfondo giallo */
.fotovoltaico-consumo-azienda-panel.fotovoltaico-energia-oggi-panel {
  box-shadow:
    0 0 12px rgba(245, 158, 11, 0.45),
    0 0 26px rgba(250, 204, 21, 0.28);
}
.fotovoltaico-consumo-azienda-panel.fotovoltaico-energia-oggi-panel::before {
  background: conic-gradient(
    from 0deg,
    #1e293b 0deg,
    #1e293b 100deg,
    rgba(146, 64, 14, 0.9) 118deg,
    #f59e0b 138deg,
    #facc15 158deg,
    #fde047 170deg,
    #fef08a 182deg,
    #fde047 194deg,
    #facc15 206deg,
    rgba(146, 64, 14, 0.9) 224deg,
    #1e293b 240deg,
    #1e293b 360deg
  );
  animation: fotovoltaico-neon-border-spin 2.6s linear infinite;
}
.fotovoltaico-consumo-azienda-panel .fotovoltaico-energia-oggi-panel__inner {
  background: linear-gradient(160deg, rgba(120, 53, 15, 0.58) 0%, rgba(30, 41, 59, 0.96) 52%, #1e293b 100%);
}

.btn-danger {
  border: 1px solid #f87171 !important;
  color: #fca5a5 !important;
}

.content {
  flex: 1;
  padding: 1rem;
  overflow: auto;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.15), transparent);
  display: flex;
  flex-direction: column;
}

.content-inner {
  background-color: rgba(15, 23, 42, 0.8);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  flex: 1;
  min-height: 0;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.page-title__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
}

.page-title__icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.page-hint {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: -0.35rem 0 0.85rem;
  line-height: 1.45;
}

.admin-stato-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-stato-badge--active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.admin-stato-badge--inactive {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.admin-stato-badge--expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.data-table--sistemi-fv {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}

.data-table--sistemi-fv col.sistemi-fv-azienda-col {
  width: auto;
}

.data-table--sistemi-fv th.sistemi-fv-azienda-col,
.data-table--sistemi-fv td.sistemi-fv-azienda-name {
  max-width: 0;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--sistemi-fv th.sistemi-fv-azienda-col .data-table__filter-input {
  min-width: 0;
  max-width: 100%;
}

.data-table--sistemi-fv .sistemi-fv-azienda-row {
  cursor: pointer;
}

.data-table--sistemi-fv col.sistemi-fv-stato-col,
.data-table--sistemi-fv th.sistemi-fv-stato-col,
.data-table--sistemi-fv td.sistemi-fv-stato-col {
  width: 12ch;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
  overflow: hidden;
}

.data-table--sistemi-fv td.sistemi-fv-stato-col .admin-stato-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.28rem;
  white-space: nowrap;
}

.data-table--sistemi-fv col.sistemi-fv-scadenza-col,
.data-table--sistemi-fv th.sistemi-fv-scadenza-col,
.data-table--sistemi-fv td.sistemi-fv-scadenza-col {
  width: 20ch;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.data-table--sistemi-fv .data-table__filter-input--date,
.data-table--sistemi-fv .data-table__filter-select {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.content-inner .data-table.data-table--sistemi-fv col.sistemi-fv-num-head,
.content-inner .data-table.data-table--sistemi-fv th.sistemi-fv-num-head,
.content-inner .data-table.data-table--sistemi-fv td.sistemi-fv-num-cell {
  width: 10ch;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}

.content-inner .table-wrapper:has(.data-table--sistemi-fv) {
  overflow-x: hidden;
}

.data-table--sistemi-fv .sistemi-fv-azienda-row:hover,
.data-table--sistemi-fv .sistemi-fv-azienda-row--expanded {
  background: rgba(56, 189, 248, 0.06);
}

.content-inner .data-table td.cell-ragione-sociale,
.content-inner .data-table td.sistemi-fv-azienda-name {
  font-weight: 600;
}

.content-inner .data-table td.anagrafica-azienda-name--attivo {
  font-weight: 700;
  color: #4ade80;
}

.content-inner .data-table td.anagrafica-azienda-name--scaduto {
  font-weight: 700;
  color: #f87171;
}

.data-table--sistemi-fv .sistemi-fv-num-cell {
  font-weight: 700;
  color: #38bdf8;
}

.sistemi-fv-detail-row > td {
  padding: 0 !important;
  border-top: none !important;
}

.sistemi-fv-detail-panel {
  margin: 0 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border-left: 3px solid #38bdf8;
  border-radius: 0 0.35rem 0.35rem 0;
}

.sistemi-fv-detail-panel__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.data-table--installatori {
  table-layout: auto;
  min-width: 100%;
}

.content-inner .table-wrapper:has(.data-table--installatori) {
  overflow-x: auto;
}

.data-table--installatori .installatori-row {
  cursor: pointer;
}

.data-table--installatori th.installatori-actions-col,
.data-table--installatori td.installatori-actions-cell {
  width: 2.75rem;
  text-align: center;
  white-space: nowrap;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.data-table--installatori td.installatori-push-cell {
  width: 2.75rem;
}

.data-table--installatori .icon-btn--bell {
  width: 36px;
  height: 36px;
}

.data-table--installatori .icon-btn--bell svg {
  width: 24px;
  height: 24px;
}

.installatori-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.2rem 0.35rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.installatori-expand-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.installatori-expand-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.installatori-row--expanded .installatori-expand-btn {
  color: #38bdf8;
}

.installatori-eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #38bdf8;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.installatori-eye-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #0ea5e9;
}

.installatori-eye-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.data-table--installatori .installatori-row:hover,
.data-table--installatori .installatori-row--expanded {
  background: rgba(56, 189, 248, 0.06);
}

.data-table--installatori th.installatori-num-head,
.data-table--installatori td.installatori-num-cell {
  width: 9ch;
  text-align: center;
  white-space: nowrap;
}

.data-table--installatori td.installatori-num-cell {
  font-weight: 700;
  color: #38bdf8;
}

.data-table--installatori .installatori-note-cell {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.installatori-detail-row > td {
  padding: 0 !important;
  border-top: none !important;
}

.installatori-detail-panel {
  margin: 0 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border-left: 3px solid #38bdf8;
  border-radius: 0 0.35rem 0.35rem 0;
}

.installatori-detail-panel__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.installatori-detail-panel__actions {
  margin-bottom: 0.65rem;
}

.data-table--nested .installatori-cliente-row {
  cursor: pointer;
}

.data-table--nested .installatori-cliente-row:hover,
.data-table--nested .installatori-cliente-row.selected {
  background: rgba(56, 189, 248, 0.08);
}

.installatori-dettaglio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.installatori-dettaglio-section {
  margin: 0;
}

.installatori-dettaglio-section--dati {
  border-color: rgba(56, 189, 248, 0.45);
}

.installatori-dettaglio-section--aziende {
  border-color: rgba(167, 139, 250, 0.45);
}

.installatori-dettaglio-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem 1rem;
  font-size: 0.9rem;
}

.installatori-dettaglio-meta__item--full {
  grid-column: 1 / -1;
}

.installatori-dettaglio-meta__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.installatori-dettaglio-meta__value {
  color: #e2e8f0;
  word-break: break-word;
}

.installatori-dettaglio-table-wrap {
  margin-top: 0.25rem;
}

.installatori-dettaglio-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}

.installatori-dettaglio-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1f2937;
  vertical-align: middle;
}

.installatori-dettaglio-table th.data-table__col-boolean,
.installatori-dettaglio-table td.data-table__col-boolean {
  text-align: center;
}

.installatori-dettaglio-table th.installatori-dettaglio-cliente-col,
.installatori-dettaglio-table td.installatori-dettaglio-cliente-col {
  text-align: left;
}

.installatori-dettaglio-table th.installatori-num-head,
.installatori-dettaglio-table td.installatori-num-cell {
  text-align: center;
}

.installatori-dettaglio-error-cell {
  color: #f87171;
  padding: 0.75rem 1rem;
}

.data-table--nested .installatori-cliente-name {
  font-weight: 600;
}

.data-table--nested th.installatori-num-head,
.data-table--nested td.installatori-num-cell {
  width: 10ch;
  text-align: center;
}

.data-table--nested td.installatori-num-cell {
  font-weight: 700;
  color: #38bdf8;
}

.data-table--nested {
  font-size: 0.9rem;
}

.data-table--nested .sistemi-fv-sistema-row {
  cursor: pointer;
}

.data-table--nested .sistemi-fv-sistema-row:hover {
  background: rgba(56, 189, 248, 0.08);
}

.data-table--nested .sistemi-fv-sistema-row.selected {
  background: rgba(56, 189, 248, 0.2) !important;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.sistemi-fv-eye-col {
  width: 2.75rem;
}

.sistemi-fv-eye-cell {
  text-align: center;
  white-space: nowrap;
}

.sistemi-fv-eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #38bdf8;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.sistemi-fv-eye-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #0ea5e9;
}

.sistemi-fv-eye-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.brand-fv-errors-col {
  width: 2.75rem;
}

.brand-fv-logo-col {
  width: 4.5rem;
}

.brand-fv-logo-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0.35rem 0.5rem;
}

.brand-fv-grid-logo {
  display: block;
  width: 44px;
  height: 32px;
  margin: 0 auto;
  object-fit: contain;
}

.brand-fv-grid-logo--empty {
  color: #64748b;
  font-size: 0.875rem;
}

.brand-fv-errors-cell {
  text-align: center;
  white-space: nowrap;
}

.brand-fv-errors-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fbbf24;
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.brand-fv-errors-btn:hover {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
}

.brand-fv-errors-btn:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 1px;
}

.brand-fv-error-codes-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  color: #94a3b8;
}

.brand-fv-error-codes__intro {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

.brand-fv-error-codes__intro strong {
  color: #e2e8f0;
  font-weight: 600;
}

.brand-fv-error-codes--empty {
  padding: 1.5rem 0.5rem;
  color: #94a3b8;
  text-align: center;
}

.brand-fv-error-codes__table-wrap {
  max-height: min(60vh, 520px);
}

.brand-fv-error-codes__table .brand-fv-error-codes__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: nowrap;
}

.brand-fv-error-codes__table .brand-fv-error-codes__desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  max-width: 28rem;
}

.brand-fv-error-severity {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.brand-fv-error-severity--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.brand-fv-error-severity--info {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.brand-fv-error-severity--warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.brand-fv-error-severity--error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.cell-attivo-icon {
  text-align: center;
}

.icon-attivo-status {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.78);
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.82);
}

.app-dialog {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 0.65rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  padding: 1rem 1.1rem 1.05rem;
}

.app-dialog--info {
  border-color: rgba(56, 189, 248, 0.45);
}

.app-dialog--error {
  border-color: rgba(248, 113, 113, 0.5);
}

.app-dialog__content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.app-dialog__content--center {
  justify-content: center;
}

.app-dialog__actions.app-dialog__actions--with-icon {
  justify-content: space-between;
  align-items: center;
}

.app-dialog__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.app-dialog__text {
  min-width: 0;
  flex: 1;
}

.app-dialog__hl {
  color: #22c55e;
  font-weight: 700;
  text-decoration: underline;
}

.app-dialog__text--center {
  text-align: center;
}

.app-dialog__text--center .app-dialog__message {
  text-align: center;
}

.app-dialog__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f9fafb;
}

.app-dialog__message {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #1f2937;
}

.app-dialog__textarea {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: #e5e7eb;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  resize: vertical;
  min-height: 90px;
  box-sizing: border-box;
}

.app-dialog__textarea:focus {
  outline: none;
  border-color: #2f9bd6;
  box-shadow: 0 0 0 2px rgba(47, 155, 214, 0.25);
}

.app-dialog__hint {
  margin: 0.5rem 0 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: #94a3b8;
}

.app-dialog__hint--error {
  color: #f87171;
}

.admin-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 0.65rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.admin-modal--wide {
  max-width: 640px;
}

.admin-modal--dettaglio {
  max-width: 720px;
  max-height: min(94vh, 920px);
}

.admin-modal--dettaglio.admin-modal--wide {
  max-width: 720px;
}

.admin-modal--xl {
  max-width: 780px;
  max-height: min(92vh, 860px);
}

.admin-modal--tall {
  max-height: min(94vh, 920px);
}

.admin-modal--log-error .admin-modal__body {
  max-height: min(70vh, 560px);
  overflow: auto;
}

.monitor-log-error-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.monitor-log-error-empty {
  margin: 0.5rem 0;
  color: #94a3b8;
  text-align: center;
}

.monitor-log-error-empty--error {
  color: #f87171;
}

.monitor-log-error-table-wrap {
  margin: 0 -0.15rem;
}

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

.monitor-log-error-table th,
.monitor-log-error-table td {
  padding: 0.45rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #1f2937;
  vertical-align: top;
}

.monitor-log-error-table th {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.monitor-log-error-table__row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.monitor-log-error-table__row:hover,
.monitor-log-error-table__row:focus-visible {
  background: rgba(248, 113, 113, 0.08);
  outline: none;
}

.monitor-log-error-table__data {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.monitor-log-error-table__cod {
  white-space: nowrap;
  color: #fca5a5;
}

.monitor-log-error-table__azienda {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #1f2937;
}

.admin-modal__header--with-actions .admin-modal__title {
  flex: 1;
  min-width: 0;
}

.admin-modal__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f9fafb;
}

.admin-modal__title--with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-modal__close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.admin-modal__close:hover {
  color: #f9fafb;
}

.admin-modal__body {
  padding: 1rem 1.15rem 1.15rem;
}

.admin-modal-form .form-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1f2937;
}

.sistema-fv-dettaglio-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 0.5rem;
  color: #94a3b8;
}

.sistema-fv-dettaglio-loading .spinner-ring {
  width: 28px;
  height: 28px;
}

.sistema-fv-dettaglio-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.sistema-fv-dettaglio-meta__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.sistema-fv-dettaglio-error {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.88rem;
}

.sistema-fv-dettaglio-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sistema-fv-dettaglio-stat {
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: #0f172a;
  border: 1px solid #1e293b;
}

.sistema-fv-dettaglio-stat__label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.sistema-fv-dettaglio-stat__value {
  font-size: 1.35rem;
  font-weight: 700;
}

.sistema-fv-dettaglio-stat__value--instant {
  color: #60a5fa;
}

.sistema-fv-dettaglio-stat__value--energy {
  color: #34d399;
}

.sistema-fv-dettaglio-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.sistema-fv-dettaglio-table-wrap {
  margin-bottom: 1rem;
}

.sistema-fv-dettaglio-table {
  width: 100%;
  border-collapse: collapse;
  line-height: 1.1;
}

.sistema-fv-dettaglio-table th,
.sistema-fv-dettaglio-table td {
  text-align: left;
  padding: 0;
  margin: 0;
  vertical-align: middle;
  border-bottom: 1px solid #1f2937;
}

.sistema-fv-dettaglio-table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
}

.sistema-fv-dettaglio-table tbody td {
  font-size: 0.72rem;
  line-height: 1.15;
  color: #e5e7eb;
}

.sistema-fv-dettaglio-row--alert {
  cursor: pointer;
}

.sistema-fv-dettaglio-row--alert:hover {
  background: rgba(239, 68, 68, 0.08);
}

.sistema-fv-dettaglio-row--alert.sistema-fv-dettaglio-row--selected {
  background: rgba(239, 68, 68, 0.16);
  box-shadow: inset 3px 0 0 #ef4444;
}

.sistema-fv-dettaglio-row--events:not(.sistema-fv-dettaglio-row--alert) {
  cursor: pointer;
}

.sistema-fv-dettaglio-row--events:not(.sistema-fv-dettaglio-row--alert):hover {
  background: rgba(148, 163, 184, 0.12);
}

.sistema-fv-dettaglio-row--events:not(.sistema-fv-dettaglio-row--alert).sistema-fv-dettaglio-row--selected {
  background: rgba(148, 163, 184, 0.2);
  box-shadow: inset 3px 0 0 #94a3b8;
}

.monitor-inv-row--alert {
  cursor: help;
}

.monitor-inv-row--alert:hover {
  background: rgba(239, 68, 68, 0.08);
}

.monitor-inv-stato {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.monitor-inv-stato__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.monitor-inv-stato--alert .monitor-inv-stato__dot {
  background: #ef4444;
}

.monitor-inv-errore-code {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #fca5a5;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(252, 165, 165, 0.45);
  text-underline-offset: 2px;
}

.monitor-inv-errore-code:hover {
  color: #fecaca;
  text-decoration-color: #fecaca;
}

.monitor-inv-errore-code:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
  border-radius: 2px;
}

.monitor-inv-mob--loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 4px;
}

.monitor-inv-mob__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.monitor-inv-mob__count {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  font-weight: 600;
}

.monitor-inv-mob__stato {
  font-size: 0.8rem;
}

.monitor-inv-mob-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.monitor-inv-mob-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-left: 3px solid #334155;
  border-radius: 8px;
  padding: 11px 13px;
}

.monitor-inv-mob-card--alert {
  border-left-color: #ef4444;
}

.monitor-inv-mob-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.monitor-inv-mob-card__name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #e2e8f0;
  word-break: break-word;
}

.monitor-inv-mob-card__ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #22c55e;
  white-space: nowrap;
}

.monitor-inv-mob-card__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
}

.monitor-inv-mob-card .monitor-inv-errore-code {
  font-size: 0.9rem;
  white-space: nowrap;
}

.monitor-inv-mob-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.monitor-inv-mob-card__metrics > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.monitor-inv-mob-card__metrics span {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64748b;
}

.monitor-inv-mob-card__metrics strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
}

.monitor-inv-mob-card__serial {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #64748b;
  word-break: break-all;
}

.admin-modal--errore {
  max-width: 520px;
}

.sistema-fv-errore-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
}

.sistema-fv-errore-meta__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.1rem;
}

.sistema-fv-errore-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: #0f172a;
  border: 1px solid #334155;
}

.sistema-fv-errore-code {
  font-size: 1rem;
  font-weight: 700;
  color: #fca5a5;
}

.sistema-fv-errore-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.sistema-fv-errore-badge--known {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.sistema-fv-errore-badge--unknown {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.sistema-fv-errore-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f9fafb;
}

.sistema-fv-errore-desc {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.sistema-fv-errore-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #94a3b8;
  padding: 0.5rem 0.6rem;
  border-left: 3px solid #475569;
  background: rgba(15, 23, 42, 0.6);
}

.sistema-fv-errore-eventi {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.85rem;
}

.sistema-fv-errore-eventi__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
}

.sistema-fv-errore-eventi__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.sistema-fv-evento-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.sistema-fv-evento-row--unknown {
  border-style: dashed;
}

.sistema-fv-evento-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.sistema-fv-evento-badge--error {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.sistema-fv-evento-badge--warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.sistema-fv-evento-badge--info {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.sistema-fv-evento-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sistema-fv-evento-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.sistema-fv-evento-id {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.sistema-fv-evento-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
}

.sistema-fv-evento-count {
  font-size: 0.7rem;
  color: #94a3b8;
}

.sistema-fv-evento-desc {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.sistema-fv-evento-foot {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.sistema-fv-evento-time {
  font-variant-numeric: tabular-nums;
}

.sistema-fv-dettaglio-table tbody tr:last-child td {
  border-bottom: none;
}

.sistema-fv-dettaglio-table .cell-num {
  text-align: right;
  white-space: nowrap;
}

.sistema-fv-dettaglio-empty {
  color: #64748b;
  text-align: center;
  padding: 1rem !important;
}

.sistema-fv-dettaglio-stato {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  line-height: 1;
}

.sistema-fv-dettaglio-stato__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sistema-fv-dettaglio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1f2937;
}

@media (max-width: 640px) {
  .sistema-fv-dettaglio-stats {
    grid-template-columns: 1fr;
  }

  .sistema-fv-dettaglio-table .cell-hide-narrow {
    display: none;
  }
}

.admin-anagrafica-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-anagrafica-form .admin-form-section {
  padding: 0.45rem 0.75rem;
}

.admin-anagrafica-form .admin-form-section__title {
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.admin-anagrafica-form .admin-form-section__grid,
.admin-anagrafica-form .admin-form-section__grid--3col {
  gap: 0.3rem 0.65rem;
}

.admin-anagrafica-form .field {
  margin-bottom: 0;
}

.admin-anagrafica-form .field label {
  margin-bottom: 0.12rem;
  font-size: 0.8rem;
}

.admin-anagrafica-form .field input,
.admin-anagrafica-form .field select,
.admin-anagrafica-form .admin-form-section__grid textarea {
  padding: 0.32rem 0.5rem;
}

.admin-anagrafica-form .admin-form-section__grid textarea {
  min-height: 2.75rem;
}

.admin-anagrafica-form .field--attivo-radio .radio-group {
  padding: 0.08rem 0;
  gap: 0.9rem;
}

.admin-anagrafica-form .field--attivo-radio .radio-label {
  font-size: 0.85rem;
}

.mailinglist-page {
  max-width: 680px;
}

.mailinglist-form__hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.mailinglist-form__alert {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.mailinglist-form {
  margin-top: 0.25rem;
}

.mailinglist-form .admin-form-section__grid textarea {
  min-height: 7rem;
  resize: vertical;
}

.mailinglist-recipients-field {
  position: relative;
}

.mailinglist-recipients-mirror,
.mailinglist-recipients-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 7rem;
  margin: 0;
  padding: 0.32rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  resize: vertical;
}

.mailinglist-recipients-mirror {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: #0f172a;
  background: #fff;
}

.mailinglist-recipients-mirror mark.mailinglist-recipient-known {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
}

.mailinglist-recipients-input {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: #0f172a;
}

.mailinglist-form .field .mailinglist-recipients-input {
  background: transparent;
  color: transparent;
  caret-color: #0f172a;
}

.mailinglist-recipients-input:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 0;
}

.mailinglist-recipients-legend {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.mailinglist-form .mailinglist-recipients-input {
  min-height: 7rem;
}

.mailinglist-form__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mailinglist-form__actions--top {
  margin: 0 0 1rem;
}

.mailinglist-form__feedback {
  font-size: 0.875rem;
  color: #64748b;
}

.mailinglist-form__feedback--ok {
  color: #15803d;
}

.mailinglist-form__feedback--err {
  color: #b91c1c;
}

.mailinglist-preview {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.mailinglist-preview__frame {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  background: #fff;
}

.mailinglist-preview__loading {
  margin: 0;
  padding: 1.25rem;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.admin-modal--xl .admin-modal__header {
  padding: 0.65rem 1rem;
}

.admin-modal--xl .admin-modal__body {
  padding: 0.65rem 0.85rem 0.75rem;
}

.admin-form-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.75rem 0.85rem;
}

.admin-form-section--dati {
  border-color: rgba(56, 189, 248, 0.55);
}

.admin-form-section--login {
  border-color: rgba(167, 139, 250, 0.55);
}

.admin-form-section--abbonamento {
  border-color: rgba(52, 211, 153, 0.55);
}

.admin-form-section--sms {
  border-color: rgba(251, 191, 36, 0.55);
}

.admin-form-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-form-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
}

.admin-form-section__grid .field--full {
  grid-column: 1 / -1;
}

.admin-form-section__grid--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

.admin-form-section__grid textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.35rem;
  border: 1px solid #374151;
  background-color: #020617;
  color: #e5e7eb;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
}

@media (max-width: 640px) {
  .admin-form-section__grid,
  .admin-form-section__grid--3col {
    grid-template-columns: 1fr;
  }
}

/* Pagina Home (benvenuto) */
.mfarm-home {
  display: flex;
  flex: 1;
  min-height: 0;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.mfarm-home__layout {
  text-align: center;
  max-width: 36rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mfarm-home__logo {
  display: block;
  margin: 0 auto 0.85rem;
  width: 256px;
  height: auto;
  max-width: min(256px, 70vw);
  object-fit: contain;
  animation: mfarm-home-logo-neon 2.8s ease-in-out infinite;
}

@keyframes mfarm-home-logo-neon {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.85)) drop-shadow(0 0 20px rgba(34, 197, 94, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(59, 130, 246, 1)) drop-shadow(0 0 32px rgba(34, 197, 94, 0.7))
      drop-shadow(0 0 48px rgba(96, 165, 250, 0.5));
  }
}

.mfarm-home__welcome {
  margin: 0.15rem 0 0.5rem;
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #f1f5f9;
  text-wrap: balance;
}

.mfarm-home__name {
  color: #60a5fa;
  font-weight: 600;
}

.mfarm-home__subtitle {
  margin: 0;
  line-height: 1.5;
  max-width: 28rem;
}

.mfarm-home__subtitle--tagline {
  margin-top: 0.15rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: #94a3b8;
}

.mfarm-home__subtitle--company {
  font-size: 1.02rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.03em;
}

.mfarm-home__hint {
  margin: 1.1rem 0 0;
  max-width: 26rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.55;
  color: #9ca3af;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.login-card h1 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.login-card {
  caret-color: transparent;
}

.login-card input {
  caret-color: auto;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
}

.login-shell__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.login-card h1 {
  text-align: center;
  color: #f1f5f9;
}

.login-card h1:not(:has(.unisolar-brand)) {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card__logo {
  display: block;
  margin: 0 auto 1rem;
  text-align: center;
}

.unisolar-brand-logo {
  display: block;
  background: transparent;
  object-fit: contain;
  animation: homeBrandIn 0.7s ease both, homeLogoNeon 2.6s ease-in-out 0.7s infinite;
  will-change: filter, transform;
}

.unisolar-brand-logo--hero {
  width: clamp(112px, 14vw, 152px);
  height: auto;
}

.unisolar-brand-logo--login {
  width: clamp(88px, 24vw, 112px);
  height: auto;
  margin: 0 auto;
}

.login-card__tagline {
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.login-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.login-tabs .btn-tab {
  flex: 1;
}

.login-card .btn-primary {
  width: 100%;
  margin-top: 0.75rem;
}

.field--login-tipo .field__group-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9ca3af;
}

.login-tipo-radios {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.15rem 0 0.35rem;
}

.login-tipo-radios .radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #e5e7eb;
  cursor: pointer;
  margin: 0;
}

.login-tipo-radios .radio-label input[type='radio'] {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  margin: 0;
  padding: 0;
  border: none;
  accent-color: #38bdf8;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.login-tipo-radios__icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.login-card--installatore {
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-piva-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-piva-input {
  width: 22ch;
  max-width: 22ch;
  min-width: 0;
  flex: 0 0 auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.login-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.login-remember-label input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  accent-color: #38bdf8;
}

.install-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-color: #f59e0b;
  color: #fcd34d;
}

.install-app-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.12);
  border-color: #fbbf24;
}

.install-app-btn__icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.login-install-app {
  width: 100%;
  margin-top: 0.75rem;
}

.error-message {
  display: none;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.45);
}

.error-message:not(:empty) {
  display: block;
}

.field {
  margin-bottom: 0.35rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #9ca3af;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.35rem;
  border: 1px solid #374151;
  background-color: #020617;
  color: #e5e7eb;
  box-sizing: border-box;
  font: inherit;
}

.field textarea.textarea-auto-grow {
  display: block;
  min-height: 2.25rem;
  resize: none;
  overflow-y: hidden;
  line-height: 1.35;
  field-sizing: content;
}

.field-password .password-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.field-password .password-input-wrap input {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.3rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.password-toggle-btn:hover {
  color: #e5e7eb;
  background: rgba(148, 163, 184, 0.12);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.password-toggle-btn--visible {
  color: #38bdf8;
}

.password-toggle-icon {
  display: block;
  pointer-events: none;
}

.field input.required-field,
.field select.required-field {
  border-color: #facc15;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.field select {
  min-height: 2.25rem;
  cursor: pointer;
}

.field--attivo-radio .radio-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.35rem 0;
}

.field--attivo-radio .radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  cursor: pointer;
  margin: 0;
}

.field--attivo-radio .radio-label input[type='radio'] {
  width: auto;
  margin: 0;
  accent-color: #38bdf8;
  cursor: pointer;
}

/* Icone calendario/orologio native: visibili su sfondo scuro/blu (Chromium / Safari) */
input[type='date']::-webkit-calendar-picker-indicator,
input[type='datetime-local']::-webkit-calendar-picker-indicator,
input[type='time']::-webkit-calendar-picker-indicator,
input[type='month']::-webkit-calendar-picker-indicator,
input[type='week']::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 0.95;
  cursor: pointer;
}

input[type='date']:disabled::-webkit-calendar-picker-indicator,
input[type='datetime-local']:disabled::-webkit-calendar-picker-indicator,
input[type='time']:disabled::-webkit-calendar-picker-indicator,
input[type='month']:disabled::-webkit-calendar-picker-indicator,
input[type='week']:disabled::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: not-allowed;
}

input[type='date'],
input[type='datetime-local'],
input[type='time'],
input[type='month'],
input[type='week'] {
  color-scheme: dark;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  gap: 0.35rem;
  background: rgba(31, 41, 55, 0.8);
  color: #e5e7eb;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.1s ease;
}

.btn[disabled] {
  background: #111827;
  border-color: #4b5563;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
}

.btn[disabled]:hover {
  background: #111827;
  border-color: #4b5563;
  color: #6b7280;
}

.btn:hover {
  background: rgba(55, 65, 81, 0.9);
  border-color: #4b5563;
  color: #f9fafb;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #f9fafb;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #38bdf8);
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.btn-danger {
  background: rgba(127, 29, 29, 0.6);
  color: #fecaca;
  border-color: #7f1d1d;
}

.btn-danger:hover {
  background: rgba(185, 28, 28, 0.8);
  border-color: #b91c1c;
  color: #fee2e2;
  box-shadow: 0 2px 10px rgba(185, 28, 28, 0.3);
}

.btn-ghost {
  background-color: transparent;
  color: #9ca3af;
}

.btn-ghost:hover {
  background-color: #111827;
}

@keyframes da-eseguire-border {
  0% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4);
  }
  50% {
    box-shadow: 0 0 10px 3px rgba(250, 204, 21, 0.9);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4);
  }
}

/* Pulsante Indietro: evidenziato e animato */
@keyframes btn-back-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(59, 130, 246, 0.25);
    border-color: #60a5fa;
  }
}

.btn-back {
  border: 1px solid #3b82f6 !important;
  color: #60a5fa !important;
  font-weight: 600;
  animation: btn-back-pulse 2s ease-in-out infinite;
}

.btn-back:hover {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
  animation: none;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-tab {
  border-radius: 9999px;
  padding: 0.3rem 0.9rem;
  border: 1px solid transparent;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn-tab:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: #1f2937;
  color: #e5e7eb;
}

.btn-tab.active {
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: #f9fafb;
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8), 0 10px 25px rgba(15, 23, 42, 0.9);
}

.grid-layout {
  display: grid;
  grid-template-columns: 2fr 2fr 1.5fr;
  gap: 0.75rem;
}

.panel {
  background-color: rgba(15, 23, 42, 0.95);
  border-radius: 0.6rem;
  border: 1px solid #1f2937;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.table-wrapper {
  flex: 1;
  overflow: auto;
  border-radius: 0.4rem;
  border: 1px solid #1f2937;
  user-select: none;
}

.table-wrapper.sistema-fv-dettaglio-table-wrap {
  overflow: visible;
  max-height: none;
  flex: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

/* Griglie admin (Anagrafica, Brand FV, Sistemi FV) */
.content-inner .data-table {
  font-size: 0.95rem;
  line-height: 1.45;
}

.content-inner .data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: #94a3b8;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #334155;
  background: #111827;
  white-space: nowrap;
}

.content-inner .data-table td {
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #1f2937;
  vertical-align: top;
  color: #e5e7eb;
  word-break: break-word;
}

.data-table--anagrafica {
  table-layout: fixed;
  width: 100%;
}

.data-table--anagrafica col.data-table__col-boolean,
.data-table--anagrafica th.data-table__col-boolean,
.data-table--anagrafica td.data-table__col-boolean {
  width: 6ch;
  max-width: 6ch;
  min-width: 6ch;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  text-align: center;
  overflow: hidden;
}

.data-table--anagrafica thead th {
  vertical-align: bottom;
}

.data-table--anagrafica th.data-table__col-center,
.data-table--anagrafica td.data-table__col-center {
  text-align: center;
}

.data-table--anagrafica col.data-table__col-action,
.data-table--anagrafica th.data-table__col-action,
.data-table--anagrafica td.data-table__col-action {
  width: 5.5rem;
  max-width: 5.5rem;
  min-width: 5.5rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  text-align: center;
  overflow: visible;
}

.data-table--anagrafica .data-table__action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.data-table--anagrafica .icon-btn--bell,
.data-table--anagrafica .icon-btn--report {
  width: 36px;
  height: 36px;
}

.data-table--anagrafica .icon-btn--bell svg,
.data-table--anagrafica .icon-btn--report svg {
  width: 24px;
  height: 24px;
}

.data-table--anagrafica .icon-btn--report:hover {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}

.data-table--anagrafica .icon-btn--report:focus-visible {
  outline-color: rgba(217, 119, 6, 0.6);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover {
  background: rgba(47, 155, 214, 0.12);
  border-color: rgba(47, 155, 214, 0.35);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn:focus-visible {
  outline: 2px solid rgba(47, 155, 214, 0.6);
  outline-offset: 2px;
}

.data-table--anagrafica th.data-table__col-boolean.data-table__sortable {
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  white-space: normal;
  line-height: 1.15;
  hyphens: auto;
}

.data-table--anagrafica .icon-attivo-status {
  width: 16px;
  height: 16px;
}

.data-table__sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table__sortable:hover {
  color: #e2e8f0;
}

.data-table__sortable--active {
  color: #38bdf8;
}

.data-table__sort-indicator {
  font-size: 0.72rem;
  opacity: 0.9;
}

.data-table__filter-row th {
  padding-top: 0.35rem;
  padding-bottom: 0.55rem;
  background: #0f172a;
}

.data-table__filter-input {
  width: 100%;
  min-width: 0;
  padding: 0.32rem 0.45rem;
  border-radius: 0.3rem;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.data-table__filter-input::placeholder {
  color: #64748b;
}

.data-table__filter-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.data-table__filter-select {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.15rem;
  border-radius: 0.3rem;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.78rem;
  box-sizing: border-box;
  cursor: pointer;
}

.data-table__filter-select--boolean {
  padding-right: 0.1rem;
  text-align: center;
  text-align-last: center;
}

.data-table__filter-select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.data-table__filter-input--date {
  font-size: 0.72rem;
  padding: 0.26rem 0.15rem;
  text-align: center;
}

.content-inner .data-table td.cell-brand {
  font-weight: 700;
  color: #38bdf8;
}

/* Riga selezionata — tutte le griglie (.data-table) */
.data-table tbody tr[data-id],
.data-table tbody tr.sunny-plant-row,
.data-table tbody tr.zcs-plant-row {
  cursor: pointer;
}

.data-table tbody tr[data-id]:hover,
.data-table tbody tr.sunny-plant-row:hover,
.data-table tbody tr.zcs-plant-row:hover {
  background: rgba(56, 189, 248, 0.06);
}

.data-table.zcs-plants-table tfoot td,
.data-table.zcs-inverter-subtable tfoot td {
  vertical-align: middle;
}

.data-table tbody tr.selected {
  background: rgba(56, 189, 248, 0.2) !important;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.data-table tbody tr.selected td.cell-brand {
  color: #7dd3fc;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(96, 165, 250, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Intestazioni tabella impianti: etichetta breve solo su mobile */
.monitor-plants-table thead th .th-label-short {
  display: none;
}

/* ——— Responsive: login azienda + monitoraggio ——— */
@media (max-width: 768px) {
  .login-shell__body {
    align-items: flex-start;
    padding-top: max(0.25rem, env(safe-area-inset-top));
  }

  .login-card {
    max-width: none;
    padding: 1.25rem 1.1rem;
    border-radius: 0.65rem;
  }

  .login-card h1 {
    font-size: 1.15rem;
  }

  .login-card__logo .unisolar-brand-logo--login {
    width: clamp(80px, 26vw, 100px);
  }

  .login-card .field input,
  .login-card .field select {
    font-size: 16px;
  }

  .monitor-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
  }

  .monitor-toolbar__title {
    font-size: calc(0.95rem * 1.15 * 1.2 * 0.88);
    gap: 0.45rem;
  }

  .monitor-toolbar__title--installatore {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }

  .monitor-toolbar__title-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .monitor-toolbar__title--installatore .monitor-toolbar__company {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .monitor-toolbar__role-icon {
    display: block;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    margin-left: auto;
  }

  .monitor-toolbar__icon {
    width: 1.65rem;
    height: 1.65rem;
  }

  .monitor-toolbar__title-text {
    line-height: 1.3;
  }

  .monitor-toolbar__actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .monitor-toolbar__actions .btn,
  .monitor-toolbar__notifications {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
    justify-content: center;
  }

  .monitor-toolbar__btn-settings {
    min-width: 0;
  }

  .monitor-toolbar__autorefresh,
  .monitor-toolbar__btn-refresh,
  .monitor-toolbar__btn-logerr,
  .monitor-toolbar__btn-settings,
  .monitor-toolbar .btn-ghost,
  .monitor-toolbar__notifications {
    font-size: 0.78rem;
    padding: 0.4rem 0.55rem;
  }

  .monitor-toolbar__notifications-input {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }

  .monitor-toolbar__notifications-input:checked::after {
    width: 5px;
    height: 9px;
  }

  .monitor-toolbar__settings-label,
  .monitor-toolbar__logerr-label {
    display: inline;
  }

  .content--monitor {
    padding: 0.65rem 0.5rem;
  }

  .content--monitor .page-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  /* Statistiche annuali (grafico 12 mesi): nascoste su mobile */
  .monitor-header-yearly {
    display: none !important;
  }

  .monitor-summary {
    margin: 10px 0;
    padding: 10px;
  }

  .monitor-summary__row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .monitor-summary__card,
  .monitor-summary__prelevato,
  .fotovoltaico-energia-oggi-panel--header {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .monitor-summary__prelevato {
    min-width: 0;
  }

  .fotovoltaico-energia-oggi-panel__inner--header {
    width: 100%;
  }

  .fotovoltaico-energia-oggi-panel__inner--header > div {
    width: 100%;
  }

  .monitor-brand-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    align-items: stretch;
  }

  .monitor-brand-card,
  .monitor-brand-cards > .fotovoltaico-energia-oggi-panel {
    flex: initial;
    width: auto;
    min-width: 0 !important;
    max-width: none;
    aspect-ratio: auto;
  }

  .monitor-brand-card.monitor-stat-card,
  .monitor-brand-card .fotovoltaico-energia-oggi-panel__inner,
  .monitor-brand-card .monitor-battery-panel__inner {
    padding: 9px 11px;
  }

  .monitor-brand-card .monitor-battery-panel__inner {
    min-width: 0;
  }

  .monitor-brand-cards .monitor-stat-card__label {
    font-size: 0.6rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }

  .monitor-brand-cards .monitor-stat-card__value {
    font-size: 1.12rem;
    margin-top: 2px;
  }

  .monitor-brand-cards .monitor-impianti-card {
    gap: 10px;
  }

  .monitor-brand-cards .monitor-impianti-card__metric--inv {
    padding-left: 10px;
  }

  .monitor-brand-cards .monitor-battery-panel__soc {
    font-size: 1.05rem;
  }

  .monitor-brand-card .monitor-battery-panel__body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
  }

  .monitor-brand-card .monitor-battery-panel__power {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    min-height: 0;
  }

  .monitor-brand-card--placeholder {
    display: none;
  }

  .content--monitor .table-wrapper,
  .content--monitor [style*='overflow-x:auto'] {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-bottom: 4px;
  }

  /* Lista inverter/impianti: intestazione e righe a tutta larghezza del display */
  .content--monitor .monitor-plants-table-wrap {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    padding-bottom: 4px;
  }

  /* Titolo impianto: banda con bordo a tutta riga, nome centrato e in maiuscolo */
  .content--monitor .monitor-section {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 18px !important;
  }

  .content--monitor .monitor-section-title {
    justify-content: center;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    padding: 8px 12px;
    margin-bottom: 12px !important;
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .data-table {
    font-size: 0.82rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.45rem 0.5rem;
  }

  /* Righe impianti: solo Nome, pot. istant., energia oggi, stato — una riga */
  .monitor-plants-table {
    table-layout: fixed;
    width: 100%;
  }

  .monitor-plants-table .col-hide-mobile,
  .monitor-plants-table col.col-hide-mobile {
    display: none;
  }

  .monitor-plants-table .plant-stato-full {
    display: none;
  }

  .monitor-plants-table .sunny-plant-row.monitor-plant-row--flat,
  .monitor-plants-table .zcs-plant-row.monitor-plant-row--flat,
  .monitor-plants-table .huawei-plant-row.monitor-plant-row--flat {
    cursor: default;
  }

  .monitor-plants-table .monitor-plant-row--flat:active {
    background: #1e293b;
  }

  .monitor-plants-table .plant-row-expand-hit:active {
    background: rgba(30, 41, 59, 0.65);
  }

  .monitor-plants-table .sunny-devices-row:not(.monitor-devices-row--mobile),
  .monitor-plants-table .zcs-devices-row:not(.monitor-devices-row--mobile),
  .monitor-plants-table .huawei-devices-row:not(.monitor-devices-row--mobile) {
    display: none !important;
  }

  .monitor-plants-table .plant-row-expand-hit {
    cursor: pointer;
  }

  .monitor-plants-table .plant-row-stato-cell[data-plant-errore-key] {
    cursor: pointer;
  }

  .monitor-planta-errore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    font: inherit;
    line-height: 1;
    cursor: pointer;
  }

  .monitor-planta-errore-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
    border-radius: 2px;
  }

  .monitor-plants-table .sunny-plant-row td,
  .monitor-plants-table .zcs-plant-row td,
  .monitor-plants-table .huawei-plant-row td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 0.4rem 0.35rem;
    font-size: 0.78rem;
  }

  .monitor-plants-table .col-nome {
    width: 36%;
    max-width: 36%;
  }

  .monitor-plants-table .col-pot-inst {
    width: 24%;
    text-align: right !important;
  }

  .monitor-plants-table .col-oggi {
    width: 26%;
    text-align: right !important;
  }

  .monitor-plants-table .col-stato {
    width: 14%;
    text-align: center !important;
    overflow: visible;
  }

  .monitor-plants-table .plant-row-chevron {
    display: inline-block;
    width: 11px;
    font-size: 0.6rem;
    color: #64748b;
    margin-right: 2px;
    vertical-align: middle;
    flex-shrink: 0;
  }

  .monitor-plants-table .plant-row-name {
    vertical-align: middle;
  }

  .monitor-plants-table thead th {
    font-size: 0.52rem;
    padding: 0.28rem 0.15rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
  }

  .monitor-plants-table thead th .th-label-full {
    display: none;
  }

  .monitor-plants-table thead th .th-label-short {
    display: inline;
  }

  .monitor-plants-totals-row td {
    font-size: 0.8rem !important;
    padding: 0.45rem 0.35rem !important;
  }

  .monitor-plants-totals-label {
    text-align: left !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.35rem !important;
  }

  .monitor-plants-totals-label::before {
    content: 'Tot.';
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
  }

  .monitor-plants-totals-label {
    color: transparent !important;
  }

  .plant-stato-compact {
    font-size: 0.95rem;
    line-height: 1;
  }

  .plant-stato-compact--ok {
    color: #22c55e;
  }

  .plant-stato-compact--warn {
    color: #ef4444;
  }
}

@media (min-width: 769px) {
  .monitor-brand-card.monitor-stat-card,
  .monitor-brand-card .fotovoltaico-energia-oggi-panel__inner {
    padding: 12px 14px;
  }

  .monitor-brand-card .monitor-battery-panel__inner {
    min-width: 0;
  }

  .monitor-brand-card .monitor-battery-panel__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .monitor-brand-card .monitor-battery-panel__power {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }

  .monitor-plants-table .plant-stato-compact {
    display: none;
  }

  .monitor-plants-table thead th .th-label-full {
    display: inline;
  }

  .monitor-plants-table thead th .th-label-short {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .login-card {
    padding: 1rem 0.85rem;
  }

  .monitor-toolbar__title {
    font-size: 0.95rem;
  }

  .fotovoltaico-energia-oggi-panel__inner--header [style*='font-size:1.45rem'] {
    font-size: 1.2rem !important;
  }

  .monitor-summary__prelevato [style*='font-size:1.45rem'] {
    font-size: 1.2rem !important;
  }

  .monitor-plants-table thead th {
    font-size: 0.48rem;
    padding: 0.22rem 0.1rem;
  }
}

/* ============================== HOME / LANDING ============================== */

#app:has(.home-shell) {
  display: block;
  height: auto;
  min-height: 100vh;
  align-items: initial;
  justify-content: initial;
}

.home-shell {
  width: 100%;
  min-height: 100vh;
  color: #e5e7eb;
  background: radial-gradient(circle at 50% -10%, #1f2937 0, #0b1120 45%, #020617 80%, #000 100%);
  overflow-x: hidden;
}

.home-shell strong {
  color: #f1f5f9;
}

/* Navbar */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.home-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.home-nav__logo {
  border-radius: 8px;
}

.home-nav__links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
}

.home-nav--brandless .home-nav__links {
  margin-left: 0;
  margin-right: auto;
}

.home-nav__link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.home-nav__link:hover {
  color: #60a5fa;
}

.home-nav__cta {
  margin-left: 0.4rem;
  flex-shrink: 0;
}

/* Hero */
.home-hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1rem, 5vw, 3rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}

.home-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.home-hero__glow {
  position: absolute;
  top: -25%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.28) 0, rgba(59, 130, 246, 0) 65%);
  animation: homeGlowPulse 7s ease-in-out infinite;
}

.home-hero__panel {
  position: absolute;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(2px);
}

.home-hero__panel--1 {
  width: 130px;
  height: 90px;
  top: 18%;
  left: 8%;
  transform: rotate(-12deg);
  animation: homeFloat 6s ease-in-out infinite;
}

.home-hero__panel--2 {
  width: 90px;
  height: 64px;
  top: 58%;
  left: 14%;
  transform: rotate(8deg);
  animation: homeFloat 5s ease-in-out infinite 0.6s;
}

.home-hero__panel--3 {
  width: 150px;
  height: 104px;
  top: 24%;
  right: 9%;
  transform: rotate(10deg);
  animation: homeFloat 7s ease-in-out infinite 0.3s;
}

.home-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.home-hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.6rem;
}

.home-hero__brand-name {
  font-size: clamp(1.85rem, 4.8vw, 2.75rem);
  letter-spacing: 0.08em;
  line-height: 1;
  display: inline-block;
  animation: homeBrandNameIn 0.7s ease 0.08s both, homeBrandBadge 3s ease-in-out 0.7s infinite;
}

.home-nav__name {
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.home-footer__brand-name {
  font-size: 1rem;
  letter-spacing: 0.07em;
}

@keyframes homeBrandNameIn {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeBrandBadge {
  0%,
  100% {
    color: var(--unisolar-brand);
    text-shadow:
      0 0 8px rgba(0, 200, 255, 0.55),
      0 0 18px rgba(0, 200, 255, 0.35);
  }
  50% {
    color: var(--unisolar-brand-bright);
    text-shadow:
      0 0 14px rgba(0, 232, 255, 0.95),
      0 0 32px rgba(0, 200, 255, 0.7),
      0 0 48px rgba(56, 189, 248, 0.45);
  }
}

@keyframes homeBrandIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

@keyframes homeLogoNeon {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.55)) drop-shadow(0 0 16px rgba(251, 146, 60, 0.45));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.95)) drop-shadow(0 0 34px rgba(251, 146, 60, 0.85))
      drop-shadow(0 0 48px rgba(244, 114, 22, 0.55));
    transform: scale(1.04);
  }
}

@keyframes homeNeonText {
  0%, 100% {
    text-shadow: 0 0 4px rgba(96, 165, 250, 0.45), 0 0 12px rgba(56, 189, 248, 0.35);
  }
  50% {
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.9), 0 0 20px rgba(56, 189, 248, 0.8), 0 0 40px rgba(45, 212, 191, 0.55);
  }
}

/* Navbar: installa app e demo */
.home-nav__install {
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.1);
}

.home-nav__demo {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.5);
  padding: 0.5rem 1rem;
}

.home-nav__demo:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.home-hero-sun {
  width: 18px;
  height: 18px;
}

.home-hero-sun__rays {
  transform-origin: 32px 32px;
  animation: homeSpin 14s linear infinite;
}

.home-hero__title {
  margin: 1.1rem 0 0.9rem;
  font-size: clamp(1.9rem, 5.2vw, 3.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.home-hero__title-accent {
  background: linear-gradient(100deg, #60a5fa, #22d3ee 50%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero__subtitle {
  max-width: 680px;
  margin: 0 auto 1.8rem;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.6;
  color: #cbd5e1;
}

.home-hero__actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-hero__cta {
  font-size: 1rem;
  padding: 0.7rem 1.6rem;
}

.home-hero__install {
  font-size: 1rem;
  padding: 0.7rem 1.5rem;
  background: rgba(245, 158, 11, 0.1);
}

.home-hero__demo {
  font-size: 1rem;
  padding: 0.7rem 1.5rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.home-hero__demo:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
}

.home-hero__secondary {
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
}

.home-hero__brands {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.2rem;
}

.home-hero__brands-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.home-pill {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.home-pill--live {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
}

.home-pill--live::before {
  content: "✓";
  margin-right: 0.32rem;
  font-weight: 700;
  color: #4ade80;
}

.home-pill--soon {
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.45);
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
}

.home-hero__brands--soon {
  margin-top: 0.9rem;
}

/* Sezioni generiche */
.home-section {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 5vw, 3rem);
  max-width: 1160px;
  margin: 0 auto;
}

.home-section--alt {
  max-width: none;
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.home-section--alt > * {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.home-section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.6rem;
}

.home-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 0.6rem;
}

.home-section__title {
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  line-height: 1.18;
  margin: 0 0 0.7rem;
}

.home-section__lead {
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0;
}

/* Steps */
.home-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.home-step {
  position: relative;
  padding: 1.6rem 1.4rem;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.home-step__num {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  color: #0b1120;
  background: linear-gradient(135deg, #60a5fa, #34d399);
  margin-bottom: 0.9rem;
}

.home-step h3 {
  font-size: 1.05rem;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}

.home-step p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #94a3b8;
}

/* Card grid */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

.home-cards--compact {
  grid-template-columns: repeat(4, 1fr);
}

.home-card {
  padding: 1.5rem 1.35rem;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-card:hover {
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.55);
}

.home-card__icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.85rem;
}

.home-card__title {
  font-size: 1.08rem;
  color: #f1f5f9;
  margin-bottom: 0.45rem;
}

.home-card__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #94a3b8;
}

/* Highlight notifiche */
.home-highlight {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 1160px;
}

.home-list {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
}

.home-list li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.7rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.home-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #34d399;
  font-weight: 800;
}

.home-highlight__visual {
  display: flex;
  justify-content: center;
}

.home-phone {
  position: relative;
  width: 230px;
  height: 320px;
  border-radius: 32px;
  background: linear-gradient(160deg, #0f172a, #1e293b);
  border: 2px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.6);
  padding: 1.4rem 1rem;
  overflow: hidden;
}

.home-phone__notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 18px;
  border-radius: 0 0 12px 12px;
  background: rgba(148, 163, 184, 0.25);
}

.home-phone__notif {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.home-phone__notif strong {
  display: block;
  font-size: 0.82rem;
  color: #f1f5f9;
}

.home-phone__notif small {
  font-size: 0.72rem;
  color: #94a3b8;
}

.home-phone__bell {
  font-size: 1.2rem;
}

.home-phone__notif--1 {
  margin-top: 2.2rem;
  animation: homeNotif 4s ease-in-out infinite;
}

.home-phone__notif--2 {
  margin-top: 0.8rem;
  animation: homeNotif 4s ease-in-out infinite 2s;
}

/* Stats */
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
}

.home-stat {
  text-align: center;
  padding: 1.6rem 1rem;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.home-stat__value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-stat__label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* CTA band */
.home-cta-band {
  text-align: center;
}

.home-cta-band__actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.home-cta-band__btn {
  font-size: 1.05rem;
  padding: 0.75rem 1.8rem;
}

.home-cta-band__install {
  font-size: 1.05rem;
  padding: 0.75rem 1.8rem;
  background: rgba(245, 158, 11, 0.1);
}

.home-cta-band__demo {
  font-size: 1.05rem;
  padding: 0.75rem 1.8rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.home-cta-band__demo:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
}

/* Contatti */
.home-contatti__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

.home-contatti__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1.7rem 1.2rem;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.12);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

a.home-contatti__card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.45);
}

.home-contatti__icon {
  font-size: 1.7rem;
}

.home-contatti__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.home-contatti__value {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* Footer */
.home-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(2, 6, 23, 0.6);
}

.home-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.home-footer__brand img {
  border-radius: 6px;
}

.home-footer__note {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 0.3rem;
}

.home-footer__contact {
  margin-bottom: 0.35rem;
}

.home-footer__email,
.app-footer-compact__email,
.sidebar-footer__email-link {
  color: #60a5fa;
  text-decoration: none;
}

.home-footer__email:hover,
.app-footer-compact__email:hover,
.sidebar-footer__email-link:hover {
  text-decoration: underline;
}

.home-footer__copy {
  font-size: 0.78rem;
  color: #64748b;
}

.app-footer-compact {
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(2, 6, 23, 0.4);
}

.sidebar-footer__email {
  margin-bottom: 0.6rem;
  text-align: center;
  font-size: 0.68rem;
}

/* Login: prova demo */
.login-card__demo {
  width: 100%;
  margin-top: 0.75rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.login-card__demo[hidden],
[data-login-demo-wrap][hidden] {
  display: none !important;
}

.login-card__demo:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
}

/* Login: torna alla home */
.login-card__back {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.login-card__back:hover {
  color: #60a5fa;
}

/* Reveal on scroll */
.home-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.home-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================== LISTINO PREZZI ============================== */

.home-nav__link.is-active {
  color: #60a5fa;
  font-weight: 700;
}

.listino-hero {
  padding-bottom: 1rem;
}

.listino-section {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  max-width: 1080px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.listino-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.6fr;
  gap: 1.4rem;
  align-items: stretch;
}

.listino-card {
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.listino-card__eyebrow {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #38bdf8;
  font-weight: 700;
}

.listino-card__title {
  margin: 0.5rem 0 0.4rem;
  font-size: 1.35rem;
  color: #f1f5f9;
}

.listino-card__price {
  margin: 0.4rem 0 0.8rem;
}

.listino-plan__amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.listino-plan__period {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-left: 0.3rem;
}

.listino-card__desc {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.listino-card--setup {
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.14), rgba(15, 23, 42, 0.7) 60%);
  border-color: rgba(34, 197, 94, 0.3);
}

.listino-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.listino-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.2rem 1rem;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.listino-plan--featured {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 12px 30px -16px rgba(59, 130, 246, 0.7);
}

.listino-plan__tag {
  position: absolute;
  top: -0.7rem;
  right: 0.8rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0b1120;
  background: #60a5fa;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.listino-plan__range {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.listino-plan__price {
  display: flex;
  align-items: baseline;
}

.listino-plan__price .listino-plan__amount {
  font-size: 1.9rem;
}

.listino-plan__hint {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

.listino-plan__cta {
  margin-top: 0.6rem;
  width: 100%;
}

.listino-card__footnote {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.listino-card__footnote a {
  color: #60a5fa;
  text-decoration: none;
}

.listino-card__footnote a:hover {
  text-decoration: underline;
}

.listino-included {
  padding: 1.8rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.listino-included__title {
  margin: 0 0 1.1rem;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.listino-included__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.listino-included__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.listino-included__item svg {
  flex: none;
  color: #34d399;
}

.listino-addons {
  padding: 1.8rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.listino-addons__title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.listino-addons__lead {
  margin: 0 0 1.2rem;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.55;
}

.listino-addons__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.listino-addon {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.listino-addon__qty {
  font-weight: 700;
  color: #e2e8f0;
}

.listino-addon__per {
  font-size: 0.8rem;
  color: #94a3b8;
}

.listino-addon__price {
  margin-top: 0.4rem;
}

.listino-addon__price .listino-plan__amount {
  font-size: 1.7rem;
}

.listino-cta {
  text-align: center;
  padding: 2rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.6) 65%);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.listino-cta__title {
  margin: 0 0 1.2rem;
  font-size: 1.35rem;
  color: #f1f5f9;
}

.listino-cta__actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Animazioni */
@keyframes homeFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-16px) rotate(var(--rot, 0deg)); }
}

.home-hero__panel--1 { --rot: -12deg; }
.home-hero__panel--2 { --rot: 8deg; }
.home-hero__panel--3 { --rot: 10deg; }

@keyframes homeGlowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.12); }
}

@keyframes homeSpin {
  to { transform: rotate(360deg); }
}

@keyframes homeNotif {
  0%, 100% { transform: translateY(0); opacity: 1; }
  8% { transform: translateY(-4px); }
  88% { opacity: 1; }
  96% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__panel,
  .home-hero__glow,
  .home-hero-sun__rays,
  .home-phone__notif,
  .home-hero__brand-logo,
  .unisolar-brand-logo,
  .home-hero__brand-name {
    animation: none !important;
  }
  .home-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .home-steps,
  .home-cards,
  .home-cards--compact,
  .home-stats,
  .home-contatti__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-highlight {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .home-highlight__visual {
    order: -1;
  }
  .listino-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .home-nav__links {
    display: none;
  }
  .home-nav__demo {
    display: none;
  }
  .home-nav__cta {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .home-steps,
  .home-cards,
  .home-cards--compact,
  .home-stats,
  .home-contatti__grid {
    grid-template-columns: 1fr;
  }
  .home-hero__panel {
    display: none;
  }
  .home-hero__actions .btn {
    width: 100%;
  }
  .listino-plans,
  .listino-included__list,
  .listino-addons__grid {
    grid-template-columns: 1fr;
  }
}

/* Popup autochiudente di avvenuto aggiornamento app */
.app-update-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1px solid #22c55e;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.app-update-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.app-update-toast__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.app-update-toast__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-update-toast__text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.app-update-toast__text span {
  font-size: 0.82rem;
  color: #94a3b8;
}

.app-update-toast__ver {
  color: #22c55e;
  font-weight: 700;
}

.push-foreground-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 1px solid #3b82f6;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.push-foreground-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.push-foreground-toast strong {
  font-size: 0.95rem;
}

.push-foreground-toast span {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Biogas > Trend Reali: display 7-segment (font DSEG) + layout pannelli */
@font-face {
