/* Vista unica: la stessa dashboard si adatta, senza simulatore mobile/desktop. */
.desktop {
  min-height: 100vh
}

.side,
.right {
  min-height: 100vh
}

.mobile-wrap {
  display: none !important
}

@media(max-width:1050px) {
  .right {
    display: grid;
    width: 290px
  }

  .side {
    width: 220px
  }

  .main {
    padding: 28px
  }
}

@media(max-width:760px) {
  .desktop {
    display: block;
    height: auto;
    overflow: visible;
  }

  .side,
  .main,
  .right {
    height: auto;
    overflow: visible;
  }

  .side {
    position: relative;
    top: auto;
    width: 100%;
    min-height: auto;
    padding: 18px 16px;
    gap: 16px;
    box-shadow: none;
  }

  .side>div:first-child {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center
  }

  .brand {
    grid-column: 1;
    margin: 0;
    height: 38px;
    font-size: 25px
  }

  .brand img {
    width: 42px;
    height: 42px
  }

  .side .primary {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    padding: 11px 14px;
    font-size: 13px
  }

  .nav-title {
    display: none
  }

  .side nav {
    grid-column: 1/-1;
    display: flex;
    gap: 4px;
    overflow-x: auto
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 9px 11px
  }

  .nav-icon {
    margin-right: 5px
  }

  .side-bottom {
    display: none
  }

  .main {
    padding: 24px 16px
  }

  .main-head {
    display: block
  }

  .main h1 {
    font-size: 29px
  }

  .head-tools {
    margin-top: 14px;
    flex-wrap: wrap
  }

  .hero {
    padding: 24px 20px;
    margin-bottom: 28px
  }

  .hero .amount {
    font-size: 38px
  }

  .hero img {
    width: 125px;
    height: 115px
  }

  .subline {
    display: block
  }

  .subline .link-btn {
    display: block;
    margin-top: 12px
  }

  .deadline-row {
    padding: 14px;
    gap: 10px;
    align-items: center
  }

  .deadline-info {
    gap: 10px
  }

  .deadline-title {
    font-size: 13px
  }

  .deadline-row>b {
    font-size: 13px;
    white-space: nowrap
  }

  .pay {
    display: none
  }

  .right {
    position: relative;
    top: auto;
    width: 100%;
    min-height: auto;
    padding: 0 16px 28px;
    border: 0;
    background: transparent
  }

  .right .bi {
    grid-template-columns: 1fr
  }

  .right .card {
    background: #fff
  }

  .modal .drawer-panel {
    padding: 22px 18px
  }

  .two {
    grid-template-columns: 1fr
  }

  .invoice-total {
    gap: 10px
  }

  .invoice-total button {
    padding: 10px;
    font-size: 12px
  }

  .dialog {
    padding: 24px 18px
  .breakdown div {
    padding: 14px;
    font-size: 12px
  }

  .dialog-foot {
    display: block
  }

  .dialog-foot button {
    margin-top: 12px;
    min-height: 44px
  }

}

/* Mobile dashboard: riprende il layout approvato negli allegati. */
@media(max-width:760px) {
  body {
    background: #faf9f6
  }

  .desktop {
    display: none !important
  }

  .mobile-wrap {
    display: flex !important;
    padding: 0;
    min-height: 100dvh;
    background: #faf9f6
  }

  .phone {
    width: 100%;
    max-width: 430px;
    height: 100dvh;
    min-height: 680px;
    border-radius: 0;
    box-shadow: none;
    background: #faf9f6
  }

  .status {
    height: 30px
  }

  .mobile-content {
    min-height: calc(100% - 30px);
    padding: 0 clamp(18px, 7vw, 34px) 116px
  }

  .mobile-head {
    height: 190px;
    padding-top: 14px;
    position: relative
  }

  .mobile-actions {
    position: relative;
    z-index: 2
  }

  .mobile-actions .link-btn {
    font-size: 30px;
    color: #252a25;
    line-height: 1
  }

  .mobile-shapes i {
    position: absolute;
    right: 12px;
    top: 28px;
    width: 138px;
    height: 69px;
    border-radius: 138px 138px 0 0;
    background: #c3d9b4
  }

  .mobile-shapes b {
    position: absolute;
    right: 0;
    top: 151px;
    width: 77px;
    height: 39px;
    border-radius: 77px 77px 0 0;
    background: #fac54c
  }

  .mobile-shapes em {
    position: absolute;
    right: 180px;
    top: 79px;
    color: #c0d4b7;
    font-style: normal;
    font-size: 19px;
    line-height: 13px;
    letter-spacing: 6px
  }

  .mobile-greeting {
    position: relative;
    z-index: 1;
    margin: 44px 0 0;
    font-size: clamp(30px, 10vw, 39px);
    line-height: 1;
    letter-spacing: -1.3px
  }

  .mobile-sub {
    position: relative;
    z-index: 1;
    margin: 15px 0 0;
    color: #8c938b;
    font-size: clamp(15px, 4.7vw, 19px);
    font-weight: 500;
    white-space: normal
  }

  .mobile-hero {
    margin: 0;
    border-radius: 39px;
    background: #eff1eb;
    box-shadow: 0 12px 28px #3844340b
  }

  .mobile-hero-body {
    height: auto;
    min-height: 266px;
    padding: 24px 20px 20px
  }


  .mobile-hero-revenue-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: rgba(46, 125, 50, 0.09);
    border: 1px solid rgba(46, 125, 50, 0.22);
    font-size: 11.5px;
    color: #2b542c;
    font-variant-numeric: tabular-nums;
  }

  .mobile-hero-revenue-pill strong {
    font-weight: 800;
    color: #173b18;
  }

  .mobile-label-sub {
    font-size: 11px;
    font-weight: 600;
    color: #4e6347;
    display: inline-block;
    margin-top: 2px;
  }

  .mobile-hero img {
    top: 55%;
    right: 6px;
    width: min(47vw, 190px);
    height: auto;
    transform: translateY(-35%)
  }

  .mobile-label {
    position: relative;
    z-index: 1;
    color: #3e6b3e;
    font-size: clamp(13px, 4.2vw, 18px);
    font-weight: 700;
    line-height: 1.15
  }

  .mobile-amount {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    color: #202421;
    font-size: clamp(34px, 11vw, 54px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.8px
  }

  .mobile-hero .auto {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    padding: 9px 13px;
    background: #dcead4;
    color: #3e6b3e;
    border-radius: 24px;
    font-size: clamp(13px, 4vw, 17px);
    font-weight: 700
  }

  .mobile-updated {
    position: relative;
    z-index: 1;
    margin-top: 17px;
    color: #a0a79e;
    font-size: clamp(12px, 3.8vw, 16px)
  }

  .mobile-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border: 0;
    border-top: 1px solid #e8e9e4;
    background: #fff;
    color: #3e6b3e;
    font-size: 16px;
    font-weight: 700
  }

  .mobile-detail span {
    font-size: 28px
  }

  .mobile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 6px 14px;
    color: #737a72;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px
  }

  .mobile-section-title button {
    border: 0;
    background: transparent;
    color: #3e6b3e;
    font-size: 14px;
    font-weight: 700
  }

  .mobile-section-title.single {
    margin-bottom: 18px
  }

  .mobile-deadlines {
    padding: 18px 24px;
    border-radius: 35px;
    background: #fff;
    box-shadow: 0 12px 30px #35422d09
  }

  .mobile-deadline {
    min-height: 112px;
    gap: 17px;
    padding: 18px 0
  }

  .mobile-deadline .datebox {
    width: 72px;
    height: 72px;
    border-radius: 19px;
    background: #f0f2ee
  }

  .mobile-deadline .datebox b {
    font-size: 25px
  }

  .mobile-deadline .datebox small {
    font-size: 15px
  }

  .mobile-deadline strong {
    font-size: 21px;
    line-height: 1.18
  }

  .mobile-deadline small {
    font-size: 17px
  }

  .mobile-deadline em {
    font-size: 21px;
    white-space: nowrap
  }

  .mobile-deadline>span {
    font-size: 34px;
    color: #b1b8af
  }

  .mobile-op {
    min-height: 124px;
    margin-top: 22px;
    padding: 22px 20px;
    display: flex;
    gap: 20px;
    border-radius: 24px;
    background: #fff0ce;
    position: relative;
    overflow: hidden
  }

  .mobile-op-link {
    align-items: flex-start;
    color: var(--ink);
    text-decoration: none
  }

  .mobile-op-link > div {
    min-width: 0;
    flex: 1
  }

  .mobile-op-link > .ui-icon {
    color: #b1822a;
    font-size: 22px
  }

  .mobile-bulb {
    width: 48px;
    height: 48px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffe0b2;
    color: #e79a21;
    font-size: 24px
  }

  .mobile-op b {
    display: block;
    position: relative;
    z-index: 1;
    font-size: 15px;
    line-height: 1.3
  }

  .mobile-op small {
    display: block;
    position: relative;
    z-index: 1;
    margin-top: 4px;
    color: #8f8065;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap
  }

  .mobile-match {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-top: 13px;
    padding: 7px 14px;
    border-radius: 20px;
    background: #dbe9d4;
    color: #3e6b3e;
    font-size: 16px
  }

  [data-dashboard-opportunity-mobile] .opportunity-empty {
    padding: 6px 4px
  }

  .mobile-op>i {
    position: absolute;
    right: 29px;
    top: 36px;
    color: #f8b82c;
    font-style: normal;
    font-size: 26px;
    text-align: center;
    line-height: 1.3
  }

  .mobile-arc {
    position: absolute;
    right: 42px;
    bottom: -57px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: #3e6b3e
  }

  .mobile-highlights {
    gap: 18px
  }

  .mini {
    min-height: 260px;
    padding: 25px 24px;
    border-radius: 34px;
    position: relative
  }

  .mini-action {
    width: 100%
  }

  .mini-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #dce8d6;
    color: #3e6b3e;
    font-size: 24px
  }

  .mini.purple .mini-icon {
    background: #e5dff5;
    color: #8b7fb5
  }

  .mini.orange .mini-icon {
    background: #f2ddb9;
    color: #7a4b08
  }

  .mini h4 {
    margin: 22px 0 7px;
    font-size: 17px
  }

  .mini b {
    font-size: 28px;
    letter-spacing: -.7px;
    white-space: nowrap
  }

  .mini p {
    margin: 13px 0;
    color: #5c8a54;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15
  }

  .mini.purple h4 {
    color: #756d82
  }

  .mini.purple p {
    color: #9a94ab
  }

  .recent-invoices-heading {
    display: flex;
    margin-top: 28px;
  }

  .recent-invoices-card-mobile {
    display: block;
    overflow: hidden;
    border: 1px solid #ebece7;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px #3844340b;
  }

  .recent-invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    touch-action: pan-y;
    transform: translateX(var(--invoice-swipe-x, 0));
    transition: transform .22s ease;
    will-change: transform;
  }

  .recent-invoice-main {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .desktop-only {
    display: none !important;
  }

  .recent-invoice-row.is-dragging {
    transition: none;
  }

  .recent-invoice-row.is-dragging.is-delete-snapped {
    transition: transform .14s cubic-bezier(.2, .8, .2, 1);
  }

  .recent-invoice-row.is-awaiting-delete {
    transition: none;
  }

  .recent-invoice-delete-cue {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    background: #c95050;
    color: #fff;
    pointer-events: none;
  }

  .recent-invoice-delete-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: 132px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .15px;
  }

  .recent-invoice-delete-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #ffffff73;
    border-radius: 50%;
    background: #ffffff1f;
  }

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

  .recent-invoice-entry.is-delete-armed .recent-invoice-delete-icon {
    background: #fff;
    border-color: #fff;
    color: #b93f3f;
  }

  .recent-invoice-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .recent-invoice-details strong,
  .recent-invoice-summary strong {
    font-size: 12.5px;
  }

  .recent-invoice-details time {
    font-size: 10.5px;
  }

  .invoice-status {
    padding: 2px 7px;
    font-size: 9px;
  }

  .invoices-list-head {
    padding: 12px 14px;
    gap: 10px;
  }

  .invoices-batch-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
  }

  .invoices-batch-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .invoices-archive-row {
    padding: 10px 12px;
    gap: 8px;
  }

  .mini svg {
    position: absolute;
    left: 24px;
    bottom: 23px;
    width: calc(100% - 40px);
    height: 42px
  }

  .mini>i {
    position: absolute;
    right: 18px;
    bottom: 22px;
    color: #a9b4a4;
    font-size: 31px;
    font-style: normal
  }

  .mobile-bars {
    position: absolute;
    bottom: 23px;
    left: 24px;
    display: flex;
    align-items: end;
    gap: 9px;
    height: 47px
  }

  .mobile-bars i {
    display: block;
    width: 11px;
    border-radius: 4px;
    background: #b3a8d8
  }


}

@media (max-width:760px) and (prefers-reduced-motion: reduce) {
  .recent-invoice-row {
    transition-duration: .01ms;
  }
}

@media(max-width:760px) {
  .mobile-bell {
    position: relative
  }

  .mobile-bell i {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 7px;
    height: 7px;
    border: 2px solid #faf9f6;
    border-radius: 50%;
    background: #4e7a4e
  }

  .mobile-bulb svg {
    width: 24px;
    height: 24px
  }

  .mini .mini-icon svg {
    position: static !important;
    width: 18px !important;
    height: 18px !important
  }

  .mini>svg {
    position: absolute;
    left: 15px;
    bottom: 14px;
    width: calc(100% - 28px);
    height: 34px
  }

  .bottom-nav b svg {
    display: block;
    width: 24px;
    height: 24px
  }

  .mobile-fab-actions i svg {
    width: 26px;
    height: 26px
  }
}



/* Misure originali del prototipo mobile (viewport logica 390px). */
@media(max-width:760px) {
  .phone {
    width: 100%;
    max-width: 390px;
    height: 100dvh;
    min-height: 600px
  }

  .status {
    display: none
  }

  .mobile-content {
    height: 100%;
    padding: 0 20px 116px
  }

  .mobile-head {
    height: auto;
    padding-top: 14px
  }

  .mobile-actions .link-btn {
    padding: 6px;
    font-size: 24px
  }

  .mobile-actions svg {
    display: block;
    width: 24px;
    height: 24px
  }

  .mobile-shapes i {
    right: 8px;
    top: 41px;
    width: 92px;
    height: 46px
  }

  .mobile-shapes b {
    right: 16px;
    top: 115px;
    width: 52px;
    height: 26px
  }

  .mobile-shapes em {
    right: 126px;
    top: 72px;
    font-size: 14px;
    line-height: 10px;
    letter-spacing: 4px
  }

  .mobile-greeting {
    margin: 41px 0 0;
    font-size: 27px;
    line-height: 1.15;
    letter-spacing: -.3px
  }

  .mobile-sub {
    margin: 4px 0 0;
    font-size: 14.5px
  }

  .mobile-hero {
    margin-top: 20px;
    border-radius: 26px
  }

  .mobile-hero-body {
    height: auto;
    min-height: 0;
    padding: 20px 20px 12px
  }

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

  .mobile-label {
    max-width: 190px;
    font-size: 12.5px;
    line-height: 1.35;
    letter-spacing: .4px
  }

  .mobile-amount {
    margin-top: 8px;
    font-size: 37px;
    line-height: normal;
    letter-spacing: -1px
  }

  .mobile-hero .auto {
    margin-top: 12px;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600
  }

  .mobile-updated {
    margin-top: 14px;
    font-size: 13px
  }

  .mobile-detail {
    padding: 12px 20px;
    font-size: 14.5px
  }

  .mobile-detail span {
    font-size: 20px
  }

  .mobile-section-title {
    margin: 24px 4px 12px;
    font-size: 13px;
    letter-spacing: .6px
  }

  .mobile-section-title button {
    font-size: 13.5px
  }

  .mobile-section-title.single {
    margin-bottom: 12px
  }

  .mobile-deadlines {
    padding: 6px 16px;
    border-radius: 22px
  }

  .mobile-deadline {
    min-height: 0;
    gap: 14px;
    padding: 14px 0
  }

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

  .mobile-deadline .datebox b {
    font-size: 17px
  }

  .mobile-deadline .datebox small {
    font-size: 10px
  }

  .mobile-deadline strong {
    font-size: 15px;
    line-height: normal
  }

  .mobile-deadline small {
    font-size: 12.5px
  }

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

  .mobile-deadline>span {
    font-size: 20px
  }

  .mobile-op {
    min-height: 0;
    margin-top: 18px;
    padding: 18px;
    gap: 15px;
    border-radius: 22px
  }

  .mobile-bulb {
    width: 44px;
    height: 44px;
    font-size: 23px
  }

  .mobile-op b {
    font-size: 15.5px
  }

  .mobile-op small {
    margin-top: 2px;
    font-size: 13px
  }

  .mobile-match {
    margin-top: 9px;
    padding: 4px 10px;
    font-size: 11.5px
  }

  .mobile-op>i {
    right: 18px;
    top: 22px;
    font-size: 18px
  }

  .mobile-arc {
    right: 32px;
    bottom: -44px;
    width: 78px;
    height: 78px
  }

  .mobile-highlights {
    gap: 13px
  }

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

  .mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 17px
  }

  .mini h4 {
    margin: 12px 0 3px;
    font-size: 13px
  }

  .mini b {
    font-size: 19px;
    letter-spacing: -.3px
  }

  .mini p {
    margin: 5px 0;
    font-size: 11.5px;
    line-height: 1.3
  }

  .mini svg {
    left: 15px;
    bottom: 14px;
    width: calc(100% - 28px);
    height: 34px
  }

  .mini>i {
    right: 12px;
    bottom: 14px;
    font-size: 20px
  }

  .mobile-bars {
    left: 15px;
    bottom: 14px;
    height: 34px;
    gap: 8px
  }

  .mobile-bars i {
    width: 8px;
    border-radius: 3px
  }

}

@media(max-width:370px) {
  .mobile-sub {
    font-size: 14px;
    letter-spacing: -.15px
  }
}

@media(max-width:340px) {
  .mobile-content {
    padding-left: 14px;
    padding-right: 14px
  }

  .mobile-amount {
    font-size: 34px
  }

  .mobile-hero img {
    width: 140px
  }

  .mobile-hero .auto {
    font-size: 12px
  }

  .mobile-deadline {
    gap: 9px
  }

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

  .mobile-deadline em {
    font-size: 14px
  }


}
