/* Tema e struttura riutilizzati da LaPrimaNota, adattamenti Global Service. */
.app-content { padding-top: 28px; }
.app-content > h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 5px; }
.eyebrow { color: var(--lp-primary); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.card { border-radius: 14px; --bs-card-bg: #fff; }
.form-control, .form-select { background-color: #fff; }
.btn-primary { --bs-btn-bg: var(--lp-primary); --bs-btn-border-color: var(--lp-primary); --bs-btn-hover-bg: var(--lp-primary-dark); --bs-btn-hover-border-color: var(--lp-primary-dark); --bs-btn-active-bg: var(--lp-primary-dark); --bs-btn-active-border-color: var(--lp-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--lp-primary); --bs-btn-border-color: var(--lp-primary); --bs-btn-hover-bg: var(--lp-primary); --bs-btn-hover-border-color: var(--lp-primary); }
.text-bg-primary { background-color: var(--lp-primary) !important; }
.empty-state { max-width: 550px; }
.table { color: var(--bs-body-color); --bs-table-bg: #fff; min-width: 1050px; }
.table > thead > tr > th { padding: 14px 16px; background: #f8fafc; color: #65758b; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.table > tbody > tr > td { padding: 14px 16px; vertical-align: middle; border-color: #e9eef4; }
.table td:nth-child(2) { font-weight: 600; }
.mobile-nav a { display: flex; align-items: center; gap: 12px; }
.customer-cards { display: grid; gap: 14px; }
.offer-cards { display: grid; gap: 14px; }
.offer-card p { overflow-wrap: anywhere; }
.offer-card .offer-row-actions { min-width: 0; justify-content: flex-start; }
.topbar-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; color: inherit; text-decoration: none; }
.topbar-brand strong { font-size: 1.25rem; font-weight: 700; }
.topbar-brand span { color: #65758b; font-size: .75rem; font-weight: 400; }
.site-footer a { color: inherit; font-weight: inherit; font-size: inherit; }
.form-validation-summary { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.form-validation-summary .bi { margin-top: 2px; }
form :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, :user-invalid) {
  border-color: #b42318;
  box-shadow: 0 0 0 1px #b42318;
  scroll-margin-block: 110px 120px;
}
form :is(input, select, textarea):is([aria-invalid="true"], .is-invalid, :user-invalid):focus {
  box-shadow: 0 0 0 1px #b42318, 0 0 0 .22rem #b4231826;
}
.errorlist, .client-validation-message {
  list-style: none;
  margin: .5rem 0 0;
  padding: .5rem .7rem;
  border-inline-start: 3px solid #b42318;
  border-radius: .25rem;
  background: #fff1f0;
  color: #842029;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: start;
  overflow-wrap: anywhere;
}
.errorlist > li + li { margin-top: .25rem; }
.alert-danger { border-inline-start: 4px solid #b42318; font-weight: 600; }
.customers-table { min-width: 0; width: 100%; }
.customers-table > thead > tr > th, .customers-table > tbody > tr > td { padding: 12px 10px; }
.customers-table th:nth-child(1), .customers-table td:nth-child(1),
.customers-table th:nth-child(4), .customers-table td:nth-child(4),
.customers-table th:nth-child(5), .customers-table td:nth-child(5) { width: 1%; white-space: nowrap; }
.customers-table td:nth-child(2), .customers-table td:nth-child(3), .customers-table td:nth-child(6) { overflow-wrap: anywhere; }
.customers-table th:last-child, .customers-table td:last-child { width: 1%; white-space: nowrap; }
.customers-table .offer-row-actions, .customer-card .offer-row-actions { min-width: 0; flex-wrap: nowrap; }
.customer-card h2 { font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.customer-card-details { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px 12px; font-size: .9rem; }
.customer-card-details dt { color: #65758b; font-weight: 500; }
.customer-card-details dd { margin: 0; overflow-wrap: anywhere; }
.mobile-nav a.active { background: #e1f2fa; color: var(--lp-primary-dark); font-weight: 700; }
.login-card { width: min(440px,100%); border-radius: 18px; box-shadow: 0 24px 70px #16364f1f; overflow: hidden; }
.login-brand { display:flex; align-items:center; gap:12px; }
.login-brand strong, .login-brand small { display:block; }
.login-brand strong { font-size: 1.05rem; }
.login-brand small { color:#7b8997; font-size:.75rem; margin-top:2px; }
.login-card h1 { font-size:1.8rem; font-weight:750; letter-spacing:-.03em; }
.login-form .form-label { font-size:.8rem; font-weight:700; color:#425466; }
.login-form .form-control { padding:.7rem .85rem; }
.login-brand .logo-mark { width:50px; height:50px; flex:0 0 auto; }
@media (max-width:575.98px) { .app-content { padding-top:20px; } .site-footer { flex-wrap:wrap; } }

/* Logo originale: proporzioni preservate e fondo chiaro nella barra laterale. */
.brand-logo { display: block; height: auto; object-fit: contain; max-width: 100%; }
.app-logo { display: block; padding: 10px; margin: 0 8px 24px; background: #fff; border-radius: 10px; }
.sidebar-logo { width: 100%; }
.topbar-logo { width: 105px; margin: 0 auto 2px; }
.mobile-logo { width: 185px; }
.login-brand { flex-direction: column; align-items: center; gap: 10px; }
.login-logo { width: 280px; }

.offers-table { min-width: 620px; }
.offers-table td:nth-child(2) { font-weight: 400; white-space: nowrap; }
.offers-table td:nth-child(3) { font-weight: 600; }

.offer-type-options { display: grid; gap: 10px; }
.offer-type-choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; margin: 0; border: 1px solid var(--lp-border); border-radius: 10px; }
.offer-type-choice input { appearance: auto; width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--lp-primary); }
.offer-type-choice label { flex: 1; cursor: pointer; }

.offer-services-table { min-width: 1000px; table-layout: fixed; }
.offer-services-table th:nth-child(1) { width: 10%; }
.offer-services-table th:nth-child(2) { width: 18%; }
.offer-services-table th:nth-child(3) { width: 44%; }
.offer-services-table th:nth-child(4) { width: 28%; }
.offer-services-table > tbody > tr > td { vertical-align: top; }
.offer-services-table td:nth-child(2) { font-weight: 700; }
.offer-rich-text { font-size: .9rem; line-height: 1.65; overflow-wrap: anywhere; }
.offer-rich-text p:last-child { margin-bottom: 0; }
.amount-input { min-width: 120px; }

/* Il menu mobile compare solo quando la navigazione fissa non e disponibile. */
@media (min-width: 1600px) {
  .navigation-toggle { visibility: hidden; pointer-events: none; }
  #mobileNav { display: none !important; }
}
.offer-text-preview { font-size: .9rem; line-height: 1.55; font-weight: 400; }
.offer-text-preview summary { list-style: none; cursor: pointer; }
.offer-text-preview summary::-webkit-details-marker { display: none; }
.offer-text-preview summary:focus-visible { outline: 2px solid var(--lp-primary); outline-offset: 4px; border-radius: 4px; }
.text-excerpt { display: block; color: #526477; }
.text-expand-label, .text-collapse-label { display: inline-block; color: var(--lp-primary-dark); font-weight: 600; font-size: .8rem; margin-top: 8px; text-decoration: underline; }
.text-collapse-label, .offer-text-preview[open] .text-excerpt, .offer-text-preview[open] .text-expand-label { display: none; }
.offer-text-preview[open] .text-collapse-label { display: inline-block; }
.offer-step-two-table { min-width: 0; width: 100%; }
@media (max-width: 1199.98px) {
  .offer-step-two-table, .offer-step-two-table tbody { display: block; width: 100%; }
  .offer-step-two-table thead { display: none; }
  .offer-step-two-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 22px; border-bottom: 1px solid var(--lp-border); }
  .offer-step-two-table tbody tr:last-child { border-bottom: 0; }
  .offer-step-two-table > tbody > tr > td { display: block; width: auto; padding: 0; border: 0; background: transparent; min-width: 0; }
  .offer-step-two-table td::before { content: attr(data-label); display: block; color: #65758b; text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; font-weight: 700; margin-bottom: 8px; }
  .offer-step-two-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .offer-step-two-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .offer-step-two-table td:nth-child(4) { grid-column: 2; grid-row: 1 / span 2; }
  .offer-step-two-table td:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .offer-step-two-table tbody tr { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .offer-step-two-table td:nth-child(n) { grid-column: 1; grid-row: auto; }
  .offer-step-two-table td:nth-child(1) { order: 1; }
  .offer-step-two-table td:nth-child(2) { order: 2; }
  .offer-step-two-table td:nth-child(4) { order: 3; }
  .offer-step-two-table td:nth-child(3) { order: 4; }
}

.offer-row-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 290px; }

.offer-filter-heading { color: var(--lp-primary-dark); }
.offer-filter-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 3fr) auto; gap: 16px; align-items: end; }
.offer-filter-controls [data-custom-date] { display: none; }
.offer-filter-card.has-custom-dates .offer-filter-controls { grid-template-columns: minmax(155px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(240px, 2fr) auto; }
.offer-filter-card.has-custom-dates [data-custom-date] { display: block; }
.offer-filter-controls [hidden] { display: none !important; }
@media (max-width: 1199.98px) {
  .offer-filter-controls, .offer-filter-card.has-custom-dates .offer-filter-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer-filter-search, .offer-filter-card.has-custom-dates .offer-filter-controls > div:first-child { grid-column: 1 / -1; }
  .offer-filter-controls > button { grid-column: 1 / -1; justify-self: end; min-width: 140px; }
}
@media (max-width: 575.98px) {
  .offer-filter-controls, .offer-filter-card.has-custom-dates .offer-filter-controls { grid-template-columns: minmax(0, 1fr); }
}

.offer-print-page { max-width: 900px; margin: 0 auto 28px; scroll-margin-top: 90px; }
.offer-print-page img { display: block; width: 100%; height: auto; border: 1px solid var(--lp-border); box-shadow: 0 8px 28px rgba(16, 45, 78, .08); background: white; }

@media (max-width: 991.98px) {
  .offer-row-actions { min-width: 0; flex-wrap: nowrap; }
  .offer-row-actions .offer-action-label { display: none; }
  .offer-row-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
  .offer-row-actions .bi { margin-right: 0 !important; }
}

.customer-picker { position: relative; }
.customer-picker-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px; max-height: 300px; overflow-y: auto; background: white; border: 1px solid var(--lp-border); border-radius: 10px; box-shadow: 0 10px 30px #16364f1f; }
.customer-picker-option { display: block; width: 100%; padding: 12px 14px; text-align: left; border: 0; background: white; color: var(--bs-body-color); overflow-wrap: anywhere; }
.customer-picker-option:hover, .customer-picker-option:focus-visible, .customer-picker-option[aria-selected="true"] { background: #e1f2fa; outline: none; }
.customer-picker-status { padding: 12px 14px; color: #65758b; font-size: .85rem; }

.offer-step-navigation { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.offer-step-navigation > .btn { max-width: 100%; }
.offer-step-navigation > .btn:last-child { margin-left: auto; }

.offer-amounts-table { min-width: 0; width: 100%; table-layout: fixed; }
.offer-amounts-table .amount-input { min-width: 0; max-width: 10rem; margin-inline-start: auto; text-align: right; }
.offer-amounts-table :is(.service-amount-cell, .offer-module-price, .offer-annuality-price) { text-align: right; }
.offer-amounts-table th:nth-child(1) { width: 22%; }
.offer-amounts-table th:nth-child(2) { width: 48%; }
.offer-amounts-table th:nth-child(3) { width: 30%; }
.offer-amounts-table td { overflow-wrap: anywhere; }
.offer-amounts-table td:nth-child(2) { font-weight: 700; }
@media (min-width: 992px) {
  .offer-amounts-table > tbody > .offer-service-divider > td { border-top: 2px solid #b8c7d7; }
}
@media (min-width: 1200px) {
  .offer-services-table > tbody > .offer-service-divider > td { border-top: 2px solid #b8c7d7; }
}
@media (max-width: 1199.98px) {
  .offer-services-table > tbody > .offer-service-divider { border-top: 2px solid #b8c7d7; }
}
@media (max-width: 991.98px) {
  .offer-amounts-table, .offer-amounts-table tbody { display: block; }
  .offer-amounts-table thead { display: none; }
  .offer-amounts-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; padding: 22px; border-bottom: 1px solid var(--lp-border); }
  .offer-amounts-table tbody tr:last-child { border-bottom: 0; }
  .offer-amounts-table tbody .offer-service-divider { border-top: 2px solid #b8c7d7; }
  .offer-amounts-table > tbody > tr > td { display: block; min-width: 0; padding: 0; border: 0; background: transparent; }
  .offer-amounts-table td::before { content: attr(data-label); display: block; color: #65758b; text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; font-weight: 700; margin-bottom: 8px; }
  .offer-amounts-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .offer-amounts-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .offer-amounts-table td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 575.98px) {
  .offer-amounts-table tbody tr { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .offer-amounts-table td:nth-child(n) { grid-column: 1; grid-row: auto; }
}

/* Moduli con importi complessivi per azienda. */
.offer-module-total { display: block; font-size: 1.15rem; font-weight: 700; }
.offer-module-picker, .offer-module-summary { min-width: 0; margin: 0; padding: 6px 0 10px; }
.offer-module-picker legend { float: none; width: auto; }
.offer-module-options { display: grid; gap: 10px; }
.offer-module-option { display: grid; grid-template-columns: minmax(0, 1fr) 165px; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--lp-border); border-radius: 10px; background: #fff; }
.offer-module-option.is-selected { border-color: var(--lp-primary); background: #f4fbff; }
.offer-module-choice { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.offer-module-choice input[type="checkbox"] { appearance: auto; width: 20px; height: 20px; flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--lp-primary); }
.offer-module-choice label { display: block; flex: 1; cursor: pointer; line-height: 1.45; padding: 2px 0; }
.offer-module-choice label > span:first-child { font-weight: 600; }
.offer-module-duration { display: block; font-size: .8rem; font-weight: 400; color: #65758b; margin-top: 4px; }
.offer-module-price { min-width: 0; }
.offer-module-note { grid-column: 1 / -1; min-width: 0; margin-inline-start: 32px; }
.offer-module-price .form-label { margin-bottom: 4px; }
.offer-module-price .amount-input { min-width: 0; }
.offer-module-price input:disabled { background: #f1f4f7; color: #65758b; }
.offer-module-saved-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.offer-module-saved-list > li { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--lp-border); }
.offer-module-saved-list > li:first-child { padding-top: 0; }
.offer-module-saved-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.offer-module-saved-list > li > strong { flex: 0 0 auto; white-space: nowrap; }
.offer-amounts-table > tbody > tr.offer-modular-heading > td { border-bottom: 0; }
.offer-services-table > tbody > tr.offer-modules-row > td { width: auto; }
@media (max-width: 991.98px) {
  .offer-amounts-table tbody tr.offer-modular-heading { border-bottom: 0; padding-bottom: 12px; }
  .offer-amounts-table tbody tr.offer-modules-row { display: block; padding-top: 0; }
  .offer-amounts-table > tbody > tr.offer-modules-row > td { display: block; width: 100%; }
  .offer-amounts-table tr.offer-modules-row td::before { display: none; }
}
@media (max-width: 575.98px) {
  .offer-module-option { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .offer-module-price { padding-left: 32px; }
}

@media (max-width: 1199.98px) {
  .offer-step-two-table tbody tr.offer-modules-row { display: block; }
  .offer-step-two-table > tbody > tr.offer-modules-row > td { display: block; width: 100%; }
  .offer-step-two-table tr.offer-modules-row td::before { display: none; }
}

.offer-pdf-viewer { display: block; width: 100%; height: 80vh; min-height: 560px; border: 1px solid var(--lp-border); border-radius: 8px; background: #525659; }
@media (max-width: 575.98px) { .offer-pdf-viewer { min-height: 420px; height: 72vh; } }
