:root {
  --green: #3e6b3e;
  --ink: #1f231f;
  --paper: #faf9f6;
  --sage: #e4eee0;
  --muted: #7a8277;
  --mobile-bottom-nav-height: 96px;
  --mobile-fab-overhang: 24px;
  --mobile-overlay-gap: 14px
}

* {
  box-sizing: border-box
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: #f0f2eb;
  color: var(--ink);
  font: 14px 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit
}

button {
  cursor: pointer
}

.topbar {
  height: 41px;
  background: #1f251e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px
}

.topbar strong {
  color: #d9e7d0;
  font: 900 15px Nunito, sans-serif
}

.mode-buttons {
  display: flex;
  gap: 8px
}

.mode-buttons button {
  border: 0;
  border-radius: 8px;
  padding: 5px 12px;
  background: #ffffff18;
  color: white;
  font-size: 12px;
  font-weight: 700
}

.mode-buttons button.active {
  background: var(--green)
}

.desktop {
  display: flex;
  height: 100vh;
  max-width: 1600px;
  margin: auto;
  overflow: hidden;
}

.side {
  width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 20px;
  background: var(--paper);
  border-right: 1px solid #00000010;
  box-shadow: 4px 0 24px #00000008;
  z-index: 3;
  overflow-y: auto;
  flex-shrink: 0;
}

.brand {
  height: 56px;
  margin: 0 0 26px -2px;
  display: flex;
  align-items: center;
}

.brand img.brand-logo {
  height: 82px;
  max-width: 215px;
  object-fit: contain;
  display: block;
  margin-left: -6px;
  transform: scale(1.22);
  transform-origin: left center;
}

.primary,
.outline,
.nav-item,
.icon-btn,
.link-btn {
  border: 0;
  background: transparent
}

.primary {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 18px #3e6b3e40
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.nav-title,
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: #9aa096;
  letter-spacing: .8px
}

.nav-title {
  padding: 0 12px 8px;
  margin-top: 30px
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  margin: 4px 0;
  border-radius: 14px;
  color: #6e756b;
  font-weight: 600;
  text-align: left;
  transition: .18s
}

.nav-item:hover {
  background: #f0f3ec
}

.nav-item.active {
  color: var(--green);
  background: #d9e7d0;
  font-weight: 700
}

.nav-icon {
  width: 22px;
  text-align: center;
  margin-right: 12px;
  font-size: 18px
}

.badge,
.tag {
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700
}

.badge {
  background: #e2e7df;
  color: #596056
}

.nav-item.active .badge {
  background: var(--green);
  color: white
}

/* Desktop Movimenti Popover */
.desktop-movimenti-wrap {
  position: relative;
  width: 100%;
}

.desktop-movimenti-trigger {
  cursor: pointer;
  user-select: none;
}

.desktop-movimenti-chevron {
  font-size: 12px;
  color: #9aa395;
  transition: transform 0.2s ease, color 0.18s ease;
  margin-left: auto;
}

.desktop-movimenti-trigger:hover .desktop-movimenti-chevron,
.desktop-movimenti-trigger.active .desktop-movimenti-chevron {
  color: var(--green);
}

.desktop-movimenti-trigger[aria-expanded="true"] .desktop-movimenti-chevron {
  transform: rotate(90deg);
}

.desktop-movimenti-popover {
  position: fixed;
  z-index: 9999;
  transform: translateY(-50%) translateX(-6px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.15s;
}

.desktop-movimenti-popover.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.desktop-movimenti-caret {
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #dbe4d8;
  border-bottom: 1px solid #dbe4d8;
  z-index: 1;
}

.desktop-movimenti-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 175px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #dbe4d8;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(18, 30, 16, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.desktop-movimenti-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3b4637;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.desktop-movimenti-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 19px;
  color: #63725f;
  transition: color 0.12s ease;
}

.desktop-movimenti-label {
  font-size: 14.5px;
  font-weight: 700;
  color: inherit;
}

.desktop-movimenti-item:hover {
  background: #f2f7ef;
  color: var(--green);
}

.desktop-movimenti-item:hover .desktop-movimenti-icon {
  color: var(--green);
}

.desktop-movimenti-item:active {
  transform: scale(0.98);
}

.desktop-movimenti-item.active {
  background: #eef6ec;
  color: var(--green);
  font-weight: 800;
}

.desktop-movimenti-item.active .desktop-movimenti-icon {
  color: var(--green);
}

@media (max-width: 760px) {
  .desktop-movimenti-wrap,
  .desktop-movimenti-popover {
    display: none !important;
  }
}

.side-bottom {
  display: grid;
  gap: 12px
}

.outline {
  border: 1.5px solid rgba(124, 58, 237, 0.20);
  background: rgba(124, 58, 237, 0.07);
  color: #5b21b6;
  border-radius: 16px;
  padding: 6px 14px 6px 7px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
}

.ai-badge-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c4dff 0%, #5e35b1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(124, 77, 255, 0.32);
  overflow: hidden;
  position: relative;
  transition: transform var(--ui-fast) var(--ui-ease);
}

.ai-badge-circle img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  transform: translate(0px, -1px);
  display: block;
}

.profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #ebf0e6;
  border-radius: 14px;
  background: #fff
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d9e7d0;
  color: var(--green);
  font-weight: 800
}

.profile small {
  color: #889084
}

.auth-logout {
  color: #758070;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  padding: 32px 40px;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dashboard-dec1-bg {
  position: absolute;
  top: -30px;
  right: -10px;
  width: 320px;
  height: auto;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.main-head h1,
.main-head .head-tools {
  position: relative;
  z-index: 1;
}

.main h1 {
  font-size: 34px;
  letter-spacing: -.7px;
  margin: 0
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 10px
}

.tag {
  background: #e4ede0;
  color: var(--green);
  font-size: 12px;
  padding: 5px 12px
}

.tag.muted {
  background: #f0f3eb;
  color: #657060;
  border: 1px solid #e1e7dc
}

.toggle {
  padding: 6px 10px;
  border: 1px solid #d4dcd0;
  border-radius: 12px;
  background: #fff;
  color: var(--green);
  font-size: 11px;
  font-weight: 600
}

.bell,
.round {
  width: 38px;
  height: 38px;
  border: 1px solid #e1e6de;
  border-radius: 50%;
  background: white;
  font-size: 17px
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 40px;
  margin-bottom: 36px;
  border: 1px solid #c5d8bf;
  border-radius: 28px;
  background: linear-gradient(135deg, #e4eee0, #d8e5d3);
  box-shadow: 0 12px 32px #3e6b3e1a
}

.hero-revenue-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.09);
  border: 1px solid rgba(46, 125, 50, 0.22);
  font-size: 13px;
  color: #2b542c;
  line-height: 1.2;
}

.hero-revenue-pill .hero-revenue-label {
  font-weight: 600;
  color: #3b5a3c;
}

.hero-revenue-pill .hero-revenue-value {
  font-weight: 800;
  color: #173b18;
  font-variant-numeric: tabular-nums;
}

.hero .label {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .7px;
  color: var(--green)
}

.hero .amount {
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -1.4px;
  margin: 5px 0 16px
}

.subline {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #788075;
  font-size: 13px
}

.threshold-card {
  padding: 20px;
}

.mobile-threshold-section {
  margin-top: 16px;
}

.mobile-threshold-section .threshold-card {
  margin: 0;
}

.link-btn {
  padding: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 700
}

.hero img {
  width: 210px;
  height: 160px;
  object-fit: contain
}

.hero img.hero-person-img {
  width: 250px;
  height: 190px;
  object-fit: contain;
  flex-shrink: 0;
  margin: -10px -10px -10px 0;
  position: relative;
  z-index: 1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px
}

.section-title h2 {
  margin: 0;
  font-size: 18px
}

.section-title a {
  font-weight: 700;
  color: var(--green);
  text-decoration: none
}

.deadline-list,
.card {
  background: #fff;
  border: 1px solid #eef2ea;
  border-radius: 24px;
  box-shadow: 0 6px 24px #3c50320d
}

.deadline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid #f2f5ef
}

.deadline-row:last-child {
  border: 0
}

.recent-invoices-section {
  margin-top: 30px;
}

.recent-invoices-card {
  overflow: hidden;
}

.recent-invoice-entry {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #f0f2ed;
}

.recent-invoice-entry:last-child {
  border-bottom: 0;
}

.recent-invoice-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: background .12s ease;
}

.recent-invoice-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.recent-invoice-amount strong {
  font-size: 14px;
  white-space: nowrap;
}

.recent-invoice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.recent-invoice-row:focus-within {
  background: #f8faf6;
}

@media (hover: hover) and (pointer: fine) {
  .recent-invoice-row:hover {
    background: #f8faf6;
  }
}

.recent-invoice-row[aria-busy="true"] {
  cursor: wait;
  opacity: .68;
}

.invoice-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}

.invoice-status-toggle .ui-icon {
  width: 13px;
  height: 13px;
}

.invoice-status-toggle.is-pagata {
  background: #e1f2e5;
  color: #1b542a;
  border-color: #bee3c6;
}

.invoice-status-toggle.is-pagata:hover {
  background: #cfeed8;
  border-color: #a7dab2;
}

.invoice-status-toggle.is-emessa {
  background: #fef7ed;
  color: #92540d;
  border-color: #fed7aa;
}

.invoice-status-toggle.is-emessa:hover {
  background: #fde8cc;
  border-color: #fdba74;
}

.invoice-status-toggle:active {
  transform: scale(0.97);
}

.invoice-status-toggle[aria-busy="true"] {
  cursor: wait;
  opacity: .65;
}

.invoice-row-delete-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e4ebe0;
  border-radius: 10px;
  background: #fbfdfa;
  color: #61705d;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.invoice-row-delete-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.invoice-row-delete-btn:active {
  transform: translateY(0);
}

.invoice-row-delete-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.invoice-row-delete-btn .ui-icon {
  width: 17px;
  height: 17px;
}

.recent-invoice-delete-cue {
  display: none;
}

.recent-invoice-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #eeecf3;
  color: #7769a6;
}

.recent-invoice-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.recent-invoice-details,
.recent-invoice-summary {
  min-width: 0;
}

.recent-invoice-details strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-invoice-details time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.recent-invoice-summary {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.recent-invoice-summary strong {
  font-size: 14px;
  white-space: nowrap;
}

.invoice-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf5ea;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.invoice-status-bozza {
  background: #f2f1ed;
  color: #6f746c;
}

.invoice-status-pagata {
  background: #e1f2e5;
  color: #2f6b3e;
}

.recent-invoices-empty {
  margin: 0;
  padding: 24px 20px;
  color: var(--muted);
  text-align: center;
}

.recent-invoices-heading,
.recent-invoices-card-mobile {
  display: none;
}

.datebox {
  flex: none;
  width: 52px;
  height: 52px;
  border: 1px solid #dee4da;
  border-radius: 16px;
  background: #edefe9;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1
}

.datebox b {
  font-size: 18px;
  color: #2f5230
}

.datebox small {
  margin-top: 3px;
  color: #7e937a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px
}

.deadline-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1
}

.deadline-title {
  font-size: 15.5px;
  font-weight: 700;
}

.deadline-due-subtitle {
  display: block;
  font-size: 12px;
  color: #7e937a;
  margin-top: 2px;
}

.info-tip {
  position: relative;
  color: #9da599;
  cursor: help
}

.info-tip span {
  display: none;
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  white-space: normal;
  padding: 7px 12px;
  background: #1f231f;
  color: white;
  border-radius: 8px;
  font-size: 12px;
  z-index: 5
}

.info-tip:hover span {
  display: block
}

.pay {
  border: 1.5px solid #b2cbb2;
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px
}

.empty {
  padding: 48px 32px;
  text-align: center
}

.empty .check {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: auto auto 20px;
  border-radius: 50%;
  background: #f0f7ec;
  font-size: 35px
}

.empty h3 {
  font-size: 20px;
  margin: 0 0 8px
}

.empty p {
  max-width: 440px;
  margin: 0 auto 20px;
  color: var(--muted);
  line-height: 1.5
}

.right {
  width: 330px;
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  padding: 28px 20px;
  background: var(--paper);
  border-left: 1px solid #00000010;
  display: grid;
  align-content: start;
  gap: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.side,
.main,
.right {
  scrollbar-width: thin;
  scrollbar-color: #d2ded0 transparent;
}

.side::-webkit-scrollbar,
.main::-webkit-scrollbar,
.right::-webkit-scrollbar {
  width: 6px;
}

.side::-webkit-scrollbar-thumb,
.main::-webkit-scrollbar-thumb,
.right::-webkit-scrollbar-thumb {
  background-color: #d2ded0;
  border-radius: 4px;
}

.side::-webkit-scrollbar-track,
.main::-webkit-scrollbar-track,
.right::-webkit-scrollbar-track {
  background: transparent;
}

.opportunity-wrapper {
  position: relative;
  margin-top: 24px;
}

.opportunity {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #f2dfb8;
  border-radius: 20px;
  background: #f9ecd3;
  box-shadow: 0 4px 14px #785a1e0f;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
}

.opportunity .bulb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fbe0bb;
  font-size: 20px
}

.opportunity b {
  display: block;
  font-size: 13.5px
}

.opportunity small {
  color: #807052;
  font-weight: 600
}

.opportunity div {
  min-width: 0;
  flex: 1
}

.opportunity b,
.opportunity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.opportunity-empty {
  margin: 0;
  padding: 14px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45
}

.bi {
  display: grid;
  gap: 16px
}

.bi .card {
  padding: 20px
}

.spese-shortcut,
.invoices-shortcut {
  width: 100%;
  color: var(--ink);
  text-align: left
}

.spese-shortcut .stat,
.invoices-shortcut-title {
  display: block;
  margin-top: 8px
}


.invoices-shortcut .pending-invoices-copy {
  display: block;
  margin-top: 6px
}

.invoices-shortcut .footer-split {
  margin-top: 36px
}

.invoices-shortcut-title {
  font-size: 25px;
  letter-spacing: -.6px
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.card-title {
  font-size: 13px;
  color: #5f6b5c;
  font-weight: 700
}

.stat {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.6px;
  margin-top: 8px
}

.up {
  background: #edf5ea;
  color: var(--green)
}

.spark {
  width: 100%;
  height: 40px;
  margin-top: 12px
}

.threshold-progress {
  width: 100%;
  height: 10px;
  margin: 8px 0 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #edf3ea;
  accent-color: var(--green);
}

.threshold-progress::-webkit-progress-bar {
  background: #edf3ea
}

.threshold-progress::-webkit-progress-value {
  background: var(--green);
  transition: width .25s ease, background-color .25s ease
}

.threshold-progress::-moz-progress-bar {
  background: var(--green);
  transition: width .25s ease, background-color .25s ease
}

.threshold-card.is-warning .threshold-progress { accent-color: #d59b26 }
.threshold-card.is-warning .threshold-progress::-webkit-progress-value { background: #d59b26 }
.threshold-card.is-warning .threshold-progress::-moz-progress-bar { background: #d59b26 }
.threshold-card.is-critical .threshold-progress { accent-color: #c46c2b }
.threshold-card.is-critical .threshold-progress::-webkit-progress-value { background: #c46c2b }
.threshold-card.is-critical .threshold-progress::-moz-progress-bar { background: #c46c2b }
.threshold-card.is-exceeded .threshold-progress { accent-color: #b84f4f }
.threshold-card.is-exceeded .threshold-progress::-webkit-progress-value { background: #b84f4f }
.threshold-card.is-exceeded .threshold-progress::-moz-progress-bar { background: #b84f4f }
.threshold-card.is-exceeded .limit-usage,
.threshold-card.is-exceeded .amount-positive { color: #b84f4f }

.split,
.footer-split {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600
}


.threshold-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dbe6d6;
  font-size: 12px;
  color: #606b5b;
}

.threshold-context-text {
  font-weight: 500;
}

.threshold-context-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.settings-summary {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e4e9e1;
  border-radius: 16px;
  background: #e4e9e1
}

.settings-summary div {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  background: #fff
}

.settings-summary small {
  color: var(--muted);
  font-weight: 700
}

.settings-summary b {
  font-size: 15px
}

.settings-dialog {
  width: min(680px, 94vw);
  max-height: min(760px, 88dvh);
  overflow: auto;
}

.settings-dialog .dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 13px;
  padding: 17px;
  border: 1px solid #e4e9e1;
  border-radius: 18px;
  background: #fff;
}

.settings-section label:not(.settings-choice) {
  display: grid;
  gap: 7px;
  color: #485246;
  font-size: 12px;
  font-weight: 800;
}

.settings-section input,
.settings-section select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #d9e2d7;
  border-radius: 11px;
  background: #fbfcfa;
  color: var(--ink);
}

.settings-section input[readonly] {
  background: #f1f3ef;
  color: #697267;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.settings-section-head > .ui-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  background: #e4eee0;
  color: var(--green);
  font-size: 17px;
}

.settings-section-head h3,
.settings-section-head p {
  margin: 0;
}

.settings-section-head h3 {
  font-size: 14px;
}

.settings-section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.settings-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 2px;
  cursor: pointer;
}

.settings-choice input {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.settings-choice b,
.settings-choice small {
  display: block;
}

.settings-choice b {
  font-size: 13px;
}

.settings-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-readonly {
  background: #f8faf7;
}

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

.settings-readonly dl div {
  padding: 10px;
  border-radius: 10px;
  background: #fff;
}

.settings-readonly dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-readonly dd {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-message {
  margin: 0;
  color: #b44f4f;
  font-size: 13px;
  font-weight: 700;
}

.settings-message[data-type="success"] {
  color: var(--green);
}

.settings-logout-wrap {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.settings-logout-btn {
  border: 1px solid #d99b9b;
  border-radius: 11px;
  padding: 8px 16px;
  background: #fff5f5;
  color: #c93b3b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}

.settings-logout-btn:hover {
  background: #fde8e8;
  border-color: #c93b3b;
  color: #b52a2a;
}

@media (max-width: 520px) {
  .settings-dialog {
    width: min(100%, 94vw);
  }

  .settings-readonly dl {
    grid-template-columns: 1fr;
  }
}

.contenitore-toast {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.messaggio-toast {
  padding: 14px 16px;
  border: 1px solid #dce7db;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(36, 49, 43, .16);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease;
}

.messaggio-toast-successo { border-left: 4px solid var(--green); }
.messaggio-toast-errore { border-left: 4px solid #c95050; }
.messaggio-toast-informazione { border-left: 4px solid #7769a6; }
.messaggio-toast.is-in-uscita { opacity: 0; transform: translateY(8px); }

.footer-split {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f4ec
}

.lilac {
  border-color: #f0edf7 !important
}

.lilac .card-title {
  color: #6a6577
}

.lilac .tag {
  background: #f3effa;
  color: #7769a6
}

.bars {
  height: 36px;
  margin-top: 14px;
  display: flex;
  align-items: end;
  gap: 8px
}

.bars i {
  width: 16px;
  border-radius: 3px 3px 0 0;
  background: #d3cbef
}

.mobile-wrap {
  display: none;
  justify-content: center;
  padding: 20px 0
}

.phone {
  position: relative;
  overflow: hidden;
  width: 390px;
  height: 844px;
  border-radius: 44px;
  background: var(--paper);
  box-shadow: 0 20px 60px #00000038
}

.status {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px 0 34px;
  font-weight: 700
}

.mobile-content {
  height: calc(100% - 52px);
  overflow-y: auto;
  padding: 0 20px 130px
}

body.has-modal-open {
  overflow: hidden;
}

body.has-modal-open .mobile-content {
  overflow: hidden !important;
  touch-action: none;
}

.mobile-head {
  padding-top: 14px
}

.mobile-actions {
  display: flex;
  justify-content: space-between
}

.mobile-greeting {
  margin-top: 20px;
  font-size: 27px;
  font-weight: 800
}

.mobile-sub {
  margin-top: 4px;
  color: #8a8f88;
  font-size: 14px
}

.mobile-hero {
  margin-top: 20px;
  border-radius: 26px;
  overflow: hidden;
  background: #edefe9;
  box-shadow: 0 8px 24px #3c503212
}

.mobile-hero-body {
  position: relative;
  padding: 20px
}

.mobile-hero img {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 135px;
  object-fit: contain
}

.mobile-hero .amount {
  font-size: 37px;
  font-weight: 800;
  margin-top: 8px
}

.mobile-hero .auto {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 13px;
  border-radius: 20px;
  background: #d9e7d0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600
}

.mobile-detail {
  width: 100%;
  border: 0;
  border-top: 1px solid #0000000a;
  padding: 15px 20px;
  background: #fbfbf9;
  color: var(--green);
  font-weight: 600;
  text-align: left
}

.mobile-section-title {
  display: flex;
  justify-content: space-between;
  margin: 24px 4px 12px;
  color: #6f746d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px
}

.mobile-deadlines {
  padding: 6px 16px;
  border-radius: 22px;
  background: #fbfbf9;
  box-shadow: 0 6px 20px #3c50320f
}

.mobile-deadline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #0000000d
}

.mobile-deadline:last-child {
  border: 0
}

.mobile-deadline .datebox {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px
}

.mobile-deadline strong {
  font-size: 15px
}

.mobile-deadline small {
  display: block;
  margin-top: 2px;
  color: #9aa096
}

.mobile-deadline em {
  margin-left: auto;
  font-style: normal;
  font-weight: 700
}

.mobile-op {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: #f9ecd3
}

.mobile-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px
}

.mini {
  padding: 15px;
  border-radius: 22px
}

.mini-action {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left
}

.mini-action:focus-visible {
  outline: 3px solid #3e6b3e;
  outline-offset: 3px
}

.mini.green {
  background: #e9ede4
}

.mini.purple {
  background: #eeecf3
}

.mini.orange {
  background: #f9ecd3
}

.mini h4 {
  margin: 14px 0 3px;
  font-size: 13px;
  color: #5f6b5c
}

.mini b {
  font-size: 19px
}

.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bottom-nav-height);
  padding: 12px 2px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  background: #fbfbf9;
  border-top: 1px solid #0000000d;
  box-shadow: 0 -6px 24px #0000000d;
  z-index: 5;
  box-sizing: border-box;
  column-gap: 0;
}

.bottom-nav button[data-tab] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #a4a9a0;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.bottom-nav button[data-tab].active {
  color: var(--green);
  font-weight: 700;
}

.bottom-nav button[data-tab] b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin: 0 auto;
  line-height: 1;
}

.bottom-nav button[data-tab] b .ui-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.bottom-nav button[data-tab] span {
  display: block;
  width: 100%;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.bottom-nav button[data-tab="home"] { grid-column: 1; }
.bottom-nav button[data-tab="movimenti"] { grid-column: 2; }
.bottom-nav .fab { grid-column: 3; }
.bottom-nav button[data-tab="forecast"] { grid-column: 4; }
.bottom-nav button[data-tab="documents"] { grid-column: 5; }

.fab {
  position: relative;
  grid-column: 3;
  justify-self: center;
  align-self: start;
  top: -24px;
  left: auto;
  right: auto;
  transform: none;
  width: 62px;
  height: 62px;
  margin: 0 auto;
  padding: 0;
  border: 5px solid var(--paper);
  border-radius: 50%;
  background: #4e7a4e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 20px #4e7a4e66;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 6;
}

.bottom-nav .fab .ui-icon {
  display: block;
  width: 28px;
  height: 28px;
  color: #fff;
}

.home-indicator {
  position: absolute;
  bottom: 9px;
  left: 50%;
  width: 130px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #1c1c1c
}

.sheet-handle {
  display: block;
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.18);
  margin: 0 auto 12px auto;
  flex-shrink: 0
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.modal.open {
  display: flex
}

.backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(20, 32, 18, 0.45);
  backdrop-filter: blur(8px);
  animation: fade .25s;
}

@keyframes floatingCardEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(14px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.drawer-panel,
.dialog {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 24px 64px rgba(15, 25, 12, 0.28), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.drawer-panel {
  align-self: center;
  margin: auto;
  width: 780px;
  max-width: 92vw;
  max-height: min(88vh, 720px);
  padding: 32px 36px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  animation: floatingCardEnter .3s cubic-bezier(.16, 1, .3, 1) forwards;
}

.dialog {
  align-self: center;
  margin: auto;
  width: 580px;
  max-width: 92vw;
  max-height: min(88vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 32px 36px;
  border-radius: 28px;
  animation: floatingCardEnter .3s cubic-bezier(.16, 1, .3, 1) forwards;
}

.drawer-header,
.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px
}

.drawer-header h2,
.dialog h2 {
  margin: 0;
  font-size: 22px
}

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

.sheet-compare-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.sheet-compare-item {
  background: #f8faf7;
  border: 1px solid #e7ede4;
  border-radius: 16px;
  padding: 14px 16px;
}

.sheet-compare-item h4 {
  margin: 4px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.sheet-compare-item p {
  margin: 0;
  color: #556050;
  font-size: 13px;
  line-height: 1.45;
}

.sheet-compare-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.sheet-compare-badge.green {
  background: #e3ede0;
  color: #274f27;
}

.sheet-compare-badge.purple {
  background: #ece7f7;
  color: #5a3597;
}

.sheet-rules-box {
  background: #fff8eb;
  border: 1px solid #f3e2be;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 8px;
}

.sheet-rules-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #825a14;
}

.sheet-rules-box ul {
  margin: 0;
  padding-left: 18px;
  color: #57441d;
  font-size: 12.5px;
  line-height: 1.45;
}

.sheet-rules-box li + li {
  margin-top: 6px;
}

.threshold-context-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: #556050;
  cursor: pointer;
  text-align: left;
}

.threshold-context-btn:hover {
  color: var(--green);
}

.threshold-context-btn .ui-icon {
  font-size: 13px;
  color: var(--green);
}
}

.drawer-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13.5px
}

.modal.confirm-modal-app {
  z-index: 1001;
}

.confirm-delete-dialog {
  width: 430px;
  text-align: center;
}

.confirm-delete-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 18px;
  background: #f8e7e7;
  color: #b53f3f;
}

.confirm-delete-icon.confirm-primary-icon {
  background: #eaf5e7;
  color: var(--green);
}

.confirm-delete-icon .ui-icon {
  width: 26px;
  height: 26px;
}

.confirm-delete-dialog p {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.confirm-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirm-delete-actions button {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 13px;
  font-weight: 800;
}

.secondary-action {
  border: 1px solid #d8ddd4;
  background: #fff;
  color: var(--ink);
}

.danger-action {
  border: 1px solid #ad3737;
  background: #c95050;
  color: #fff;
}

.danger-action[aria-busy="true"] {
  cursor: wait;
  opacity: .65;
}

.close {
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #edebe4;
  font-size: 23px;
  color: #4a5047
}

.tabs {
  display: flex;
  padding: 4px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #edefe9
}

.tabs button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6b7367;
  font-weight: 700;
  font-size: 13px
}

.tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 8px #0000000f
}

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

.form label {
  display: grid;
  gap: 6px;
  color: #333830;
  font-size: 13px;
  font-weight: 700
}

.form input,
.form textarea,
.form select,
.chat-form input,
.spesa-form input:not([type="checkbox"]),
.spesa-form select {
  width: 100%;
  border: 1px solid #d8e0d4;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font-weight: 600;
  outline-color: var(--green)
}

.form select,
.spesa-form select {
  cursor: pointer;
}

.form input[type="date"],
.spesa-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form input[type="date"]::-webkit-date-and-time-value,
.spesa-form input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.two label {
  min-width: 0;
  width: 100%;
}

.invoice-form-section {
  display: grid;
  gap: 14px;
}

.invoice-form-section .eyebrow {
  margin-top: 4px;
}

#manual-invoice .two:has([data-invoice-cash-date-field][hidden]) {
  grid-template-columns: 1fr;
}

.invoice-origin-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #edf7ee;
  border: 1px solid #ccebd2;
  color: #1e5a2e;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.invoice-origin-banner .ui-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--green);
}

#invoice-status-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dce4d9;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
  cursor: pointer;
}

.checks {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: #f4f7f2;
  font-size: 13.5px;
  font-weight: 600
}

.checks label {
  display: flex;
  align-items: center;
  gap: 10px
}

.checks input {
  width: 18px;
  height: 18px;
  accent-color: var(--green)
}

.invoice-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-radius: 18px;
  background: var(--green);
  color: white
}

.invoice-total small {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700
}

.invoice-total b {
  display: block;
  margin-top: 2px;
  font-size: 24px
}

.invoice-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-drawer-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  padding: 12px 18px;
  background: #dc2626;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}

.invoice-drawer-delete-btn:hover {
  background: #b91c1c;
}

.invoice-drawer-delete-btn .ui-icon {
  width: 15px;
  height: 15px;
}

.invoice-total button[type="submit"] {
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  background: white;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.upload {
  padding: 48px 24px;
  border: 2px dashed #b5c7b0;
  border-radius: 24px;
  background: #f6f9f4;
  text-align: center
}

.upload .upload-icon {
  margin: auto auto 16px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #d9e7d0;
  font-size: 30px
}

.upload h3 {
  margin: 0 0 6px
}

.upload p {
  color: var(--muted)
}

.tax-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #edefe9, #e3e8de)
}

.tax-hero b {
  display: block;
  font-size: 32px;
  margin-top: 2px
}

.breakdown {
  display: grid;
  gap: 14px;
  margin-bottom: 24px
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid #eef2ea;
  border-radius: 18px;
  background: white
}

.breakdown b {
  font-size: 15px
}

.breakdown small {
  display: block;
  margin-top: 4px;
  color: var(--muted)
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #e9eee5;
  color: var(--muted);
  font-size: 12.5px
}

.dialog-foot button {
  border: 0;
  border-radius: 14px;
  padding: 10px 22px;
  background: var(--green);
  color: white;
  font-weight: 700
}



.chat-panel {
  width: 780px;
  max-width: 92vw;
  height: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9eee5
}

.chat-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-top-actions .icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #edebe4;
  color: #4a5047;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.chat-top-actions .icon-button:hover {
  background: #dfded5;
  color: #1a1e18;
  transform: scale(1.05);
}

.chat-top-actions .icon-button:active {
  transform: scale(0.95);
}

.chat-top-actions .icon-button .ui-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.chat-top-actions [data-chat-action="new-thread"] .ui-icon {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-top-actions [data-chat-action="new-thread"]:hover .ui-icon {
  transform: rotate(90deg);
}

.ai-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--green);
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.ai-icon img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  transform: translate(0px, -1px);
  display: block;
}

.online {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

@keyframes chatThreadReset {
  0% {
    opacity: 0.15;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

.messages.chat-thread-reset {
  animation: chatThreadReset 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message {
  max-width: 85%
}

.message.user {
  align-self: flex-end
}

.bubble {
  padding: 14px 18px;
  border: 1px solid #eef2ea;
  border-radius: 20px 20px 20px 4px;
  background: #fff;
  box-shadow: 0 4px 16px #0000000d;
  line-height: 1.45;
  font-weight: 500
}

.user .bubble {
  border: 0;
  border-radius: 20px 20px 4px;
  background: var(--green);
  color: white
}

/* Tipografia interna della bolla: il testo del modello arriva come paragrafi,
   elenchi e grassetti, non come una riga unica. */
.bubble > p {
  margin: 0 0 8px
}

.bubble > p:last-child {
  margin-bottom: 0
}

.bubble ul,
.bubble ol {
  margin: 0 0 8px;
  padding-left: 18px
}

.bubble ul:last-child,
.bubble ol:last-child {
  margin-bottom: 0
}

.bubble li + li {
  margin-top: 4px
}

.bubble strong {
  font-weight: 700
}

/* Titolo reso come riga in grassetto: un heading vero dentro il feed
   sporcherebbe la struttura dei titoli della pagina. */
.bubble > p.bubble-heading {
  margin: 12px 0 4px;
  font-weight: 700
}

.bubble > p.bubble-heading:first-child {
  margin-top: 0
}

.sources {
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid #eef2ea;
  border-radius: 12px;
  background: #fbfcfa;
  font-size: 12px;
  line-height: 1.4
}

.sources-label {
  margin-bottom: 4px;
  color: #6b7264;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase
}

.sources-list {
  margin: 0;
  padding-left: 16px
}

.sources-list li + li {
  margin-top: 3px
}

.sources-list a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px
}

/* Assenza di fonti: segnale di cautela, non un errore. */
.sources-missing {
  border-color: #f0e4c8;
  background: #fdf8ec;
  color: #7a6636
}

.time {
  margin-top: 4px;
  color: #9aa096;
  font-size: 11px
}

.user .time {
  text-align: right
}

.chat-form {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #e9eee5
}

.chat-form button {
  border: 0;
  border-radius: 16px;
  padding: 0 20px;
  background: var(--green);
  color: white;
  font-size: 18px
}

.chat-form button:disabled {
  cursor: progress;
  opacity: .65
}

.chat-privacy-note {
  margin: 10px 0 0;
  color: #899487;
  font-size: 11px;
  line-height: 1.4
}

@keyframes fade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slide {
  from {
    transform: translateX(100%)
  }

  to {
    transform: translateX(0)
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.96)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

.hover-lift {
  transition: transform .22s, box-shadow .22s
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px #32462d1f
}

@media(max-width:1050px) {
  .right {
    display: none
  }

  .main {
    padding: 30px
  }

  .side {
    width: 230px
  }
}

@media(max-width:760px) {
  .topbar {
    padding: 0 12px
  }

  .topbar span {
    display: none
  }

  .desktop {
    display: none
  }

  .mobile-wrap {
    display: flex
  }

  .mode-buttons button {
    padding: 5px 8px
  }

  .phone {
    max-width: 100%;
    border-radius: 0
  }

  .mobile-wrap {
    padding: 0
  }

  .topbar {
    height: 41px
  }
}
