/* REDDIO — Sistema visivo (navy, oro, off-white; Fraunces + Inter) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0B1B3B; --navy-2: #142951; --navy-3: #1f3a6e;
  --gold: #C4A05A; --gold-2: #A88340; --gold-soft: #E8DDC4;
  --bone: #F7F4EE; --bone-2: #EEE9DC;
  --ink: #1A2238; --ink-2: #4A5677; --ink-3: #7A8499;
  --line: #E3DDD0; --line-2: #D6CFBC;
  --green: #2E7D4F; --green-soft: #DCE9DF;
  --amber: #C8821E; --amber-soft: #F3E5CA;
  --danger: #B23A3A;
  --shadow-sm: 0 1px 3px rgba(11,27,59,.06);
  --shadow: 0 4px 16px rgba(11,27,59,.08);
  --shadow-lg: 0 12px 40px rgba(11,27,59,.12);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bone); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--gold-2); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--navy); margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; }
h3 { font-size: 1.3rem; }

/* HEADER */
header.nav { position: sticky; top: 0; z-index: 100; background: rgba(11,27,59,.97); backdrop-filter: blur(10px); color: #fff; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(196,160,90,.2); }
header.nav .brand { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: .04em; color: #fff; }
header.nav .brand span { color: var(--gold); font-style: italic; }
header.nav nav { display: flex; gap: 28px; align-items: center; }
header.nav nav a { color: rgba(255,255,255,.78); font-size: 14px; font-weight: 500; transition: color .15s; }
header.nav nav a:hover { color: #fff; }
header.nav nav a.cta { background: var(--gold); color: var(--navy); padding: 8px 18px; border-radius: 6px; font-weight: 600; }
header.nav nav a.cta:hover { background: #d4b06a; color: var(--navy); }

/* HERO */
.hero { position: relative; padding: 100px 32px 80px; background: linear-gradient(180deg, #0B1B3B 0%, #142951 100%); color: #fff; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(ellipse at 80% 20%, rgba(196,160,90,.18) 0%, transparent 50%), radial-gradient(ellipse at 10% 100%, rgba(196,160,90,.10) 0%, transparent 50%); pointer-events: none; }
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); padding: 6px 14px; border: 1px solid rgba(196,160,90,.4); border-radius: 20px; margin-bottom: 24px; }
.hero h1 { color: #fff; max-width: 900px; }
.hero h1 em { font-style: italic; color: var(--gold-soft); font-weight: 500; }
.hero .lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: rgba(255,255,255,.82); max-width: 680px; margin: 24px 0 40px; line-height: 1.6; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 20px; margin: 40px 0 36px; }
.hero-stat { background: rgba(255,255,255,.05); border: 1px solid rgba(196,160,90,.2); border-radius: 12px; padding: 22px 28px; min-width: 170px; }
.hero-stat b { display: block; font-family: var(--serif); font-size: 38px; font-weight: 600; color: var(--gold); line-height: 1; margin-bottom: 6px; }
.hero-stat span { font-size: 13px; color: rgba(255,255,255,.7); }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--navy); padding: 14px 28px; border-radius: 8px; font-weight: 600; font-size: 15px; transition: all .2s; border: none; cursor: pointer; }
.cta:hover { background: #d4b06a; transform: translateY(-1px); box-shadow: var(--shadow); color: var(--navy); }
.cta.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.cta.ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.cta .arrow { transition: transform .2s; }
.cta:hover .arrow { transform: translateX(3px); }

/* SEZIONI */
.section { padding: 80px 32px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 12px; }
.section h2 { margin-bottom: 16px; }
.section .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 620px; line-height: 1.7; }
.bg-bone-2 { background: var(--bone-2); }
.bg-navy { background: var(--navy); color: #fff; }
.bg-navy h2, .bg-navy h3 { color: #fff; }
.bg-navy .lead { color: rgba(255,255,255,.75); }
.bg-navy .section-eyebrow { color: var(--gold); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 48px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; transition: all .25s; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-soft); }
.step .num { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--gold-2); letter-spacing: .1em; margin-bottom: 12px; }
.step h3 { margin-bottom: 12px; }
.step p { color: var(--ink-2); font-size: .95rem; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.feat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px 32px; position: relative; overflow: hidden; }
.feat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gold); }
.feat.work::before { background: var(--amber); }
.feat .tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 12px; background: var(--green-soft); color: var(--green); margin-bottom: 16px; }
.feat.work .tag { background: var(--amber-soft); color: var(--amber); }
.feat h3 { margin-bottom: 12px; }
.feat p { color: var(--ink-2); margin: 0; line-height: 1.65; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; margin-top: 48px; }
.metric b { display: block; font-family: var(--serif); font-size: 44px; font-weight: 600; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.metric span { color: rgba(255,255,255,.7); font-size: 14px; }

/* CONTENT (legali) */
.content { max-width: 760px; margin: 48px auto; padding: 48px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.content h1 { font-size: 2.2rem; margin-bottom: 32px; }
.content h2 { font-size: 1.3rem; margin-top: 32px; margin-bottom: 12px; color: var(--navy-2); }
.content p, .content li { line-height: 1.75; }
.content .note { background: var(--gold-soft); border-left: 3px solid var(--gold); padding: 14px 18px; font-size: 13px; color: #5b4a28; border-radius: 4px; margin: 18px 0; }

/* MAPPA con filtri + lista */
.map-page { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - 65px); }
@media (max-width: 900px) { .map-page { grid-template-columns: 1fr; height: auto; } .map-sidebar { max-height: 50vh; } #map { height: 60vh; } }
.map-sidebar { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.filters { padding: 20px 22px; border-bottom: 1px solid var(--line); background: var(--bone); }
.filters h3 { font-size: 1rem; margin: 0 0 14px; color: var(--navy); }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row label { flex: 1; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.filter-row input, .filter-row select { font-family: var(--sans); font-size: 13px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; color: var(--ink); outline: none; }
.filter-row input:focus, .filter-row select:focus { border-color: var(--gold); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; transition: all .15s; }
.chip:hover { border-color: var(--gold); color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.active.flip { background: var(--green); border-color: var(--green); }
.chip.active.work { background: var(--amber); border-color: var(--amber); }

.list-header { padding: 14px 22px; font-size: 12px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); background: #fff; display: flex; justify-content: space-between; align-items: center; }
.list-header select { font-size: 12px; border: none; background: transparent; color: var(--navy); font-weight: 600; cursor: pointer; }

.list-items { flex: 1; }
.list-item { padding: 16px 22px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 6px; }
.list-item:hover { background: var(--bone); }
.list-item.active { background: var(--bone-2); border-left: 3px solid var(--gold); padding-left: 19px; }
.list-item .li-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.list-item .li-head b { font-family: var(--serif); font-size: 1.05rem; color: var(--navy); }
.list-item .li-roi { font-weight: 600; font-size: .95rem; }
.list-item .li-roi.green { color: var(--green); }
.list-item .li-roi.amber { color: var(--amber); }
.list-item .li-roi.gray { color: var(--ink-3); }
.list-item .li-meta { font-size: 12px; color: var(--ink-3); }
.list-item .li-prezzo { font-size: 13px; color: var(--ink-2); }

#map { height: 100%; }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { font-family: var(--sans); font-size: 13px; color: var(--ink); line-height: 1.55; margin: 14px 16px; }
.leaflet-popup-content b { color: var(--navy); font-family: var(--serif); font-size: 14px; }
.pop-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.pop-tag.flip { background: var(--green); color: #fff; }
.pop-tag.work { background: var(--amber); color: #fff; }
.pop-tag.none { background: var(--ink-3); color: #fff; }
.pop-link { display: inline-block; margin-top: 8px; font-weight: 600; color: var(--gold-2); font-size: 12px; }

/* SCHEDA DETTAGLIO */
.detail { max-width: 1100px; margin: 32px auto; padding: 0 32px; }
.breadcrumb { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.detail-head { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px 40px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.detail-head h1 { font-size: 2rem; margin-bottom: 8px; }
.detail-head .subtitle { color: var(--ink-2); font-size: 1rem; margin-bottom: 24px; }
.detail-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 18px; font-size: 13px; font-weight: 600; background: var(--bone-2); color: var(--ink-2); }
.detail-tag.flip { background: var(--green-soft); color: var(--green); }
.detail-tag.work { background: var(--amber-soft); color: var(--amber); }
.detail-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 1.1rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kv-list { display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; }
.kv .k { color: var(--ink-2); font-size: 14px; }
.kv .v { color: var(--navy); font-weight: 600; font-family: var(--serif); font-size: 1rem; text-align: right; }
.kv .v.big { font-size: 1.4rem; color: var(--gold-2); }
.kv .v.green { color: var(--green); }
.kv .v.amber { color: var(--amber); }

.scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .scenarios { grid-template-columns: 1fr; } }
.scenario { background: var(--bone); border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; }
.scenario h4 { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.scenario .big { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.scenario .small { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.scenario.ott { background: linear-gradient(180deg, var(--gold-soft) 0%, var(--bone-2) 100%); border-color: var(--gold-soft); }
.scenario.ott .big { color: var(--gold-2); }

#mini-map { height: 280px; border-radius: 10px; margin-top: 4px; }

/* FOOTER */
footer.site { background: var(--navy); color: rgba(255,255,255,.65); padding: 56px 32px 36px; margin-top: 80px; }
footer.site .inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 700px) { footer.site .inner { grid-template-columns: 1fr; } }
footer.site h4 { color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
footer.site .brand-name { font-family: var(--serif); font-size: 22px; color: #fff; font-weight: 700; margin-bottom: 12px; }
footer.site .brand-name span { color: var(--gold); font-style: italic; }
footer.site p { font-size: 13px; line-height: 1.65; margin: 8px 0; }
footer.site a { color: rgba(255,255,255,.65); display: block; padding: 4px 0; font-size: 14px; }
footer.site a:hover { color: var(--gold); }
footer.site .bottom { max-width: 1100px; margin: 36px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 12px; color: rgba(255,255,255,.45); }
footer.site .bottom .attrib { max-width: 720px; line-height: 1.6; }

/* COOKIE */
#cookie { position: fixed; bottom: 20px; left: 20px; right: 20px; max-width: 720px; margin: 0 auto; background: var(--navy); color: rgba(255,255,255,.9); padding: 18px 24px; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid rgba(196,160,90,.3); display: flex; gap: 16px; align-items: center; font-size: 13px; z-index: 9999; flex-wrap: wrap; }
#cookie span { flex: 1; min-width: 200px; line-height: 1.5; }
#cookie a { color: var(--gold); text-decoration: underline; }
#cookie button { background: var(--gold); border: 0; color: var(--navy); padding: 9px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 13px; font-family: var(--sans); }
#cookie button:hover { background: #d4b06a; }
#cookie button.secondary { background: transparent; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.85); }

/* FORM contatti */
.form-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px; max-width: 620px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-row label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.form-row input, .form-row textarea { font-family: var(--sans); font-size: 15px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--gold); }
.form-row textarea { min-height: 130px; resize: vertical; }

/* ANIMAZIONI */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.hero-inner > * { animation: fadeUp .6s ease backwards; }
.hero-inner > *:nth-child(1) { animation-delay: .05s; }
.hero-inner > *:nth-child(2) { animation-delay: .15s; }
.hero-inner > *:nth-child(3) { animation-delay: .25s; }
.hero-inner > *:nth-child(4) { animation-delay: .35s; }
.hero-inner > *:nth-child(5) { animation-delay: .45s; }

/* ============================================================
   WORKSPACE PRIVATO
   ============================================================ */

/* LOGIN */
.login-page { background: linear-gradient(180deg, #0B1B3B 0%, #142951 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-wrap { background: #fff; padding: 48px 44px; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: 0 24px 60px rgba(0,0,0,.3); text-align: center; }
.brand-big { display: inline-block; font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--navy); letter-spacing: .04em; margin-bottom: 4px; }
.brand-big span { color: var(--gold); font-style: italic; }
.login-sub { font-size: 13px; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 32px; }
.login-form { text-align: left; }
.login-form .form-row { margin-bottom: 18px; }
.login-form input { font-family: var(--sans); font-size: 15px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; width: 100%; }
.login-form input:focus { border-color: var(--gold); }
.login-error { background: #fde8e8; color: var(--danger, #B23A3A); padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; border-left: 3px solid #B23A3A; }
.login-back { display: block; margin-top: 24px; font-size: 13px; color: var(--ink-3); }
.login-back:hover { color: var(--gold-2); }

/* WORKSPACE HEADER */
body.ws { background: var(--bone); }
.ws-nav { background: var(--navy); color: #fff; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(196,160,90,.2); position: sticky; top: 0; z-index: 100; }
.ws-nav-left { display: flex; align-items: center; gap: 32px; }
.ws-nav .brand { font-family: var(--serif); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .04em; }
.ws-nav .brand span:not(.badge) { color: var(--gold); font-style: italic; }
.ws-nav .badge { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; background: rgba(196,160,90,.15); color: var(--gold); padding: 3px 8px; border-radius: 10px; vertical-align: middle; margin-left: 6px; font-style: normal; }
.ws-tabs { display: flex; gap: 4px; }
.ws-tabs a { color: rgba(255,255,255,.7); font-size: 14px; padding: 8px 14px; border-radius: 6px; font-weight: 500; transition: all .15s; }
.ws-tabs a:hover { color: #fff; background: rgba(255,255,255,.06); }
.ws-tabs a.active { color: #fff; background: rgba(196,160,90,.15); }
.ws-tabs a.ext { color: rgba(255,255,255,.5); font-size: 13px; }
.ws-nav-right { display: flex; align-items: center; gap: 16px; }
.ws-user { font-size: 13px; color: rgba(255,255,255,.75); }
.ws-logout { background: transparent; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.85); padding: 7px 14px; border-radius: 6px; font-family: var(--sans); font-size: 13px; cursor: pointer; transition: all .15s; }
.ws-logout:hover { background: rgba(255,255,255,.06); color: #fff; }

/* WORKSPACE LAYOUT */
.ws-main { padding: 32px 28px 60px; }
.ws-page { max-width: 1280px; margin: 0 auto; }
.ws-pageheader { margin-bottom: 24px; }
.ws-pageheader h2 { font-size: 1.7rem; margin-bottom: 4px; }
.ws-pageheader-sub { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* WELCOME BOX */
.welcome-box { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border-radius: 14px; padding: 28px 32px; margin-bottom: 28px; display: flex; gap: 20px; align-items: flex-start; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.welcome-box::before { content: ''; position: absolute; top: -40%; right: -10%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(196,160,90,.2) 0%, transparent 70%); pointer-events: none; }
.welcome-content { flex: 1; position: relative; }
.welcome-content h2 { color: #fff; font-size: 1.4rem; margin: 0 0 8px; }
.welcome-content p { color: rgba(255,255,255,.85); margin: 0; line-height: 1.65; font-size: .95rem; }
.welcome-content p a { color: var(--gold); text-decoration: underline; }
.welcome-dismiss { background: transparent; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.7); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; transition: all .15s; position: relative; }
.welcome-dismiss:hover { background: rgba(255,255,255,.1); color: #fff; }

/* KPI ROW */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: var(--shadow-sm); transition: transform .15s; }
.kpi:hover { transform: translateY(-2px); }
.kpi-num { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; color: var(--navy); line-height: 1; margin-bottom: 6px; }
.kpi-lab { font-size: 12px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.kpi.flip { border-left: 3px solid var(--green); }
.kpi.flip .kpi-num { color: var(--green); }
.kpi.work { border-left: 3px solid var(--amber); }
.kpi.work .kpi-num { color: var(--amber); }
.kpi.watch { border-left: 3px solid var(--gold); }
.kpi.watch .kpi-num { color: var(--gold-2); }

/* WORKSPACE GRID */
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .ws-grid { grid-template-columns: 1fr; } }

.ws-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px 26px; box-shadow: var(--shadow-sm); }
.ws-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ws-card-head h3 { font-size: 1.05rem; margin: 0; }
.ws-link { font-size: 12px; font-weight: 600; color: var(--gold-2); letter-spacing: .04em; }
.ws-link:hover { color: var(--gold); }

.ws-list { list-style: none; padding: 0; margin: 0; }
.ws-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--bone-2); }
.ws-list li:last-child { border-bottom: none; }
.ws-list li a { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ws-list .il-comune { font-family: var(--serif); font-weight: 600; color: var(--navy); font-size: 1rem; }
.ws-list .il-meta { font-size: 12px; color: var(--ink-3); }
.ws-list .roi { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; min-width: 60px; text-align: right; }
.ws-list .roi small { font-size: .65em; opacity: .7; }
.ws-list .roi.green { color: var(--green); }
.ws-list .roi.amber { color: var(--amber); }
.ws-list .roi.gray { color: var(--ink-3); }
.empty { color: var(--ink-3); font-size: 13px; padding: 16px 0; }
.empty a { color: var(--gold-2); text-decoration: underline; }

/* STATO GRID */
.stato-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stato-cell { padding: 16px; border-radius: 10px; text-align: center; transition: transform .15s; border: 1px solid var(--line); background: var(--bone); }
.stato-cell:hover { transform: translateY(-2px); }
.stato-cell b { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1; margin-bottom: 4px; }
.stato-cell span { font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }
.stato-cell.stato-nuovo b { color: var(--navy); }
.stato-cell.stato-watch { background: linear-gradient(135deg, var(--gold-soft) 0%, var(--bone-2) 100%); border-color: var(--gold-soft); }
.stato-cell.stato-watch b { color: var(--gold-2); }
.stato-cell.stato-scartato b { color: var(--ink-3); }
.stato-cell.stato-concluso { background: var(--green-soft); border-color: var(--green-soft); }
.stato-cell.stato-concluso b { color: var(--green); }

/* BAR CHART */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-lab { font-size: 13px; color: var(--ink-2); min-width: 80px; }
.bar-track { flex: 1; display: flex; height: 22px; background: var(--bone); border-radius: 6px; overflow: hidden; }
.bar-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; min-width: 24px; }
.bar-seg.flip { background: var(--green); }
.bar-seg.work { background: var(--amber); }
.bar-seg.altro { background: var(--ink-3); }

/* TABELLA */
.tabella-filtri { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.t-search { flex: 1; min-width: 220px; font-family: var(--sans); font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; }
.t-search:focus { border-color: var(--gold); }
.tabella-filtri select { font-family: var(--sans); font-size: 13px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
.cta-sm { padding: 9px 18px; font-size: 14px; }
.cta-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line-2); }
.cta-ghost:hover { background: var(--bone-2); color: var(--navy); }

.tabella-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.tabella { width: 100%; border-collapse: collapse; }
.tabella thead th { background: var(--bone-2); padding: 12px 16px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: left; border-bottom: 1px solid var(--line); }
.tabella thead th.num { text-align: right; }
.tabella tbody td { padding: 14px 16px; border-bottom: 1px solid var(--bone-2); font-size: 14px; vertical-align: middle; }
.tabella tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabella tbody tr:hover { background: var(--bone); }
.tabella tbody tr:last-child td { border-bottom: none; }
.td-link { color: var(--navy); display: block; }
.td-link b { font-family: var(--serif); font-weight: 600; }
.td-link small { color: var(--ink-3); font-size: 12px; }
.td-link:hover b { color: var(--gold-2); }
.empty-row { text-align: center; color: var(--ink-3); padding: 40px !important; }

.tag-mini { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 10px; margin-right: 4px; }
.tag-mini.flip { background: var(--green-soft); color: var(--green); }
.tag-mini.work { background: var(--amber-soft); color: var(--amber); }
.tag-mini.gray { background: var(--bone-2); color: var(--ink-3); }

.stato-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 12px; letter-spacing: .03em; }
.stato-pill.stato-nuovo { background: var(--bone-2); color: var(--ink-2); }
.stato-pill.stato-watch { background: var(--gold-soft); color: var(--gold-2); }
.stato-pill.stato-scartato { background: #f0eded; color: var(--ink-3); }
.stato-pill.stato-concluso { background: var(--green-soft); color: var(--green); }

.actions { text-align: right; }
.quick-form { margin: 0; display: inline; }
.quick-select { font-family: var(--sans); font-size: 12px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.quick-select:hover { border-color: var(--gold); }

.num .green { color: var(--green); }
.num .amber { color: var(--amber); }
.num .gray { color: var(--ink-3); }

/* DETTAGLIO EDIT */
.ws-detail-head { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.ws-detail-head h1 { font-size: 1.6rem; margin-bottom: 4px; }
.ws-detail-head .subtitle { color: var(--ink-2); font-size: .95rem; }
.ws-detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.edit-form .form-row { margin-bottom: 18px; }
.edit-form label { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; font-weight: 600; }
.edit-form textarea { width: 100%; min-height: 130px; font-family: var(--sans); font-size: 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; resize: vertical; line-height: 1.5; }
.edit-form textarea:focus { border-color: var(--gold); }

.stato-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-radio { cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio .chip { padding: 7px 14px; border-radius: 16px; font-size: 13px; font-weight: 500; transition: all .15s; }
.chip-radio input:checked + .chip { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-radio input:checked + .chip.stato-watch { background: var(--gold-2); border-color: var(--gold-2); }
.chip-radio input:checked + .chip.stato-concluso { background: var(--green); border-color: var(--green); }
.chip-radio input:checked + .chip.stato-scartato { background: var(--ink-3); border-color: var(--ink-3); }

.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.last-edit { font-size: 12px; color: var(--ink-3); margin: 16px 0 0; font-style: italic; }

