/* BâtiZen UI polish — final visual layer loaded after every module stylesheet. */
:root {
  --bz-focus-ring: 0 0 0 .22rem rgba(11, 103, 183, .14);
  --bz-surface-hover: #f6fafe;
  --bz-divider: #e5edf2;
  --bz-ease: cubic-bezier(.2, .7, .2, 1);
  --bz-transition-fast: 150ms var(--bz-ease);
  --bz-transition: 220ms var(--bz-ease);
}

.workspace-body,
.client-portal-body,
.terrain-offline-shell {
  font-feature-settings: "kern" 1, "liga" 1;
}

.workspace-body :where(h1, h2, h3),
.client-portal-body :where(h1, h2, h3),
.terrain-offline-shell :where(h1, h2, h3) {
  color: var(--bz-heading, var(--bz-navy));
  letter-spacing: -.018em;
  text-wrap: balance;
}

.workspace-body :where(p, li, dd),
.client-portal-body :where(p, li, dd),
.terrain-offline-shell :where(p, li, dd) {
  text-wrap: pretty;
}

.workspace-body :where(a, button, .btn, input, select, textarea),
.client-portal-body :where(a, button, .btn, input, select, textarea),
.terrain-offline-shell :where(a, button, .btn, input, select, textarea) {
  transition:
    color var(--bz-transition-fast),
    border-color var(--bz-transition-fast),
    background-color var(--bz-transition-fast),
    box-shadow var(--bz-transition),
    transform var(--bz-transition-fast),
    opacity var(--bz-transition-fast);
}

/* Actions */
.workspace-body .btn,
.client-portal-body .btn {
  border-width: 1px;
  letter-spacing: .005em;
}

.workspace-body .btn-primary,
.client-portal-body .btn-primary {
  border-color: transparent;
}

.workspace-body :where(.btn-outline-primary, .btn-outline-secondary),
.client-portal-body :where(.btn-outline-primary, .btn-outline-secondary) {
  background: rgba(255, 255, 255, .78);
}

.workspace-body .btn-outline-secondary {
  color: #486171;
  border-color: #cbd8e0;
}

.workspace-body :where(.btn, button):disabled,
.workspace-body :where(.btn, button).disabled,
.client-portal-body :where(.btn, button):disabled,
.terrain-offline-shell button:disabled {
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
  opacity: .62;
}

@media (hover: hover) and (pointer: fine) {
  .workspace-body .btn:not(:disabled, .disabled):hover,
  .client-portal-body .btn:not(:disabled, .disabled):hover {
    transform: translateY(-1px);
  }

  .workspace-body .btn-primary:not(:disabled, .disabled):hover,
  .client-portal-body .btn-primary:not(:disabled, .disabled):hover {
    box-shadow: 0 12px 28px rgba(11, 103, 183, .24);
  }

  .workspace-body :where(.btn-outline-primary, .btn-outline-secondary):not(:disabled, .disabled):hover,
  .client-portal-body :where(.btn-outline-primary, .btn-outline-secondary):not(:disabled, .disabled):hover {
    box-shadow: 0 8px 20px rgba(8, 36, 58, .08);
  }
}

.workspace-body .btn:not(:disabled, .disabled):active,
.client-portal-body .btn:not(:disabled, .disabled):active {
  transform: translateY(0);
}

/* Forms */
.workspace-body .form-label,
.client-portal-body .form-label,
.terrain-offline-shell .form-label {
  margin-bottom: .4rem;
  color: #29485d;
  font-weight: 740;
  line-height: 1.35;
}

.workspace-body :where(.form-control, .form-select),
.client-portal-body :where(.form-control, .form-select) {
  box-shadow: 0 1px 2px rgba(8, 36, 58, .025);
}

.workspace-body :where(.form-control, .form-select):hover:not(:focus, :disabled),
.client-portal-body :where(.form-control, .form-select):hover:not(:focus, :disabled) {
  border-color: #b8cad5;
}

.workspace-body :where(.form-control, .form-select):focus,
.client-portal-body :where(.form-control, .form-select):focus {
  box-shadow: var(--bz-focus-ring);
}

.workspace-body .form-control::placeholder,
.client-portal-body .form-control::placeholder,
.terrain-offline-shell :where(input, textarea)::placeholder {
  color: #91a0aa;
  opacity: 1;
}

.workspace-body .form-control[type="file"],
.client-portal-body .form-control[type="file"] {
  padding: .32rem;
}

.workspace-body .form-control::file-selector-button,
.client-portal-body .form-control::file-selector-button {
  min-height: 34px;
  margin: -.05rem .65rem -.05rem -.05rem;
  padding: .42rem .72rem;
  border: 0;
  border-radius: 8px;
  color: var(--bz-brand-deep);
  background: #eaf4fb;
  font-size: .76rem;
  font-weight: 750;
}

.workspace-body :where(.form-select, input[type="date"], input[type="checkbox"], input[type="radio"]),
.client-portal-body :where(.form-select, input[type="date"], input[type="checkbox"], input[type="radio"]) {
  cursor: pointer;
}

.workspace-network-indicator {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  gap: .45rem;
  padding: .42rem .68rem;
  border: 1px solid #dce9f1;
  border-radius: 999px;
  color: #466477;
  background: #f7fbfe;
  font-size: .74rem;
  font-weight: 780;
  white-space: nowrap;
  cursor: pointer;
}

button.workspace-network-indicator {
  font-family: inherit;
  line-height: inherit;
}

button.workspace-network-indicator:hover {
  border-color: #b9d7e9;
  color: var(--bz-brand);
  background: #eef8fe;
}

.workspace-network-indicator i {
  width: .55rem;
  height: .55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--bz-success);
  box-shadow: 0 0 0 .22rem rgba(39, 174, 96, .12);
}

.workspace-network-indicator strong {
  display: grid;
  min-width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--bz-brand);
  font-size: .66rem;
}

.workspace-network-indicator.is-offline {
  border-color: #f2c99a;
  color: #7d4c12;
  background: #fff8ef;
}

.workspace-network-indicator.is-offline i {
  background: var(--bz-accent);
  box-shadow: 0 0 0 .22rem rgba(255, 123, 0, .13);
}

.workspace-network-indicator.is-syncing i {
  border: 2px solid #cfe3f2;
  border-top-color: var(--bz-brand);
  background: transparent;
  box-shadow: none;
  animation: city-lookup-spin .8s linear infinite;
}

.offline-center {
  width: min(46rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(48rem, calc(100dvh - 2rem));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1.35rem;
  color: #12354c;
  background: #fff;
  box-shadow: 0 30px 90px rgba(3, 32, 52, .28);
}

.offline-center::backdrop {
  background: rgba(4, 31, 49, .54);
  backdrop-filter: blur(4px);
}

.offline-center-shell {
  max-height: min(48rem, calc(100dvh - 2rem));
  padding: clamp(1.15rem, 3vw, 1.75rem);
  overflow: auto;
}

.offline-center-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.offline-center-header span {
  color: var(--bz-accent);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.offline-center-header h2 {
  margin: .25rem 0 .35rem;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 850;
}

.offline-center-header p {
  margin: 0;
  color: #61798a;
}

.offline-center-header form button {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  padding: 0;
  border: 1px solid #dce9f1;
  border-radius: 50%;
  color: #4f697a;
  background: #f7fbfe;
  font-size: 1.45rem;
  line-height: 1;
}

.offline-center-state,
.offline-center-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1.25rem;
}

.offline-center-state article,
.offline-center-summary article {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .25rem;
  padding: .9rem;
  border: 1px solid #dce9f1;
  border-radius: 1rem;
  background: #f8fbfd;
}

.offline-center-state span,
.offline-center-summary span {
  color: #6d8392;
  font-size: .72rem;
}

.offline-center-state strong {
  font-size: .86rem;
}

.offline-center-state b {
  color: inherit;
  font: inherit;
}

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

.offline-center-summary strong {
  color: var(--bz-brand);
  font-size: 1.55rem;
  line-height: 1;
}

.offline-center-list-wrap {
  margin-top: 1.35rem;
}

.offline-center-list-wrap h3 {
  margin: 0 0 .75rem;
  font-size: 1rem;
  font-weight: 820;
}

.offline-center-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed #cfe0ea;
  border-radius: .9rem;
  color: #587386;
  text-align: center;
  background: #fbfdfe;
}

.offline-center-list {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.offline-center-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem .9rem;
  border: 1px solid #dce9f1;
  border-radius: .9rem;
  background: #fff;
}

.offline-center-item.has-issue {
  border-color: #f2c99a;
  background: #fffaf4;
}

.offline-center-item > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .1rem;
}

.offline-center-item small {
  overflow: hidden;
  color: #6b8292;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-center-item > a,
.offline-center-item-actions a,
.offline-center-item-actions button {
  flex: 0 0 auto;
  padding: .35rem .58rem;
  border: 1px solid #cfe0ea;
  border-radius: .55rem;
  color: var(--bz-brand);
  background: #f7fbfe;
  font-size: .72rem;
  font-weight: 780;
  text-decoration: none;
}

.offline-center-item-actions {
  display: flex;
  gap: .4rem;
}

.offline-center-item-actions button {
  color: #8b471c;
  cursor: pointer;
}

.offline-center-footer {
  display: flex;
  gap: .7rem;
  margin-top: 1.25rem;
}

.offline-center-footer + small {
  display: block;
  margin-top: .8rem;
  color: #708696;
}

.offline-action-message {
  position: sticky;
  z-index: 1025;
  top: .75rem;
  margin-bottom: 1rem;
  box-shadow: 0 14px 34px rgba(5, 39, 64, .13);
}

.offline-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.25rem;
  color: #102f43;
  background:
    radial-gradient(circle at 90% 5%, rgba(24, 145, 225, .14), transparent 26rem),
    linear-gradient(145deg, #eef7fc, #fff 58%);
}

.offline-page-card {
  width: min(100%, 44rem);
  padding: clamp(1.5rem, 5vw, 3.3rem);
  border: 1px solid #dce9f1;
  border-radius: 1.6rem;
  background: #fff;
  box-shadow: 0 26px 70px rgba(4, 40, 66, .14);
}

.offline-page-card > img {
  width: min(14rem, 70%);
  height: auto;
  margin-bottom: 1.8rem;
}

.offline-page-kicker {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .8rem;
  color: #df6800;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.offline-page-kicker i {
  width: 1.6rem;
  height: 2px;
  background: var(--bz-accent);
}

.offline-page-card h1 {
  max-width: 36rem;
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 5vw, 2.7rem);
  font-weight: 850;
  line-height: 1.06;
}

.offline-page-card p {
  max-width: 38rem;
  color: #567184;
  font-size: 1rem;
  line-height: 1.7;
}

.offline-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.6rem 0 1.2rem;
}

.offline-page-card > small {
  color: #708696;
}

@media (max-width: 575.98px) {
  .workspace-network-indicator {
    min-height: 2rem;
    padding: .36rem .55rem;
  }

  .workspace-network-indicator span {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .offline-page-actions {
    flex-direction: column;
  }

  .offline-page-actions .btn {
    width: 100%;
  }

  .offline-center {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 1rem;
  }

  .offline-center-shell {
    max-height: calc(100dvh - 1rem);
    padding: 1rem;
  }

  .offline-center-state {
    grid-template-columns: 1fr;
  }

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

  .offline-center-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .offline-center-footer {
    flex-direction: column;
  }
}

.city-suggestions-select {
  margin-top: .55rem;
  border-color: rgba(11, 103, 183, .34) !important;
  background-color: #f4faff !important;
  box-shadow: 0 6px 18px rgba(11, 103, 183, .07) !important;
}

.city-suggestions-status {
  display: flex;
  min-height: 1.5rem;
  align-items: center;
  gap: .4rem;
  margin-top: .45rem;
  color: #607584;
}

.city-suggestions-status::before {
  content: "i";
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8aa0af;
  font-size: .66rem;
  font-weight: 850;
}

.city-suggestions-status.is-loading::before {
  content: "";
  border: 2px solid #cfe3f2;
  border-top-color: var(--bz-brand);
  background: transparent;
  animation: city-lookup-spin .8s linear infinite;
}

.city-suggestions-status.is-success {
  color: #22704c;
}

.city-suggestions-status.is-success::before {
  content: "✓";
  background: var(--bz-success);
}

.city-suggestions-status.is-warning {
  color: #8a5b21;
}

.city-suggestions-status.is-warning::before {
  content: "!";
  background: var(--bz-accent);
}

.postal-city-lookup:has(#postal_code[aria-busy="true"]) .form-label::after {
  content: " · recherche";
  color: var(--bz-brand);
  font-size: .7rem;
  font-weight: 650;
}

@keyframes city-lookup-spin {
  to { transform: rotate(360deg); }
}

.address-autocomplete-wrap {
  position: relative;
}

.address-autocomplete-list {
  position: absolute;
  z-index: 1085;
  top: calc(100% + .4rem);
  right: 0;
  left: 0;
  max-height: min(22rem, 55vh);
  overflow-y: auto;
  padding: .4rem;
  border: 1px solid rgba(11, 103, 183, .22);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 44px rgba(5, 39, 64, .18);
}

.address-autocomplete-list[hidden] {
  display: none !important;
}

.address-autocomplete-option {
  display: flex;
  width: 100%;
  min-height: 3.25rem;
  flex-direction: column;
  justify-content: center;
  gap: .1rem;
  padding: .62rem .75rem;
  border: 0;
  border-radius: .72rem;
  color: var(--bz-ink);
  background: transparent;
  text-align: left;
}

.address-autocomplete-option + .address-autocomplete-option {
  border-top: 1px solid #e7eff5;
}

.address-autocomplete-option:hover,
.address-autocomplete-option:focus-visible,
.address-autocomplete-option.is-active {
  outline: 0;
  color: #064e8d;
  background: #eef7ff;
}

.address-autocomplete-main {
  font-weight: 780;
  line-height: 1.25;
}

.address-autocomplete-detail {
  color: #617888;
  font-size: .82rem;
  line-height: 1.3;
}

.address-autocomplete-option.is-active .address-autocomplete-detail {
  color: #356b94;
}

@media (max-width: 575.98px) {
  .address-autocomplete-list {
    max-height: 45vh;
    border-radius: .82rem;
  }

  .address-autocomplete-option {
    min-height: 3.6rem;
    padding: .72rem;
  }
}

.workspace-body :where(.invalid-feedback, .valid-feedback) {
  margin-top: .32rem;
  font-size: .72rem;
  line-height: 1.4;
}

.workspace-body .form-section {
  margin-bottom: 1.65rem;
  padding-bottom: 1.65rem;
}

.workspace-body .form-section-heading {
  margin-bottom: 1.1rem;
}

.workspace-body :where(.module-form, .client-form) {
  border-color: var(--bz-border);
  box-shadow: var(--bz-shadow-sm);
}

/* Navigation and page frame */
.workspace-sidebar .offcanvas-body {
  scrollbar-color: rgba(255, 255, 255, .24) transparent;
  scrollbar-width: thin;
}

.workspace-brand-label,
.workspace-account-copy :where(strong, small) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-nav > a {
  position: relative;
  isolation: isolate;
}

.workspace-nav > a::before {
  content: "";
  position: absolute;
  top: 23%;
  bottom: 23%;
  left: -.12rem;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.workspace-nav > a:is(.active, [aria-current="page"])::before {
  background: var(--bz-accent);
  box-shadow: 0 0 0 3px rgba(239, 122, 33, .12);
}

@media (hover: hover) and (pointer: fine) {
  .workspace-nav > a:hover {
    background: rgba(255, 255, 255, .09);
    transform: translateX(2px);
  }
}

.workspace-topbar {
  border-bottom: 1px solid rgba(200, 214, 223, .84);
}

.workspace-page-title {
  min-width: 0;
}

.workspace-page-title h1 {
  letter-spacing: -.028em;
}

.workspace-page-description {
  padding-left: .85rem;
  border-left: 3px solid rgba(11, 103, 183, .2);
}

.workspace-quick-search:focus-within {
  border-color: rgba(11, 103, 183, .52);
  box-shadow: var(--bz-focus-ring);
}

.workspace-notification-link:hover {
  color: var(--bz-brand-deep);
  background: #edf7fd;
}

.workspace-alert {
  border-width: 1px;
  box-shadow: 0 10px 28px rgba(8, 36, 58, .075);
}

/* Shared cards, headings and lists */
.workspace-body :where(
  .workspace-panel,
  .client-list,
  .chantier-list,
  .quote-list,
  .quote-list-card,
  .quote-editor,
  .planning-calendar-card,
  .planning-sidebar > section,
  .terrain-report-card,
  .terrain-queue-card,
  .terrain-history-card,
  .billing-source-card,
  .billing-settings-card,
  .payment-panel,
  .purchase-import-card,
  .purchase-list-card,
  .purchase-document-card,
  .purchase-review-card,
  .purchase-api-hero,
  .purchase-api-card,
  .evidence-list-card,
  .evidence-proof-document,
  .profitability-table-card,
  .productivity-panel,
  .workforce-card,
  .team-card,
  .time-table-wrap,
  .approval-card,
  .module-form
) {
  border-color: var(--bz-border);
  background-color: #fff;
  box-shadow: var(--bz-shadow-sm);
}

.workspace-body :where(
  .workspace-panel-header,
  .billing-settings-card > header,
  .invoice-preparation > header,
  .credit-panel > header,
  .purchase-list-card > header,
  .purchase-document-card > header,
  .purchase-review-card > header,
  .evidence-list-card > header,
  .evidence-section > header
) {
  background: linear-gradient(180deg, #fff, #fbfdfe);
}

.workspace-body :where(
  .workspace-panel-header,
  .billing-settings-card > header,
  .invoice-preparation > header,
  .credit-panel > header,
  .purchase-list-card > header,
  .purchase-document-card > header,
  .purchase-review-card > header,
  .evidence-list-card > header,
  .evidence-section > header
) :where(h2, h3) {
  overflow-wrap: anywhere;
}

.workspace-body :where(
  .client-row,
  .chantier-row,
  .recent-client-row,
  .billing-row,
  .quote-list-row,
  .evidence-project-list > a,
  .portal-document-row
) {
  transition:
    background-color var(--bz-transition-fast),
    box-shadow var(--bz-transition),
    transform var(--bz-transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  .workspace-body :where(
    .client-row,
    .chantier-row,
    .billing-row,
    .quote-list-row,
    .evidence-project-list > a
  ):hover {
    background: var(--bz-surface-hover);
    box-shadow: inset 3px 0 0 rgba(11, 103, 183, .42);
  }
}

.workspace-body :where(
  .client-main,
  .chantier-main,
  .quote-list-main,
  .billing-row > div,
  .evidence-project-main,
  .approval-main
) {
  min-width: 0;
}

.workspace-body :where(
  .client-main,
  .chantier-main,
  .quote-list-main,
  .billing-row > div,
  .evidence-project-main,
  .approval-main
) :where(h2, h3, strong, p) {
  overflow-wrap: anywhere;
}

/* Readable module typography */
.workspace-body :where(
  .catalogue-card,
  .quote-list,
  .quote-editor,
  .quote-workflow,
  .quote-interventions,
  .company-card,
  .team-card,
  .time-header,
  .active-timers,
  .time-summary,
  .time-table-wrap,
  .timer-starter,
  .approval-card,
  .terrain-report-card,
  .terrain-queue-card,
  .terrain-history-card,
  .evidence-list-card,
  .evidence-proof-document
) :where(p, small, time) {
  font-size: max(.72rem, 11.5px);
  line-height: 1.48;
}

.workspace-body :where(
  .catalogue-card-heading span,
  .catalogue-card-heading em,
  .quote-status,
  .quote-status-filters a,
  .quote-list-number span,
  .quote-list-date span,
  .quote-list-total span,
  .quote-material-card small,
  .quote-line-index,
  .time-status,
  .company-status,
  .approval-main > div span
) {
  font-size: max(.68rem, 10.9px);
}

.workspace-body .quote-editor :where(.form-control, .form-select) {
  min-height: 40px;
  font-size: .8rem;
}

.workspace-body :where(.quote-status, .invoice-status, .time-status, .company-status) {
  min-height: 26px;
  align-items: center;
  line-height: 1.2;
}

/* Tables and horizontal content */
.workspace-body .table-responsive,
.client-portal-body .table-responsive {
  border-radius: inherit;
  background:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right,
    linear-gradient(to right, rgba(8, 36, 58, .08), rgba(255, 255, 255, 0)),
    linear-gradient(to left, rgba(8, 36, 58, .08), rgba(255, 255, 255, 0)) right;
  background-attachment: local, local, scroll, scroll;
  background-repeat: no-repeat;
  background-size: 38px 100%, 38px 100%, 12px 100%, 12px 100%;
}

.workspace-body :where(.invoice-document, .quote-document) .table-responsive {
  background: none;
}

.workspace-body .table:not(.invoice-table, .quote-document-table) thead th {
  color: #385166;
  background-color: #f4f8fa;
  border-bottom-color: #dbe5ec;
  font-weight: 800;
}

.workspace-body .table tbody tr {
  transition: background-color var(--bz-transition-fast);
}

.workspace-body .table tbody tr:focus-within td {
  background: #eef7fd;
}

/* Toolbars */
.workspace-body :where(
  .client-toolbar,
  .catalogue-toolbar,
  .quote-list-heading,
  .quote-detail-toolbar,
  .billing-toolbar,
  .billing-detail-toolbar,
  .purchase-page-actions,
  .purchase-detail-toolbar,
  .evidence-toolbar,
  .ereporting-toolbar,
  .terrain-report-actions,
  .time-header,
  .module-toolbar
) {
  flex-wrap: wrap;
}

.workspace-body :where(
  .billing-toolbar-actions,
  .quote-list-actions,
  .time-header-actions,
  .module-toolbar
) {
  gap: .55rem;
}

/* Evidence module */
.evidence-overview article {
  position: relative;
  overflow: hidden;
}

.evidence-overview article::after {
  content: "";
  position: absolute;
  right: -1rem;
  bottom: -1.25rem;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  background: rgba(11, 103, 183, .055);
}

.evidence-overview article.is-ready::after {
  background: rgba(23, 130, 82, .07);
}

.evidence-overview article.is-review::after {
  background: rgba(239, 122, 33, .08);
}

.evidence-project-list > a {
  min-height: 88px;
}

.evidence-readiness {
  min-width: 0;
  border: 1px solid rgba(100, 116, 139, .09);
  line-height: 1.4;
}

.evidence-hero {
  background:
    radial-gradient(circle at 90% 0, rgba(11, 103, 183, .09), transparent 18rem),
    linear-gradient(135deg, #fbfdff, #edf6fc);
}

.evidence-checklist article {
  min-width: 0;
}

.evidence-checklist article > div {
  min-width: 0;
}

.evidence-checklist :where(strong, small) {
  overflow-wrap: anywhere;
}

.evidence-summary-grid article {
  border: 1px solid #e9f0f4;
}

.evidence-timeline article > a {
  font-weight: 750;
  text-decoration: none;
}

/* Authentication and client portal */
.auth-card {
  border: 1px solid rgba(219, 229, 236, .9);
  box-shadow: 0 24px 64px rgba(8, 36, 58, .1);
}

.auth-card :where(h1, h2) {
  letter-spacing: -.035em;
}

.auth-description {
  line-height: 1.62;
}

.client-portal-header {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px) saturate(1.15);
}

.client-portal-body :where(
  .portal-project-card,
  .portal-document-row,
  .portal-proof-event,
  .portal-proof-report-grid article
) {
  transition:
    border-color var(--bz-transition-fast),
    box-shadow var(--bz-transition),
    transform var(--bz-transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  .client-portal-body :where(.portal-project-card, .portal-document-row):hover {
    border-color: #bfd7e6;
    box-shadow: 0 12px 30px rgba(8, 36, 58, .08);
  }
}

/* Offline field form */
.terrain-offline-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(200, 214, 223, .86);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 20px rgba(8, 36, 58, .055);
  backdrop-filter: blur(16px);
}

.terrain-offline-main {
  width: min(1180px, 100%);
  margin-inline: auto;
}

/* Tablet */
@media (max-width: 991.98px) {
  .workspace-topbar {
    background: rgba(255, 255, 255, .96);
  }

  .workspace-sidebar {
    box-shadow: 18px 0 54px rgba(4, 25, 41, .22);
  }

  .workspace-nav > a {
    padding-inline: .82rem;
  }

  .evidence-project-list > a {
    grid-template-columns: auto minmax(0, 1fr) minmax(190px, .72fr);
  }

  .evidence-readiness {
    grid-column: auto;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .workspace-page-title h1 {
    display: -webkit-box;
    overflow: hidden;
    max-width: min(58vw, 420px);
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .workspace-page-description {
    padding-left: .7rem;
    border-left-width: 2px;
  }

  .workspace-body :where(
    .workspace-panel-header,
    .billing-settings-card > header,
    .invoice-preparation > header,
    .credit-panel > header,
    .purchase-list-card > header,
    .purchase-document-card > header,
    .purchase-review-card > header,
    .evidence-list-card > header,
    .evidence-section > header
  ) {
    align-items: flex-start;
    flex-direction: column;
    gap: .55rem;
    padding: 1rem;
  }

  .workspace-body :where(.module-form-actions, .client-form-actions) {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .workspace-body :where(.module-form-actions, .client-form-actions) .btn {
    width: 100%;
  }

  .workspace-body .form-section {
    margin-bottom: 1.35rem;
    padding-bottom: 1.35rem;
  }

  .workspace-body .form-section-heading {
    gap: .65rem;
  }

  .workspace-body .table {
    min-width: 640px;
  }

  .evidence-project-list > a {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .75rem;
    padding: .9rem;
  }

  .evidence-score {
    width: 50px;
    height: 50px;
    font-size: .76rem;
  }

  .evidence-readiness {
    grid-column: 1 / -1;
  }

  .evidence-hero {
    padding: 1.15rem;
  }

  .evidence-hero h1 {
    font-size: clamp(1.45rem, 8vw, 1.85rem);
  }

  .evidence-hero .evidence-readiness {
    min-width: 0;
  }

  .evidence-checklist article {
    border-right: 0;
    border-bottom: 1px solid var(--bz-divider);
  }

  .evidence-checklist article:last-child {
    border-bottom: 0;
  }

  .evidence-timeline {
    padding: 1rem;
  }

  .evidence-certificate {
    display: grid;
    gap: .35rem;
    padding: 1rem;
  }

  .evidence-certificate span {
    float: none;
  }

  .auth-content {
    min-height: calc(100dvh - 72px);
  }

  .terrain-offline-main {
    padding-inline: .8rem;
  }
}

@media (max-width: 575.98px) {
  .workspace-body .btn,
  .client-portal-body .btn {
    min-height: 44px;
  }

  .workspace-page-title h1 {
    max-width: calc(100vw - 138px);
    font-size: 1.08rem;
  }

  .workspace-mobile-nav :where(a, button) > small {
    font-size: .62rem;
  }

  .workspace-body :where(
    .workspace-panel,
    .client-list,
    .chantier-list,
    .quote-list,
    .quote-editor,
    .billing-settings-card,
    .purchase-list-card,
    .purchase-document-card,
    .evidence-list-card,
    .evidence-proof-document,
    .module-form
  ) {
    border-radius: 14px;
  }

  .workspace-body :where(.catalogue-search, .catalogue-actions, .quote-list-heading > div) {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-body :where(.catalogue-search, .catalogue-actions, .quote-list-heading > div) .btn {
    width: 100%;
  }

  .evidence-overview article {
    min-height: 110px;
  }

  .client-portal-header {
    box-shadow: 0 10px 30px rgba(8, 36, 58, .09);
  }
}

/* UX/mobile consolidation — shared behavior across every module. */
.workspace-search-link {
  display: inline-grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--bz-border);
  border-radius: 12px;
  color: #536b7b;
  background: #fff;
  box-shadow: 0 4px 14px rgba(8, 36, 58, .035);
  font-size: 1rem;
  font-weight: 850;
  text-decoration: none;
}

.workspace-search-link:hover {
  color: var(--bz-brand-deep);
  background: #edf7fd;
}

.workspace-body :where(.workspace-main, .workspace-content, .row, fieldset),
.client-portal-body :where(main, section, article, .row, fieldset),
.terrain-offline-shell :where(main, section, article, .row, fieldset) {
  min-width: 0;
}

.workspace-body :where(img, svg, video, canvas),
.client-portal-body :where(img, svg, video, canvas),
.terrain-offline-shell :where(img, svg, video, canvas) {
  max-width: 100%;
}

.workspace-body :where(code, pre, .text-break, a),
.client-portal-body :where(code, pre, .text-break, a) {
  overflow-wrap: anywhere;
}

.table-scroll-hint {
  display: none;
  align-items: center;
  gap: .4rem;
  margin: .5rem 0 0;
  color: #607584;
  font-size: .72rem;
  line-height: 1.35;
}

.table-scroll-hint::before {
  content: "↔";
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--bz-brand-deep);
  background: #eaf4fb;
  font-weight: 900;
}

.workspace-body .table-responsive[data-scrollable="true"]:focus-visible,
.client-portal-body .table-responsive[data-scrollable="true"]:focus-visible {
  outline: 3px solid rgba(11, 103, 183, .24);
  outline-offset: 3px;
}

.workspace-body :where(.pagination, .nav-tabs, .nav-pills),
.client-portal-body :where(.pagination, .nav-tabs, .nav-pills) {
  max-width: 100%;
}

@media (hover: none), (pointer: coarse) {
  .workspace-body :where(a.btn, button, input, select, textarea),
  .client-portal-body :where(a.btn, button, input, select, textarea),
  .terrain-offline-shell :where(a.btn, button, input, select, textarea) {
    min-height: 44px;
  }

  .workspace-body :where(.btn, a, button),
  .client-portal-body :where(.btn, a, button),
  .terrain-offline-shell :where(.btn, a, button) {
    touch-action: manipulation;
  }
}

@media (max-width: 991.98px) {
  .workspace-body {
    scroll-padding-top: 82px;
    scroll-padding-bottom: calc(var(--bz-mobile-nav-height) + 5rem + env(safe-area-inset-bottom));
  }

  .workspace-topbar-actions {
    gap: .4rem;
  }

  .workspace-mobile-nav :where(a, button) > small {
    font-size: max(.68rem, 10.8px);
  }

  .workspace-mobile-nav :where(a, button) > span {
    width: 1.9rem;
    height: 1.9rem;
    font-size: .82rem;
  }

  .workspace-body :where(
    .billing-filters,
    .billing-type-filters,
    .quote-status-filters,
    .purchase-list-card nav,
    .planning-view-switcher
  ) {
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-body :where(
    .billing-filters,
    .billing-type-filters,
    .quote-status-filters,
    .purchase-list-card nav,
    .planning-view-switcher
  ) > * {
    scroll-snap-align: start;
  }
}

@media (max-width: 767.98px) {
  .workspace-topbar {
    min-height: 68px;
    padding: max(.65rem, env(safe-area-inset-top)) .8rem .65rem;
  }

  .workspace-topbar-status {
    display: none !important;
  }

  .workspace-page-title {
    flex: 1 1 auto;
  }

  .workspace-page-title h1 {
    display: -webkit-box;
    overflow: hidden;
    max-width: none;
    font-size: clamp(1.03rem, 4.7vw, 1.22rem);
    line-height: 1.2;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .workspace-page-title p {
    font-size: max(.6rem, 9.8px);
  }

  .workspace-search-link,
  .workspace-notification-link,
  .workspace-menu-button {
    width: 42px;
    height: 42px;
  }

  .workspace-content {
    padding: 1rem max(.85rem, env(safe-area-inset-right)) 1.2rem max(.85rem, env(safe-area-inset-left));
  }

  .workspace-page-description {
    max-width: none;
    margin: 0 0 1rem;
    font-size: max(.84rem, 13.4px);
    line-height: 1.55;
  }

  .workspace-body :where(.form-control, .form-select, .input-group-text),
  .client-portal-body :where(.form-control, .form-select, .input-group-text),
  .auth-card :where(.form-control, .form-select, .input-group-text) {
    min-height: 48px;
    font-size: 16px !important;
  }

  .workspace-body :where(textarea.form-control),
  .client-portal-body :where(textarea.form-control),
  .auth-card :where(textarea.form-control) {
    min-height: 116px;
  }

  .workspace-body :where(.form-label, label),
  .client-portal-body :where(.form-label, label),
  .auth-card :where(.form-label, label) {
    font-size: max(.82rem, 13px);
    line-height: 1.35;
  }

  .workspace-body :where(.form-text, .invalid-feedback, .valid-feedback),
  .client-portal-body :where(.form-text, .invalid-feedback, .valid-feedback),
  .auth-card :where(.form-text, .invalid-feedback, .valid-feedback) {
    font-size: max(.76rem, 12px);
    line-height: 1.45;
  }

  .workspace-body :where(
    .planning-page,
    .quote-editor,
    .quote-list,
    .terrain-page,
    .billing-page,
    .purchase-page,
    .evidence-proof-document,
    .workforce-page,
    .profitability-page
  ) :where(p, small, time) {
    font-size: max(.76rem, 12px);
    line-height: 1.48;
  }

  .workspace-body :where(.planning-page, .quote-editor) :where(.form-control, .form-select) {
    font-size: 16px !important;
  }

  .workspace-body :where(.client-form-actions, .module-form-actions, .quote-save-bar) {
    position: sticky;
    z-index: 18;
    bottom: calc(var(--bz-mobile-nav-height) + .5rem + env(safe-area-inset-bottom));
    padding: .72rem;
    border: 1px solid rgba(200, 214, 223, .94);
    border-radius: 15px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -10px 32px rgba(8, 36, 58, .13);
    backdrop-filter: blur(16px) saturate(1.15);
  }

  .workspace-body :where(.client-form-actions, .module-form-actions, .quote-save-bar) :where(.btn, button) {
    min-height: 46px;
  }

  .workspace-body .quote-save-bar > span {
    display: none;
  }

  .workspace-body .quote-save-bar > div {
    width: 100%;
  }

  .workspace-body .table-scroll-hint:not([hidden]),
  .client-portal-body .table-scroll-hint:not([hidden]) {
    display: flex;
  }

  .workspace-body .table-responsive[data-scrollable="true"],
  .client-portal-body .table-responsive[data-scrollable="true"] {
    border-inline: 1px solid #edf2f5;
    scroll-snap-type: x proximity;
  }

  .workspace-body :where(.pagination, .nav-tabs, .nav-pills),
  .client-portal-body :where(.pagination, .nav-tabs, .nav-pills) {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .25rem;
    scrollbar-width: none;
  }

  .workspace-body :where(.pagination, .nav-tabs, .nav-pills)::-webkit-scrollbar,
  .client-portal-body :where(.pagination, .nav-tabs, .nav-pills)::-webkit-scrollbar {
    display: none;
  }

  .workspace-body .modal-dialog,
  .client-portal-body .modal-dialog {
    min-height: calc(100dvh - 1rem);
    align-items: flex-end;
    margin: .5rem;
  }

  .workspace-body .modal-content,
  .client-portal-body .modal-content {
    max-height: calc(100dvh - 1rem);
    overflow: hidden;
    border-radius: 22px 22px 14px 14px;
  }

  .workspace-body .modal-body,
  .client-portal-body .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .workspace-body .modal-footer,
  .client-portal-body .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .workspace-body .modal-footer .btn,
  .client-portal-body .modal-footer .btn {
    width: 100%;
    margin: 0;
  }

  .planning-calendar-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .planning-calendar-navigation,
  .planning-view-switcher {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .planning-calendar-navigation button,
  .planning-view-switcher button {
    min-width: 44px;
    min-height: 44px;
    flex: 1 0 auto;
    font-size: max(.76rem, 12px);
  }

  .planning-workload-identity :where(strong, small),
  .planning-workload-value :where(strong, small),
  .planning-team-option :where(strong, small),
  .planning-workload-card > p {
    font-size: max(.74rem, 11.8px);
  }

  .quote-material-card .add-material-button,
  #add-free-quote-line,
  .quote-remove-line {
    min-width: 44px;
    min-height: 44px;
  }

  .client-portal-header {
    top: max(.45rem, env(safe-area-inset-top));
  }

  .client-portal-body {
    scroll-padding-top: 90px;
  }

  .client-portal-body :where(.portal-quote-toolbar, .portal-decision-card, .portal-signature-submit) {
    gap: .65rem;
  }

  .terrain-offline-shell {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 575.98px) {
  .workspace-content {
    padding-inline: max(.75rem, env(safe-area-inset-left));
  }

  .workspace-body :where(.client-form-actions, .module-form-actions, .quote-save-bar) {
    margin-right: -.25rem;
    margin-left: -.25rem;
  }

  .workspace-body :where(.client-form-actions, .module-form-actions, .quote-save-bar) :where(.d-flex, .btn-group) {
    display: grid !important;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .workspace-body :where(.client-row, .chantier-row, .billing-row, .quote-list-row, .approval-card) {
    align-items: flex-start;
  }

  .workspace-body :where(.client-row, .chantier-row, .billing-row, .quote-list-row, .approval-card) :where(.btn, button) {
    min-height: 44px;
  }

  .auth-content {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .auth-card .input-group-lg {
    align-items: stretch;
  }

  .auth-card .password-toggle {
    min-width: 92px;
    font-size: .78rem;
  }
}

@media (max-width: 390px) {
  .workspace-topbar {
    gap: .45rem;
    padding-inline: .6rem;
  }

  .workspace-search-link,
  .workspace-notification-link,
  .workspace-menu-button {
    width: 40px;
    height: 40px;
  }

  .workspace-page-title p {
    display: none;
  }

  .workspace-mobile-nav :where(a, button) > small {
    font-size: max(.63rem, 10px);
  }

  .workspace-content {
    padding-inline: .7rem;
  }
}

@media (prefers-contrast: more) {
  :root {
    --bz-border: #aebfca;
    --bz-text-muted: #4c6271;
  }

  .workspace-body :where(.btn, .form-control, .form-select),
  .client-portal-body :where(.btn, .form-control, .form-select) {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-body *,
  .client-portal-body *,
  .terrain-offline-shell * {
    transform: none !important;
  }
}

@media print {
  .workspace-search-link,
  .table-scroll-hint,
  .workspace-body :where(.client-form-actions, .module-form-actions, .quote-save-bar) {
    position: static !important;
    display: none !important;
  }

  .workspace-body,
  .client-portal-body {
    color: #111;
    background: #fff !important;
  }

  :where(
    .invoice-document,
    .quote-document,
    .evidence-proof-document,
    .portal-quote-document
  ) {
    border-color: #d4d4d4 !important;
    box-shadow: none !important;
  }
}

/* Garde-fous de dimension : restent valides même pendant un rafraîchissement
   différé du cache hors ligne. */
.workspace-body .workspace-sidebar {
  overflow: hidden;
}

.workspace-body .workspace-brand a {
  display: block !important;
  width: 158px !important;
  max-width: 158px !important;
}

.workspace-body .workspace-brand img {
  display: block !important;
  width: 158px !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 158 / 85;
  object-fit: contain;
}

.workspace-body svg.ui-icon,
.client-portal-body svg.ui-icon,
.auth-body svg.ui-icon {
  display: inline-block !important;
  width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  max-height: 20px !important;
  flex: 0 0 20px !important;
}

.workspace-body .workspace-nav-icon,
.workspace-body .metric-icon,
.workspace-body .quick-action-icon,
.workspace-body .chantier-avatar,
.workspace-body .client-empty-icon,
.workspace-body .workspace-mobile-nav :where(a, button) > span {
  overflow: hidden;
}

.workspace-body .workspace-nav-icon svg.ui-icon {
  width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  max-height: 16px !important;
  flex-basis: 16px !important;
}

.workspace-body .workspace-menu-button svg.ui-icon,
.workspace-body .workspace-search-link svg.ui-icon,
.workspace-body .workspace-notification-link svg.ui-icon {
  width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  max-height: 18px !important;
  flex-basis: 18px !important;
}

/* --------------------------------------------------------------------------
   BâtiZen UX v3 — système visuel unifié
   Cette section est la source de vérité finale pour toutes les surfaces.
   -------------------------------------------------------------------------- */
:root {
  --bz-v3-navy-950: #061b2b;
  --bz-v3-navy-900: #08263c;
  --bz-v3-navy-800: #0d3654;
  --bz-v3-blue-700: #075fae;
  --bz-v3-blue-600: #0874d1;
  --bz-v3-blue-500: #1688e4;
  --bz-v3-orange-600: #e96706;
  --bz-v3-orange-500: #ff7a16;
  --bz-v3-ink: #132b3a;
  --bz-v3-muted: #617786;
  --bz-v3-border: #dce6ec;
  --bz-v3-border-strong: #cad9e2;
  --bz-v3-canvas: #f3f7f9;
  --bz-v3-surface: #fff;
  --bz-v3-surface-soft: #f8fafc;
  --bz-v3-success: #188653;
  --bz-v3-warning: #a65b08;
  --bz-v3-danger: #b53737;
  --bz-v3-radius-sm: 10px;
  --bz-v3-radius: 14px;
  --bz-v3-radius-lg: 20px;
  --bz-v3-radius-xl: 26px;
  --bz-v3-shadow-sm: 0 3px 12px rgba(8, 38, 60, .05);
  --bz-v3-shadow: 0 14px 38px rgba(8, 38, 60, .075);
  --bz-v3-shadow-raised: 0 20px 55px rgba(8, 38, 60, .13);
}

html {
  scroll-padding-top: 104px;
}

.workspace-body,
.auth-body,
.client-portal-body,
.terrain-offline-shell,
.offline-page {
  color: var(--bz-v3-ink);
  background: var(--bz-v3-canvas);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ui-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  overflow: visible;
  vertical-align: -.18em;
}

.workspace-body .btn {
  --bs-btn-border-radius: 11px;
  min-height: 44px;
  padding: .68rem 1rem;
  font-size: .84rem;
  font-weight: 750;
}

.workspace-body .btn-sm {
  min-height: 38px;
  padding: .48rem .78rem;
  border-radius: 9px;
  font-size: .76rem;
}

.workspace-body .btn-primary,
.client-portal-body .btn-primary,
.auth-body .btn-primary {
  border-color: var(--bz-v3-blue-600);
  background: linear-gradient(135deg, var(--bz-v3-blue-600), #0564b9);
  box-shadow: 0 8px 18px rgba(8, 116, 209, .17);
}

.workspace-body .btn-primary:hover,
.client-portal-body .btn-primary:hover,
.auth-body .btn-primary:hover {
  border-color: #055da8;
  background: linear-gradient(135deg, #086bc0, #0559a5);
  box-shadow: 0 11px 23px rgba(8, 116, 209, .23);
}

.workspace-body .btn-dark {
  border-color: var(--bz-v3-navy-900);
  background: var(--bz-v3-navy-900);
}

.workspace-body .btn .ui-icon,
.client-portal-body .btn .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
  margin-right: .38rem;
}

/* Navigation principale */
.workspace-sidebar {
  --bs-offcanvas-width: 284px;
  width: 284px;
  background:
    radial-gradient(circle at 8% 4%, rgba(35, 141, 221, .2), transparent 19rem),
    linear-gradient(180deg, var(--bz-v3-navy-900), var(--bz-v3-navy-950) 82%);
  box-shadow: 8px 0 35px rgba(6, 27, 43, .07);
}

.workspace-sidebar .offcanvas-body {
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
  scrollbar-width: thin;
}

.workspace-brand {
  padding: 1.2rem 1.1rem .85rem;
}

.workspace-brand a {
  width: 158px;
  padding: .28rem .55rem;
  border-radius: 10px;
  box-shadow: 0 9px 25px rgba(0, 0, 0, .17);
}

.workspace-brand-label {
  margin-top: .66rem;
  color: rgba(255, 255, 255, .55);
  font-size: .66rem;
  letter-spacing: .1em;
  line-height: 1.4;
}

.workspace-nav {
  padding: .55rem .7rem 1.2rem;
}

.workspace-nav-title {
  margin: .95rem .7rem .42rem;
  color: rgba(255, 255, 255, .41);
  font-size: .6rem;
  letter-spacing: .13em;
}

.workspace-nav-title-secondary {
  margin-top: 1.3rem;
}

.workspace-nav > a {
  gap: .7rem;
  min-height: 43px;
  margin-bottom: .12rem;
  padding: .45rem .62rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, .72);
  font-size: .79rem;
}

.workspace-nav > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .075);
}

.workspace-nav > a.active {
  color: #fff;
  background: linear-gradient(110deg, rgba(12, 119, 211, .87), rgba(12, 119, 211, .43));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 7px 17px rgba(0, 0, 0, .11);
}

.workspace-nav > a.active::before {
  top: 9px;
  left: -.7rem;
  height: 25px;
  background: var(--bz-v3-orange-500);
}

.workspace-nav-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  color: #acd9fb;
  background: rgba(255, 255, 255, .065);
}

.workspace-nav-icon .ui-icon {
  width: 1rem;
  height: 1rem;
}

.workspace-nav > a.active .workspace-nav-icon {
  color: #fff;
  background: rgba(255, 255, 255, .13);
}

.workspace-sidebar-bottom {
  padding: .72rem;
}

.workspace-support {
  margin-bottom: .48rem;
  padding: .65rem .72rem;
  border-radius: 11px;
}

.workspace-account {
  padding: .62rem;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 11px;
}

.workspace-account button .ui-icon {
  width: .95rem;
  height: .95rem;
}

@media (min-width: 992px) {
  .workspace-main {
    margin-left: 284px;
  }
}

/* En-tête et cadre de page */
.workspace-topbar {
  min-height: 78px;
  padding: .8rem clamp(1.2rem, 2.8vw, 2.6rem);
  border-bottom: 1px solid rgba(202, 217, 226, .78);
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 4px 18px rgba(8, 38, 60, .025);
  backdrop-filter: blur(18px) saturate(150%);
}

.workspace-page-title p {
  margin-bottom: .15rem;
  color: var(--bz-v3-orange-600);
  font-size: .62rem;
  letter-spacing: .13em;
}

.workspace-page-title h1 {
  color: var(--bz-v3-navy-900);
  font-size: clamp(1.22rem, 2vw, 1.52rem);
  font-weight: 820;
  letter-spacing: -.028em;
}

.workspace-topbar-actions {
  gap: .55rem;
}

.workspace-quick-search {
  width: min(28vw, 330px);
  height: 42px;
  border: 1px solid var(--bz-v3-border);
  border-radius: 12px;
  background: var(--bz-v3-surface-soft);
  box-shadow: inset 0 1px 1px rgba(8, 38, 60, .025);
}

.workspace-quick-search:focus-within {
  border-color: rgba(8, 116, 209, .58);
  background: #fff;
  box-shadow: var(--bz-focus-ring);
}

.workspace-quick-search input {
  padding: .6rem .8rem;
  color: var(--bz-v3-ink);
  font-size: .8rem;
}

.workspace-quick-search button {
  width: 42px;
  color: var(--bz-v3-muted);
}

.workspace-search-link,
.workspace-notification-link,
.workspace-menu-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--bz-v3-border);
  border-radius: 11px;
  color: var(--bz-v3-navy-800);
  background: #fff;
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-search-link .ui-icon,
.workspace-notification-link .ui-icon,
.workspace-menu-button .ui-icon {
  width: 1.08rem;
  height: 1.08rem;
}

.workspace-network-indicator,
.workspace-topbar-status {
  min-height: 38px;
  border-radius: 999px;
  font-size: .65rem;
}

.workspace-content {
  max-width: 1560px;
  padding: clamp(1.25rem, 2.7vw, 2.5rem);
}

.workspace-page-description {
  max-width: 72ch;
  margin: -.2rem 0 1.45rem;
  color: var(--bz-v3-muted);
  font-size: .86rem;
  line-height: 1.65;
}

.workspace-footer {
  padding: .9rem clamp(1.25rem, 2.7vw, 2.5rem) 1.25rem;
}

.workspace-alert,
.workspace-body .alert {
  border: 0;
  border-left: 4px solid currentColor;
  border-radius: 12px;
  box-shadow: var(--bz-v3-shadow-sm);
}

/* Tableau de bord */
.workspace-welcome {
  min-height: 220px;
  margin-bottom: 1rem;
  padding: clamp(1.55rem, 3.4vw, 2.55rem);
  border-radius: var(--bz-v3-radius-xl);
  background:
    radial-gradient(circle at 79% 16%, rgba(86, 183, 255, .3), transparent 19rem),
    linear-gradient(125deg, var(--bz-v3-navy-900), #0b548c 70%, #0874c9);
  box-shadow: 0 22px 52px rgba(8, 38, 60, .14);
}

.workspace-welcome h2 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -.055em;
}

.workspace-welcome-copy > p {
  max-width: 52ch;
  color: rgba(255, 255, 255, .76);
  font-size: .92rem;
  line-height: 1.65;
}

.welcome-actions .btn {
  min-height: 46px;
}

.welcome-primary-action .ui-icon {
  margin-right: .3rem;
}

.workspace-metrics {
  gap: .8rem;
  margin-bottom: 1rem;
}

.workspace-metric {
  min-height: 116px;
  padding: 1.05rem;
  border: 1px solid rgba(220, 230, 236, .9);
  border-radius: var(--bz-v3-radius-lg);
  background: #fff;
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-metric:hover {
  border-color: #c9dce8;
  box-shadow: var(--bz-v3-shadow);
}

.metric-icon {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
}

.metric-icon .ui-icon {
  width: 1.22rem;
  height: 1.22rem;
}

.workspace-metric strong {
  color: var(--bz-v3-navy-900);
  font-size: 1.7rem;
}

.workspace-panel {
  border: 1px solid var(--bz-v3-border);
  border-radius: var(--bz-v3-radius-lg);
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-panel-header {
  padding: 1.15rem 1.2rem;
  border-bottom-color: var(--bz-v3-border);
}

.workspace-panel-header h2 {
  color: var(--bz-v3-navy-900);
  font-size: 1rem;
}

.recent-client-row,
.workspace-quick-actions > a {
  min-height: 67px;
}

.workspace-quick-actions > a:hover {
  background: #f6fafe;
}

.quick-action-icon {
  border-radius: 11px;
}

.quick-action-icon .ui-icon {
  width: 1.08rem;
  height: 1.08rem;
}

/* Barres d'outils, recherche et filtres */
.workspace-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem !important;
  padding: .95rem 1.05rem !important;
  border: 1px solid var(--bz-v3-border) !important;
  border-radius: var(--bz-v3-radius) !important;
  background: #fff !important;
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-list-toolbar small {
  display: block;
  margin-top: .18rem;
  color: var(--bz-v3-muted);
  font-size: .68rem;
}

.workspace-result-count {
  color: var(--bz-v3-muted);
  font-size: .78rem;
}

.workspace-result-count strong {
  color: var(--bz-v3-navy-900);
  font-size: 1.05rem;
}

.workspace-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) auto auto;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .75rem;
  border: 1px solid var(--bz-v3-border);
  border-radius: var(--bz-v3-radius);
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-filter-search {
  position: relative;
}

.workspace-filter-search > .ui-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: .85rem;
  width: 1rem;
  height: 1rem;
  color: #78909e;
  transform: translateY(-50%);
  pointer-events: none;
}

.workspace-filter-search .form-control {
  padding-left: 2.55rem;
}

.workspace-filter-bar :where(.form-control, .form-select) {
  min-height: 44px;
  border-color: transparent;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: inset 0 0 0 1px var(--bz-v3-border);
  font-size: .82rem;
}

.workspace-filter-bar :where(.form-control, .form-select):focus {
  border-color: var(--bz-v3-blue-600);
  box-shadow: var(--bz-focus-ring);
}

.workspace-filter-reset {
  min-height: auto !important;
  padding-inline: .45rem !important;
  color: var(--bz-v3-muted);
  font-size: .75rem !important;
  white-space: nowrap;
}

/* Listes métier */
.client-list,
.chantier-list,
.billing-list,
.quote-list,
.evidence-project-list {
  overflow: hidden;
  border: 1px solid var(--bz-v3-border);
  border-radius: var(--bz-v3-radius-lg);
  background: #fff;
  box-shadow: var(--bz-v3-shadow-sm);
}

.client-row,
.chantier-row,
.billing-row,
.quote-list-row {
  min-height: 82px;
  padding: 1rem 1.1rem;
  border-bottom-color: #e8eff3;
}

.client-row:hover,
.chantier-row:hover,
.billing-row:hover,
.quote-list-row:hover {
  background: #f7fbfd;
}

.client-avatar,
.chantier-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
}

.chantier-avatar .ui-icon {
  width: 1.22rem;
  height: 1.22rem;
}

.client-main h3,
.chantier-main h3 {
  color: var(--bz-v3-navy-900);
  font-size: .91rem !important;
}

.client-meta,
.chantier-meta {
  gap: .2rem .75rem;
  color: var(--bz-v3-muted);
  font-size: .7rem;
  line-height: 1.55;
}

.client-type-badge,
.chantier-status {
  padding: .25rem .55rem;
  font-size: .6rem;
  letter-spacing: .01em;
}

.client-row-actions,
.chantier-row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: .45rem;
}

.client-row-actions {
  flex-direction: column;
}

.chantier-row-actions {
  align-items: center;
}

.chantier-budget {
  min-width: 82px;
  color: var(--bz-v3-navy-800);
  text-align: right;
  white-space: nowrap;
}

.client-empty,
.recent-empty,
.module-empty,
.empty-state {
  padding: clamp(2.5rem, 7vw, 5.5rem) 1.5rem;
  border: 1px dashed var(--bz-v3-border-strong);
  border-radius: var(--bz-v3-radius-lg);
  background: linear-gradient(145deg, #fff, #f7fafc);
}

.client-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  border-radius: 16px;
}

.client-empty-icon .ui-icon {
  width: 1.45rem;
  height: 1.45rem;
}

/* Formulaires */
.workspace-body :where(.client-form, .module-form, .quote-form, .billing-form, .automation-form),
.workspace-content-changer-mot-de-passe > form {
  border-color: var(--bz-v3-border) !important;
  border-radius: var(--bz-v3-radius-lg) !important;
  background: #fff;
  box-shadow: var(--bz-v3-shadow-sm) !important;
}

.form-section {
  position: relative;
  margin-bottom: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border: 1px solid #e3ebf0;
  border-radius: 16px;
  background: #fbfdfe;
}

.form-section::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--bz-v3-blue-600), var(--bz-v3-orange-500));
  opacity: .72;
}

.form-section-heading {
  gap: .8rem;
  margin-bottom: 1.15rem;
}

.form-section-heading > span {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  color: var(--bz-v3-blue-700);
  background: #eaf4fb;
  font-size: .63rem;
}

.form-section-heading h3 {
  color: var(--bz-v3-navy-900);
  font-size: .98rem;
}

.form-section-heading p {
  margin-top: .15rem;
  color: var(--bz-v3-muted);
  font-size: .72rem;
}

.workspace-body .form-label,
.auth-body .form-label,
.client-portal-body .form-label {
  margin-bottom: .42rem;
  color: #294657;
  font-size: .73rem;
  font-weight: 720 !important;
}

.workspace-body :where(.form-control, .form-select),
.client-portal-body :where(.form-control, .form-select),
.auth-body :where(.form-control, .form-select) {
  min-height: 46px;
  border-color: var(--bz-v3-border-strong);
  border-radius: 11px;
  color: var(--bz-v3-ink);
  background-color: #fff;
  font-size: .88rem;
}

.workspace-body :where(.form-control, .form-select):hover,
.client-portal-body :where(.form-control, .form-select):hover,
.auth-body :where(.form-control, .form-select):hover {
  border-color: #afc5d2;
}

.workspace-body :where(.form-control, .form-select):focus,
.client-portal-body :where(.form-control, .form-select):focus,
.auth-body :where(.form-control, .form-select):focus {
  border-color: rgba(8, 116, 209, .72);
  background-color: #fff;
  box-shadow: var(--bz-focus-ring);
}

.workspace-body textarea.form-control {
  min-height: 112px;
  line-height: 1.55;
}

.workspace-body .form-control::placeholder,
.auth-body .form-control::placeholder {
  color: #91a2ad;
}

.required-mark {
  color: var(--bz-v3-orange-600);
  font-weight: 850;
}

.workspace-body :where(.form-text, .map-privacy) {
  color: #718693;
  font-size: .68rem;
  line-height: 1.5;
}

.client-form-actions,
.module-form-actions,
.quote-save-bar {
  border-top-color: var(--bz-v3-border) !important;
  background: rgba(248, 251, 252, .95) !important;
  backdrop-filter: blur(12px);
}

.location-map {
  height: clamp(310px, 45vw, 430px);
  border: 1px solid var(--bz-v3-border-strong);
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

/* Tableaux et modules denses */
.workspace-body .table-responsive {
  border: 1px solid var(--bz-v3-border);
  border-radius: var(--bz-v3-radius);
  background: #fff;
  box-shadow: var(--bz-v3-shadow-sm);
}

.workspace-body table {
  margin-bottom: 0;
  color: var(--bz-v3-ink);
  font-size: .76rem;
}

.workspace-body table thead th {
  padding: .82rem .8rem;
  border-bottom: 1px solid var(--bz-v3-border-strong);
  color: #57707f;
  background: #f5f8fa;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.workspace-body table tbody td,
.workspace-body table tbody th {
  padding: .82rem .8rem;
  border-color: #e8eef2;
  vertical-align: middle;
}

.workspace-body table tbody tr:hover > * {
  background-color: #f8fbfd;
}

.table-scroll-hint {
  margin: .45rem .2rem 0;
  color: var(--bz-v3-muted);
  font-size: .67rem;
}

.module-card,
.approval-card,
.billing-card,
.quote-card,
.profitability-card,
.productivity-card,
.planning-sidebar,
.terrain-card,
.evidence-summary,
.evidence-timeline,
.evidence-proof-document {
  border-color: var(--bz-v3-border) !important;
  border-radius: var(--bz-v3-radius-lg) !important;
  box-shadow: var(--bz-v3-shadow-sm) !important;
}

.modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(6, 27, 43, .24);
}

.modal-header,
.modal-footer {
  border-color: var(--bz-v3-border);
  background: #f9fbfc;
}

.modal-title {
  color: var(--bz-v3-navy-900);
  font-size: 1.05rem;
  font-weight: 800;
}

/* Planning : lisibilité des jours et événements */
.planning-shell,
.planning-calendar-panel {
  border-color: var(--bz-v3-border) !important;
  border-radius: var(--bz-v3-radius-lg) !important;
  box-shadow: var(--bz-v3-shadow-sm) !important;
}

.planning-calendar-navigation {
  border-color: var(--bz-v3-border);
  background: #fff;
}

.fc .fc-toolbar-title {
  color: var(--bz-v3-navy-900);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 820;
}

.fc .fc-button-primary {
  border-color: var(--bz-v3-blue-600);
  background: var(--bz-v3-blue-600);
}

.fc .fc-col-header-cell {
  background: #f4f8fa;
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
  color: var(--bz-v3-navy-800);
  font-weight: 700;
}

.fc .fc-event {
  border-radius: 7px;
  box-shadow: 0 3px 9px rgba(8, 38, 60, .12);
}

/* Authentification et espace client */
.auth-body .auth-panel {
  background:
    radial-gradient(circle at 98% 7%, rgba(8, 116, 209, .08), transparent 22rem),
    #f8fafc;
}

.auth-body .brand-panel {
  background:
    radial-gradient(circle at 72% 35%, rgba(24, 136, 228, .2), transparent 25rem),
    linear-gradient(145deg, var(--bz-v3-navy-900), var(--bz-v3-navy-950));
}

.auth-body .auth-card {
  border: 1px solid rgba(220, 230, 236, .92);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--bz-v3-shadow-raised);
}

.auth-body .auth-card h2 {
  color: var(--bz-v3-navy-950);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.auth-body .auth-description {
  color: var(--bz-v3-muted);
  line-height: 1.6;
}

.client-portal-body .portal-shell,
.client-portal-body .portal-card,
.client-portal-body .portal-document {
  border-color: var(--bz-v3-border) !important;
  border-radius: var(--bz-v3-radius-lg) !important;
  box-shadow: var(--bz-v3-shadow-sm) !important;
}

/* Petits écrans */
@media (max-width: 1199.98px) {
  .workspace-filter-bar {
    grid-template-columns: minmax(200px, 1fr) minmax(170px, 220px) auto;
  }

  .workspace-filter-reset {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 991.98px) {
  .workspace-sidebar {
    width: min(88vw, 310px);
  }

  .workspace-topbar {
    padding-top: max(.72rem, env(safe-area-inset-top));
  }

  .workspace-content {
    padding-bottom: calc(var(--bz-mobile-nav-height) + 2rem + env(safe-area-inset-bottom));
  }

  .workspace-mobile-nav {
    min-height: calc(var(--bz-mobile-nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(202, 217, 226, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -10px 28px rgba(8, 38, 60, .08);
    backdrop-filter: blur(18px) saturate(160%);
  }

  .workspace-mobile-nav :where(a, button) {
    color: #6e8290;
  }

  .workspace-mobile-nav :where(a, button) > span {
    display: grid;
    height: 24px;
    place-items: center;
  }

  .workspace-mobile-nav .ui-icon {
    width: 1.18rem;
    height: 1.18rem;
  }

  .workspace-mobile-nav :where(a, button).active {
    color: var(--bz-v3-blue-700);
  }

  .workspace-mobile-nav :where(a, button).active::before {
    background: var(--bz-v3-orange-500);
  }

  .client-form-actions,
  .module-form-actions,
  .quote-save-bar {
    bottom: calc(var(--bz-mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .modal-dialog {
    max-height: calc(100dvh - 1rem);
  }
}

@media (max-width: 767.98px) {
  .workspace-topbar {
    min-height: 68px;
    padding-inline: .85rem;
  }

  .workspace-page-title h1 {
    font-size: 1.08rem;
  }

  .workspace-page-title p {
    font-size: .54rem;
  }

  .workspace-content {
    padding: 1rem .85rem calc(var(--bz-mobile-nav-height) + 1.5rem);
  }

  .workspace-page-description {
    margin-bottom: .9rem;
    font-size: .78rem;
  }

  .workspace-welcome {
    padding: 1.4rem;
    border-radius: 19px;
  }

  .workspace-welcome h2 {
    font-size: 1.95rem;
  }

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

  .workspace-metric {
    min-height: 106px;
  }

  .workspace-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-filter-search {
    grid-column: 1 / -1;
  }

  .workspace-filter-bar > .btn-dark {
    width: 100%;
  }

  .workspace-filter-reset {
    grid-column: auto;
    justify-self: center;
  }

  .client-row,
  .chantier-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: .8rem;
  }

  .client-row-actions,
  .chantier-row-actions {
    grid-column: 2;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .form-section {
    padding: 1rem;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table),
  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody,
  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tr,
  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) td {
    display: block;
    width: 100%;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody {
    padding: .45rem;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody tr {
    margin-bottom: .55rem;
    padding: .35rem .7rem;
    border: 1px solid var(--bz-v3-border);
    border-radius: 12px;
    background: #fff;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody tr:last-child {
    margin-bottom: 0;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: .7rem;
    padding: .58rem .1rem;
    border-bottom: 1px solid #e9eff3;
    text-align: right;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody td:last-child {
    border-bottom: 0;
  }

  .workspace-body .bz-data-table:not(.fc-scrollgrid, .quote-builder-table, .document-lines-table) tbody td::before {
    content: attr(data-label);
    color: var(--bz-v3-muted);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-align: left;
    text-transform: uppercase;
  }

  .workspace-body .table-responsive:has(.bz-data-table) {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .workspace-body .table-responsive:has(.bz-data-table) + .table-scroll-hint {
    display: none;
  }

  .fc .fc-toolbar {
    align-items: stretch;
    gap: .6rem;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 575.98px) {
  .workspace-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-list-toolbar .btn {
    width: 100%;
  }

  .workspace-filter-bar {
    grid-template-columns: 1fr;
    padding: .65rem;
  }

  .workspace-filter-search,
  .workspace-filter-reset {
    grid-column: 1;
  }

  .workspace-filter-reset {
    justify-self: center;
  }

  .workspace-metrics {
    grid-template-columns: 1fr;
  }

  .workspace-metric {
    min-height: 94px;
  }

  .workspace-welcome h2 {
    font-size: 1.72rem;
  }

  .welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .welcome-actions .btn {
    width: 100%;
  }

  .client-row,
  .chantier-row {
    padding: .9rem;
  }

  .client-avatar,
  .chantier-avatar {
    width: 2.45rem;
    height: 2.45rem;
  }

  .client-row-actions,
  .chantier-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .client-row-actions .btn,
  .chantier-row-actions .btn {
    width: 100%;
  }

  .chantier-budget {
    text-align: left;
  }

  .form-section-heading {
    align-items: flex-start;
  }

  .location-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .location-map {
    height: 300px;
  }

  .auth-body .auth-card {
    border-radius: 17px;
  }

  .workspace-body :where(.form-control, .form-select),
  .client-portal-body :where(.form-control, .form-select),
  .auth-body :where(.form-control, .form-select) {
    font-size: 16px !important;
  }

  .workspace-body :where(button, .btn, a),
  .client-portal-body :where(button, .btn, a),
  .auth-body :where(button, .btn, a) {
    touch-action: manipulation;
  }
}

@media (prefers-contrast: more) {
  :root {
    --bz-v3-border: #9dafba;
    --bz-v3-border-strong: #8299a7;
    --bz-v3-muted: #425968;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

@media print {
  .workspace-filter-bar,
  .workspace-list-toolbar .btn,
  .workspace-mobile-nav,
  .workspace-sidebar,
  .workspace-topbar-actions {
    display: none !important;
  }
}

/* Socle structurel de secours. Il garantit un espace utilisable même si le
   navigateur conserve momentanément une ancienne réponse de app.css. */
.workspace-body .workspace-shell {
  display: flex !important;
  width: 100%;
  min-height: 100vh;
}

.workspace-body .workspace-sidebar {
  color: #fff;
  border: 0 !important;
}

.workspace-body .workspace-sidebar .offcanvas-body {
  display: flex !important;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.workspace-body .workspace-nav {
  display: block;
}

.workspace-body .workspace-nav > a {
  position: relative;
  display: flex !important;
  width: 100%;
  align-items: center;
  text-decoration: none !important;
}

.workspace-body .workspace-sidebar-bottom {
  width: 100%;
  margin-top: auto !important;
}

.workspace-body .workspace-main {
  display: flex !important;
  width: auto;
  min-width: 0;
  min-height: 100vh;
  flex: 1 1 auto;
  flex-direction: column;
}

.workspace-body .workspace-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex !important;
  width: 100%;
  align-items: center;
}

.workspace-body .workspace-topbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.workspace-body .workspace-content {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  align-self: center;
}

.workspace-body .workspace-welcome {
  color: #fff;
}

.workspace-body .workspace-footer {
  display: flex;
}

@media (min-width: 992px) {
  .workspace-body .workspace-sidebar {
    position: fixed !important;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 284px !important;
    height: 100vh !important;
    transform: none !important;
    visibility: visible !important;
  }

  .workspace-body .workspace-main {
    margin-left: 284px !important;
  }
}

/* Le même socle protège les écrans publics, le portail client et les pages
   hors ligne lorsque la feuille Bootstrap ou une ancienne feuille de module
   est encore présente dans le cache du navigateur. */
.auth-body .app-shell,
.auth-body .app-shell > .row {
  width: 100%;
  min-height: 100vh;
}

.auth-body .app-shell > .row {
  display: flex !important;
  margin: 0;
  flex-wrap: wrap;
}

.auth-body .brand-panel,
.auth-body .auth-panel {
  position: relative;
  min-width: 0;
}

.auth-body .brand-panel,
.auth-body .auth-panel,
.auth-body .auth-content {
  flex-direction: column;
}

.auth-body .auth-panel,
.auth-body .auth-content {
  display: flex !important;
  width: 100%;
}

.auth-body .auth-content {
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
}

.client-portal-body {
  min-height: 100vh;
  margin: 0;
}

.client-portal-body .client-portal-shell {
  display: flex !important;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
}

.client-portal-body .client-portal-header,
.client-portal-body .client-portal-footer {
  display: flex !important;
  width: 100%;
  align-items: center;
}

.client-portal-body .client-portal-main {
  display: block;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.terrain-offline-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.terrain-offline-shell .terrain-offline-header {
  display: flex !important;
  width: 100%;
  align-items: center;
}

.terrain-offline-shell .terrain-offline-main {
  display: block;
  width: 100%;
  min-width: 0;
}

@media (min-width: 992px) {
  .auth-body .brand-panel {
    display: flex !important;
    width: 41.66666667%;
    flex: 0 0 auto;
  }

  .auth-body .auth-panel {
    width: 58.33333333%;
    flex: 0 0 auto;
  }

  .auth-body .mobile-brand {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .auth-body .brand-panel {
    display: none !important;
  }

  .auth-body .auth-panel {
    width: 100% !important;
  }
}
