@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;500;600;700&display=swap");

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-soft: #F1F5F9;
  --surface-hover: #EFF6FF;
  --surface-strong: #0F172A;
  --text: #0F172A;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-soft: #DBEAFE;

  --accent: #0891B2;
  --accent-dark: #0E7490;
  --accent-soft: #CFFAFE;

  --danger: #DC2626;
  --danger-bg: #FEF2F2;

  --ok: #16A34A;
  --ok-bg: #F0FDF4;

  --warn: #D97706;
  --warn-bg: #FFFBEB;

  --sidebar: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #2563EB;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, .07);
  --shadow-lg: 0 22px 50px rgba(15, 23, 42, .10);

  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 34%),
    radial-gradient(circle at bottom left, rgba(8, 145, 178, .06), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

strong {
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}

.hidden {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

.right {
  text-align: right;
}

.strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.formGap {
  margin-top: 14px;
}

/* =========================================================
   LOGIN
   ========================================================= */

.loginShell {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 22%, rgba(37, 99, 235, .24), transparent 24%),
    radial-gradient(circle at 80% 58%, rgba(6, 182, 212, .18), transparent 26%),
    radial-gradient(circle at 28% 20%, rgba(109, 93, 246, .12), transparent 22%),
    linear-gradient(180deg, #000000 0%, #030712 42%, #000000 100%);
  color: #F8FAFC;
}

.loginNoise {
  position: absolute;
  inset: 0;
  opacity: .14;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  pointer-events: none;
}

.loginLayout {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 68px));
  display: grid;
  grid-template-columns: minmax(460px, 520px) minmax(420px, 1fr);
  gap: 34px;
  align-items: stretch;
}

.loginPanel,
.loginVisual {
  min-height: 680px;
  height: 100%;
}

.loginPanel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(9, 17, 39, .92), rgba(2, 6, 23, .82)),
    rgba(2, 6, 23, .88);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 30px 80px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
}

.loginEyebrow {
  width: max-content;
  margin-bottom: 18px;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  color: rgba(226,232,240,.74);
  background: rgba(255,255,255,.06);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.loginBrand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brandMark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563EB, #22D3EE);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -.025em;
  box-shadow: 0 18px 34px rgba(37,99,235,.28);
}

.loginBrand h1,
.sidebarBrand h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.loginBrand h1 {
  color: #F8FAFC;
}

.loginBrand p,
.sidebarBrand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.loginBrand p {
  color: rgba(203,213,225,.72);
}

.loginPanel .loginBrandClean {
  display: block;
  text-align: center;
  margin-bottom: 34px;
}

.loginPanel .loginBrandClean h1 {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.loginPanelAlt .loginBrandClean h1 {
  font-size: clamp(26px, 3vw, 34px);
}

.loginPanel .loginBrandClean p {
  margin-top: 8px;
}

.loginIntro {
  margin-bottom: 24px;
}

.loginIntro p {
  max-width: none;
  margin: 0;
  color: rgba(226,232,240,.84);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
}

.loginIntroLine {
  display: block;
  max-width: none;
  white-space: nowrap;
  letter-spacing: -.02em;
}

.loginFields {
  display: grid;
  gap: 14px;
}

.loginPanel label {
  color: rgba(226,232,240,.86);
  font-weight: 500;
}

.loginPanel input {
  margin-top: 8px;
  min-height: 56px;
  color: #F8FAFC;
  background: rgba(10, 17, 35, .88);
  border-color: rgba(148, 163, 184, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.loginPanel input::placeholder {
  color: rgba(148,163,184,.66);
}

.loginPanel input:focus {
  border-color: rgba(56,189,248,.85);
  box-shadow:
    0 0 0 4px rgba(56,189,248,.12),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.loginPanel input:-webkit-autofill,
.loginPanel input:-webkit-autofill:hover,
.loginPanel input:-webkit-autofill:focus,
.loginPanel input:-webkit-autofill:active {
  -webkit-text-fill-color: #EAF2FF;
  caret-color: #EAF2FF;
  box-shadow:
    0 0 0 1000px rgba(8, 16, 36, .96) inset,
    inset 0 1px 0 rgba(255,255,255,.05);
  border-color: rgba(120, 160, 220, .35);
  transition: background-color 9999s ease-in-out 0s;
}

.loginPanel input:-webkit-autofill::first-line {
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.loginSubmit {
  width: 100%;
  min-height: 56px;
  margin-top: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563EB, #22C7E8);
  box-shadow: 0 18px 34px rgba(37,99,235,.28);
}

.loginSubmit:hover {
  background: linear-gradient(135deg, #1D4ED8, #06B6D4);
}

.loginSubmit:disabled {
  opacity: .68;
  cursor: wait;
  box-shadow: none;
}

.loginSecondaryActions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.linkButton {
  border: 0;
  background: transparent;
  color: rgba(125, 211, 252, .92);
  font-weight: 600;
  padding: 6px 8px;
}

.linkButton:hover {
  color: #E0F2FE;
  text-decoration: underline;
}

.loginPanelAlt {
  grid-column: 1;
  grid-row: 1;
}

.loginPanel .msg,
.loginPanel .error,
.loginPanel .ok,
.loginPanel .warn,
.loginPanel .notice {
  margin-top: 14px;
}

.loginVisual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 40px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    rgba(3, 7, 18, .82);
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
  isolation: isolate;
}

.loginVisual::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,.05);
  background:
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: .6;
  pointer-events: none;
}

.loginVisual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(34,211,238,.12), transparent 34%),
    radial-gradient(circle at center, rgba(96,165,250,.08), transparent 50%);
  pointer-events: none;
}

.siriOrb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}

.siriOrb::before,
.siriOrb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(24px);
}

.siriOrb::before {
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(34,211,238,.10) 0%, rgba(59,130,246,.10) 28%, rgba(168,85,247,.08) 52%, transparent 72%);
  animation: siriHaloPulse 6s ease-in-out infinite;
}

.siriOrb::after {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255,255,255,.10), rgba(34,211,238,.16) 24%, rgba(59,130,246,.12) 42%, transparent 68%);
  animation: siriCorePulse 4.5s ease-in-out infinite;
}

.siriWave {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 38%, rgba(255,255,255,.22) 42%, transparent 46%),
    conic-gradient(from 0deg, rgba(34,211,238,.0), rgba(34,211,238,.92), rgba(59,130,246,.0), rgba(168,85,247,.88), rgba(34,211,238,.0));
  mix-blend-mode: screen;
  filter: blur(20px);
  opacity: .56;
  animation: siriRingRotate 7.5s linear infinite;
}

.waveOne {
  transform: scale(.82);
}

.waveTwo {
  width: 620px;
  height: 620px;
  opacity: .32;
  filter: blur(28px);
  animation-duration: 11s;
  animation-direction: reverse;
}

.waveThree {
  width: 420px;
  height: 420px;
  opacity: .44;
  filter: blur(14px);
  animation-duration: 8.8s;
}

.loginLogoGlass {
  position: relative;
  z-index: 2;
  width: min(560px, 84%);
  padding: 42px 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(19, 34, 67, .44), rgba(9, 15, 28, .22));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 28px 80px rgba(0,0,0,.30);
  backdrop-filter: blur(18px);
}

.loginLogoGlass::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 34px;
  background:
    radial-gradient(circle at center, rgba(34,211,238,.16), transparent 52%),
    radial-gradient(circle at 48% 52%, rgba(59,130,246,.18), transparent 65%);
  filter: blur(18px);
  z-index: -1;
}

.loginLogoSvg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.28));
}

@keyframes siriRingRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes siriHaloPulse {
  0%, 100% { transform: scale(.92); opacity: .52; }
  50% { transform: scale(1.04); opacity: .82; }
}

@keyframes siriCorePulse {
  0%, 100% { transform: scale(.88); opacity: .44; }
  50% { transform: scale(1.08); opacity: .84; }
}

@media (max-width: 960px) {
  .loginShell {
    padding: 18px;
  }

  .loginLayout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .loginPanel,
  .loginVisual {
    min-height: auto;
  }

  .loginPanel {
    order: 2;
  }

  .loginVisual {
    order: 1;
    min-height: 360px;
  }

  .loginLogoGlass {
    width: min(440px, 86%);
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .loginShell {
    padding: 12px;
  }

  .loginPanel,
  .loginVisual {
    border-radius: 24px;
    padding: 22px;
  }

  .loginIntro p {
    font-size: 18px;
  }

  .loginIntroLine {
    white-space: nowrap;
    font-size: 16px;
  }

  .loginVisual {
    min-height: 280px;
  }
}
/* =========================================================
   LAYOUT
   ========================================================= */

.appShell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid rgba(255,255,255,.08);
  overflow-y: auto;
}

.sidebarBrand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebarBrandLogo {
  display: block;
  width: min(100%, 216px);
  height: auto;
}

.sidebarBrand p {
  color: rgba(255,255,255,.64);
}

.navGroupLabel {
  padding: 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  font-weight: 600;
  letter-spacing: .08em;
}

.nav {
  display: grid;
  gap: 6px;
}

.navBtn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  padding: 11px 12px;
  border-radius: 14px;
  text-align: left;
  font-weight: 600;
}

.navBtn:hover {
  background: var(--sidebar-hover);
  color: white;
}

.navBtn.active {
  background: var(--sidebar-active);
  color: white;
  box-shadow: 0 10px 26px rgba(37,99,235,.22);
}

.navIcon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 600;
}

.sidebarFooter {
  margin-top: auto;
  padding-top: 12px;
}

.sideHint {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.pageTitle h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.05em;
}

.pageTitle p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topActions,
.inlineActions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mobileTop {
  display: none;
}

main {
  display: grid;
  gap: 18px;
}

.tabPanel {
  display: grid;
  gap: 18px;
}

/* =========================================================
   CARD BASE
   ========================================================= */

.card {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.cardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cardHeader h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.035em;
}

.cardHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* =========================================================
   CONCEPT 2 — HEADER SEZIONI GLOBALI
   Logica applicata a tutte le pagine.
   Barra superiore colorata, sfondo leggero, icona a sinistra.
   ========================================================= */

.sectionHeader {
  --section-color: #2563EB;
  --section-bg: #EFF6FF;
  --section-border: #BFDBFE;
  --section-icon-bg: #DBEAFE;
  --section-icon-color: #1D4ED8;

  position: relative;
  min-height: 108px;
  align-items: center;
  margin: -4px -4px 20px;
  padding: 26px 18px 22px 96px;
  border: 1px solid var(--section-border);
  border-radius: 17px;
  background:
    linear-gradient(90deg, var(--section-bg), rgba(255,255,255,.96) 74%),
    white;
  overflow: hidden;
  box-shadow: 0 7px 20px rgba(15, 23, 42, .045);
}

.sectionHeader::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: var(--section-color);
  border-radius: 17px 17px 0 0;
}

.sectionHeader::before {
  content: attr(data-section-icon);
  position: absolute;
  left: 28px;
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translateY(-50%);
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--section-icon-bg);
  color: var(--section-icon-color);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.72),
    0 8px 18px rgba(15, 23, 42, .06);
}

.sectionHeader > * {
  position: relative;
  z-index: 1;
}

.sectionHeader h2 {
  font-size: 24px;
  line-height: 1.1;
  color: #0F172A;
}

.sectionHeader p {
  margin-top: 8px;
  color: #475569;
  font-size: 15px;
  line-height: 1.4;
}

.sectionHeader button,
.sectionHeader .compactBtn {
  align-self: center;
}

/* Palette sezioni */

.section-blue {
  --section-color: #1D7AF2;
  --section-bg: #EFF6FF;
  --section-border: #BFDBFE;
  --section-icon-bg: #DBEAFE;
  --section-icon-color: #1D4ED8;
}

.section-teal {
  --section-color: #08A7B9;
  --section-bg: #ECFEFF;
  --section-border: #A5F3FC;
  --section-icon-bg: #CFFAFE;
  --section-icon-color: #0E7490;
}

.section-green {
  --section-color: #16A34A;
  --section-bg: #F0FDF4;
  --section-border: #BBF7D0;
  --section-icon-bg: #DCFCE7;
  --section-icon-color: #15803D;
}

.section-purple {
  --section-color: #6D5DF6;
  --section-bg: #F5F3FF;
  --section-border: #DDD6FE;
  --section-icon-bg: #EDE9FE;
  --section-icon-color: #6D28D9;
}

.section-orange {
  --section-color: #F59E0B;
  --section-bg: #FFFBEB;
  --section-border: #FDE68A;
  --section-icon-bg: #FEF3C7;
  --section-icon-color: #D97706;
}

.section-red {
  --section-color: #EF4444;
  --section-bg: #FEF2F2;
  --section-border: #FECACA;
  --section-icon-bg: #FEE2E2;
  --section-icon-color: #DC2626;
}

.section-pink {
  --section-color: #DB2777;
  --section-bg: #FDF2F8;
  --section-border: #FBCFE8;
  --section-icon-bg: #FCE7F3;
  --section-icon-color: #BE185D;
}

/* =========================================================
   FORM
   ========================================================= */

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filtersGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.fieldHint {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  outline: none;
  min-height: 42px;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.checkLabel {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  cursor: pointer;
}

.checkLabel:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.checkLabel input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin-top: 2px;
  accent-color: var(--primary);
}

.checkLabel span {
  display: grid;
  gap: 3px;
}

.checkLabel strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.checkLabel small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* =========================================================
   BUTTONS
   ========================================================= */

button {
  border: 0;
  border-radius: 13px;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(37,99,235,.17);
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: var(--border);
}

button.ghost {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  border: 1px solid var(--border);
}

button.ghost:hover {
  background: var(--primary-soft);
}

button.dangerBtn {
  background: var(--danger);
  color: white;
}

button.dangerBtn:hover {
  background: #B91C1C;
}

button.okBtn {
  background: var(--ok);
  color: white;
}

button.okBtn:hover {
  background: #15803D;
}

button.small,
button.compactBtn,
.miniBtn {
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 12px;
}

button.iconBtn {
  min-width: 31px;
  padding: 7px 8px;
  text-align: center;
}

.actionsCell {
  min-width: 112px;
}

/* =========================================================
   MESSAGGI
   ========================================================= */

.msg,
.error,
.ok,
.warn,
.notice {
  margin: 12px 0 0;
  padding: 11px 12px;
  border-radius: 14px;
  font-size: 13px;
}

.msg:empty {
  display: none;
}

.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
}

.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid #BBF7D0;
}

.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #FED7AA;
}

.notice {
  color: #075985;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
}

/* =========================================================
   KPI
   ========================================================= */

.grid {
  display: grid;
  gap: 14px;
}

.kpiGrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, white, var(--surface-soft));
  min-height: 95px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.kpi strong {
  font-size: 23px;
  letter-spacing: -.045em;
}

.kpi.positive strong {
  color: var(--ok);
}

.kpi.negative strong {
  color: var(--danger);
}

/* =========================================================
   TABLE
   ========================================================= */

.tableWrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: var(--surface-hover);
}

tr:last-child td {
  border-bottom: 0;
}

.rowAnnullato td {
  background: #FAFAFA;
  color: var(--muted);
  text-decoration: line-through;
}

.rowAnnullato:hover td {
  background: #F5F5F5;
}

.listInfo {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
}

/* =========================================================
   BADGE
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid #BBF7D0;
  padding: 4px 9px;
  margin: 0;
}

.badge.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #FED7AA;
  padding: 4px 9px;
  margin: 0;
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  padding: 4px 9px;
  margin: 0;
}

.badge.off {
  color: #525252;
  background: #F5F5F5;
  border: 1px solid #E5E5E5;
  padding: 4px 9px;
  margin: 0;
}

.badge.info {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #A5F3FC;
  padding: 4px 9px;
  margin: 0;
}

/* =========================================================
   MODAL / DETTAGLIO
   ========================================================= */

.detailGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detailItem {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-soft);
}

.detailItem.full {
  grid-column: 1 / -1;
}

.detailItem span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}

.detailItem strong {
  display: block;
  font-size: 14px;
  word-break: break-word;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.48);
  backdrop-filter: blur(4px);
}

.modalCard {
  position: relative;
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.96);
  z-index: 2;
}

.modalHeader h2 {
  margin: 0;
  letter-spacing: -.04em;
}

.modalHeader p {
  margin: 3px 0 0;
  color: var(--muted);
}

.modalHeaderActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modalHeaderActions button {
  white-space: nowrap;
}

.modalBody {
  padding: 18px;
}


/* =========================================================
   IMPOSTAZIONI — SOTTOMENU SISTEMA
   ========================================================= */

.settingsHubCard {
  padding-bottom: 18px;
}

.settingsSubNav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settingsSubBtn {
  min-height: 86px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 15px 16px;
  background: linear-gradient(180deg, #FFFFFF, var(--surface-soft));
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.settingsSubBtn span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.settingsSubBtn small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.settingsSubBtn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.settingsSubBtn.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-soft), #FFFFFF);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}

.settingsSubBtn.active span {
  color: var(--primary-dark);
}

.settingsSubPage {
  display: grid;
  gap: 18px;
}

.settingsSubPage.hidden {
  display: none !important;
}


.budgetCategoriesHelper {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.budgetCategoriesHelper strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.budgetCategoriesHelper p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.budgetCategoriesHelper.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .budgetCategoriesHelper {
    align-items: stretch;
    flex-direction: column;
  }
}


/* =========================================================
   BUDGET — MAPPATURA CATEGORIE IN IMPOSTAZIONI
   ========================================================= */

.budgetMappingCard {
  display: grid;
  gap: 14px;
}

.budgetMappingCard.hidden {
  display: none !important;
}

.budgetMappingCard .cardHeader {
  align-items: center;
  margin-bottom: 0;
}

.budgetMappingCard .notice {
  margin: 0;
  line-height: 1.45;
}

.budgetMappingCard .filtersGrid {
  grid-template-columns: minmax(220px, 300px) minmax(260px, 420px);
  align-items: end;
  margin: 0;
}

.budgetMappingCard .listInfo {
  margin-top: -4px;
}

.budgetMappingCard .tableWrap {
  max-height: 620px;
  overflow: auto;
}

.budgetMappingCard table {
  min-width: 1120px;
}

.budgetMappingCard th,
.budgetMappingCard td {
  padding: 9px 10px;
  vertical-align: middle;
}

.budgetMappingCard .budgetMappingSelect,
.budgetMappingCard .budgetMappingNote {
  width: 100%;
  min-height: 36px;
  height: 36px;
}

.budgetMappingCard .miniBtn {
  min-height: 32px;
}

@media (max-width: 920px) {
  .budgetMappingCard .filtersGrid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1120px) {
  .appShell {
    grid-template-columns: 1fr;
  }

  .mobileTop {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar);
    color: white;
    padding: 12px 16px;
  }

  .sidebar {
    position: fixed;
    inset: 54px auto 0 0;
    width: 280px;
    z-index: 29;
    transform: translateX(0);
    transition: transform .2s ease;
  }

  .sidebar.collapsed {
    transform: translateX(-105%);
  }

  .content {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .filtersGrid,
  .row,
  .row.two,
  .kpiGrid,
  .settingsSubNav {
    grid-template-columns: 1fr;
  }

  .detailGrid {
    grid-template-columns: 1fr;
  }

  .sectionHeader {
    min-height: 104px;
    margin: -2px -2px 18px;
    padding: 22px 14px 18px 88px;
  }

  .sectionHeader::before {
    left: 22px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .sectionHeader h2 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 12px;
  }

  .settingsSubBtn {
    min-height: 74px;
    padding: 13px 14px;
  }

  .card {
    border-radius: 18px;
    padding: 14px;
  }

  .pageTitle h2 {
    font-size: 23px;
  }

  table {
    min-width: 880px;
  }

  .sectionHeader {
    min-height: auto;
    padding: 58px 14px 18px 14px;
  }

  .sectionHeader::before {
    top: 16px;
    left: 14px;
    width: 36px;
    height: 36px;
    transform: none;
    border-radius: 10px;
    font-size: 19px;
  }

  .sectionHeader h2 {
    font-size: 20px;
  }

  .sectionHeader p {
    font-size: 14px;
  }

  .checkLabel {
    min-height: auto;
  }
}

/* =========================================================
   TIPI DOCUMENTO — MACROCATEGORIE DINAMICHE
   ========================================================= */

.macroManager {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, .86), rgba(255, 255, 255, .94));
  box-shadow: var(--shadow-sm);
}

.macroManagerHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.macroManagerHeader h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.macroManagerHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.macroList {
  display: grid;
  gap: 10px;
}

.macroRow {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.macroRow.inactive {
  background: #F8FAFC;
  opacity: .82;
}

.macroInfo {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.macroNameLine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.macroName {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.macroName:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.macroMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.macroActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.macroActions .miniBtn {
  min-height: 36px;
}


.tipoDocTypeEditor {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 250, 252, .76), rgba(255, 255, 255, .96));
  box-shadow: var(--shadow-sm);
}

.tipoDocTypeEditorHeader h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.tipoDocTypeEditorHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}


.tipoDocListHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 0 2px;
}

.tipoDocListHeader h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.tipoDocListHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.tipoDocTableWrap {
  margin-top: 10px;
}

.tipoDocTableActions {
  gap: 7px;
}

.tipoDocTableActions .miniBtn {
  width: 30px;
  min-width: 30px;
  height: 30px;
}

@media (max-width: 900px) {
  .macroManagerHeader {
    flex-direction: column;
  }

  .macroRow {
    grid-template-columns: 1fr;
  }

  .macroActions {
    justify-content: flex-start;
  }
}

/* =========================================================
   UTENTI / RUOLI V20
   ========================================================= */

.utentiFormGrid textarea {
  min-height: 96px;
}

@media (min-width: 980px) {
  .utentiFormGrid label:last-child {
    grid-column: span 2;
  }
}

/* =========================================================
   UTENTI / RUOLI V22 — UI, filtri, badge e form coerenti
   ========================================================= */

.utentiPage {
  gap: 22px;
}

.utentiOverviewCard {
  padding-bottom: 26px;
}

.utentiKpiGrid {
  margin-top: 16px;
}

.selectedProfileBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
  padding: 15px 18px;
  border: 1px solid #BBF7D0;
  border-radius: 18px;
  background: linear-gradient(90deg, #F0FDF4, #FFFFFF);
  color: #166534;
  box-shadow: var(--shadow-sm);
}

.selectedProfileBox strong {
  display: block;
  margin-top: 2px;
  color: #14532D;
  font-size: 16px;
  letter-spacing: -.02em;
}

.selectedProfileLabel {
  display: block;
  color: #16A34A;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.selectedProfileMeta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.utentiCreateCard,
.utentiEditCard,
.utentiListCard,
.utentiPermessiCard {
  padding-bottom: 24px;
}

.utentiEditNotice {
  margin-bottom: 0;
}

.utentiFormGrid {
  align-items: start;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 0;
}

.utentiFormGrid label,
.utentiListFilters label {
  align-self: start;
}

.utentiFormGrid label:last-child {
  grid-column: auto;
}

.utentiFormGrid input,
.utentiFormGrid select,
.utentiListFilters input,
.utentiListFilters select {
  min-height: 54px;
}

.utentiFormGrid textarea {
  min-height: 112px;
}

.utentiFormGrid .fieldStatus {
  align-self: start;
}

.utentiFormGrid .fieldNotes {
  grid-column: 1 / -1;
}

.passwordField {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.passwordField input {
  min-width: 0;
}

.passwordField .miniBtn {
  min-height: 54px;
  white-space: nowrap;
}

.utentiFormActions {
  margin-top: 22px;
}

.passwordResetBox {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #BFDBFE;
  border-radius: 18px;
  background: linear-gradient(90deg, #EFF6FF, #FFFFFF);
  box-shadow: var(--shadow-sm);
}

.passwordResetBox.isLocked {
  background: linear-gradient(90deg, #F8FAFC, #FFFFFF);
  border-color: #E2E8F0;
}

.passwordResetBox.isLocked .passwordResetHeader strong,
.passwordResetBox.isLocked .passwordResetHeader span {
  color: #64748B;
}

.passwordResetBox.isLocked input,
.passwordResetBox.isLocked button {
  cursor: not-allowed;
}

.passwordResetHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.passwordResetHeader strong {
  display: block;
  color: #1E3A8A;
  font-size: 15px;
  letter-spacing: -.01em;
}

.passwordResetHeader span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.utentiPasswordGrid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 0;
}

.utentiPasswordActions {
  margin-top: 16px;
}

#utentePasswordMsg {
  margin-top: 12px;
}

.utentiListFilters {
  align-items: start;
  margin-bottom: 12px;
}

.roleBadge {
  border-width: 1px;
}

.role-admin {
  color: #1D4ED8;
  background: #DBEAFE;
  border: 1px solid #BFDBFE;
}

.role-amministrazione,
.role-direzione,
.role-direzione_amministrazione,
.role-admin_sistema {
  color: #6D28D9;
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
}

.role-operativo {
  color: #0E7490;
  background: #CFFAFE;
  border: 1px solid #A5F3FC;
}

.role-sola_lettura {
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
}

.rowSelected td {
  background: #F0F9FF;
}

.rowSelected:hover td {
  background: #E0F2FE;
}

.rowInactiveUser td {
  color: var(--muted);
  background: #FAFAFA;
}

.rowInactiveUser:hover td {
  background: #F5F5F5;
}

@media (max-width: 1120px) {
  .utentiFormGrid,
  .utentiListFilters {
    grid-template-columns: 1fr;
  }

  .utentiFormGrid .fieldNotes {
    grid-column: auto;
  }

  .selectedProfileBox {
    align-items: flex-start;
    flex-direction: column;
  }

  .selectedProfileMeta {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .passwordField {
    grid-template-columns: 1fr;
  }

  .passwordField .miniBtn {
    min-height: 42px;
  }
}

/* =========================================================
   UTENTI / RUOLI V23 — gestione permessi moduli per ruolo
   ========================================================= */

.utentiRolePermissionsCard {
  padding-bottom: 24px;
}

.utentiPermessiToolbar {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: end;
}

.permissionSummaryBox {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(180deg, #FFFFFF, var(--surface-soft));
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.permissionSummaryBox strong {
  color: var(--text);
  font-size: 14px;
}

.permissionSummaryBox span {
  color: var(--muted);
  font-size: 12px;
}

.permissionMatrixWrap table,
.permissionMatrixTable {
  min-width: 980px;
}

.permissionMatrixTable th:not(:first-child),
.permissionMatrixTable td.permissionCell {
  text-align: center;
}

.permissionMatrixTable input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-height: auto;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.permissionMatrixTable tbody tr:hover input[type="checkbox"] {
  transform: scale(1.08);
}

@media (max-width: 1120px) {
  .utentiPermessiToolbar {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V24 — REPORT / LOG / PRESTITI / DIPENDENTI
   ========================================================= */

.reportChartsGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.chartCard {
  min-height: 420px;
}

.simpleChart {
  display: grid;
  gap: 10px;
  min-height: 210px;
}

.simpleChartEmpty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 600;
}

.chartBarRow {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr minmax(90px, auto);
  gap: 10px;
  align-items: center;
}

.chartBarLabel {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chartBarTrack {
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.chartBarFill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.chartBarValue {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.chartLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chartLegend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chartMiniKpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.chartMiniKpi div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: var(--surface-soft);
}

.chartMiniKpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chartMiniKpi strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.auditActionBadge {
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 68px;
  justify-content: center;
  font-weight: 700;
}

.auditActionInsert {
  color: #047857;
  background: #D1FAE5;
  border: 1px solid #A7F3D0;
}

.auditActionUpdate {
  color: #1D4ED8;
  background: #DBEAFE;
  border: 1px solid #BFDBFE;
}

.auditActionDanger {
  color: #B91C1C;
  background: #FEE2E2;
  border: 1px solid #FECACA;
}

.auditActionAccess {
  color: #6D28D9;
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
}

.auditActionWarn {
  color: #C2410C;
  background: #FFEDD5;
  border: 1px solid #FED7AA;
}

.auditActionNeutral {
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
}

.auditDescriptionCell {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rowSelectedSoft td {
  background: #F0F9FF !important;
}

@media (max-width: 1120px) {
  .reportChartsGrid {
    grid-template-columns: 1fr;
  }

  .chartBarRow {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chartBarValue {
    text-align: left;
  }
}

.stackedMiniBars {
  display: grid;
  gap: 4px;
}

.stackedMiniBars .chartBarTrack {
  height: 8px;
}

/* =========================================================
   V25 — DASHBOARD
   ========================================================= */

.dashboardFilters {
  margin-bottom: 10px;
}

.dashboardFiltersInline {
  align-items: end;
}

.dashboardFilterActions {
  min-height: 42px;
  align-self: end;
  justify-content: flex-start;
  margin-bottom: 0;
}

.dashboardFilterActions button {
  min-height: 42px;
}

.sectionActionBtn,
.sectionResetBtn {
  min-height: 42px;
  border: 1px solid transparent;
  box-shadow: 0 11px 24px rgba(15, 23, 42, .12);
}

.sectionActionBtnOrange {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
  border-color: #D97706;
}

.sectionActionBtnOrange:hover {
  background: linear-gradient(135deg, #D97706, #B45309);
}

.sectionResetBtnOrange {
  background: #FFF7ED;
  color: #9A3412;
  border-color: #FDBA74;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .10);
}

.sectionResetBtnOrange:hover {
  background: #FED7AA;
  color: #7C2D12;
}

.sectionActionBtnPurple {
  background: linear-gradient(135deg, #6D5DF6, #6D28D9);
  color: #FFFFFF;
  border-color: #6D28D9;
}

.sectionActionBtnPurple:hover {
  background: linear-gradient(135deg, #6D28D9, #5B21B6);
}

.sectionResetBtnPurple {
  background: #F5F3FF;
  color: #5B21B6;
  border-color: #C4B5FD;
  box-shadow: 0 8px 18px rgba(109, 93, 246, .10);
}

.sectionResetBtnPurple:hover {
  background: #EDE9FE;
  color: #4C1D95;
}

.sectionActionBtnGreen {
  background: linear-gradient(135deg, #16A34A, #15803D);
  color: #FFFFFF;
  border-color: #15803D;
}

.sectionActionBtnGreen:hover {
  background: linear-gradient(135deg, #15803D, #166534);
}

.sectionResetBtnGreen {
  background: #F0FDF4;
  color: #166534;
  border-color: #BBF7D0;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .10);
}

.sectionResetBtnGreen:hover {
  background: #DCFCE7;
  color: #14532D;
}

.dashboardKpiGrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi.tonePositive {
  background: linear-gradient(180deg, #F0FDF4, #FFFFFF);
  border-color: #BBF7D0;
}

.kpi.tonePositive strong {
  color: var(--ok);
}

.kpi.toneNegative {
  background: linear-gradient(180deg, #FEF2F2, #FFFFFF);
  border-color: #FECACA;
}

.kpi.toneNegative strong {
  color: var(--danger);
}

.guideToggleBtn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 10px 22px rgba(8, 145, 178, .22);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.guideToggleBtn:hover {
  background: var(--accent-dark);
}

.openDocPayBtn {
  background: linear-gradient(135deg, #6D5DF6, #6D28D9);
  color: #FFFFFF;
  border: 1px solid #6D28D9;
  box-shadow: 0 9px 18px rgba(109, 93, 246, .30);
}

.openDocPayBtn:hover {
  background: linear-gradient(135deg, #6D28D9, #5B21B6);
  border-color: #5B21B6;
}

.dashboardGuideCard {
  padding-bottom: 22px;
}

.dashboardGuideGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guideItem {
  min-height: 142px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFFFF, var(--surface-soft));
  box-shadow: var(--shadow-sm);
}

.guideItem h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.guideItem p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 500;
}

@media (max-width: 1120px) {
  .dashboardKpiGrid,
  .dashboardGuideGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboardKpiGrid,
  .dashboardGuideGrid {
    grid-template-columns: 1fr;
  }
}



.openDocsFilters {
  margin-top: -4px;
  margin-bottom: 14px;
}

.openDocsTableWrap {
  max-height: 560px;
  overflow: auto;
}

.openDocsTableWrap th {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* =========================================================
   V25 Dashboard — ordinamento Documenti aperti
   ========================================================= */

.sortableTable th {
  vertical-align: middle;
}

.tableSortBtn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: left;
}

.tableSortBtn:hover,
.tableSortBtn.active {
  background: transparent;
  color: var(--primary-dark);
  box-shadow: none;
}

.tableSortBtn.rightSort {
  justify-content: flex-end;
  text-align: right;
}

.sortIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1;
}

.tableSortBtn.active .sortIcon {
  color: var(--primary-dark);
}


/* =========================================================
   V26 — DOCUMENTI
   ========================================================= */

.sectionActionBtnBlue {
  background: linear-gradient(135deg, #1D7AF2, #1D4ED8);
  color: #FFFFFF;
  border-color: #1D4ED8;
}

.sectionActionBtnBlue:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
}

.sectionResetBtnBlue {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .10);
}

.sectionResetBtnBlue:hover {
  background: #DBEAFE;
  color: #1E3A8A;
}

.documentiValidareTableWrap {
  max-height: 430px;
  overflow: auto;
}

.documentiListaTableWrap {
  max-height: 620px;
  overflow: auto;
}

.documentiValidareTableWrap th,
.documentiListaTableWrap th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.documentiListaTable {
  min-width: 1780px;
}

.documentActionsCell {
  min-width: 150px;
}

.documentActionsCell .inlineActions {
  flex-wrap: nowrap;
}

.docPayBtn {
  background: linear-gradient(135deg, #6D5DF6, #6D28D9);
  color: #FFFFFF;
  border: 1px solid #6D28D9;
  box-shadow: 0 9px 18px rgba(109, 93, 246, .24);
}

.docPayBtn:hover {
  background: linear-gradient(135deg, #6D28D9, #5B21B6);
  border-color: #5B21B6;
}

.docPayBtn:disabled {
  background: #E5E7EB;
  color: #94A3B8;
  border-color: #CBD5E1;
  box-shadow: none;
}

.documentPrimaryActions {
  align-items: center;
}

.labelWithInfo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
}

.fieldInfoBtn {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.fieldInfoBtn:hover {
  background: #BBF7D0;
  color: #14532D;
}

.noMargin {
  margin: 0;
}

.docPaidPopup .notice {
  line-height: 1.55;
}

.documentiValidareTable {
  min-width: 1180px;
}

.documentActionsCellCompact {
  min-width: 132px;
}

.docActionGroup {
  flex-wrap: nowrap;
  gap: 6px;
}

.docActionBtn {
  border: 1px solid transparent;
  box-shadow: 0 7px 15px rgba(15, 23, 42, .10);
}

.docViewBtn {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}

.docViewBtn:hover {
  background: #DBEAFE;
  color: #1E40AF;
}

.docEditBtn {
  background: #ECFEFF;
  color: #0E7490;
  border-color: #A5F3FC;
}

.docEditBtn:hover {
  background: #CFFAFE;
  color: #155E75;
}

.docAnnulBtn {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.docAnnulBtn:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

.docRestoreBtn {
  background: #F0FDF4;
  color: #15803D;
  border-color: #BBF7D0;
}

.docRestoreBtn:hover {
  background: #DCFCE7;
  color: #166534;
}

.docActionBtn:disabled {
  background: #F1F5F9;
  color: #94A3B8;
  border-color: #CBD5E1;
  box-shadow: none;
}

@media (max-width: 1120px) {
  .documentiListaTableWrap {
    max-height: 560px;
  }
}


/* =========================================================
   V26_DOCUMENTI_3 — Validazione, dettaglio e guida Documenti
   ========================================================= */

.docValidateBtn {
  background: #F0FDF4;
  color: #15803D;
  border-color: #86EFAC;
  box-shadow: 0 9px 18px rgba(22, 163, 74, .16);
}

.docValidateBtn:hover {
  background: #DCFCE7;
  color: #14532D;
  border-color: #4ADE80;
}

.documentActionsCellCompact {
  min-width: 172px;
}

.documentiGuideCard {
  padding-bottom: 22px;
}

.documentDetail {
  display: grid;
  gap: 18px;
}

.documentDetailHero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #DDD6FE;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(109, 93, 246, .14), transparent 34%),
    linear-gradient(135deg, #F5F3FF, #FFFFFF 72%);
}

.documentDetailEyebrow {
  color: #6D28D9;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.documentDetailHero h2 {
  margin: 0;
  color: #0F172A;
  font-size: 26px;
  letter-spacing: -.05em;
}

.documentDetailHero p {
  margin: 6px 0 0;
  color: #475569;
  font-weight: 600;
}

.documentDetailBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.documentDetailHeroAmount {
  min-width: 190px;
  display: grid;
  place-content: center;
  text-align: right;
  padding: 16px;
  border: 1px solid rgba(109, 93, 246, .22);
  border-radius: 19px;
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow-sm);
}

.documentDetailHeroAmount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.documentDetailHeroAmount strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: -.05em;
}

.positiveText {
  color: var(--ok);
}

.negativeText {
  color: var(--danger);
}

.documentDetailMetrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.documentDetailMetric {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
}

.documentDetailMetric span,
.documentDetailField span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}

.documentDetailMetric strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  letter-spacing: -.04em;
}

.documentDetailMetric.positive strong {
  color: var(--ok);
}

.documentDetailMetric.negative strong {
  color: var(--danger);
}

.documentDetailSection {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #FFFFFF;
}

.documentDetailSection h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.035em;
}

.documentDetailGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.documentDetailField {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.documentDetailField.full {
  grid-column: 1 / -1;
}

.documentDetailField strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.documentDetailPaymentsTable {
  max-height: 270px;
  overflow: auto;
}

.documentDetailPaymentsTable table {
  min-width: 900px;
}

.documentDetailEmpty {
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 600;
}

@media (max-width: 920px) {
  .documentDetailHero {
    flex-direction: column;
  }

  .documentDetailHeroAmount {
    text-align: left;
    min-width: 0;
  }

  .documentDetailMetrics,
  .documentDetailGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .modalHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .modalHeaderActions {
    justify-content: flex-start;
  }
}

/* =========================================================
   V27 — PAGAMENTI: ricerca documento, lista e guida
   ========================================================= */

.sectionActionBtnTeal {
  background: linear-gradient(135deg, #08A7B9, #0E7490);
  color: #FFFFFF;
  border-color: #0E7490;
}

.sectionActionBtnTeal:hover {
  background: linear-gradient(135deg, #0E7490, #155E75);
}

.sectionResetBtnTeal {
  background: #ECFEFF;
  color: #155E75;
  border-color: #A5F3FC;
  box-shadow: 0 8px 18px rgba(8, 167, 185, .10);
}

.sectionResetBtnTeal:hover {
  background: #CFFAFE;
  color: #164E63;
}

.pagamentiFormCard,
.pagamentiListCard,
.pagamentiGuideCard {
  padding-bottom: 22px;
}

.paymentDocumentPicker {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #DDD6FE;
  border-radius: 20px;
  background: linear-gradient(180deg, #F5F3FF, #FFFFFF);
  box-shadow: var(--shadow-sm);
}

.paymentDocumentPickerHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: 14px;
  align-items: start;
}

.paymentDocumentPickerHeader h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
  color: var(--text);
}

.paymentDocumentPickerHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.paySelectedDoc {
  margin: 0;
  padding: 12px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.paySelectedDoc strong,
.paySelectedDoc span {
  display: block;
}

.paySelectedDoc strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.paySelectedDoc span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.paymentDocFilters {
  margin-bottom: 0;
}

.paymentDocActions {
  justify-content: flex-start;
}

.paymentDocPickerWrap {
  max-height: 360px;
  overflow: auto;
}

.paymentDocPickerWrap th,
.paymentsTableWrap th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.paymentDocPickerTable {
  min-width: 1180px;
}

.paymentDocActionCell {
  min-width: 116px;
}


.paymentExtraSections {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.paymentSubSection {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #DDD6FE;
  border-radius: 20px;
  background: linear-gradient(180deg, #F8F7FF, #FFFFFF);
  box-shadow: var(--shadow-sm);
}

.paymentSubSectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.paymentSubSectionHeader h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
  color: var(--text);
}

.paymentSubSectionHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.paymentRecurringWrap,
.paymentAffittiWrap,
.affittiTableWrap {
  max-height: 360px;
  overflow: auto;
}

.paymentRecurringTable,
.paymentAffittiTable,
.affittiTable {
  min-width: 1020px;
}

.paymentDataGrid {
  align-items: end;
}

.paymentPreviewRow {
  align-items: center;
}

.paymentPrimaryActions {
  justify-content: flex-end;
}

.paymentsTableWrap {
  max-height: 560px;
  overflow: auto;
}

.paymentsTable {
  min-width: 1280px;
}

.paymentsTable .actionsCell {
  min-width: 150px;
  white-space: nowrap;
}

.paymentsTable .actionsCell .inlineActions {
  flex-wrap: nowrap;
}

.paymentsTable .iconBtn {
  min-width: 32px;
}


.paymentActionsCell {
  min-width: 138px;
  white-space: nowrap;
}

.paymentActionGroup {
  flex-wrap: nowrap;
  gap: 6px;
}

/* =========================================================
   FORNITORI — CAMPO RICERCA SU DROPDOWN ESTESI
   ========================================================= */

.supplierOriginalSelect {
  display: none !important;
}

.supplierSearchCombo {
  position: relative;
  width: 100%;
}

.supplierSearchInput {
  width: 100%;
  padding-right: 36px;
}

.supplierSearchCombo::after {
  content: "⌄";
  position: absolute;
  right: 13px;
  top: 13px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.supplierSearchList {
  display: none;
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
}

.supplierSearchCombo.open .supplierSearchList {
  display: grid;
  gap: 4px;
}

.supplierSearchOption {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.supplierSearchOption:hover {
  background: var(--surface-hover);
  color: var(--primary-dark);
}

.supplierSearchEmpty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1120px) {
  .paymentSubSectionHeader {
    flex-direction: column;
  }

  .paymentDocumentPickerHeader {
    grid-template-columns: 1fr;
  }

  .paymentPrimaryActions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .paymentDocumentPicker {
    padding: 14px;
  }

  .paymentDocPickerWrap,
  .paymentsTableWrap {
    max-height: 460px;
  }
}

/* =========================================================
   V32 — COSTI RICORRENTI / CAMPI CALCOLATI
   ========================================================= */

.calculatedFieldsRow input[readonly] {
  background: linear-gradient(180deg, #F8FAFC, #EEF2FF);
  border-color: #CBD5E1;
  color: #334155;
  font-weight: 600;
}

#prestitoCalcoloPreview {
  border-color: #BAE6FD;
  background: #F0F9FF;
  color: #075985;
  font-weight: 600;
}

/* =========================================================
   V32_FRONTEND_FIX_2 — SCADENZIARIO / PAGAMENTI / ARRETRATI
   ========================================================= */

.paymentReferenceCell {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.paymentReferenceCell > span {
  font-weight: 600;
  color: var(--text);
}

.paymentReferenceCell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.arrearsPopup {
  display: grid;
  gap: 12px;
}

.arrearsText {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 500;
}

.scadenziarioSourceCell {
  display: grid;
  gap: 4px;
}


/* =========================================================
   V33 — STILE UNICO, GUIDA, POPUP MESSAGGI
   ========================================================= */

.navBtn[data-tab="dashboard"] .navIcon,
.navBtn[data-tab="report"] .navIcon,
.navBtn[data-tab="documenti"] .navIcon,
.navBtn[data-tab="pagamenti"] .navIcon,
.navBtn[data-tab="prestiti"] .navIcon,
.navBtn[data-tab="affitti"] .navIcon,
.navBtn[data-tab="fornitori"] .navIcon,
.navBtn[data-tab="scadenziario"] .navIcon,
.navBtn[data-tab="ricavi"] .navIcon,
.navBtn[data-tab="personale"] .navIcon,
.navBtn[data-tab="budget"] .navIcon,
.navBtn[data-tab="controllo"] .navIcon,
.navBtn[data-tab="impostazioni"] .navIcon,
.navBtn[data-tab="utenti"] .navIcon,
.navBtn[data-tab="log"] .navIcon,
.navBtn[data-tab="guida"] .navIcon {
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1;
}

.navBtn[data-tab="guida"] .navIcon {
  background: rgba(20, 184, 166, .18);
  color: #99F6E4;
}

.guideHeroCard .sectionHeader {
  margin-bottom: 18px;
}

.guideIntroGrid,
.guideManualGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guideIntroBox,
.guideManualItem {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #FFFFFF, var(--surface-soft));
  box-shadow: var(--shadow-sm);
}

.guideIntroBox h3,
.guideManualItem h3 {
  margin: 0 0 7px;
  font-size: 16px;
  letter-spacing: -.03em;
  color: var(--text);
}

.guideIntroBox p,
.guideManualItem p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.systemNoticeStack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.systemNotice {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 38px 1fr 28px;
  gap: 11px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-lg);
  animation: noticeIn .18s ease-out;
}

.systemNotice.leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .24s ease, transform .24s ease;
}

.systemNoticeIcon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 600;
}

.systemNotice.ok {
  border-color: #BBF7D0;
}

.systemNotice.ok .systemNoticeIcon {
  background: var(--ok-bg);
  color: var(--ok);
}

.systemNotice.error {
  border-color: #FECACA;
}

.systemNotice.error .systemNoticeIcon {
  background: var(--danger-bg);
  color: var(--danger);
}

.systemNotice.warn {
  border-color: #FED7AA;
}

.systemNotice.warn .systemNoticeIcon {
  background: var(--warn-bg);
  color: var(--warn);
}

.systemNoticeContent strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}

.systemNoticeContent p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.systemNoticeClose {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
}

.systemNoticeClose:hover {
  background: var(--border);
  color: var(--text);
}

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

@media (max-width: 1120px) {
  .guideIntroGrid,
  .guideManualGrid {
    grid-template-columns: 1fr;
  }

  .systemNoticeStack {
    top: 68px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}


/* =========================================================
   V33 FIX 1 — SISTEMA VISIVO UNICO PER ICONE E COLORI
   Ogni pagina usa una famiglia colore stabile; le icone sezione
   indicano la funzione: nuovo, lista, report, controllo, log.
   ========================================================= */

.section-theme-dashboard {
  --section-color: #7C3AED;
  --section-color-dark: #5B21B6;
  --section-bg: #FAF7FF;
  --section-border: #DDD6FE;
  --section-icon-bg: #F3E8FF;
  --section-icon-color: #6D28D9;
}

.section-theme-report {
  --section-color: #7C3AED;
  --section-color-dark: #5B21B6;
  --section-bg: #F5F3FF;
  --section-border: #DDD6FE;
  --section-icon-bg: #EDE9FE;
  --section-icon-color: #6D28D9;
}

.section-theme-documenti {
  --section-color: #16A34A;
  --section-color-dark: #166534;
  --section-bg: #F0FDF4;
  --section-border: #BBF7D0;
  --section-icon-bg: #DCFCE7;
  --section-icon-color: #15803D;
}

.section-theme-pagamenti {
  --section-color: #6D5DF6;
  --section-color-dark: #4C1D95;
  --section-bg: #F5F3FF;
  --section-border: #C4B5FD;
  --section-icon-bg: #EDE9FE;
  --section-icon-color: #6D28D9;
}

.section-theme-ricorrenti {
  --section-color: #2563EB;
  --section-color-dark: #1E40AF;
  --section-bg: #EFF6FF;
  --section-border: #BFDBFE;
  --section-icon-bg: #DBEAFE;
  --section-icon-color: #1D4ED8;
}

.section-theme-affitti {
  --section-color: #0891B2;
  --section-color-dark: #155E75;
  --section-bg: #ECFEFF;
  --section-border: #A5F3FC;
  --section-icon-bg: #CFFAFE;
  --section-icon-color: #0E7490;
}

.section-theme-fornitori {
  --section-color: #0284C7;
  --section-color-dark: #075985;
  --section-bg: #F0F9FF;
  --section-border: #BAE6FD;
  --section-icon-bg: #E0F2FE;
  --section-icon-color: #0369A1;
}

.section-theme-scadenziario {
  --section-color: #EA580C;
  --section-color-dark: #9A3412;
  --section-bg: #FFF7ED;
  --section-border: #FDBA74;
  --section-icon-bg: #FFEDD5;
  --section-icon-color: #C2410C;
}

.section-theme-ricavi {
  --section-color: #059669;
  --section-color-dark: #065F46;
  --section-bg: #ECFDF5;
  --section-border: #A7F3D0;
  --section-icon-bg: #D1FAE5;
  --section-icon-color: #047857;
}

.section-theme-personale {
  --section-color: #4F46E5;
  --section-color-dark: #3730A3;
  --section-bg: #EEF2FF;
  --section-border: #C7D2FE;
  --section-icon-bg: #E0E7FF;
  --section-icon-color: #4338CA;
}

.section-theme-budget {
  --section-color: #9333EA;
  --section-color-dark: #6B21A8;
  --section-bg: #FAF5FF;
  --section-border: #E9D5FF;
  --section-icon-bg: #F3E8FF;
  --section-icon-color: #7E22CE;
}

.section-theme-controllo {
  --section-color: #334155;
  --section-color-dark: #0F172A;
  --section-bg: #F8FAFC;
  --section-border: #CBD5E1;
  --section-icon-bg: #E2E8F0;
  --section-icon-color: #1E293B;
}

.section-theme-impostazioni {
  --section-color: #475569;
  --section-color-dark: #1E293B;
  --section-bg: #F8FAFC;
  --section-border: #CBD5E1;
  --section-icon-bg: #E2E8F0;
  --section-icon-color: #334155;
}

.section-theme-utenti {
  --section-color: #0D9488;
  --section-color-dark: #115E59;
  --section-bg: #F0FDFA;
  --section-border: #99F6E4;
  --section-icon-bg: #CCFBF1;
  --section-icon-color: #0F766E;
}

.section-theme-log {
  --section-color: #DC2626;
  --section-color-dark: #991B1B;
  --section-bg: #FEF2F2;
  --section-border: #FECACA;
  --section-icon-bg: #FEE2E2;
  --section-icon-color: #B91C1C;
}

.section-theme-guida {
  --section-color: #14B8A6;
  --section-color-dark: #0F766E;
  --section-bg: #F0FDFA;
  --section-border: #99F6E4;
  --section-icon-bg: #CCFBF1;
  --section-icon-color: #0F766E;
}

.sectionHeader {
  background:
    linear-gradient(90deg, var(--section-bg), rgba(255,255,255,.98) 68%),
    white;
}

.sectionHeader::after {
  background: linear-gradient(90deg, var(--section-color), var(--section-color-dark, var(--section-color)));
}

.sectionHeader::before {
  font-size: 24px;
  letter-spacing: -.03em;
}

.sectionHeader .secondary,
.sectionHeader .compactBtn.secondary {
  background: white;
  color: var(--section-icon-color);
  border-color: var(--section-border);
}

.sectionHeader .secondary:hover,
.sectionHeader .compactBtn.secondary:hover {
  background: var(--section-bg);
  color: var(--section-color-dark, var(--section-icon-color));
}

.navBtn {
  --nav-accent: #2563EB;
  --nav-accent-soft: rgba(37, 99, 235, .16);
  --nav-accent-icon: #BFDBFE;
}

.navBtn .navIcon {
  background: var(--nav-accent-soft);
  color: var(--nav-accent-icon);
}

.navBtn.active {
  background: linear-gradient(135deg, var(--nav-accent), color-mix(in srgb, var(--nav-accent) 72%, #020617));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--nav-accent) 24%, transparent);
}

.navBtn.active .navIcon {
  background: rgba(255,255,255,.18);
  color: #FFFFFF;
}

.navBtn[data-tab="dashboard"] { --nav-accent: #F59E0B; --nav-accent-soft: rgba(245, 158, 11, .16); --nav-accent-icon: #FDE68A; }
.navBtn[data-tab="report"] { --nav-accent: #7C3AED; --nav-accent-soft: rgba(124, 58, 237, .16); --nav-accent-icon: #DDD6FE; }
.navBtn[data-tab="documenti"] { --nav-accent: #16A34A; --nav-accent-soft: rgba(22, 163, 74, .16); --nav-accent-icon: #BBF7D0; }
.navBtn[data-tab="pagamenti"] { --nav-accent: #6D5DF6; --nav-accent-soft: rgba(109, 93, 246, .18); --nav-accent-icon: #DDD6FE; }
.navBtn[data-tab="prestiti"] { --nav-accent: #2563EB; --nav-accent-soft: rgba(37, 99, 235, .16); --nav-accent-icon: #BFDBFE; }
.navBtn[data-tab="affitti"] { --nav-accent: #0891B2; --nav-accent-soft: rgba(8, 145, 178, .16); --nav-accent-icon: #A5F3FC; }
.navBtn[data-tab="fornitori"] { --nav-accent: #0284C7; --nav-accent-soft: rgba(2, 132, 199, .16); --nav-accent-icon: #BAE6FD; }
.navBtn[data-tab="scadenziario"] { --nav-accent: #EA580C; --nav-accent-soft: rgba(234, 88, 12, .16); --nav-accent-icon: #FDBA74; }
.navBtn[data-tab="ricavi"] { --nav-accent: #059669; --nav-accent-soft: rgba(5, 150, 105, .16); --nav-accent-icon: #A7F3D0; }
.navBtn[data-tab="personale"] { --nav-accent: #4F46E5; --nav-accent-soft: rgba(79, 70, 229, .16); --nav-accent-icon: #C7D2FE; }
.navBtn[data-tab="budget"] { --nav-accent: #9333EA; --nav-accent-soft: rgba(147, 51, 234, .16); --nav-accent-icon: #E9D5FF; }
.navBtn[data-tab="controllo"] { --nav-accent: #64748B; --nav-accent-soft: rgba(100, 116, 139, .18); --nav-accent-icon: #CBD5E1; }
.navBtn[data-tab="impostazioni"] { --nav-accent: #475569; --nav-accent-soft: rgba(71, 85, 105, .18); --nav-accent-icon: #CBD5E1; }
.navBtn[data-tab="utenti"] { --nav-accent: #0D9488; --nav-accent-soft: rgba(13, 148, 136, .16); --nav-accent-icon: #99F6E4; }
.navBtn[data-tab="log"] { --nav-accent: #DC2626; --nav-accent-soft: rgba(220, 38, 38, .16); --nav-accent-icon: #FECACA; }
.navBtn[data-tab="guida"] { --nav-accent: #14B8A6; --nav-accent-soft: rgba(20, 184, 166, .16); --nav-accent-icon: #99F6E4; }


/* =========================================================
   V34 — TABELLE, FILTRI, ORDINAMENTI
   ========================================================= */

.sortableTable th,
.tableWrap table th {
  white-space: nowrap;
}

.tableSortBtn,
.genericTableSortBtn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
  color: inherit;
  box-shadow: none;
  border-radius: 0;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
}

.tableSortBtn:hover,
.genericTableSortBtn:hover {
  background: transparent;
  color: var(--primary-dark);
  box-shadow: none;
}

.tableSortBtn.rightSort,
.genericTableSortBtn.rightSort {
  justify-content: flex-end;
}

.sortIcon,
.genericSortIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1;
}

.tableSortBtn[aria-sort="ascending"],
.tableSortBtn[aria-sort="descending"],
.genericTableSortBtn[aria-sort="ascending"],
.genericTableSortBtn[aria-sort="descending"] {
  color: var(--primary-dark);
}

.tableSortBtn[aria-sort="ascending"] .sortIcon,
.tableSortBtn[aria-sort="descending"] .sortIcon,
.genericTableSortBtn[aria-sort="ascending"] .genericSortIcon,
.genericTableSortBtn[aria-sort="descending"] .genericSortIcon {
  color: var(--primary-dark);
}

.paymentStandaloneFilters {
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr);
  margin-top: 12px;
}

.v34ResetBtn {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}

.v34ResetBtn:hover {
  background: var(--border);
}

@media (max-width: 1120px) {
  .paymentStandaloneFilters {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   V35_FIX_7 — BADGE MENU, FUTURE TOGGLE, SPAZIATURA SCADENZIARIO
   ========================================================= */

.navBtn {
  position: relative;
}

/*
   V36_FRONTEND_FIX_30 — Menu notifiche stile 1: badge tondo.
   Solo intervento visivo: non modifica conteggi, query o logiche badge.
*/
.navBadge {
  margin-left: auto;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #60A5FA 0%, #2563EB 58%, #1D4ED8 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,.22);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.02em;
  box-shadow:
    0 8px 18px rgba(37,99,235,.30),
    inset 0 1px 0 rgba(255,255,255,.20);
}

.navBtn:hover .navBadge,
.navBtn.active .navBadge {
  border-color: rgba(255,255,255,.32);
  box-shadow:
    0 10px 22px rgba(37,99,235,.38),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.navBadge.hidden {
  display: none !important;
}

.compactCheckLabel {
  min-height: 42px;
  align-items: center;
  padding: 10px 12px;
}

.compactCheckLabel input {
  margin-top: 0;
}

.compactCheckLabel small {
  display: block;
  margin-top: 2px;
}

.futureToggle {
  background: #FFFFFF;
}

#tab-scadenziario .scadenziarioCard {
  display: grid;
  gap: 0;
}

#tab-scadenziario .sectionHeader {
  margin-bottom: 22px;
}

#tab-scadenziario .scadenziarioFilters {
  align-items: end;
  margin-bottom: 18px;
}

#tab-scadenziario .scadenziarioKpiGrid {
  margin: 4px 0 18px;
}

#tab-scadenziario .scadenziarioTableWrap {
  margin-top: 4px;
}

#tab-scadenziario th,
#tab-scadenziario td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.paymentStandaloneFilters {
  align-items: end;
}

@media (max-width: 1120px) {
  .navBadge {
    margin-left: auto;
  }

  #tab-scadenziario .scadenziarioFilters {
    margin-bottom: 16px;
  }
}


/* =========================================================
   V36 — DOCUMENTO COLLEGATO, RETTIFICHE E CREDITI ANTICIPATI
   ========================================================= */

.v36DocLinkBox {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #DDD6FE;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(109, 93, 246, .10), transparent 34%),
    linear-gradient(180deg, #F5F3FF, #FFFFFF);
}

.v36DocLinkHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.v36DocLinkHeader strong {
  display: block;
  color: #4C1D95;
  font-size: 14px;
  letter-spacing: -.02em;
}

.v36DocLinkHeader p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.v36DocLinkBox select:disabled,
.v36DocLinkBox input:disabled {
  background: #F8FAFC;
  color: var(--muted);
}

.documentDetailSubTitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.documentDetailTableMini {
  max-height: 270px;
  overflow: auto;
}

.documentDetailTableMini table {
  min-width: 820px;
}

.creditExhaustedNotice {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
}

.creditAvailableNotice {
  color: #075985;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
}


/* =========================================================
   V36_FIX_7 — EXPORT CSV TABELLE
   ========================================================= */

.csvExportBtn {
  background: #FFFFFF;
  color: var(--accent-dark);
  border: 1px solid #A5F3FC;
  box-shadow: none;
}

.csvExportBtn:hover {
  background: var(--accent-soft);
  color: #164E63;
}

.csvTableToolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}


/* =========================================================
   V36_FRONTEND_FIX_12 — NEGATIVI ROSSI / CREDITI ANTICIPATI UI
   ========================================================= */

.valueNegative,
td.valueNegative,
.chartBarValue.valueNegative,
.documentDetailMetric.valueNegative strong,
.kpi.valueNegative strong {
  color: var(--danger) !important;
}

.valuePositive,
td.valuePositive,
.chartBarValue.valuePositive {
  color: var(--ok);
}

.chartBarFill.valueNegative {
  background: linear-gradient(90deg, #FCA5A5, var(--danger));
}

.chartBarFill.valuePositive {
  background: linear-gradient(90deg, var(--ok), #22C55E);
}

.mutedText {
  color: var(--muted);
}

.documentDetailHeroAmount.creditHeroAmount {
  border-color: #A7F3D0;
  background: linear-gradient(180deg, #F0FDF4, #FFFFFF);
}

.creditDocumentMetrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.creditDocumentSummarySection {
  border-color: #A7F3D0;
  background: linear-gradient(180deg, #F0FDF4, #FFFFFF);
}

.documentDetailSection:has(+ .documentDetailSection) + .documentDetailSection.creditDocumentSummarySection {
  margin-top: 0;
}

/* =========================================================
   V36_FRONTEND_FIX_19 — REPORT FINALE DIREZIONALE
   ========================================================= */

.reportHeroCard {
  border-color: #DDD6FE;
  background:
    radial-gradient(circle at top right, rgba(109, 93, 246, .10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
}

.reportFinalFilters {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  align-items: end;
}

.reportExecutiveNote {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 16px;
  padding: 13px 15px;
  border: 1px solid #C4B5FD;
  border-radius: 18px;
  background: #F5F3FF;
  color: #4C1D95;
  font-size: 13px;
  line-height: 1.45;
}

.reportExecutiveNote strong {
  white-space: nowrap;
}

.reportKpiFinalGrid {
  margin-top: 12px;
}

.reportComparisonGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.reportComparisonCard {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
  box-shadow: var(--shadow-sm);
}

.reportComparisonCard span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.reportComparisonCard strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  letter-spacing: -.035em;
}

.reportComparisonCard small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reportFinalChartsGrid {
  align-items: stretch;
  grid-template-columns: 1fr;
}

.reportFinalChart {
  min-height: 440px;
}

.reportFinalChart .simpleChart {
  min-height: 245px;
}

.reportFinalChart .reportVerticalBars {
  justify-content: space-between;
  gap: 10px;
  min-width: 940px;
}

.reportFinalChart .reportVerticalGroup {
  min-width: 66px;
}

.reportFinalChart .reportVerticalBar {
  width: 20px;
}

.reportVerticalGroup.isNoValue .reportVerticalBarSet {
  border-bottom-style: dashed;
  opacity: .45;
}

.reportVerticalGroup.isNoValue .reportVerticalLabel {
  color: var(--muted);
}

.reportVerticalBar.isNoValue {
  min-height: 0;
  opacity: 0;
}

.reportWideChart {
  grid-column: 1 / -1;
}

.reportKpiCard {
  position: relative;
}

.reportKpiTitle {
  display: flex !important;
  align-items: center;
  gap: 7px;
}

.reportKpiInfo {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: white;
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.reportKpiInfo:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.reportKpiInfo[aria-expanded="true"] {
  background: #4C1D95;
  border-color: #4C1D95;
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .14);
}

.reportInfoPopover {
  position: fixed;
  z-index: 80;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(124, 58, 237, .24);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, .10), transparent 42%),
    #FFFFFF;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  color: var(--text);
  animation: reportInfoPopoverIn .14s ease-out;
}

.reportInfoPopover::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(124, 58, 237, .24);
  border-top: 1px solid rgba(124, 58, 237, .24);
  background: #FFFFFF;
  transform: translateX(-50%) rotate(45deg);
}

.reportInfoPopover[data-placement="bottom"]::before {
  top: -7px;
}

.reportInfoPopover[data-placement="top"]::before {
  bottom: -7px;
  transform: translateX(-50%) rotate(225deg);
}

.reportInfoPopoverIcon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #F5F3FF;
  color: #5B21B6;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #DDD6FE;
}

.reportInfoPopoverContent strong {
  display: block;
  color: #2E1065;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.reportInfoPopoverContent p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reportInfoPopoverClose {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.reportInfoPopoverClose:hover {
  background: #F1F5F9;
  color: var(--text);
}

@keyframes reportInfoPopoverIn {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reportComparisonCard strong em {
  color: var(--muted-2);
  font-style: normal;
  font-weight: 600;
}

.reportVerticalChart {
  overflow-x: auto;
}

.reportVerticalBars {
  display: flex;
  align-items: stretch;
  gap: 16px;
  min-height: 255px;
  padding: 10px 2px 2px;
}

.reportVerticalGroup {
  min-width: 86px;
  display: grid;
  grid-template-rows: 170px auto auto;
  gap: 8px;
  align-items: end;
  justify-items: center;
}

.reportVerticalBarSet {
  height: 170px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  border-bottom: 1px solid var(--border-strong);
}

.reportVerticalBar {
  width: 24px;
  min-height: 4px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.reportVerticalBar.valuePositive {
  background: linear-gradient(180deg, var(--ok), #15803D);
}

.reportVerticalBar.valueNegative {
  background: linear-gradient(180deg, #FCA5A5, var(--danger));
}

.reportVerticalLabel {
  max-width: 94px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reportVerticalValue {
  max-width: 116px;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.reportGroupedChart {
  display: grid;
  gap: 18px;
}

.reportGroupedBlock {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #FFFFFF;
}

.reportGroupedAreaTitle {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.reportGroupedBars {
  display: grid;
  gap: 8px;
}

.reportGroupedRow {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr minmax(92px, auto);
  gap: 12px;
  align-items: center;
}

.reportTrendRow,
.reportLocaliRow {
  display: grid;
  grid-template-columns: minmax(112px, 150px) 1fr minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.reportTrendRow:last-child,
.reportLocaliRow:last-child {
  border-bottom: 0;
}

.reportTrendBars,
.reportLocaliBars {
  display: grid;
  gap: 5px;
}

.reportTrendMeta,
.reportLocaliMeta {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.reportLegendDot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reportLegendDot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.reportLegendDot.costs::before {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.reportLegendDot.valuePositive::before {
  background: linear-gradient(180deg, var(--ok), #15803D);
}

.reportLegendDot.valueNegative::before {
  background: linear-gradient(180deg, #FCA5A5, var(--danger));
}

.reportLegendDot.mixedMargin::before {
  background: linear-gradient(180deg, var(--ok) 0 50%, var(--danger) 50% 100%);
}

.reportTablesGrid {
  display: grid;
  gap: 18px;
}

.reportTableCard .tableWrap {
  max-height: 460px;
}

.reportOpenTableCard .tableWrap {
  max-height: 520px;
}

.reportTableCard table th,
.reportTableCard table td {
  vertical-align: top;
}

.reportTableCard tbody td:first-child strong {
  color: var(--text);
}

.reportCellSubtle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reportNoComparison {
  grid-column: 1 / -1;
  padding: 13px 15px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1260px) {
  .reportFinalFilters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .reportComparisonGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .reportFinalFilters,
  .reportComparisonGrid {
    grid-template-columns: 1fr;
  }

  .reportExecutiveNote {
    display: grid;
  }

  .reportTrendRow,
  .reportLocaliRow,
  .reportGroupedRow {
    grid-template-columns: 1fr;
  }

  .reportTrendMeta,
  .reportLocaliMeta {
    text-align: left;
  }
}


/* V36 FIX 27 — Report trend 12 mesi chiaro */
.reportTrendNote {
  margin: 4px 2px 8px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 58, 237, .16);
  border-radius: 14px;
  background: rgba(124, 58, 237, .06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.reportVerticalBars.hideValues {
  min-height: 224px;
}

.reportVerticalBars.hideValues .reportVerticalGroup {
  grid-template-rows: 170px auto 0;
}

.reportVerticalBars.hideValues .reportVerticalValue {
  display: none;
}

.reportVerticalBars.compactLabels .reportVerticalLabel {
  max-width: 72px;
  font-size: 11px;
}

.reportVerticalGroup.isSelectedPeriod .reportVerticalLabel {
  color: var(--primary-dark);
}

.reportVerticalGroup.isSelectedPeriod .reportVerticalBarSet {
  border-bottom-color: rgba(124, 58, 237, .55);
  box-shadow: inset 0 -2px 0 rgba(124, 58, 237, .18);
}

.reportVerticalGroup.isNoValue.isSelectedPeriod .reportVerticalBarSet {
  border-bottom-color: rgba(124, 58, 237, .35);
}

/* =========================================================
   V36_FRONTEND_REPORT_REDESIGN_01 — Report direzionale 1–8
   ========================================================= */
.reportHeaderBar {
  align-items: flex-start;
}

.reportHeaderActions {
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.reportHeaderActions .compactBtn,
.reportHeaderBar .v34ResetBtn {
  min-height: 38px;
}

.reportRedesignGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.reportRedesignGrid .reportFinalChart {
  min-height: 410px;
}

.reportRedesignGrid .reportFinalChart .simpleChart {
  min-height: 245px;
}

.reportAxisChart {
  overflow-x: auto;
}

.reportAxisBars {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  min-width: 560px;
  min-height: 260px;
  padding: 10px 2px 4px;
}

.reportAxisGroup {
  min-width: 54px;
  display: grid;
  grid-template-rows: 190px auto auto;
  gap: 8px;
  align-items: end;
  justify-items: center;
}

.reportAxisBarSet {
  position: relative;
  height: 190px;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .025), rgba(15, 23, 42, .045));
  overflow: hidden;
}

.reportAxisZeroLine {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(15, 23, 42, .26);
  z-index: 1;
}

.reportAxisBar {
  position: relative;
  z-index: 2;
  align-self: stretch;
  width: 18px;
  min-height: 0;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 14px rgba(15, 23, 42, .10);
}

.reportAxisBar.isPositiveAxis {
  position: absolute;
  transform: translateX(-50%);
}

.reportAxisBar.isNegativeAxis {
  position: absolute;
  transform: translateX(-50%);
  border-radius: 0 0 9px 9px;
}

.reportAxisBar:nth-child(2) { left: calc(50% - 12px); }
.reportAxisBar:nth-child(3) { left: calc(50% + 12px); }
.reportAxisBar:only-child { left: 50%; }

.reportAxisBar.valuePositive {
  background: linear-gradient(180deg, var(--ok), #15803D);
}

.reportAxisBar.valueNegative {
  background: linear-gradient(180deg, #FCA5A5, var(--danger));
}

.reportAxisBar.costs {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.reportAxisBar.isNoValue {
  opacity: 0;
  height: 0 !important;
}

.reportAxisGroup.isNoValue .reportAxisBarSet {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, .55);
}

.reportAxisGroup.isNoValue .reportAxisLabel {
  color: var(--muted);
}

.reportAxisGroup.isSelectedPeriod .reportAxisLabel {
  color: var(--primary-dark);
}

.reportAxisGroup.isSelectedPeriod .reportAxisBarSet {
  box-shadow: inset 0 0 0 2px rgba(124, 58, 237, .18);
}

.reportAxisLabel {
  max-width: 86px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reportAxisValue {
  max-width: 116px;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.reportAxisBars.hideValues .reportAxisGroup {
  grid-template-rows: 190px auto 0;
}

.reportAxisBars.hideValues .reportAxisValue {
  display: none;
}

.reportAxisBars.compactLabels .reportAxisLabel {
  max-width: 64px;
  font-size: 10.5px;
}

.reportPieChart {
  display: grid;
  align-items: center;
}

.reportPieWrap {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.reportPieDonut {
  width: min(240px, 100%);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08), 0 18px 34px rgba(15, 23, 42, .10);
}

.reportPieCenter {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 14px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--border);
  text-align: center;
}

.reportPieCenter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.reportPieCenter strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.04em;
}

.reportPieLegend {
  display: grid;
  gap: 9px;
}

.reportPieLegendRow {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #FFFFFF;
  font-size: 12px;
}

.reportPieLegendRow strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

.reportPieLegendRow em,
.reportPieLegendRow span:last-child {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.reportPieSwatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

:root {
  --report-pie-1: #7C3AED;
  --report-pie-2: #16A34A;
  --report-pie-3: #F59E0B;
  --report-pie-4: #0EA5E9;
  --report-pie-5: #EF4444;
  --report-pie-6: #64748B;
}

@media (max-width: 1180px) {
  .reportRedesignGrid {
    grid-template-columns: 1fr;
  }

  .reportAxisBars {
    min-width: 720px;
  }
}

@media (max-width: 760px) {
  .reportHeaderBar {
    display: grid;
  }

  .reportHeaderActions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .reportHeaderActions .compactBtn,
  .reportHeaderBar .v34ResetBtn {
    flex: 1 1 auto;
  }

  .reportPieWrap {
    grid-template-columns: 1fr;
  }
}

.reportAxisBarSet.singleSeries .reportAxisBar:nth-child(2) {
  left: 50%;
}

/* V36_FRONTEND_REPORT_REDESIGN_02 — controllo valori report 1-4 */
.reportChartSummaryStrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.reportChartSummaryItem {
  border: 1px solid rgba(124, 58, 237, .14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .96));
  padding: 8px 10px;
  min-width: 0;
}

.reportChartSummaryItem span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reportChartSummaryItem strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reportChartSummaryItem.valuePositive strong {
  color: var(--ok);
}

.reportChartSummaryItem.valueNegative strong {
  color: var(--danger);
}

.reportAxisValue {
  min-height: 34px;
}

.reportAxisBars.compactLabels .reportAxisValue {
  max-width: 92px;
  font-size: 9.5px;
}

/* V36_FRONTEND_REPORT_REDESIGN_03 - leggibilità Report 1-4 */
.reportMonthlyDataGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.reportMonthlyDataCell {
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 8px 9px;
  min-width: 0;
}

.reportMonthlyDataCell.isSelected {
  border-color: rgba(139, 92, 246, 0.34);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.06);
}

.reportMonthlyDataCell.isFuture {
  opacity: 0.58;
  background: rgba(248, 250, 252, 0.72);
}

.reportMonthlyDataCell strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  margin-bottom: 5px;
}

.reportMonthlyDataCell span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
}

.reportMonthlyDataCell span + span {
  margin-top: 2px;
}

.reportMonthlyDataCell span em {
  font-style: normal;
  color: var(--muted);
}

.reportMonthlyDataCell span.valuePositive {
  color: var(--green);
  font-weight: 600;
}

.reportMonthlyDataCell span.valueNegative {
  color: var(--red);
  font-weight: 600;
}

.reportComparisonMatrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.reportComparisonBox {
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.82));
  padding: 13px 14px;
  min-width: 0;
}

.reportComparisonBox span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.reportComparisonBox strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.reportComparisonBox em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.reportMetricComparisonTable {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.88);
}

.reportMetricComparisonHeader,
.reportMetricComparisonRow {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.2fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.reportMetricComparisonHeader {
  background: rgba(248, 250, 252, .95);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.reportMetricComparisonRow {
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  color: var(--text);
  font-size: 11.5px;
}

.reportMetricComparisonRow strong {
  font-size: 12px;
}

.reportMetricComparisonRow span {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.reportMetricComparisonRow .valuePositive {
  color: var(--green);
}

.reportMetricComparisonRow .valueNegative {
  color: var(--red);
}

.reportComparisonHint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .reportComparisonMatrix {
    grid-template-columns: 1fr;
  }

  .reportMetricComparisonHeader,
  .reportMetricComparisonRow {
    grid-template-columns: 1fr;
  }

  .reportMetricComparisonRow span {
    text-align: left;
  }
}


/* V36_FRONTEND_REPORT_REDESIGN_04 - Report 3/4: ricavi e costi sempre verso l'alto */
.reportAxisBars.positiveOnly {
  min-height: 250px;
}

.reportAxisBars.positiveOnly .reportAxisGroup {
  grid-template-rows: 180px auto auto;
}

.reportAxisBars.positiveOnly .reportAxisBarSet {
  height: 180px;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(15, 23, 42, .018), rgba(15, 23, 42, .045));
}

.reportAxisBars.positiveOnly .reportAxisZeroLine {
  top: auto;
  bottom: 0;
  height: 2px;
  background: rgba(15, 23, 42, .20);
}

.reportAxisBars.positiveOnly .reportAxisBar.isPositiveAxis,
.reportAxisBars.positiveOnly .reportAxisBar.isNegativeAxis {
  bottom: 0;
  top: auto;
  border-radius: 9px 9px 0 0;
}

.reportAxisBars.positiveOnly .reportAxisValue {
  max-width: 140px;
}

/* V36_FRONTEND_REPORT_REDESIGN_05 - UI Report 1/3: no scrollbar, valori mensili leggibili */
#chartReportMargineAnno.reportAxisChart,
#chartReportRicaviCostiAnno.reportAxisChart {
  overflow-x: hidden;
}

#chartReportMargineAnno .reportAxisBars,
#chartReportRicaviCostiAnno .reportAxisBars {
  min-width: 0;
  width: 100%;
  gap: 6px;
  min-height: 216px;
  padding: 8px 0 2px;
}

#chartReportMargineAnno .reportAxisGroup,
#chartReportRicaviCostiAnno .reportAxisGroup,
#chartReportRicaviCostiAnno .reportAxisBars.positiveOnly .reportAxisGroup {
  flex: 1 1 0;
  min-width: 0;
  grid-template-rows: 150px auto 0;
  gap: 6px;
}

#chartReportMargineAnno .reportAxisBarSet,
#chartReportRicaviCostiAnno .reportAxisBarSet,
#chartReportRicaviCostiAnno .reportAxisBars.positiveOnly .reportAxisBarSet {
  height: 150px;
  border-radius: 10px;
}

#chartReportMargineAnno .reportAxisBar,
#chartReportRicaviCostiAnno .reportAxisBar {
  width: 12px;
  border-radius: 7px 7px 0 0;
}

#chartReportMargineAnno .reportAxisBar.isNegativeAxis {
  border-radius: 0 0 7px 7px;
}

#chartReportMargineAnno .reportAxisBar:nth-child(2),
#chartReportRicaviCostiAnno .reportAxisBar:nth-child(2) {
  left: calc(50% - 8px);
}

#chartReportMargineAnno .reportAxisBar:nth-child(3),
#chartReportRicaviCostiAnno .reportAxisBar:nth-child(3) {
  left: calc(50% + 8px);
}

#chartReportMargineAnno .reportAxisBarSet.singleSeries .reportAxisBar:nth-child(2),
#chartReportRicaviCostiAnno .reportAxisBarSet.singleSeries .reportAxisBar:nth-child(2) {
  left: 50%;
}

#chartReportMargineAnno .reportAxisValue,
#chartReportRicaviCostiAnno .reportAxisValue {
  display: none;
}

#chartReportMargineAnno .reportAxisLabel,
#chartReportRicaviCostiAnno .reportAxisLabel {
  max-width: 100%;
  font-size: 10px;
}

#chartReportMargineAnno .reportMonthlyDataGrid,
#chartReportRicaviCostiAnno .reportMonthlyDataGrid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

#chartReportMargineAnno .reportMonthlyDataCell,
#chartReportRicaviCostiAnno .reportMonthlyDataCell {
  padding: 6px 7px;
  border-radius: 10px;
}

#chartReportMargineAnno .reportMonthlyDataCell strong,
#chartReportRicaviCostiAnno .reportMonthlyDataCell strong {
  margin-bottom: 3px;
  font-size: 10px;
}

#chartReportMargineAnno .reportMonthlyDataCell span,
#chartReportRicaviCostiAnno .reportMonthlyDataCell span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  font-size: 9px;
  line-height: 1.25;
}

#chartReportMargineAnno .reportMonthlyDataCell span em,
#chartReportRicaviCostiAnno .reportMonthlyDataCell span em {
  overflow: hidden;
  text-overflow: ellipsis;
}

#chartReportMargineAnno .reportMonthlyDataCell span b,
#chartReportRicaviCostiAnno .reportMonthlyDataCell span b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #chartReportMargineAnno .reportAxisBars,
  #chartReportRicaviCostiAnno .reportAxisBars {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  #chartReportMargineAnno .reportMonthlyDataGrid,
  #chartReportRicaviCostiAnno .reportMonthlyDataGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}



/* =========================================================
   V36 FIX 32 — Dashboard KPI UI, formati e tooltip
   ========================================================= */

.dashboardKpiGrid .kpi {
  position: relative;
}

.dashboardKpiGrid .kpiTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  line-height: 1.25;
}

.dashboardKpiGrid .dashboardKpiInfo {
  margin-left: auto;
  flex: 0 0 auto;
}

#openDocsTable {
  min-width: 1460px;
  table-layout: auto;
}

#openDocsTable th,
#openDocsTable td {
  white-space: nowrap;
}

#openDocsTable th:nth-child(1),
#openDocsTable td:nth-child(1) { min-width: 70px; }
#openDocsTable th:nth-child(2),
#openDocsTable td:nth-child(2) { min-width: 140px; }
#openDocsTable th:nth-child(3),
#openDocsTable td:nth-child(3) { min-width: 190px; }
#openDocsTable th:nth-child(4),
#openDocsTable td:nth-child(4) { min-width: 135px; }
#openDocsTable th:nth-child(5),
#openDocsTable td:nth-child(5) { min-width: 160px; }
#openDocsTable th:nth-child(6),
#openDocsTable td:nth-child(6) { min-width: 240px; }
#openDocsTable th:nth-child(7),
#openDocsTable td:nth-child(7) { min-width: 140px; }
#openDocsTable th:nth-child(8),
#openDocsTable td:nth-child(8) { min-width: 150px; }
#openDocsTable th:nth-child(9),
#openDocsTable td:nth-child(9) { min-width: 120px; }
#openDocsTable th:nth-child(10),
#openDocsTable td:nth-child(10) { min-width: 155px; }

#openDocsTable .tableSortBtn {
  white-space: nowrap;
}

#openDocsTable .openDocsFornitoreCell,
#openDocsTable .openDocsLocaleCell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =========================================================
   V36_FRONTEND_DOC_01_UI_STATI_MODAL_TABELLE
   Documenti: stati leggibili, modal accessibile e tabelle compatte
   ========================================================= */

.documentiValidareHeaderActions {
  margin-left: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.documentiValidareHeaderActions .csvExportBtn,
.sectionHeader > .inlineActions .csvExportBtn {
  margin-left: 10px;
}

.documentiListaTable {
  min-width: 2320px;
  table-layout: fixed;
}

.documentiListaTable th,
.documentiListaTable td {
  padding: 8px 10px;
  line-height: 1.22;
  vertical-align: middle;
}

.documentiListaTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 1px;
}

.documentiListaTable .actionsCell,
.documentiListaTable .docBadgeCell {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.documentiListaTable .docActionGroup {
  flex-wrap: nowrap;
}

.documentiListaTable .badge {
  white-space: nowrap;
}

.documentiListaTable th:nth-child(1),
.documentiListaTable td:nth-child(1) { width: 154px; }
.documentiListaTable th:nth-child(2),
.documentiListaTable td:nth-child(2) { width: 108px; }
.documentiListaTable th:nth-child(3),
.documentiListaTable td:nth-child(3) { width: 110px; }
.documentiListaTable th:nth-child(4),
.documentiListaTable td:nth-child(4) { width: 158px; }
.documentiListaTable th:nth-child(5),
.documentiListaTable td:nth-child(5) { width: 78px; }
.documentiListaTable th:nth-child(6),
.documentiListaTable td:nth-child(6) { width: 138px; }
.documentiListaTable th:nth-child(7),
.documentiListaTable td:nth-child(7) { width: 154px; }
.documentiListaTable th:nth-child(8),
.documentiListaTable td:nth-child(8) { width: 210px; }
.documentiListaTable th:nth-child(9),
.documentiListaTable td:nth-child(9) { width: 112px; }
.documentiListaTable th:nth-child(10),
.documentiListaTable td:nth-child(10) { width: 210px; }
.documentiListaTable th:nth-child(11),
.documentiListaTable td:nth-child(11) { width: 122px; }
.documentiListaTable th:nth-child(12),
.documentiListaTable td:nth-child(12) { width: 136px; }
.documentiListaTable th:nth-child(13),
.documentiListaTable td:nth-child(13) { width: 132px; }
.documentiListaTable th:nth-child(14),
.documentiListaTable td:nth-child(14) { width: 122px; }
.documentiListaTable th:nth-child(15),
.documentiListaTable td:nth-child(15) { width: 146px; }
.documentiListaTable th:nth-child(16),
.documentiListaTable td:nth-child(16) { width: 150px; }
.documentiListaTable th:nth-child(17),
.documentiListaTable td:nth-child(17) { width: 142px; }
.documentiListaTable th:nth-child(18),
.documentiListaTable td:nth-child(18) { width: 158px; }
.documentiListaTable th:nth-child(19),
.documentiListaTable td:nth-child(19) { width: 260px; }

.documentiValidareTable {
  min-width: 1320px;
}

.documentiValidareTable th,
.documentiValidareTable td {
  vertical-align: middle;
}

.documentiValidareTable td:nth-child(2),
.documentiValidareTable td:nth-child(8) {
  white-space: nowrap;
}

.documentDetailField strong,
.documentDetailMetric strong {
  overflow-wrap: anywhere;
}

.documentDetailField strong[title],
.documentDetailMetric strong[title] {
  cursor: default;
}

/* =========================================================
   V36_FRONTEND_DOC_01_FIX_1_TABELLA_AZIONI
   Correzione sovrapposizione pulsanti azione sulla colonna data
   ========================================================= */

.documentiListaTable {
  min-width: 2740px;
  table-layout: fixed;
}

.documentiListaTable th,
.documentiListaTable td {
  box-sizing: border-box;
}

.documentiListaTable td {
  max-width: none;
  min-width: 0;
}

.documentiListaTable th:nth-child(1),
.documentiListaTable td:nth-child(1) {
  width: 238px;
  min-width: 238px;
}

.documentiListaTable th:nth-child(2),
.documentiListaTable td:nth-child(2),
.documentiListaTable th:nth-child(3),
.documentiListaTable td:nth-child(3) {
  width: 122px;
  min-width: 122px;
}

.documentiListaTable th:nth-child(4),
.documentiListaTable td:nth-child(4) {
  width: 170px;
  min-width: 170px;
}

.documentiListaTable th:nth-child(8),
.documentiListaTable td:nth-child(8) {
  width: 240px;
  min-width: 240px;
}

.documentiListaTable th:nth-child(10),
.documentiListaTable td:nth-child(10) {
  width: 250px;
  min-width: 250px;
}

.documentiListaTable .actionsCell,
.documentiListaTable .documentActionsCell {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.documentiListaTable .docActionGroup {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}

.documentiListaTable .docActionBtn {
  flex: 0 0 31px;
  width: 31px;
  min-width: 31px;
  height: 31px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.documentiListaTable .docDateCell,
.documentiListaTable .docAmountCell,
.documentiListaTable .docCodeCell,
.documentiListaTable .docCategoryCell,
.documentiListaTable .docBadgeCell {
  white-space: nowrap;
}


/* =========================================================
   V36_FRONTEND_DOC_02_LISTA_STATO_SCADENZA_OPERATIVA
   Lista documenti completa: ordine coerente con Dashboard > Documenti aperti
   ========================================================= */

.documentiListaTable {
  min-width: 2920px;
  table-layout: fixed;
}

.documentiListaTable th:nth-child(1),
.documentiListaTable td:nth-child(1) { width: 238px; min-width: 238px; }
.documentiListaTable th:nth-child(2),
.documentiListaTable td:nth-child(2) { width: 150px; min-width: 150px; }
.documentiListaTable th:nth-child(3),
.documentiListaTable td:nth-child(3) { width: 200px; min-width: 200px; }
.documentiListaTable th:nth-child(4),
.documentiListaTable td:nth-child(4) { width: 132px; min-width: 132px; }
.documentiListaTable th:nth-child(5),
.documentiListaTable td:nth-child(5) { width: 170px; min-width: 170px; }
.documentiListaTable th:nth-child(6),
.documentiListaTable td:nth-child(6) { width: 250px; min-width: 250px; }
.documentiListaTable th:nth-child(7),
.documentiListaTable td:nth-child(7) { width: 190px; min-width: 190px; }
.documentiListaTable th:nth-child(8),
.documentiListaTable td:nth-child(8) { width: 170px; min-width: 170px; }
.documentiListaTable th:nth-child(9),
.documentiListaTable td:nth-child(9) { width: 120px; min-width: 120px; }
.documentiListaTable th:nth-child(10),
.documentiListaTable td:nth-child(10) { width: 250px; min-width: 250px; }
.documentiListaTable th:nth-child(11),
.documentiListaTable td:nth-child(11) { width: 155px; min-width: 155px; }
.documentiListaTable th:nth-child(12),
.documentiListaTable td:nth-child(12) { width: 130px; min-width: 130px; }
.documentiListaTable th:nth-child(13),
.documentiListaTable td:nth-child(13) { width: 165px; min-width: 165px; }
.documentiListaTable th:nth-child(14),
.documentiListaTable td:nth-child(14) { width: 155px; min-width: 155px; }
.documentiListaTable th:nth-child(15),
.documentiListaTable td:nth-child(15) { width: 150px; min-width: 150px; }
.documentiListaTable th:nth-child(16),
.documentiListaTable td:nth-child(16) { width: 165px; min-width: 165px; }
.documentiListaTable th:nth-child(17),
.documentiListaTable td:nth-child(17) { width: 270px; min-width: 270px; }

.documentiListaTable .docDueStatusCell,
.documentiListaTable .docBadgeCell {
  white-space: nowrap;
}

.documentiListaTable .docSupplierCell,
.documentiListaTable .docLocaleCell,
.documentiListaTable .docTypeCell,
.documentiListaTable .docNumberCell,
.documentiListaTable .docNotesCell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   V36_FRONTEND_PAY_01 — Pagamenti: filtri, CSV e popup
   ========================================================= */
.headerActions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.headerActions .compactBtn,
.paymentDocActions .compactBtn,
.paymentSubSectionHeader .compactBtn,
.pagamentiListCard .cardHeader .compactBtn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paymentSubSectionHeader > .headerActions,
.cardHeader > .headerActions {
  align-self: flex-start;
}

.paymentSubSectionHeader > div:first-child,
.cardHeader > div:first-child {
  min-width: 0;
}

.paymentDocActions {
  justify-content: flex-end;
  width: 100%;
  align-items: center;
}

.paymentDocActionCell {
  min-width: 140px;
}

.paymentDocActionCell .docActionGroup {
  flex-wrap: nowrap;
  align-items: center;
}

.creditAvailableDot {
  width: 11px;
  height: 11px;
  display: inline-flex;
  flex: 0 0 11px;
  border-radius: 999px;
  background: #22C55E;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .22), 0 8px 16px rgba(34, 197, 94, .20);
}

.paymentDetail .documentDetailHeroAmount strong {
  color: var(--primary-dark);
}

.paymentDetailMetrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paymentOriginDocumento {
  background:
    radial-gradient(circle at top right, rgba(109, 93, 246, .14), transparent 34%),
    linear-gradient(135deg, #F5F3FF, #FFFFFF 72%);
}

.paymentOriginRecurring {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, .13), transparent 34%),
    linear-gradient(135deg, #FFF7ED, #FFFFFF 72%);
}

.paymentOriginAffitto {
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, .13), transparent 34%),
    linear-gradient(135deg, #ECFEFF, #FFFFFF 72%);
}

@media (max-width: 1120px) {
  .headerActions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .paymentDocActions {
    justify-content: flex-start;
  }

  .paymentDetailMetrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .paymentDetailMetrics {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   V36_FRONTEND_DOC_07 — Dropdown custom Tipo documento
   ========================================================= */

.tipoDocumentoLabel {
  position: relative;
}

.tipoDocNativeSelect {
  display: none;
}

.tipoDocCustomSelect {
  position: relative;
  width: 100%;
}

.tipoDocCustomButton {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: #FFFFFF;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  box-shadow: none;
  outline: none;
}

.tipoDocCustomButton::after {
  content: "⌄";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.tipoDocCustomButton:focus,
.tipoDocCustomSelect.open .tipoDocCustomButton {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.tipoDocCustomButton:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.tipoDocPlaceholder {
  display: block;
  color: var(--text);
  font-weight: 600;
  padding: 2px 18px 2px 0;
}

.tipoDocCustomMenu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
}

.tipoDocCustomSearch {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  min-height: 42px;
  padding: 10px 12px;
  box-shadow: none !important;
}

.tipoDocCustomOptions {
  max-height: 288px;
  overflow: auto;
  padding: 6px;
}

.tipoDocCustomRow {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  padding: 8px 9px;
  text-align: left;
}

.tipoDocCustomOptions .tipoDocCustomRow:hover,
.tipoDocCustomOptions .tipoDocCustomRow:focus,
.tipoDocCustomOptions .tipoDocCustomRow.selected {
  background: var(--surface-hover);
  outline: none;
}

.tipoDocCustomButton .tipoDocCustomRow {
  width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 0 30px 0 0;
  border-radius: 0;
  background: transparent;
}

.tipoDocCustomButton .tipoDocCustomName,
.tipoDocCustomButton .tipoDocCustomCode,
.tipoDocCustomButton .tipoDocCustomEffectBadge {
  align-self: center;
}

.tipoDocCustomButton .tipoDocCustomCode,
.tipoDocCustomButton .tipoDocCustomEffectBadge {
  line-height: 1;
}

.tipoDocCustomName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}

.tipoDocCustomCode {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.tipoDocCustomEffectBadge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tipoDocCustomEffectBadge.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid #BBF7D0;
}

.tipoDocCustomEffectBadge.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
}

.tipoDocCustomRow.inactive {
  opacity: .62;
}

.tipoDocCustomInactive {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tipoDocCustomOptions .tipoDocCustomRow.inactive {
  grid-template-columns: minmax(0, 1fr) 58px auto auto;
}

.tipoDocCustomOptions .tipoDocCustomInactive {
  display: inline-flex;
  justify-self: end;
  border-radius: 999px;
  padding: 4px 8px;
  background: #F5F5F5;
  border: 1px solid #E5E5E5;
  color: #525252;
}

.tipoDocCustomEmpty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .tipoDocCustomMenu {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 14px;
  }

  .tipoDocCustomRow {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .tipoDocCustomEffectBadge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* =========================================================
   V36_FRONTEND_DOC_07_FIX_2 — Altezza stabile Tipo documento selezionato
   ========================================================= */

.tipoDocCustomButton {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0 10px 0 12px;
  overflow: hidden;
}

.tipoDocCustomButton .tipoDocCustomRow {
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 94px;
  align-items: center;
  gap: 8px;
  padding: 0 30px 0 0;
  overflow: hidden;
}

.tipoDocCustomButton .tipoDocCustomName {
  display: block;
  min-width: 0;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tipoDocCustomButton .tipoDocCustomCode {
  width: 46px;
  min-width: 46px;
  height: 22px;
  min-height: 22px;
  padding: 0 7px;
  line-height: 20px;
}

.tipoDocCustomButton .tipoDocCustomEffectBadge {
  width: 94px;
  min-width: 94px;
  height: 22px;
  min-height: 22px;
  padding: 0 7px;
  line-height: 20px;
  text-align: center;
}

.tipoDocCustomButton .tipoDocPlaceholder {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 30px 0 0;
  line-height: 1.15;
}

/* =========================================================
   V36_FRONTEND_DOC_07_FIX_3 — Asse visivo stabile badge Tipo documento
   Scope: solo valore selezionato del dropdown custom Tipo documento.
   ========================================================= */

.tipoDocCustomButton {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  overflow: hidden !important;
}

.tipoDocCustomButton .tipoDocCustomRow {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 30px 0 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  line-height: 1 !important;
}

.tipoDocCustomButton .tipoDocCustomName {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 22px !important;
}

.tipoDocCustomButton .tipoDocCustomCode,
.tipoDocCustomButton .tipoDocCustomEffectBadge {
  flex: 0 0 auto !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 22px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  transform: none !important;
}

.tipoDocCustomButton .tipoDocCustomCode {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
}

.tipoDocCustomButton .tipoDocCustomEffectBadge {
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
  border-width: 1px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.tipoDocCustomButton .tipoDocCustomEffectBadge.ok,
.tipoDocCustomButton .tipoDocCustomEffectBadge.danger {
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  padding: 0 !important;
  line-height: 22px !important;
}

.tipoDocCustomButton::after {
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 22px !important;
  margin: 0 !important;
}


/* =========================================================
   V36_FRONTEND_CTRL_02_CASH_FLOW_REALE
   ========================================================= */

.controlloCashChart {
  min-height: 220px;
}

.controlloCashChart .chartMiniKpi {
  margin-bottom: 14px;
}

.controlloCashChart .chartMiniKpi strong.valueNegative {
  color: var(--danger) !important;
}

.controlloCashChart .chartMiniKpi strong.valuePositive {
  color: var(--ok) !important;
}

.cashFlowBars {
  display: grid;
  gap: 12px;
}

.cashFlowBarRow {
  grid-template-columns: minmax(160px, 220px) 1fr minmax(120px, auto);
}

.cashFlowDetails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cashFlowDetails span,
.cashFlowNote {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
}

.cashFlowWarning {
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .cashFlowBarRow {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   V36_FRONTEND_GUIDA_02_FAQ_RICERCA_SEZIONI
   Guida trasformata in manuale operativo verticale
   ========================================================= */

.guideManualHero .sectionHeader {
  margin-bottom: 16px;
}

.manualHeroText {
  display: grid;
  gap: 10px;
  max-width: 1120px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.manualHeroText p {
  margin: 0;
}

.manualNoteInline {
  padding: 13px 15px;
  border: 1px solid #99F6E4;
  border-left: 5px solid #14B8A6;
  border-radius: 14px;
  background: #F0FDFA;
  color: #115E59;
  font-weight: 500;
}

.guideManualCard {
  padding: 0;
  overflow: hidden;
}

.manualLayout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
}

.manualIndex {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 4px;
  padding: 22px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #F8FAFC, #FFFFFF);
  min-height: 100%;
}

.manualIndexTitle {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.manualIndex a {
  display: block;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
  font-weight: 600;
}

.manualIndex a:hover {
  color: #0F766E;
  background: #F0FDFA;
}

.manualDocument {
  padding: 28px 34px 34px;
  max-width: 1180px;
}

.manualChapter {
  padding: 0 0 28px;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 24px;
}

.manualChapter:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.manualChapter h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -.04em;
}

.manualChapter h3 {
  margin: 20px 0 8px;
  color: #0F172A;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.manualChapter h4 {
  margin: 0 0 7px;
  font-size: 15px;
  color: var(--text);
}

.manualChapter p,
.manualChapter li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

.manualChapter p {
  margin: 0 0 12px;
}

.manualChapter ul,
.manualChapter ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.manualChapter li + li {
  margin-top: 6px;
}

.manualFlowList {
  counter-reset: manualStep;
  margin-left: 0 !important;
  display: grid;
  gap: 10px;
  list-style: none;
}

.manualFlowList li {
  position: relative;
  padding: 13px 14px 13px 48px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
}

.manualFlowList li::before {
  counter-increment: manualStep;
  content: counter(manualStep);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #14B8A6;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

.manualWarning,
.manualInfo,
.manualClosingNote {
  margin: 16px 0 4px;
  padding: 14px 16px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.55;
}

.manualWarning {
  border: 1px solid #FCD34D;
  background: #FFFBEB;
  color: #92400E;
}

.manualInfo,
.manualClosingNote {
  border: 1px solid #BAE6FD;
  background: #F0F9FF;
  color: #075985;
}

.manualDoDont {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.manualDoDont > div {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #FFFFFF;
}

.manualDoDont > div:first-child {
  border-color: #BBF7D0;
  background: #F0FDF4;
}

.manualDoDont > div:last-child {
  border-color: #FECACA;
  background: #FEF2F2;
}

.manualDoDont p {
  margin: 0;
}

.manualTableWrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #FFFFFF;
}

.manualTable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.manualTable th,
.manualTable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}

.manualTable th {
  background: #F8FAFC;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.manualTable td {
  color: var(--muted);
}

.manualTable td:first-child {
  color: var(--text);
  font-weight: 600;
}

.manualTable tr:last-child td {
  border-bottom: 0;
}

.manualScenarioTable {
  min-width: 920px;
}

@media (max-width: 1180px) {
  .manualLayout {
    grid-template-columns: 1fr;
  }

  .manualIndex {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manualIndexTitle {
    grid-column: 1 / -1;
  }

  .manualDocument {
    padding: 24px 22px 28px;
  }
}

@media (max-width: 720px) {
  .manualIndex {
    grid-template-columns: 1fr;
  }

  .manualDocument {
    padding: 20px 16px 24px;
  }

  .manualChapter h2 {
    font-size: 21px;
  }

  .manualDoDont {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V36_FRONTEND_GUIDA_02_FAQ_RICERCA_SEZIONI
   Manuale operativo con ricerca, accordion e FAQ estese
   ========================================================= */

.guideSearchCard {
  display: grid;
  gap: 14px;
}

.guideSearchTop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.guideSearchTop h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -.03em;
}

.guideSearchTop p,
.guideSearchStatus {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guideSearchActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.guideSearchBox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.guideSearchBox input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: #FFFFFF;
  outline: none;
  font-size: 14px;
}

.guideSearchBox input:focus {
  border-color: #14B8A6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}

.guideManualCard .manualDocument {
  padding-top: 22px;
}

.manualAccordion {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #FFFFFF;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 0;
  scroll-margin-top: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
}

.manualAccordion:last-child {
  margin-bottom: 0;
}

.manualAccordion > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
}

.manualAccordion > summary::-webkit-details-marker {
  display: none;
}

.manualAccordion > summary strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.manualAccordion > summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 500;
}

.manualSummaryIcon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ECFEFF;
  border: 1px solid #A5F3FC;
  position: relative;
}

.manualSummaryIcon::before,
.manualSummaryIcon::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 13px;
  height: 2px;
  border-radius: 99px;
  background: #0891B2;
}

.manualSummaryIcon::after {
  transform: rotate(90deg);
  transition: transform .16s ease;
}

.manualAccordion[open] > summary .manualSummaryIcon::after {
  transform: rotate(0deg);
}

.manualAccordion[open] > summary {
  border-bottom: 1px solid var(--border);
}

.manualChapterBody {
  padding: 18px 20px 20px;
}

.manualChapterBody h3:first-child {
  margin-top: 0;
}

.manualFaqList {
  display: grid;
  gap: 10px;
}

.manualFaqItem {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #F8FAFC;
  overflow: hidden;
}

.manualFaqItem > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.manualFaqItem > summary::-webkit-details-marker {
  display: none;
}

.manualFaqItem[open] > summary {
  border-bottom: 1px solid var(--border);
  background: #FFFFFF;
}

.manualFaqItem p {
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.guide-search-hidden {
  display: none !important;
}

.guideNoResults {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px dashed #CBD5E1;
  border-radius: 14px;
  background: #F8FAFC;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .guideSearchTop,
  .guideSearchBox {
    grid-template-columns: 1fr;
    display: grid;
  }

  .guideSearchActions {
    justify-content: flex-start;
  }

  .manualAccordion > summary {
    align-items: flex-start;
  }
}
