/* ==========================================================================
   assets/css/uniforma.css  (13/10/2026)
   Uniformità grafica sul tema scuro "space".

   Molte view hanno ancora colori del vecchio tema chiaro scritti direttamente
   nell'HTML (badge pastello, grigi chiari, verde #1D9E75 del vecchio marchio)
   o nei fogli professionista-theme.css / <style> interni. Qui li riportiamo
   alla palette del tema, senza toccare le singole view.
   Caricato dal layout DOPO tutti gli altri fogli di stile.

   Palette di riferimento (marketplace-space.css):
     superfici  #071119 · #091620 · #0c1b26     linee  #173244 · #23506a
     testo      #f7fbff · muted #8fa8b8          marchio #38bdf8 · #168fd2
   Semaforo (verde/giallo/rosso) resta tale: è un significato, non un colore.
   ========================================================================== */

:root{
  /* variabili del vecchio tema chiaro ancora usate dalle view */
  --color-surface-alt:#0c1b26 !important;
  --color-surface-2:#091620 !important;
  --color-background-secondary:#091620 !important;
  --color-border-tertiary:#173244 !important;
  --border-radius-md:9px !important;
  --teal-50:rgba(56,189,248,.10) !important;
  --teal-100:rgba(56,189,248,.18) !important;
  --teal-600:#38bdf8 !important;
  --teal-800:#7dd3fc !important;
  --amber-50:rgba(255,138,0,.12) !important;
  --amber-100:rgba(255,138,0,.2) !important;
  --amber-800:#ffc069 !important;
  --ih-orange-light:rgba(255,138,0,.12) !important;
  --color-error-bg:rgba(239,68,68,.12) !important;
  --color-warning-bg:rgba(255,138,0,.12) !important;
  --color-info-bg:rgba(56,189,248,.12) !important;
  /* tema professionista (era chiaro) */
  --pr-green:#168fd2 !important; --pr-green-2:#38bdf8 !important; --pr-green-soft:rgba(56,189,248,.12) !important;
  --pr-border:#173244 !important; --pr-muted:#8fa8b8 !important; --pr-text:#f7fbff !important; --pr-bg:#071119 !important;
}

/* ── Font: una sola famiglia in tutta l'app ─────────────────────────────── */
button,input,select,textarea,optgroup{font-family:inherit}
.pr-page,.py-page,.prof-page,.pd-page,.ed-page,.pn-wrap,.pw-wrap,.prof-inviti-page,.prof-body{font-family:inherit !important}

/* ── Badge e riquadri pastello scritti nell'HTML → tinte del tema ────────── */
/* verde (approvato, idoneo, attivo) */
[style*="background:#dcfce7" i],[style*="background: #dcfce7" i],
[style*="background:#d1fae5" i],[style*="background: #d1fae5" i],
[style*="background:#f0fdf4" i],[style*="background: #f0fdf4" i],
[style*="background:#ecfdf5" i],[style*="background: #ecfdf5" i],
[style*="background:#bbf7d0" i],[style*="background: #bbf7d0" i]{
  background:rgba(34,197,94,.13) !important; color:#86efac !important; border-color:rgba(34,197,94,.32) !important;
}
/* rosso (respinto, scaduto, errore) */
[style*="background:#fee2e2" i],[style*="background: #fee2e2" i],
[style*="background:#fef2f2" i],[style*="background: #fef2f2" i],
[style*="background:#fff0ef" i],[style*="background: #fff0ef" i],
[style*="background:#fff5f4" i],[style*="background: #fff5f4" i],
[style*="background:#fecaca" i],[style*="background: #fecaca" i]{
  background:rgba(239,68,68,.12) !important; color:#fca5a5 !important; border-color:rgba(239,68,68,.32) !important;
}
/* giallo/arancio (in attesa, potenziale, avviso) */
[style*="background:#fef9c3" i],[style*="background: #fef9c3" i],
[style*="background:#fef3c7" i],[style*="background: #fef3c7" i],
[style*="background:#fffbeb" i],[style*="background: #fffbeb" i],
[style*="background:#fff6df" i],[style*="background: #fff6df" i],
[style*="background:#fff7ed" i],[style*="background: #fff7ed" i],
[style*="background:#fef3e2" i],[style*="background: #fef3e2" i]{
  background:rgba(255,138,0,.12) !important; color:#ffc069 !important; border-color:rgba(255,138,0,.32) !important;
}
/* blu/info e vecchio verde-acqua del marchio → blu del marchio */
[style*="background:#dbeafe" i],[style*="background: #dbeafe" i],
[style*="background:#e6f1fb" i],[style*="background: #e6f1fb" i],
[style*="background:#f0f9ff" i],[style*="background: #f0f9ff" i],
[style*="background:#eff6ff" i],[style*="background: #eff6ff" i],
[style*="background:#e0f2fe" i],[style*="background: #e0f2fe" i],
[style*="background:#e1f5ee" i],[style*="background: #e1f5ee" i],
[style*="background:#edf7f3" i],[style*="background: #edf7f3" i],
[style*="background:#eef6f2" i],[style*="background: #eef6f2" i],
[style*="background:#e8f4f2" i],[style*="background: #e8f4f2" i],
[style*="background:#f0fdfa" i],[style*="background: #f0fdfa" i]{
  background:rgba(56,189,248,.11) !important; color:#7dd3fc !important; border-color:rgba(56,189,248,.3) !important;
}
/* viola */
[style*="background:#ede9fe" i],[style*="background: #ede9fe" i]{
  background:rgba(167,139,250,.14) !important; color:#c4b5fd !important; border-color:rgba(167,139,250,.32) !important;
}
/* grigi chiari (pannelli, righe, pill neutre) */
[style*="background:#f3f4f6" i],[style*="background: #f3f4f6" i],
[style*="background:#f9fafb" i],[style*="background: #f9fafb" i],
[style*="background:#f8fafc" i],[style*="background: #f8fafc" i],
[style*="background:#f1f5f9" i],[style*="background: #f1f5f9" i],
[style*="background:#f4f6f9" i],[style*="background: #f4f6f9" i],
[style*="background:#f4f5f8" i],[style*="background: #f4f5f8" i],
[style*="background:#f4f8f6" i],[style*="background: #f4f8f6" i],
[style*="background:#fafcfa" i],[style*="background: #fafcfa" i],
[style*="background:#fafafa" i],[style*="background: #fafafa" i],
[style*="background:#e5e7eb" i],[style*="background: #e5e7eb" i],
[style*="background:var(--color-surface-alt" i]{
  background:#0c1b26 !important; color:#cfe0ea !important; border-color:#173244 !important;
}

/* Vecchio verde del marchio usato come colore pieno (pulsanti, barre) → blu */
[style*="background:#1d9e75" i],[style*="background: #1d9e75" i],
[style*="background:#0f6e56" i],[style*="background: #0f6e56" i],
[style*="background:#085041" i],[style*="background: #085041" i],
[style*="background:#0b4f46" i],[style*="background: #0b4f46" i]{
  background:#168fd2 !important; border-color:#168fd2 !important;
}
[style*="border:2px solid #1d9e75" i],[style*="border: 2px solid #1d9e75" i],
[style*="border:1px solid #1d9e75" i],[style*="border-left:4px solid #1d9e75" i],
[style*="border-left: 4px solid #1d9e75" i]{border-color:#23506a !important}

/* Testi scuri del vecchio tema, illeggibili sul fondo scuro */
[style*="color:#374151" i],[style*="color: #374151" i],
[style*="color:#4b5563" i],[style*="color: #4b5563" i],
[style*="color:#334b43" i],[style*="color:#53635d" i]{color:#cfe0ea !important}
[style*="color:#6b7280" i],[style*="color: #6b7280" i],
[style*="color:#64716c" i],[style*="color:#68756f" i]{color:#9fb4c2 !important}
[style*="color:#0f6e56" i],[style*="color: #0f6e56" i],
[style*="color:#085041" i],[style*="color:#0b4f46" i],
[style*="color:#165f49" i],[style*="color:#0d9488" i]{color:#38bdf8 !important}
[style*="color:#15803d" i],[style*="color: #15803d" i],[style*="color:#166534" i]{color:#4ade80 !important}
[style*="color:#b91c1c" i],[style*="color: #b91c1c" i],[style*="color:#991b1b" i],[style*="color:#9b241c" i]{color:#f87171 !important}
[style*="color:#854d0e" i],[style*="color: #854d0e" i],[style*="color:#92400e" i],[style*="color:#7c5100" i]{color:#fbbf24 !important}
[style*="color:#1d4ed8" i],[style*="color: #1d4ed8" i],[style*="color:#1e40af" i],[style*="color:#185fa5" i]{color:#60a5fa !important}

/* ── Calendari (task e agenda) ──────────────────────────────────────────── */
.task-calendar,.cal{background:#071119 !important;border-color:#173244 !important}
.task-calendar__head,.cal-h{background:#091620 !important;color:#8fa8b8 !important;border-color:#173244 !important}
.task-calendar__day,.cal-d{background:#071119 !important;color:#f7fbff;border-color:#173244 !important}
.task-calendar__day.is-out,.cal-out{background:#050d14 !important;color:#6e8797 !important}
.task-calendar__day.is-today,.cal-today{box-shadow:inset 0 0 0 2px #38bdf8 !important}
.task-calendar__item,.cal-e{background:rgba(56,189,248,.11) !important;color:#bfe9fb !important;border-left-color:#38bdf8 !important}
.task-calendar__item.priority-alta{background:rgba(255,138,0,.12) !important;color:#ffc069 !important;border-left-color:#ff8a00 !important}
.task-calendar__item.priority-urgente{background:rgba(239,68,68,.12) !important;color:#fca5a5 !important;border-left-color:#ef4444 !important}
.task-calendar__more{color:#8fa8b8 !important}

/* ── Barre KPI e funnel ─────────────────────────────────────────────────── */
.bar-bg,.funnel-bg,.fase-bar-bg{background:#0c1b26 !important}

/* ── Messaggi e card energivoro ─────────────────────────────────────────── */
.msg-item,.reply-item,.reply-form-wrap,.thread-orig{background:#071119 !important;border-color:#173244 !important;color:#f7fbff !important}
.msg-item.unread,.reply-item.own{border-left-color:#38bdf8 !important}
.msg-item:hover{border-color:#23506a !important;box-shadow:0 8px 22px rgba(0,0,0,.3) !important}
.proj-card-foot{background:#091620 !important;border-top-color:#173244 !important}
.sb-kpi-item{background:#091620 !important;color:#f7fbff}
.kanban-drop-zone{background:#071119 !important;border-color:#173244 !important;color:#8fa8b8 !important}
.kanban-drop-zone.drop-over{background:rgba(56,189,248,.12) !important;border-color:#38bdf8 !important}
.kpi-box{background:#071119 !important;border-color:#173244 !important}
.kpi-box.accent{background:rgba(56,189,248,.08) !important;border-color:rgba(56,189,248,.3) !important}
.kpi-box.accent .val{color:#38bdf8 !important}

/* Pulsanti "ev" dell'area energivoro: stesso stile dei pulsanti del tema */
.btn-ev{background:#0b1d29 !important;border-color:#234257 !important;color:#dcecf4 !important}
.btn-ev:hover{background:#0f2737 !important;border-color:#38bdf8 !important}
.btn-ev-teal{background:#168fd2 !important;border-color:#168fd2 !important;color:#fff !important}
.btn-ev-teal:hover{background:#1597c9 !important}

/* Flag profilo aziendale (revisione profili) */
.flag-on{background:rgba(34,197,94,.13) !important;color:#86efac !important}
.flag-off{background:#0c1b26 !important;color:#6e8797 !important}

/* Pill di stato senza variante (stato sconosciuto) */
.ed-pill,.ev-status,.pw-badge{background:rgba(56,189,248,.11) !important;color:#7dd3fc !important;border-color:rgba(56,189,248,.3) !important}
.status-pill,.prof-badge{background:#112532 !important;color:#b8cbd6 !important;border-color:#244052 !important}
.status-pill.status-ok{background:rgba(34,197,94,.13) !important;color:#86efac !important}

/* Avvisi del tema professionista (erano chiari) */
.alert-success,.flash.success{background:rgba(34,197,94,.12) !important;border-color:rgba(34,197,94,.32) !important;color:#86efac !important}
.alert-danger,.flash.error,.prof-error,.py-error{background:rgba(239,68,68,.12) !important;border-color:rgba(239,68,68,.32) !important;color:#fca5a5 !important}
.pr-empty,.py-empty,.prof-empty{background:#071119 !important;border-color:#23506a !important;color:#8fa8b8 !important}

/* ── Telefono: niente scorrimento orizzontale della pagina ──────────────── */
@media (max-width:760px){
  .main-content{overflow-x:hidden}
  .main-content table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .main-content img,.main-content video,.main-content iframe{max-width:100%;height:auto}
  .main-content pre{white-space:pre-wrap;word-break:break-word}
  .main-content [style*="grid-template-columns"]:not(.task-calendar):not(.cal){grid-template-columns:1fr !important}
  .main-content [style*="min-width:"]{min-width:0 !important}
  .main-content [style*="white-space:nowrap"]{white-space:normal !important}
}

/* ── Pulsante principale: ovunque il blu del tema (alcune aree usavano un verde) ── */
.sg-btn--primary,.evp-btn--primary,.pd-btn.primary,.btn-ev-primary{
  background:linear-gradient(135deg,#168fd2,#075985) !important;
  border-color:#38bdf8 !important;color:#fff !important;
}
.sg-btn--primary:hover,.evp-btn--primary:hover,.pd-btn.primary:hover{background:linear-gradient(135deg,#21a9ee,#0b6598) !important}

/* ── Badge colorati del vecchio tema (testo scuro su tinta chiara) ─────── */
.badge-green{background:rgba(34,197,94,.13) !important;color:#86efac !important;border-color:rgba(34,197,94,.32) !important}
.badge-teal{background:rgba(56,189,248,.11) !important;color:#7dd3fc !important;border-color:rgba(56,189,248,.3) !important}
.badge-amber,.badge-yellow{background:rgba(255,138,0,.12) !important;color:#ffc069 !important;border-color:rgba(255,138,0,.32) !important}
.badge-red{background:rgba(239,68,68,.12) !important;color:#fca5a5 !important;border-color:rgba(239,68,68,.32) !important}
.badge-purple{background:rgba(167,139,250,.14) !important;color:#c4b5fd !important}

/* ── Schede e filtri attivi: testo bianco leggibile sul blu ─────────────── */
.tab-btn.active,.docs-tab.active,
[style*="background:var(--color-primary" i],[style*="background: var(--color-primary" i]{
  background:#168fd2 !important;border-color:#38bdf8 !important;color:#fff !important;
}

/* ── Intestazione pagina: palette del tema anche dove viene ricaricato page-hero.css (verde) ── */
:root{
  --page-hero-radius:13px !important;
  --page-hero-min-height:172px !important;
  --page-hero-muted:rgba(225,241,249,.82) !important;
  --page-hero-overlay:linear-gradient(103deg,rgba(2,8,14,.95) 0%,rgba(3,16,27,.78) 46%,rgba(3,15,25,.28) 100%) !important;
  --page-hero-shadow:0 16px 44px rgba(0,0,0,.28) !important;
  --page-hero-accent:#55ccff !important;
}
.main-content .page-hero .page-hero__button--primary,.main-content .page-hero .ev-btn-primary,.main-content .ev-hero .ev-btn-primary{background:linear-gradient(135deg,#137fb8,#075985) !important;border-color:#36b8f2 !important;color:#fff !important}
