:root {
  --brand-rose: #905957;
  --brand-gold: #966d2e;
  --brand-rose-dark: #794846;
  --brand-gold-dark: #7f5b27;
  --text-main: #000000;
  --bg-main: #ffffff;
}

@font-face {
  font-family: "Almara";
  src: url("/static/fonts/Almara.55f8221de96f.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Along Sans S2";
  src: url("/static/fonts/Along Sans s2 SemiBold.cc190f91f6cb.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

body {
  background: linear-gradient(180deg, #fffaf6 0%, var(--bg-main) 140px);
  color: var(--text-main);
}

html,
body {
  max-width: 100%;
}

.app-shell-body {
  --app-topbar-height: 4.2rem;
  --app-sidebar-width: 17rem;
  --app-sidebar-width-compact: 5.25rem;
}

.app-shell {
  min-height: 100vh;
  max-width: 100%;
  min-width: 0;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-topbar-height);
  z-index: 1040;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #ead8d5;
}

.app-topbar-inner {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.app-topbar-brand {
  line-height: 1;
  flex-shrink: 0;
}

.app-topbar .navbar-brand-main {
  font-size: 1.9rem;
}

.app-topbar .navbar-brand-sub {
  font-size: 0.67rem;
}

.app-topbar-search {
  flex: 1 1 28rem;
  max-width: 32rem;
  position: relative;
}

.app-topbar-search .bi {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: #7d6a67;
}

.app-topbar-search .form-control {
  padding-left: 2rem;
  border-radius: 999px;
  border-color: #ddc9c5;
  background: #fff8f6;
}

.app-topbar-search--disabled {
  align-items: center;
  min-height: 2.35rem;
  padding-left: 2rem;
  border: 1px dashed #e4d6d4;
  border-radius: 999px;
  color: #8d7c79;
  background: #faf6f5;
  font-size: 0.9rem;
  opacity: 0.72;
}

.app-topbar-actions {
  flex-shrink: 0;
}

.app-topbar-alert {
  border: 1px solid #f2dfb2;
  color: #7a5100;
  background: #fff4dd;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 600;
  align-items: center;
  gap: 0.35rem;
}

.app-sidebar {
  width: var(--app-sidebar-width) !important;
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
  border-right: 1px solid #ead8d5;
}

.offcanvas-lg.app-sidebar {
  top: var(--app-topbar-height);
  height: calc(100vh - var(--app-topbar-height));
}

.app-nav {
  padding: 0.8rem 0.65rem;
}

.app-nav-heading {
  padding: 0.3rem 0.55rem;
  margin-bottom: 0.25rem;
}

.app-nav-heading-text {
  font-size: 0.72rem;
  color: #8a7774;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 0.65rem;
  color: #6f5552;
  text-decoration: none;
  font-weight: 500;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.15rem;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  border: 1px solid transparent;
}

.app-nav-group-toggle {
  width: 100%;
  background: transparent;
  text-align: left;
}

.app-nav-chevron {
  margin-left: auto;
  width: auto !important;
  font-size: 0.8rem !important;
  transition: transform 0.18s ease;
}

.app-nav-submenu {
  display: none;
}

.app-nav-submenu.is-open {
  display: block;
}

.app-nav-group.is-open .app-nav-chevron {
  transform: rotate(180deg);
}

.app-nav-link:hover {
  color: #623f3b;
  background: #fff0eb;
  border-color: #e7c8c3;
}

.app-nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.app-nav-link.is-active {
  color: var(--brand-rose-dark);
  background: #f6e9e8;
  border-color: #d9b6b2;
}

.app-nav-link.is-disabled {
  color: #a29593;
  cursor: not-allowed;
  background: #fbf6f5;
  border-color: #f1e7e6;
}

.app-nav-link--sub {
  margin-left: 1.25rem;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

.app-nav-link--sub .app-nav-label {
  font-size: 0.89rem;
}

.app-nav-link--sub i {
  width: 0.75rem;
  font-size: 0.9rem;
}

.app-sidebar-footer {
  border-top: 1px solid #efe2e0;
  padding: 0.75rem 0.95rem;
}

.app-sidebar-footer-text {
  color: #8a7774;
  font-size: 0.74rem;
}

.app-main {
  padding-top: calc(var(--app-topbar-height) + 1rem);
  padding-left: var(--app-sidebar-width);
  min-height: 100vh;
  max-width: 100%;
  min-width: 0;
  transition: padding-left 0.2s ease;
}

.app-main-container {
  padding-bottom: 1.75rem;
  max-width: 100%;
  min-width: 0;
}

.app-main-container > *,
.app-page-header > *,
.row > *,
.card,
.table-responsive,
[data-autocomplete-select-field] {
  min-width: 0;
}

[data-autocomplete-select-field],
[data-autocomplete-input="1"] {
  width: 100%;
}

.ui-autocomplete-input {
  font-family: inherit;
}

[data-autocomplete-list="1"] {
  min-width: 0;
  max-width: 100%;
}

.app-global-message {
  border-width: 1px;
  border-style: solid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.app-global-message .bi {
  line-height: 1;
  opacity: 0.9;
}

.app-shell-overlay {
  position: fixed;
  inset: 0;
  z-index: 1028;
  background: rgba(43, 31, 30, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.app-page-eyebrow {
  color: #8a7774;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.app-page-title {
  margin: 0;
  font-size: clamp(1.22rem, 1.08rem + 0.5vw, 1.56rem);
}

.app-page-subtitle {
  margin-top: 0.25rem;
  margin-bottom: 0;
  color: #7f6b68;
}

.app-page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.2rem 0.62rem;
  font-size: 0.77rem;
  line-height: 1.2;
  font-weight: 600;
}

.ui-badge--success {
  background: #e7f7eb;
  border-color: #c9e8d1;
  color: #126333;
}

.ui-badge--warning {
  background: #fff4dd;
  border-color: #f0ddb8;
  color: #7a5100;
}

.ui-badge--danger {
  background: #fdecec;
  border-color: #f0c8cb;
  color: #9f1f2d;
}

.ui-badge--neutral {
  background: #f3f4f6;
  border-color: #dee2e6;
  color: #5f666d;
}

.ui-badge--info {
  background: #e9f1ff;
  border-color: #cddcf7;
  color: #29538f;
}

.ui-filter-bar {
  border: 1px solid #e6d9d8;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f6 100%);
}

.ui-filter-helper {
  color: #756260;
  font-size: 0.86rem;
}

.ui-admin-table-card {
  border: 1px solid #eadfdf;
}

.ui-admin-table > thead > tr > th {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7f6b68;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.ui-admin-table > tbody > tr > td {
  border-color: #efe5e4;
}

.ui-admin-table > tbody > tr:hover {
  background: #fff9f7;
}

.ui-detail-card {
  border: 1px solid #e8dddc;
}

.ui-detail-title {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.contract-tabs-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.contract-tabs {
  display: flex;
  min-width: max-content;
  border-bottom: 1px solid #e6d9d8;
}

.contract-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border-bottom: 3px solid transparent;
  color: #6f5b58;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.contract-tab:hover,
.contract-tab:focus-visible {
  color: var(--brand-rose);
  background: #fff8f6;
}

.contract-tab.active {
  border-bottom-color: var(--brand-rose);
  color: var(--brand-rose);
}

.contract-touch-target {
  min-height: 44px;
}

.contract-financial-metrics,
.contract-summary-financial {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.contract-financial-metric,
.contract-summary-financial > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid #eadfdf;
  border-radius: 0.75rem;
  background: #fff;
}

.contract-financial-metric span,
.contract-summary-financial span {
  color: #7f6b68;
  font-size: 0.78rem;
}

.contract-financial-metric strong,
.contract-summary-financial strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.contract-financial-metric--primary {
  border-color: #d8b9b5;
  background: #fff8f6;
}

.contract-financial-metric--danger {
  border-color: #f0c8cb;
  background: #fff7f7;
  color: #9f1f2d;
}

.contract-financial-history-mobile,
.contract-procedure-list,
.contract-consumption-list,
.contract-document-list,
.contract-revision-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contract-financial-installment,
.contract-procedure-item,
.contract-consumption-item,
.contract-document-item,
.contract-revision-item,
.contract-timeline-item {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #eadfdf;
  border-radius: 0.8rem;
  background: #fff;
}

.contract-installment-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.contract-installment-balances,
.contract-procedure-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.contract-installment-balances span,
.contract-procedure-balances span {
  display: flex;
  flex-direction: column;
  color: #7f6b68;
  font-size: 0.78rem;
}

.contract-installment-balances strong,
.contract-procedure-balances strong {
  color: #352a28;
  font-size: 0.9rem;
}

.contract-procedure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contract-procedure-summary span {
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: #f7f2f1;
  color: #6f5b58;
  font-size: 0.82rem;
}

.contract-timeline {
  display: grid;
  gap: 0.75rem;
  border-left: 2px solid #eadfdf;
  padding-left: 0.75rem;
}

.contract-disclosure > summary {
  cursor: pointer;
}

.contract-disclosure > summary:focus-visible {
  outline: 3px solid rgba(164, 80, 73, 0.28);
  outline-offset: 2px;
}

.ui-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}

.ui-kv-item {
  border: 1px solid #eee2e1;
  border-radius: 0.7rem;
  background: #fff;
  padding: 0.6rem 0.65rem;
}

.ui-kv-label {
  font-size: 0.77rem;
  color: #7f6b68;
  margin-bottom: 0.12rem;
  display: block;
}

.ui-kv-value {
  color: #413534;
}

.ui-kv-stack {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.ui-kv-row {
  border: 1px solid #eee2e1;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.5rem 0.62rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.ui-inline-note {
  border: 1px solid #e8dedb;
  border-radius: 0.65rem;
  background: #fff9f7;
  padding: 0.55rem 0.65rem;
  font-size: 0.92rem;
}

.ui-inline-alert {
  border: 1px solid #f0ddb8;
  border-radius: 0.65rem;
  background: #fff9ec;
  color: #5d4a22;
  padding: 0.6rem 0.68rem;
}

.ui-contract-advanced {
  border: 1px solid #e8dedb;
  border-radius: 0.65rem;
  background: #fffdfc;
  padding: 0.7rem 0.8rem;
}

.ui-contract-advanced > summary {
  cursor: pointer;
  font-weight: 600;
  color: #4b3b39;
}

.ui-contract-item-highlight > td {
  background: #fff4dd !important;
  box-shadow: inset 3px 0 0 var(--brand-gold);
}

.ui-help-link {
  display: block;
  border: 1px solid #eee2e1;
  border-radius: 0.65rem;
  background: #fff;
  color: #413534;
  padding: 0.65rem 0.7rem;
}

.ui-help-link:hover {
  border-color: #d9b6b2;
  background: #fff8f6;
}

.ui-help-link--placeholder {
  color: #746260;
  background: #fbf7f6;
}

.ui-help-article-section {
  border-top: 1px solid #eee2e1;
  padding-top: 1rem;
  margin-top: 1rem;
}

.ui-help-article-section h2 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}

.ui-help-article-section li + li {
  margin-top: 0.25rem;
}

.ui-section-note {
  color: #7a6664;
  font-size: 0.88rem;
}

.ui-choice-card {
  border: 1px solid #e8dddc;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.55rem 0.62rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.8rem;
}

.ui-choice-card .form-check-input {
  margin-top: 0;
}

.ui-empty-state {
  border: 1px dashed #dbc7c5;
  border-radius: 0.8rem;
  padding: 1.35rem 1rem;
  text-align: center;
  background: #fffaf8;
}

.ui-empty-state--compact {
  padding: 0.95rem 0.8rem;
}

.ui-empty-state-icon {
  display: inline-block;
  font-size: 1.45rem;
  color: var(--brand-gold);
  margin-bottom: 0.45rem;
}

.ui-empty-state-title {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.ui-empty-state-text {
  margin-bottom: 0.65rem;
  color: #7a6664;
}

.ui-log-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ui-log-item {
  border: 1px solid #ece2e1;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.7rem;
}

.customer-summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #fff9f7 100%);
}

.customer-summary-label {
  color: #7f6b68;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.customer-summary-value {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.7rem);
  font-weight: 700;
  color: #3f312f;
  line-height: 1.15;
}

.customer-summary-text {
  color: #7a6664;
  font-size: 0.88rem;
}

.customer-event-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.customer-event-item {
  border: 1px solid #eee2e1;
  border-radius: 0.7rem;
  background: #fff;
  padding: 0.55rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.customer-event-main {
  min-width: 0;
}

.customer-event-meta {
  color: #7f6b68;
  font-size: 0.87rem;
}

.customer-balance-value {
  font-size: clamp(1.3rem, 1.15rem + 0.75vw, 1.9rem);
  font-weight: 700;
  color: #3f312f;
  line-height: 1.2;
}

.customer-procedure-card {
  border-color: #e9dedc;
}

.customer-procedure-card .card-body {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf8 100%);
}

.customer-procedure-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #3f312f;
}

.customer-duration-badge i {
  font-size: 0.82rem;
}

.customer-catalog-grid {
  padding-bottom: 6.8rem;
}

.customer-catalog-fixed-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #e7d8d5;
  backdrop-filter: blur(8px);
}

.customer-catalog-fixed-actions__inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.25rem;
}

.customer-cart-table td,
.customer-cart-table th {
  white-space: nowrap;
}

.customer-cart-table td:first-child,
.customer-cart-table th:first-child {
  white-space: normal;
}

.customer-total-value {
  font-size: clamp(1.25rem, 1.07rem + 0.7vw, 1.8rem);
  font-weight: 700;
  color: #3f312f;
}

body.app-shell-body.app-sidebar-collapsed .app-main {
  padding-left: var(--app-sidebar-width-compact);
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  .app-main {
    padding-left: var(--app-sidebar-width-compact);
  }

  .offcanvas-lg.app-sidebar {
    width: var(--app-sidebar-width-compact) !important;
    overflow: visible;
  }

  .app-nav-heading-text,
  .app-nav-label,
  .app-sidebar-footer-text {
    display: none;
  }

  .app-nav-link {
    justify-content: center;
    padding-inline: 0.4rem;
  }

  .offcanvas-lg.app-sidebar:hover,
  .offcanvas-lg.app-sidebar:focus-within {
    width: var(--app-sidebar-width) !important;
    box-shadow: 0 0.6rem 1.7rem rgba(44, 29, 28, 0.22);
  }

  .offcanvas-lg.app-sidebar:hover .app-nav-heading-text,
  .offcanvas-lg.app-sidebar:hover .app-nav-label,
  .offcanvas-lg.app-sidebar:hover .app-sidebar-footer-text,
  .offcanvas-lg.app-sidebar:focus-within .app-nav-heading-text,
  .offcanvas-lg.app-sidebar:focus-within .app-nav-label,
  .offcanvas-lg.app-sidebar:focus-within .app-sidebar-footer-text {
    display: inline;
  }

  .offcanvas-lg.app-sidebar:hover .app-nav-link,
  .offcanvas-lg.app-sidebar:focus-within .app-nav-link {
    justify-content: flex-start;
    padding-inline: 0.6rem;
  }
}

@media (min-width: 992px) {
  .offcanvas-lg.app-sidebar {
    /* No desktop a sidebar precisa sair do fluxo para não empilhar com o main. */
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1030;
  }

  .offcanvas-lg.app-sidebar .offcanvas-body {
    overflow-y: auto;
    overflow-x: visible;
  }

  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar {
    width: var(--app-sidebar-width-compact) !important;
    overflow: visible;
  }

  body.app-shell-body.app-sidebar-collapsed .app-nav-heading-text,
  body.app-shell-body.app-sidebar-collapsed .app-nav-label,
  body.app-shell-body.app-sidebar-collapsed .app-sidebar-footer-text {
    display: none;
  }

  body.app-shell-body.app-sidebar-collapsed .app-nav-link {
    justify-content: center;
    padding-inline: 0.4rem;
  }

  body.app-shell-body.app-sidebar-collapsed-hover .offcanvas-lg.app-sidebar,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:hover,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:focus-within {
    width: var(--app-sidebar-width) !important;
    box-shadow: 0 0.6rem 1.7rem rgba(44, 29, 28, 0.22);
  }

  body.app-shell-body.app-sidebar-collapsed-hover .app-nav-heading-text,
  body.app-shell-body.app-sidebar-collapsed-hover .app-nav-label,
  body.app-shell-body.app-sidebar-collapsed-hover .app-sidebar-footer-text,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:hover .app-nav-heading-text,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:hover .app-nav-label,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:hover .app-sidebar-footer-text,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:focus-within .app-nav-heading-text,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:focus-within .app-nav-label,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:focus-within .app-sidebar-footer-text {
    display: inline;
  }

  body.app-shell-body.app-sidebar-collapsed-hover .app-nav-link,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:hover .app-nav-link,
  body.app-shell-body.app-sidebar-collapsed .offcanvas-lg.app-sidebar:focus-within .app-nav-link {
    justify-content: flex-start;
    padding-inline: 0.6rem;
  }
}

@media (max-width: 991.98px) {
  .app-main {
    padding-left: 0;
    padding-top: calc(var(--app-topbar-height) + 0.75rem);
  }

  .ui-admin-table > thead > tr > th {
    white-space: normal;
  }

  .app-sidebar {
    top: 0;
    height: 100vh;
    border-right: 0;
  }

  body.app-shell-body.app-sidebar-mobile-open .app-shell-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 767.98px) {
  .app-topbar .navbar-brand-main {
    font-size: 1.65rem;
  }

  .app-topbar .navbar-brand-sub {
    font-size: 0.62rem;
  }

  .app-main-container {
    padding-inline: 0.75rem;
  }

  .app-page-header {
    flex-direction: column;
  }

  .ui-kv-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-event-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-cart-table td,
  .customer-cart-table th {
    white-space: normal;
  }

  .customer-catalog-grid {
    padding-bottom: 8.5rem;
  }

  .customer-catalog-fixed-actions__inner {
    flex-direction: column;
    align-items: stretch;
    padding-inline: 0.75rem;
  }

  .customer-catalog-fixed-actions__inner .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 575.98px) {
  .app-page-actions {
    width: 100%;
    justify-content: stretch;
  }

  .app-page-actions .btn {
    flex: 1 1 100%;
  }

  .ui-admin-table > thead > tr > th {
    font-size: 0.7rem;
  }

  .ui-filter-bar .col-12.d-flex.flex-wrap.gap-2,
  .ui-filter-bar .col-6.d-flex.flex-wrap.gap-2,
  .ui-filter-bar .col-lg-2.d-flex.flex-wrap.gap-2 {
    width: 100%;
  }

  .ui-filter-bar .d-flex.flex-wrap.gap-2 .btn {
    flex: 1 1 auto;
  }

  .ui-detail-card .btn,
  .ui-detail-card button,
  .ui-detail-card summary.contract-touch-target {
    min-height: 44px;
  }

  .ui-detail-card .btn:has(> i:only-child),
  .ui-detail-card button:has(> i:only-child) {
    min-width: 44px;
  }
}

@media (max-width: 359.98px) {
  .contract-financial-metrics,
  .contract-summary-financial,
  .contract-installment-balances,
  .contract-procedure-balances {
    grid-template-columns: 1fr;
  }
}

.navbar {
  background-color: #ffffff !important;
}

.navbar-brand-main {
  display: block;
  font-family: "Almara", serif;
  font-size: 3rem;
  line-height: 0.8;
  color: var(--brand-rose);
}

.navbar-brand-sub {
  display: block;
  margin-top: 0.1rem;
  font-family: "Along Sans S2", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-gold);
}

a {
  color: var(--brand-rose);
}

a:hover {
  color: var(--brand-rose-dark);
}

.btn-primary {
  background-color: var(--brand-rose);
  border-color: var(--brand-rose);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--brand-rose-dark) !important;
  border-color: var(--brand-rose-dark) !important;
}

.btn-outline-primary {
  color: var(--brand-rose);
  border-color: var(--brand-rose);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  color: #ffffff !important;
  background-color: var(--brand-rose);
  border-color: var(--brand-rose);
}

.dropdown-item:active,
.dropdown-item:focus {
  background-color: #f5e9e9;
  color: var(--brand-rose-dark);
}

.notification-dropdown .notification-bell-btn {
  width: 2.3rem;
  height: 2.05rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown .notification-bell-btn .bi {
  font-size: 1rem;
}

.notification-dropdown .notification-badge {
  position: absolute;
  top: -0.38rem;
  right: -0.42rem;
  min-width: 1.2rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.67rem;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.notification-menu {
  width: min(26rem, 92vw);
  border-radius: 0.85rem;
  overflow: hidden;
}

.notification-menu-body {
  max-height: 22rem;
  overflow-y: auto;
}

.notification-preview-item:last-child {
  border-bottom: 0 !important;
}

.notification-preview-item {
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
}

.notification-preview-item:hover {
  background: #fff4ee;
}

.notification-preview-link {
  color: inherit;
}

.notification-preview-link:hover .notification-preview-body,
.notification-preview-link:hover .fw-semibold {
  color: var(--brand-rose-dark) !important;
}

.notification-level-icon {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.notification-level-icon.level-info {
  color: #0f5cc0;
  background: #e8f1ff;
}

.notification-level-icon.level-success {
  color: #0f7a32;
  background: #e7f6eb;
}

.notification-level-icon.level-warning {
  color: #8b5a00;
  background: #fff4dd;
}

.notification-level-icon.level-error {
  color: #b42318;
  background: #feecee;
}

.notification-preview-body {
  line-height: 1.35;
}

.notification-kind-pill {
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.notification-kind-pill.kind-chat {
  color: #0b7285;
  background: #e5f7fb;
  border-color: #c3ebf2;
}

.notification-kind-pill.kind-financial {
  color: #8b5a00;
  background: #fff4dd;
  border-color: #f2dfb2;
}

.notification-kind-pill.kind-schedule {
  color: #1d4f91;
  background: #e7f0ff;
  border-color: #cbddfa;
}

.notification-kind-pill.kind-system {
  color: #495057;
  background: #f1f3f5;
  border-color: #dee2e6;
}

.notification-preview-item.kind-chat {
  border-left: 3px solid #c3ebf2;
}

.notification-preview-item.kind-financial {
  border-left: 3px solid #f2dfb2;
}

.notification-preview-item.kind-schedule {
  border-left: 3px solid #cbddfa;
}

.notification-preview-item.kind-system {
  border-left: 3px solid #dee2e6;
}

.notification-empty {
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
}

.notification-card {
  border-left: 4px solid #ece4df;
}

.notification-card.is-unread {
  border-left-color: var(--brand-rose);
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
}

.notification-card.is-read {
  border-left-color: #d8dadd;
  background: #fff;
}

.notification-level-pill {
  border: 1px solid transparent;
  font-weight: 500;
}

.notification-level-pill.level-info {
  color: #0f5cc0;
  background: #e8f1ff;
  border-color: #cee0fb;
}

.notification-level-pill.level-success {
  color: #0f7a32;
  background: #e7f6eb;
  border-color: #cae9d4;
}

.notification-level-pill.level-warning {
  color: #8b5a00;
  background: #fff4dd;
  border-color: #f2dfb2;
}

.notification-level-pill.level-error {
  color: #b42318;
  background: #feecee;
  border-color: #f3cdcf;
}

.notification-card.kind-chat.is-unread {
  border-left-color: #0b7285;
}

.notification-card.kind-financial.is-unread {
  border-left-color: #8b5a00;
}

.notification-card.kind-schedule.is-unread {
  border-left-color: #1d4f91;
}

.notification-card.kind-system.is-unread {
  border-left-color: #495057;
}

.notification-empty-state i {
  color: var(--brand-gold);
}

.text-brand-gold {
  color: var(--brand-gold);
}

.progress-steps-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  display: flex;
  justify-content: center;
}

.progress-steps-wrap::-webkit-scrollbar {
  height: 6px;
}

.progress-steps-list {
  display: inline-flex;
  justify-content: center;
  min-width: max-content;
}

.progress-step {
  min-width: 8.2rem;
  border: 1px solid #e8dfdf;
  background-color: #fff;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-step .step-index {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9999px;
  background-color: #efe7e7;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.progress-step .step-index i {
  font-size: 1rem;
  line-height: 1;
}

.progress-step.is-done {
  border-color: #eadfcf;
  background-color: #fbf6ee;
  color: var(--brand-gold-dark);
}

.progress-step.is-done .step-index {
  background-color: var(--brand-gold);
  color: #fff;
}

.progress-step.active {
  background-color: var(--brand-rose);
  border-color: var(--brand-rose);
  color: #fff;
}

.progress-step.active .step-index {
  background-color: #fff;
  color: var(--brand-rose);
}

@media (max-width: 576px) {
  .progress-step {
    min-width: 7.2rem;
    padding: 0.45rem 0.65rem;
  }

  .progress-step .step-label {
    font-size: 0.78rem;
  }
}

.chat-nav-btn {
  width: 2.3rem;
  height: 2.05rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-nav-btn .bi {
  font-size: 1rem;
}

.chat-unread-badge {
  position: absolute;
  top: -0.38rem;
  right: -0.42rem;
  min-width: 1.2rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.67rem;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.chat-sidebar-card,
.chat-thread-card {
  border-radius: 0.9rem;
}

.chat-conversation-list {
  max-height: 24rem;
  overflow-y: auto;
}

.chat-conversation-item {
  border-radius: 0.75rem;
  border: 1px solid #f1e5e5;
  padding: 0.65rem 0.7rem;
  color: inherit;
  background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chat-conversation-item:hover {
  border-color: #d9bbbb;
  background: #fff4ee;
}

.chat-conversation-item.has-unread {
  border-color: #d6b3ae;
  background: linear-gradient(180deg, #fff 0%, #fff4ef 100%);
}

.chat-conversation-item.is-active {
  border-color: var(--brand-rose);
  background: #fff1ea;
}

.chat-conversation-time {
  white-space: nowrap;
}

.chat-target-list {
  max-height: 16rem;
  overflow-y: auto;
}

.chat-thread-messages {
  max-height: 60vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff 0%, #fff9f7 100%);
}

.chat-message-bubble {
  max-width: 86%;
  border-radius: 0.9rem;
  padding: 0.55rem 0.7rem;
  line-height: 1.35;
  border: 1px solid transparent;
}

.chat-message-bubble.mine {
  margin-left: auto;
  background: #f2e9e8;
  border-color: #e4d3d1;
}

.chat-message-bubble.theirs {
  margin-right: auto;
  background: #fff;
  border-color: #eee5e5;
}

.chat-message-meta {
  color: #7e6f6d;
}

.chat-message-body p:last-child {
  margin-bottom: 0;
}

.chat-empty-thread i {
  color: var(--brand-gold);
}

.chat-composer-textarea {
  min-height: 56px;
  max-height: 220px;
  resize: none;
}

.manual-search-shell {
  border: 1px solid #e8d9d7;
  border-radius: 0.8rem;
  background: #fff;
  padding: 0.65rem;
}

.manual-chooser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manual-chooser-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 16rem;
  overflow-y: auto;
}

.manual-chooser-item {
  width: 100%;
  border: 1px solid #ebdedd;
  border-radius: 0.7rem;
  padding: 0.6rem 0.7rem;
  background: linear-gradient(180deg, #fff 0%, #fff9f7 100%);
  text-align: left;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.manual-chooser-item:hover {
  border-color: #ccb2b0;
  background: #fff4ee;
}

.manual-chooser-item.is-selected {
  border-color: var(--brand-rose);
  background: #fff1ea;
}

.manual-chooser-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.manual-chooser-title {
  display: inline-block;
}

.manual-chooser-meta {
  color: #7a6664;
  font-size: 0.82rem;
  white-space: nowrap;
}

.manual-chooser-sub {
  margin-top: 0.2rem;
  color: #7a6664;
  font-size: 0.83rem;
}

.manual-chooser-empty {
  border: 1px dashed #dbc7c5;
  border-radius: 0.7rem;
  padding: 0.7rem;
  color: #746663;
  background: #fffaf8;
}

.manual-current-selection-label {
  font-size: 0.78rem;
  color: #6f625f;
  margin-bottom: 0.25rem;
}

.manual-current-selection-card,
.manual-fixed-choice {
  border: 1px solid #d8c0bd;
  border-radius: 0.7rem;
  background: #fff5f2;
  padding: 0.6rem 0.7rem;
}

.manual-procedure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

.manual-procedure-card {
  border: 1px solid #ebdedd;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.55rem 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.manual-procedure-card:hover {
  border-color: #c9aead;
  background: #fff8f5;
}

.manual-procedure-card.is-selected {
  border-color: var(--brand-rose);
  background: #fff1ea;
}

.manual-procedure-card[hidden] {
  display: none !important;
}

.manual-procedure-checkbox {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.manual-procedure-body {
  display: flex;
  flex-direction: column;
}

.manual-procedure-meta {
  color: #7a6664;
  font-size: 0.82rem;
}

.manual-step-pill {
  font-weight: 600;
}

.manual-slots-grid .manual-slot-btn {
  border-radius: 0.65rem;
}

@media (max-width: 767.98px) {
  .manual-chooser-list {
    max-height: none;
  }
}

.booking-page,
.booking-detail-page {
  max-width: 100%;
}

.booking-filter-card {
  border-color: #e6d9d8;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f6 100%);
}

.booking-filter-note {
  color: #756260;
  font-size: 0.86rem;
}

.booking-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.booking-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddc8c6;
  border-radius: 9999px;
  padding: 0.26rem 0.7rem;
  background: #fff;
  color: #7a5f5d;
  font-size: 0.82rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.booking-chip:hover {
  border-color: #cda9a5;
  background: #fff4ef;
  color: #6a4744;
}

.booking-chip.is-active {
  border-color: var(--brand-rose);
  background: #fff0e9;
  color: var(--brand-rose);
}

.booking-section {
  border: 1px solid #eadfdf;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.9rem;
}

.booking-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.booking-section-subtitle {
  color: #7a6664;
  font-size: 0.86rem;
  margin-bottom: 0.65rem;
}

.booking-count {
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 9999px;
  border: 1px solid #ddc8c6;
  background: #fff6f2;
  color: #6e514f;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.booking-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.booking-item-card {
  border: 1px solid #eadfdf;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #fff 0%, #fff9f7 100%);
  padding: 0.75rem;
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
}

.booking-item-card.is-attention {
  border-color: #e3c894;
  background: linear-gradient(180deg, #fff 0%, #fff8ed 100%);
}

.booking-item-card.is-inactive {
  border-color: #e8e3e2;
  background: #fff;
}

.booking-item-main {
  min-width: 0;
}

.booking-item-title {
  font-weight: 600;
  line-height: 1.2;
}

.booking-item-meta {
  color: #7d6a67;
  font-size: 0.84rem;
}

.booking-reference-line {
  color: #94827f;
  font-size: 0.78rem;
  line-height: 1.2;
}

.booking-item-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: #4a3f3d;
  font-size: 0.92rem;
}

.booking-item-info i {
  margin-right: 0.22rem;
  color: #8f6966;
}

.booking-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
  justify-content: flex-end;
}

.booking-pill {
  border-radius: 9999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.62rem;
  font-size: 0.77rem;
  line-height: 1.2;
  font-weight: 600;
}

.booking-pill--success {
  background: #e7f7eb;
  border-color: #c9e8d1;
  color: #126333;
}

.booking-pill--warning {
  background: #fff4dd;
  border-color: #f0ddb8;
  color: #7a5100;
}

.booking-pill--danger {
  background: #fdecec;
  border-color: #f0c8cb;
  color: #9f1f2d;
}

.booking-pill--neutral {
  background: #f3f4f6;
  border-color: #dee2e6;
  color: #5f666d;
}

.booking-pill--info {
  background: #e9f1ff;
  border-color: #cddcf7;
  color: #29538f;
}

.booking-detail-card {
  border-color: #e6d9d8;
}

.booking-summary-message {
  color: #4d403e;
  font-size: 0.95rem;
}

.booking-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.booking-detail-label {
  font-size: 0.8rem;
  color: #7d6a67;
  margin-bottom: 0.15rem;
}

.booking-inline-note {
  border: 1px solid #e8dedb;
  border-radius: 0.65rem;
  background: #fff9f7;
  padding: 0.55rem 0.65rem;
  font-size: 0.92rem;
}

.booking-payment-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.booking-payment-item {
  border: 1px solid #eadfdf;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.7rem;
}

.btn-outline-danger-soft {
  color: #8c5252;
  border-color: #d7b8b6;
  background: #fff;
}

.btn-outline-danger-soft:hover,
.btn-outline-danger-soft:focus,
.btn-outline-danger-soft:active {
  color: #7b3232 !important;
  border-color: #c58f8b !important;
  background: #fff2f2 !important;
}

.booking-empty-global {
  border-style: dashed;
}

@media (max-width: 767.98px) {
  .booking-item-card {
    flex-direction: column;
  }

  .booking-item-actions {
    justify-content: flex-start;
  }
}
