/* =====================================================================
   EnerView · sistema visivo Fervo
   Caricato dopo studio.css e app.css: ridefinisce token e componenti.
   Per tornare all'aspetto precedente basta togliere questo file da index.html.
   ===================================================================== */

/* Urbanist (OFL-1.1), ospitato in locale: la CSP consente solo font da 'self' */
@font-face { font-family: 'Urbanist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/urbanist-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Urbanist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/urbanist-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* palette Fervo */
  --fv-black: #0F0F0F; --fv-dark-2: #1A1D21; --fv-dark-3: #262B30; --fv-dark-line: #343A41;
  --fv-lime: #B8CE12; --fv-green: #4BA328; --fv-deep: #00866A; --fv-deep-2: #00664F; --fv-teal: #049AA3; --fv-teal-ink: #037F87;
  --fv-grey-50: #F9FAFB; --fv-grey-100: #F2F4F7; --fv-grey-200: #EAECF0; --fv-grey-300: #D0D5DD; --fv-grey-400: #98A2B3; --fv-grey-600: #475467; --fv-grey-700: #344054;
  --fv-green-tint: #E6F4EC; --fv-teal-tint: #E5F5F6; --fv-lime-tint: #F4F8D9; --fv-amber-tint: #FEF0C7; --fv-red: #B42318; --fv-red-tint: #FEE4E2;
  --fv-stripe: linear-gradient(90deg, #B8CE12 0 25%, #4BA328 25% 50%, #00866A 50% 75%, #049AA3 75% 100%);

  /* token usati da studio.css e app.css, rimappati su Fervo */
  --ev-navy: var(--fv-black); --ev-navy-2: var(--fv-grey-700); --ev-blue: var(--fv-teal); --ev-green: var(--fv-deep); --ev-green-2: var(--fv-green);
  --fervo-green: var(--fv-green); --fervo-lime: var(--fv-lime); --fervo-teal: var(--fv-teal); --fervo-deep: var(--fv-deep); --fervo-graphite: var(--fv-black);
  --bg: var(--fv-grey-100); --surface: #FFFFFF; --surface-solid: #FFFFFF; --ink: var(--fv-black); --muted: var(--fv-grey-600);
  --line: var(--fv-grey-200); --line-strong: var(--fv-grey-300);
  --success-soft: var(--fv-green-tint); --teal-soft: var(--fv-teal-tint); --lime-soft: var(--fv-lime-tint);
  --danger: var(--fv-red); --warning: var(--fv-amber-tint); --formula: var(--fv-grey-50);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .14);
  --radius-xl: 18px; --radius-lg: 14px; --radius-md: 10px;
  --font: 'Urbanist', 'UCity Pro', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

/* ---------- base ---------- */
html, body { background: var(--fv-grey-100) !important; }
body { font-family: var(--font); color: var(--fv-black); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.ambient, .hero-panel::before, .hero-panel::after { display: none !important; }
h1, h2, h3, h4, h5 { color: var(--fv-black); letter-spacing: -.01em; }
.eyebrow, .form-section, .sv-group { color: var(--fv-deep) !important; letter-spacing: .1em; font-weight: 800; }
a { color: var(--fv-deep); }
::selection { background: var(--fv-lime-tint); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--fv-green) 55%, transparent); outline-offset: 2px; }

/* ---------- barra laterale scura con striscia Fervo ---------- */
.app-shell { gap: 1.25rem; }
.side-panel { background: var(--fv-black) !important; color: #fff; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important;
  border-radius: 18px; padding: 0 .7rem .7rem; overflow: hidden; gap: .6rem; }
.side-panel::before { content: ''; display: block; flex: none; height: 5px; margin: 0 -.7rem; background: var(--fv-stripe); }
.brand-card.ev-brand { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: .9rem .55rem .5rem; gap: .7rem; }
.ev-lockup { display: flex; align-items: center; gap: .75rem; }
.ev-logo { width: 74px; max-width: 74px; height: auto; flex: none; }
.ev-product { display: grid; gap: .05rem; padding-left: .75rem; border-left: 1px solid var(--fv-dark-line); line-height: 1.1; }
.ev-product b { color: #fff; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.ev-product small { color: var(--fv-grey-400); font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
.ev-tenant { border-top: 1px solid var(--fv-dark-line) !important; padding-top: .6rem; }
.ev-tenant h1 { color: #D7DCE1 !important; font-size: .9rem !important; font-weight: 700; }
.ev-tenant .brand-logo-img { border-color: var(--fv-dark-line) !important; background: #fff; }
.side-panel .main-nav { gap: .15rem; padding-right: .1rem; }
.side-panel .main-nav::-webkit-scrollbar-thumb { background: var(--fv-dark-line); }
.side-panel .nav-item { color: #D7DCE1 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 10px; padding: .5rem .55rem; min-height: 2.6rem; font-weight: 600; transform: none !important; }
.side-panel .nav-item:hover { background: var(--fv-dark-2) !important; color: #fff !important; }
.side-panel .nav-item.active { background: var(--fv-dark-3) !important; color: #fff !important; box-shadow: inset 3px 0 0 var(--fv-lime) !important; }
.side-panel .nav-icon { background: var(--fv-dark-3) !important; color: var(--fv-grey-400) !important; border: 0 !important; border-radius: 8px; width: 1.9rem; height: 1.9rem; font-size: .72rem; font-weight: 800; }
.side-panel .nav-item.active .nav-icon { background: var(--fv-lime) !important; color: var(--fv-black) !important; }
.side-panel .nav-dot { background: var(--fv-grey-400) !important; }
.side-panel .nav-item.active .nav-dot { background: var(--fv-lime) !important; }
.side-panel .nav-caret { color: var(--fv-grey-400); }
.side-panel .nav-badge { background: var(--fv-lime) !important; color: var(--fv-black) !important; }
.nav-group-label { color: var(--fv-grey-400); }
.side-panel .user-card { background: var(--fv-dark-2) !important; border: 1px solid var(--fv-dark-line) !important; color: #fff; border-radius: 14px; }
.side-panel .user-card strong { color: #fff !important; }
.side-panel .user-card .muted { color: var(--fv-grey-400) !important; }
.side-panel .role-tag { background: var(--fv-dark-3) !important; color: #D7DCE1 !important; }
.side-panel .btn.ghost { background: transparent !important; color: #fff !important; border-color: var(--fv-dark-line) !important; }
.side-panel .btn.ghost:hover { border-color: var(--fv-lime) !important; }

/* telefono: barra in alto scura e menu che scorre da sinistra */
.mobile-bar { background: var(--fv-black) !important; color: #fff; border: 0 !important; box-shadow: none !important; border-radius: 14px; }
.mobile-bar .menu-btn { background: var(--fv-dark-3) !important; color: #fff !important; border: 0 !important; border-radius: 10px; }
.mobile-logo { height: 1.7rem !important; }
.menu-overlay { background: rgba(15, 15, 15, .45) !important; backdrop-filter: none !important; }

/* ---------- superfici ---------- */
.hero-panel, .panel, .tool-strip, .solution-card, .catalog-section, .totals-panel, .sheet-wrap, .modal-card, .job-card, .flow-list, .approval-bar, .svc-job, .crm-card, .pcard, .product-card, .line-card, .breakdown-card, .kpi-card, .login-card, .user-card, .save-card {
  background: #fff; border: 1px solid var(--fv-grey-200) !important; box-shadow: var(--shadow) !important; backdrop-filter: none !important; }
.hero-panel, .panel, .solution-card, .catalog-section, .totals-panel, .sheet-wrap, .tool-strip { border-radius: 16px !important; }
.modal-card { border-radius: 16px !important; box-shadow: var(--shadow-pop) !important; }
.modal-backdrop { background: rgba(15, 15, 15, .5) !important; backdrop-filter: none !important; }
.job-card, .crm-card, .pcard, .product-card, .line-card, .breakdown-card, .kpi-card, .flow-list, .svc-job { border-radius: 14px !important; }
.page-head h2 { color: var(--fv-black); font-weight: 800; }
.page-head p { color: var(--fv-grey-600); }
.panel-heading h3, .section-header h3 { color: var(--fv-black); }
.note-box { border-radius: 12px; background: var(--fv-teal-tint); border: 0; color: var(--fv-grey-700); }
.note-box.info { background: var(--fv-teal-tint); }
.breakdown-card.highlight { background: var(--fv-black) !important; color: #fff; border-color: var(--fv-black) !important; }
.breakdown-card.highlight .breakdown-value, .breakdown-card.highlight .breakdown-title { color: #fff; }

/* ---------- pulsanti ---------- */
.btn { border-radius: 10px !important; font-weight: 700; letter-spacing: 0; transition: background-color .15s, border-color .15s; }
.btn.primary, .btn.start { background: var(--fv-deep) !important; border-color: var(--fv-deep) !important; color: #fff !important; box-shadow: none !important; }
.btn.primary:hover, .btn.start:hover { background: var(--fv-deep-2) !important; border-color: var(--fv-deep-2) !important; }
.btn.ghost { background: #fff !important; color: var(--fv-black) !important; border: 1px solid var(--fv-grey-300) !important; }
.btn.ghost:hover { border-color: var(--fv-grey-600) !important; background: var(--fv-grey-50) !important; }
.btn.danger { background: #fff !important; color: var(--fv-red) !important; border: 1px solid #FDA29B !important; }
.btn.danger:hover { background: var(--fv-red-tint) !important; }
.btn.stop { background: var(--fv-red) !important; border-color: var(--fv-red) !important; color: #fff !important; }
.btn:disabled, .btn.locked { opacity: .5; }
.file-btn { border-radius: 10px !important; }
.link-btn, a.site-link strong { color: var(--fv-deep) !important; }

/* ---------- campi ---------- */
.input, .select, .textarea, .cell-input, .cell-select, .search-box input { border: 1px solid var(--fv-grey-300) !important; border-radius: 10px !important; background: #fff !important; color: var(--fv-black); box-shadow: none; }
.input:focus, .select:focus, .textarea:focus, .cell-input:focus, .cell-select:focus, .search-box input:focus { border-color: var(--fv-green) !important; box-shadow: 0 0 0 3px rgba(75, 163, 40, .2) !important; outline: none; }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--fv-grey-50) !important; color: var(--fv-grey-600); }
.input.edited, .textarea.edited { box-shadow: inset 0 0 0 2px rgba(184, 206, 18, .9) !important; }
.field label, .data-field label { color: var(--fv-grey-700); font-weight: 700; }
.search-box { border-radius: 10px !important; }
.check input, .switch-row input { accent-color: var(--fv-deep); }
.check:has(input:checked) { border-color: var(--fv-deep) !important; background: var(--fv-green-tint) !important; }
.seg label { border-radius: 999px; }
.seg label:has(input:checked) { background: var(--fv-green-tint) !important; border: 2px solid var(--fv-deep) !important; color: var(--fv-deep) !important; }

/* ---------- tabelle ---------- */
table.grid th { color: var(--fv-grey-600); border-bottom-color: var(--fv-grey-200) !important; letter-spacing: .05em; }
table.grid td { border-bottom-color: var(--fv-grey-200) !important; }
table.grid tr:hover td { background: var(--fv-grey-50) !important; }
.excel-table thead th { background: var(--fv-grey-100) !important; color: var(--fv-grey-700) !important; }
.excel-table td.header-cell { background: var(--fv-black) !important; color: #fff !important; }
.excel-table td.section-cell { background: var(--fv-deep) !important; color: #fff !important; }
.excel-table td.subheader-cell { background: var(--fv-grey-100) !important; color: var(--fv-black) !important; }
.excel-table td.total-cell { background: var(--fv-green-tint) !important; color: var(--fv-deep-2) !important; }
.excel-table td.subtotal-cell { background: var(--fv-grey-50) !important; }

/* ---------- etichette e stati ---------- */
.badge { border-radius: 999px !important; font-weight: 700; }
.role-tag { background: var(--fv-green-tint) !important; color: var(--fv-deep-2) !important; border-radius: 999px; }
.badge.approved, .badge.accepted, .badge.in_progress, .badge.surveyed, .badge.quoted, .badge.active { background: var(--fv-green-tint) !important; color: var(--fv-deep-2) !important; }
.badge.assigned, .badge.new { background: var(--fv-teal-tint) !important; color: var(--fv-teal-ink) !important; }
.badge.pending, .badge.draft { background: var(--fv-amber-tint) !important; color: #93370D !important; }
.badge.refused, .badge.inactive, .badge.failed, .badge.returned { background: var(--fv-red-tint) !important; color: var(--fv-red) !important; }
.ref-tag { background: var(--fv-grey-100) !important; color: var(--fv-black) !important; }
.toast { background: var(--fv-black) !important; border-radius: 12px !important; }
.toast.ok { background: var(--fv-deep) !important; }
.toast.error { background: var(--fv-red) !important; }
.offline-badge { background: var(--fv-amber-tint) !important; color: #93370D !important; }
.tab-btn { border-radius: 10px !important; }
.tab-btn.active { background: var(--fv-black) !important; color: #fff !important; }
.pill-link { border-radius: 999px !important; }
.total-chip { border-radius: 12px !important; }
.status-dot::before { background: var(--fv-green) !important; }

/* ---------- CRM: fasi in sequenza teal → verde Fervo ---------- */
.crm-chip.s0, .crm-pct.s0, .crm-stage-tile.s0 { --sc: #98A2B3; }
.crm-chip.s10, .crm-pct.s10, .crm-stage-tile.s10 { --sc: #049AA3; }
.crm-chip.s30, .crm-pct.s30, .crm-stage-tile.s30 { --sc: #037F87; }
.crm-chip.s50, .crm-pct.s50, .crm-stage-tile.s50 { --sc: #00866A; }
.crm-chip.s90, .crm-pct.s90, .crm-stage-tile.s90 { --sc: #00664F; }
.crm-chip.s100, .crm-pct.s100, .crm-stage-tile.s100 { --sc: #4BA328; }
.crm-stage-tile { border-radius: 14px !important; box-shadow: none !important; }

/* ---------- calendario e app del telefono ---------- */
.cal-day.today, .svc-day.today { border-color: var(--fv-deep) !important; box-shadow: inset 0 0 0 1px var(--fv-deep) !important; }
.svc-day.sel { background: var(--fv-black) !important; border-color: var(--fv-black) !important; color: #fff !important; }
.svc-day i { background: var(--fv-teal) !important; }
.svc-day i.done { background: var(--fv-deep) !important; }
.app-tabbar { background: #fff !important; border-top: 1px solid var(--fv-grey-200) !important; box-shadow: none !important; }
.tab-item { border-radius: 12px !important; }
.tab-item.active { background: var(--fv-black) !important; color: #fff !important; box-shadow: inset 0 -3px 0 var(--fv-lime); }

/* ---------- accesso ---------- */
.login-wrap { background: var(--fv-grey-100) !important; }
.login-split { border-radius: 20px !important; box-shadow: var(--shadow-pop) !important; border: 1px solid var(--fv-grey-200); }
.login-brand { position: relative; background: var(--fv-black) !important; color: #fff; border-right: 0 !important; justify-content: space-between !important; gap: 2rem !important; }
.login-brand::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--fv-stripe); }
.login-logo { width: 132px !important; max-width: 132px !important; }
.login-product { display: grid; gap: .4rem; }
.login-product h2 { margin: 0; color: #fff; font-size: clamp(2rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.login-product p { margin: 0; color: var(--fv-lime); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.login-lead { color: #C9CFD6 !important; }
.fv-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.fv-steps li { padding: .8rem .8rem .75rem; border-radius: 12px; background: var(--fv-dark-2); border-top: 4px solid var(--c); display: grid; gap: .2rem; }
.fv-steps b { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.fv-steps span { color: var(--fv-grey-400); font-size: .78rem; line-height: 1.35; }
.login-card { border: 0 !important; box-shadow: none !important; }
.login-card h1 { color: var(--fv-black) !important; font-weight: 800; }
.login-logo-mobile { width: 110px !important; }

/* ---------- stampa / anteprima PDF dei preventivi ---------- */
#printDoc .pd-title, #printDoc .pd-narrative h2, #printDoc .pd-sign h3 { color: var(--fv-black); }
#printDoc .pd-letterhead { border-bottom: 4px solid transparent; border-image: var(--fv-stripe) 1; }
.mobile-product { color: #fff; font-weight: 800; font-size: 1.05rem; padding-left: .6rem; margin-left: .1rem; border-left: 1px solid var(--fv-dark-line); flex: 1; }
.mobile-bar .mobile-logo { flex: none !important; width: auto; }
.mobile-bar .mobile-product { color: #fff; }
.mobile-bar { border-radius: 0 0 14px 14px; }
/* card KPI: niente bolle decorative, un filetto colorato a sinistra */
.kpi-card::after { display: none !important; }
.kpi-card { box-shadow: inset 3px 0 0 var(--fv-teal), var(--shadow) !important; }
.kpi-card.lime { box-shadow: inset 3px 0 0 var(--fv-lime), var(--shadow) !important; }
.kpi-card.green { box-shadow: inset 3px 0 0 var(--fv-deep), var(--shadow) !important; }
