:root{
  --bg-0:#f6f8fc;
  --bg-1:#eef3fb;
  --surface:#ffffff;
  --surface-2:rgba(255,255,255,.78);
  --surface-3:#f7faff;
  --text:#142033;
  --muted:#65758b;
  --line:#dbe5f1;
  --line-strong:#c5d4e6;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --primary-soft:rgba(37,99,235,.10);
  --success:#0f9d6c;
  --success-soft:rgba(15,157,108,.10);
  --warning:#d97706;
  --warning-soft:rgba(217,119,6,.10);
  --danger:#dc2626;
  --danger-soft:rgba(220,38,38,.10);
  --shadow-lg:0 18px 48px rgba(31,50,81,.12);
  --shadow-md:0 10px 30px rgba(31,50,81,.08);
  --radius-xl:24px;
  --radius-lg:18px;
  --radius-md:14px;
  --radius-sm:10px;
}

html{scroll-behavior:smooth}
body{
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 30%),
    radial-gradient(circle at top right, rgba(14,165,233,.10), transparent 28%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 45%, #f9fbff 100%) !important;
  color:var(--text) !important;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(37,99,235,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.025) 1px, transparent 1px);
  background-size:28px 28px;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.55), transparent 75%);
}

.wrap{
  max-width:1180px !important;
  padding:34px 22px 54px !important;
}

.top{
  align-items:flex-start !important;
  margin-bottom:22px !important;
  padding:20px 22px !important;
  background:linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  border:1px solid rgba(197,212,230,.9);
  border-radius:26px;
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(12px);
}

.brand{gap:16px !important}
.dot{
  width:16px !important;
  height:16px !important;
  background:linear-gradient(135deg, var(--primary), #38bdf8) !important;
  box-shadow:0 0 0 8px rgba(37,99,235,.12) !important;
}

h1{
  color:#0f172a !important;
  font-size:32px !important;
  letter-spacing:.2px !important;
}

.top .brand div:last-child,
.top .brand div > div{
  color:var(--muted) !important;
}

.nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.nav a{
  margin-left:0 !important;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.72);
  color:#183153 !important;
  font-weight:600;
  transition:.18s ease;
  box-shadow:0 4px 14px rgba(15,23,42,.04);
}

.nav a:hover,
a:hover{
  text-decoration:none !important;
}

.nav a:hover{
  transform:translateY(-1px);
  border-color:#b8c9df;
  background:#fff;
  box-shadow:0 10px 20px rgba(37,99,235,.08);
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)) !important;
  border:1px solid var(--line) !important;
  border-radius:var(--radius-xl) !important;
  padding:28px !important;
  box-shadow:var(--shadow-lg) !important;
  color:var(--text) !important;
  backdrop-filter:blur(10px);
}

.card h2{
  color:#0f172a !important;
  font-size:28px;
  margin-bottom:10px !important;
}

.card h3{
  color:#15325b;
  font-size:18px;
  margin-top:6px;
}

p, li, label, th, td, div, span{
  color:inherit;
}

p{
  color:var(--muted) !important;
  line-height:1.65 !important;
}

code{
  background:#eef4ff !important;
  color:#1d4ed8 !important;
  border:1px solid #d8e6ff;
  padding:3px 8px !important;
  border-radius:999px !important;
}

a{
  color:var(--primary-2) !important;
}

.footer{
  margin-top:16px !important;
  color:var(--muted) !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea{
  width:100%;
  color:var(--text) !important;
  background:linear-gradient(180deg, #fff, #f8fbff) !important;
  border:1px solid var(--line-strong) !important;
  border-radius:16px !important;
  padding:12px 14px !important;
  outline:none;
  box-sizing:border-box;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.03);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

input::placeholder,
textarea::placeholder{
  color:#8a9bb0 !important;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#8bb4ff !important;
  box-shadow:0 0 0 5px rgba(37,99,235,.12) !important;
  transform:translateY(-1px);
}

button,
a[style*="display:inline-block"],
a[style*="display:block"]{
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button{
  color:#fff !important;
  background:linear-gradient(135deg, var(--primary), #3b82f6) !important;
  border:1px solid rgba(29,78,216,.28) !important;
  border-radius:14px !important;
  padding:11px 15px !important;
  font-weight:700;
  letter-spacing:.1px;
  box-shadow:0 10px 24px rgba(37,99,235,.18);
}

button:hover,
a[style*="display:inline-block"]:hover,
a[style*="display:block"]:hover{
  transform:translateY(-1px);
  filter:saturate(1.03);
}

button:hover{
  box-shadow:0 14px 28px rgba(37,99,235,.22);
}

a[style*="display:inline-block"],
a[style*="display:block"]{
  border-radius:14px !important;
  font-weight:600;
  color:#17325c !important;
  background:linear-gradient(180deg, #ffffff, #f6f9ff) !important;
  border:1px solid var(--line-strong) !important;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

hr{
  border:none;
  border-top:1px solid var(--line);
  margin:24px 0;
}

table{
  width:100%;
  border-collapse:separate !important;
  border-spacing:0;
  overflow:hidden;
  border-radius:18px;
}

table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:linear-gradient(180deg, #eff5ff, #e8f0fc) !important;
  color:#163256 !important;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:800;
  border-bottom:1px solid var(--line) !important;
}

table tbody td{
  background:rgba(255,255,255,.82) !important;
  border-bottom:1px solid #e8eef7 !important;
  color:#25364d !important;
}

table tbody tr:hover td{
  background:#f8fbff !important;
}

th, td{
  padding:12px 14px !important;
  vertical-align:top;
}

div[style*="overflow:auto"],
div[style*="overflow:auto;border-radius"],
div[style*="overflow:auto;border-radius:14px"]{
  border-radius:20px !important;
  border:1px solid var(--line) !important;
  background:rgba(255,255,255,.65) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}

textarea[readonly]{
  background:#0f172a !important;
  color:#e2ecff !important;
  border-color:#24344a !important;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}

div[id$="Map"],
#installationsMap,
#investorInstallationsMap{
  box-shadow:var(--shadow-md);
  border:1px solid var(--line) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  background:#ffffff;
  color:#1e293b;
  box-shadow:0 18px 36px rgba(15,23,42,.18);
}

/* messaggi */
p[style*="#63ffb0"]{
  color:var(--success) !important;
  background:var(--success-soft);
  border:1px solid rgba(15,157,108,.22);
  padding:12px 14px;
  border-radius:14px;
}

p[style*="#ff7a7a"]{
  color:var(--danger) !important;
  background:var(--danger-soft);
  border:1px solid rgba(220,38,38,.18);
  padding:12px 14px;
  border-radius:14px;
}

/* pill e blocchi riepilogo */
span[style*="border-radius:999px"],
div[style*="border-radius:14px"],
div[style*="border-radius:16px"]{
  backdrop-filter:blur(8px);
}

div[style*="rgba(0,200,83,.07)"]{
  background:linear-gradient(180deg, rgba(15,157,108,.12), rgba(15,157,108,.06)) !important;
  border-color:rgba(15,157,108,.18) !important;
}

div[style*="rgba(255,193,7,.07)"],
div[style*="rgba(255,200,0,.07)"]{
  background:linear-gradient(180deg, rgba(217,119,6,.12), rgba(217,119,6,.05)) !important;
  border-color:rgba(217,119,6,.16) !important;
}

div[style*="rgba(255,82,82,.07)"]{
  background:linear-gradient(180deg, rgba(220,38,38,.11), rgba(220,38,38,.05)) !important;
  border-color:rgba(220,38,38,.16) !important;
}

div[style*="rgba(255,255,255,.03)"],
div[style*="rgba(255,255,255,.04)"],
div[style*="rgba(255,255,255,.05)"],
div[style*="rgba(255,255,255,.06)"]{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,251,255,.82)) !important;
  border-color:var(--line) !important;
}

/* select option fallback */
option{
  color:#0f172a;
  background:#ffffff;
}

@media (max-width: 900px){
  .wrap{padding:20px 14px 40px !important}
  .top{padding:16px !important}
  .card{padding:18px !important;border-radius:20px !important}
  h1{font-size:26px !important}
  .nav{justify-content:flex-start}
}

@media (max-width: 640px){
  .top{flex-direction:column !important}
  .nav a{padding:9px 12px;font-size:13px}
  table{font-size:14px}
  th,td{padding:10px !important}
}
