/* Shared page title treatment: a compact header for every primary screen. */
.page-heading {
  padding: 0.875rem 1rem;
  background: var(--bs-white, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
}

.page-heading h4 {
  font-size: 1.05rem;
  font-weight: 600;
}

.credit-account-hero { display: grid; grid-template-columns: 1.15fr .9fr .95fr; gap: 1px; overflow: hidden; color: #fff; background: #dfe7f3; border-radius: .75rem; }
.credit-account-hero > div { padding: 1.35rem 1.45rem; background: #fff; }
.credit-account-brand { display: flex; align-items: center; gap: .8rem; background: linear-gradient(135deg, #294d91, #4e7ed9) !important; }
.credit-account-chip { display: grid; width: 2.65rem; height: 2.65rem; place-items: center; color: #dbe8ff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); border-radius: .7rem; font-size: 1.25rem; }
.credit-account-eyebrow { display: block; margin-bottom: .2rem; color: #cfe0ff; font-size: .63rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.credit-account-brand h1 { margin: 0; color: #fff; font-size: 1.15rem; font-weight: 600; }
.credit-account-primary span, .credit-account-invoice span { display: block; margin-bottom: .35rem; color: #7b8ba5; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.credit-account-primary strong { display: block; color: #9d4b4b; font-size: 1.45rem; letter-spacing: -.03em; }
.credit-account-invoice strong { display: block; color: #284f93; font-size: 1.35rem; }
.credit-account-primary small, .credit-account-invoice small { display: block; margin-top: .25rem; color: #8d9aae; font-size: .7rem; }
.credit-account-facts { display: flex; flex-wrap: wrap; gap: 0; margin-top: .75rem; padding: .65rem .35rem; color: #71819a; background: #f8faff; border: 1px solid #e1e8f3; border-radius: .6rem; font-size: .72rem; }
.credit-account-facts span { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem 1rem; border-right: 1px solid #dfe7f2; }
.credit-account-facts span:first-child { padding-left: .75rem; }
.credit-account-facts span:last-child { border-right: 0; }
.credit-account-facts i { color: #5a83d4; }
.credit-account-facts strong { color: #364d70; font-weight: 600; }
@media (max-width: 767.98px) { .credit-account-hero { grid-template-columns: 1fr 1fr; }.credit-account-brand { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .credit-account-hero { grid-template-columns: 1fr; }.credit-account-brand { grid-column: auto; }.credit-account-facts { flex-direction: column; gap: .25rem; padding: .65rem .75rem; }.credit-account-facts span, .credit-account-facts span:first-child { padding: .3rem 0; border-right: 0; } }

/* Credit-card statement overview: surface the actionable statement before
   the historical table. */
.invoice-overview {
  display: grid;
  grid-template-columns: minmax(15rem, 1.6fr) repeat(3, minmax(8rem, 1fr));
  gap: 1px;
  overflow: hidden;
  background: #dfe7f3;
  border: 1px solid #dfe7f3;
  border-radius: .8rem;
  box-shadow: 0 .45rem 1.2rem rgba(42, 68, 109, .06);
}
.invoice-overview > div { padding: 1.1rem 1.2rem; background: #fff; }
.invoice-overview-main { color: #fff; background: linear-gradient(135deg, #315fae, #527fda) !important; }
.invoice-overview-kicker { margin-bottom: .4rem; color: #dce9ff; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.invoice-overview-main h5 { margin-bottom: .35rem; font-size: 1.08rem; }
.invoice-overview-main p { color: #e5efff; font-size: .76rem; }
.invoice-overview-total span, .invoice-overview-fact span { display: block; margin-bottom: .35rem; color: #8290a7; font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.invoice-overview-total strong { display: block; color: #243f6d; font-size: 1.35rem; letter-spacing: -.03em; }
.invoice-overview-total small, .invoice-overview-fact small { color: #8d9aaf; font-size: .7rem; }
.invoice-overview-fact strong { display: block; margin-bottom: .15rem; color: #314c74; font-size: .95rem; }
.invoice-history-count { color: #8b98ab; font-size: .7rem; }
.invoice-row--current td { background: #f5f8ff; }
.invoice-row--current td:first-child { border-left: 3px solid #5387e4; }
.invoice-installments-row td { padding: .8rem !important; background: #fbfcff; }
.invoice-installments-title { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; color: #63728a; font-size: .7rem; font-weight: 700; }
.invoice-installments-title span:last-child { color: #98a4b6; font-weight: 500; }
.invoice-installments-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.invoice-installment { display: inline-flex; align-items: center; gap: .55rem; min-width: 14rem; padding: .5rem .65rem; color: #334a6e; background: #fff; border: 1px solid #e4eaf3; border-radius: .55rem; text-decoration: none; }
.invoice-installment:hover { color: #275ca9; border-color: #a9c3ef; background: #f6f9ff; }
.invoice-installment-icon { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; color: #4778ce; background: #eaf1ff; border-radius: .4rem; }
.invoice-installment span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.invoice-installment strong { font-size: .73rem; }
.invoice-installment small { color: #8c99ad; font-size: .62rem; }
.invoice-installment b { color: #2f5b9f; font-size: .7rem; white-space: nowrap; }
@media (max-width: 767.98px) {
  .invoice-overview { grid-template-columns: 1fr 1fr; }
  .invoice-overview-main { grid-column: 1 / -1; }
  .invoice-installment { min-width: 100%; }
}
@media (max-width: 575.98px) {
  .invoice-overview { grid-template-columns: 1fr; }
  .invoice-overview-main { grid-column: auto; }
}

.card-header {
  padding: 0.875rem 1rem;
}

.card-header .card-title {
  margin-bottom: 0;
}

/* Profile uses the same Lavish tokens as the rest of the application. */
.profile-identity { border-top: 3px solid var(--bs-primary, #5387e4); }
.profile-avatar, .profile-avatar-fallback { width: 4.5rem; height: 4.5rem; }
.profile-avatar { object-fit: cover; }
.profile-avatar-preview { min-height: 4.5rem; }
.profile-avatar-preview .profile-avatar { flex: 0 0 auto; }
.profile-toggle { min-height: 2.75rem; padding: 0.35rem 3.25rem 0.35rem 0; }
.profile-toggle .form-check-input { float: right; margin: 0; width: 2.75rem; height: 1.5rem; cursor: pointer; }
.profile-toggle .form-check-label { display: block; font-weight: 500; cursor: pointer; }
.profile-toggle .form-text { padding-right: 0.25rem; }
.password-page { max-width: 56rem; margin: 0 auto; }
.password-card { border-top: 3px solid var(--bs-primary, #5387e4); }
.password-help ul { margin: 0.35rem 0 0; padding-left: 1.25rem; }
.password-help li + li { margin-top: 0.15rem; }
.profile-avatar-fallback, .scgpf-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--bs-primary, #5387e4); font-weight: 600;
}
.scgpf-avatar { object-fit: cover; }
.scgpf-avatar, .scgpf-avatar-fallback {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  aspect-ratio: 1;
  overflow: hidden;
}
.scgpf-compact-values .scgpf-money { letter-spacing: -.02em; }
@media (max-width: 575.98px) {
  .profile-identity .btn { min-height: 44px; }
  .profile-avatar, .profile-avatar-fallback { width: 4rem; height: 4rem; }
  .profile-avatar-preview { min-height: 4rem; }
}

/* A compact product signature that closes the content area without competing
   with the page actions. */
.scgpf-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 6.25rem;
  padding: 1.25rem 2rem;
  overflow: hidden;
  color: #aab6cb;
  background: #172238;
  border-top: 0;
}

.scgpf-footer::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: '';
  background: linear-gradient(90deg, #5d86e9, #8b70dc 55%, #45b996);
}

.scgpf-footer::after {
  position: absolute;
  top: -5rem;
  right: 16%;
  width: 18rem;
  height: 12rem;
  content: '';
  background: rgba(93, 134, 233, 0.12);
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.scgpf-footer-brand,
.scgpf-footer-meta,
.scgpf-footer-center {
  display: flex;
  align-items: center;
}

.scgpf-footer-brand {
  gap: 0.7rem;
  min-width: 18rem;
  position: relative;
  z-index: 1;
}

.scgpf-footer-mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #172238;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(145deg, #ffffff, #b8c9ff);
  border-radius: 0.7rem;
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.2);
  object-fit: contain;
}

.scgpf-footer-brand strong {
  display: block;
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.scgpf-footer-brand div span {
  display: block;
  margin-top: 0.1rem;
  color: #9daac0;
  font-size: 0.72rem;
}

.scgpf-footer-center {
  position: relative;
  z-index: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  color: #8f9db4;
  font-size: 0.75rem;
}

.scgpf-footer-center strong {
  color: #eaf0ff;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.scgpf-footer-center i {
  color: #5dd3a7;
  font-size: 0.95rem;
}

.scgpf-footer-meta {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 18rem;
  font-size: 0.72rem;
}

.scgpf-footer-meta a {
  color: #b9caff;
  font-weight: 600;
  text-decoration: none;
}

.scgpf-footer-meta a:hover {
  color: #ffffff;
  text-decoration: none;
}

.scgpf-footer-meta a i {
  margin-right: 0.2rem;
}

.scgpf-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #b9caff;
  font-weight: 600;
}

.scgpf-footer-note i {
  color: #5dd3a7;
}

.scgpf-footer-divider {
  width: 1px;
  height: 0.9rem;
  background: #3a4963;
}

.filter-actions .btn-secondary {
  min-width: 2.75rem;
}

/* The full wordmark is wider than the pinned sidebar. */
.app-brand-logo-compact {
  display: none !important;
}

.page-wrapper.pinned .app-brand .app-brand-logo-full {
  display: none !important;
}

.page-wrapper.pinned .app-brand .app-brand-logo-compact {
  display: block !important;
  width: 44px;
  height: 44px;
  margin: 0 auto;
}

/* Brand system: one optical scale across the full sidebar, pinned sidebar and
   mobile header. The compact SVG is square, so never let the generic Lavish
   horizontal-logo rule size it by width alone. */
.app-brand {
  display: flex;
  align-items: center;
  min-height: 4.75rem;
}

.app-brand > a,
.app-brand-sm > a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.app-brand-logo-full {
  display: block !important;
  width: min(100%, 13.5rem) !important;
  height: auto !important;
  max-height: 3.75rem;
}

.app-brand-logo-compact,
.app-brand-logo-mobile {
  width: 2.75rem !important;
  height: 2.75rem !important;
  max-width: 2.75rem !important;
  max-height: 2.75rem !important;
  object-fit: contain;
}

.app-brand-sm {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  margin-right: .75rem;
}

.app-brand-sm .app-brand-logo-mobile {
  display: block !important;
}

@media (max-width: 991.98px) {
  .app-brand-sm {
    display: inline-flex !important;
  }
}

.auth-shell {
  display: flex;
  width: min(100%, 25rem);
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .25rem;
}

.auth-brand img {
  display: block;
  width: min(100%, 16.5rem);
  height: auto;
}

@media (max-width: 767.98px) {
  .app-brand-sm {
    width: 2.5rem;
    height: 2.5rem;
    flex-basis: 2.5rem;
    margin-right: .5rem;
  }

  .app-brand-logo-mobile {
    width: 2.5rem !important;
    height: 2.5rem !important;
    max-width: 2.5rem !important;
    max-height: 2.5rem !important;
  }
}

/* Keep the application header in the document flow while the page scrolls. */
.app-header {
  position: relative !important;
  top: auto !important;
}

/* Shared filter layout used by list and report screens. */
.filter-card {
  margin-bottom: 1.5rem !important;
}

.filter-card .card-header {
  padding-bottom: 0.5rem;
}

.filter-card .card-body {
  padding-top: 0.75rem;
}

.filter-form {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem !important;
  margin: 0;
}

.filter-form--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-form--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.filter-form--one {
  grid-template-columns: minmax(0, 1fr);
}

.filter-field {
  min-width: 0;
  width: auto !important;
  padding: 0 !important;
}

.filter-field .form-label {
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.filter-actions {
  grid-column: 1 / -1;
  min-height: 2.375rem;
  padding: 0 !important;
}

.filter-actions .btn {
  min-width: 7rem;
}

.async-task-processing {
  min-width: 9.5rem;
  color: #fff !important;
  background: #5387e4 !important;
  border-color: #5387e4 !important;
  opacity: 1 !important;
  cursor: wait !important;
}

.async-task-processing .spinner-border {
  color: #fff;
  border-width: 0.16em;
}

/* Group selector: give the page a useful visual focal point instead of a
   single narrow Bootstrap column. */
.groups-page-heading {
  padding: 1.25rem 1.35rem;
}

.groups-eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--bs-primary, #5387e4);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.groups-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.groups-section-heading h5 {
  color: #182235;
  font-weight: 600;
}

.groups-count {
  padding: 0.35rem 0.7rem;
  color: #52627b;
  background: #eaf0fb;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.25rem;
}

.group-card {
  overflow: hidden;
  border: 1px solid #e2e8f2;
  border-radius: 0.9rem;
  box-shadow: 0 0.35rem 1.2rem rgba(34, 58, 94, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.group-card:hover {
  border-color: #b9ccef;
  box-shadow: 0 0.7rem 1.7rem rgba(34, 58, 94, 0.1);
  transform: translateY(-2px);
}

.group-card-active {
  border-color: #8eb0f1;
  box-shadow: 0 0.55rem 1.5rem rgba(83, 135, 228, 0.13);
}

.group-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
}

.group-card-mark {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #5d86e9, #6b67d8);
  border-radius: 0.8rem;
  box-shadow: 0 0.45rem 0.9rem rgba(83, 135, 228, 0.2);
  font-size: 1.1rem;
}

.group-active-label {
  padding: 0.35rem 0.6rem;
  color: #16805d;
  background: #def7ed;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.group-card-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 1rem 1.25rem 0;
}

.group-card-heading h5 {
  width: 100%;
  color: #182235;
  font-size: 1.05rem;
  font-weight: 650;
}

.group-card-body {
  display: flex;
  flex-direction: column;
  min-height: 9.5rem;
  padding: 0.8rem 1.25rem 1.25rem;
}

.group-card-description {
  min-height: 3rem;
  line-height: 1.55;
}

.group-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
}

.group-card-status {
  margin-right: auto;
  color: #16805d;
  font-size: 0.72rem;
  font-weight: 600;
}

.group-card-footer {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #71809a;
  background: #f8faff;
  border-top: 1px solid #edf1f7;
  font-size: 0.72rem;
}

.sidebar-menu .coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  color: #5b4bb7;
  background: linear-gradient(135deg, #eeeaff, #e2f3ff);
  border: 1px solid #d8d0ff;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-menu .coming-soon-badge i {
  font-size: 0.68rem;
}

.sidebar-menu .sidebar-notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.65rem;
  line-height: 1;
}

.sidebar-menu .sidebar-notification-badge[hidden] {
  display: none !important;
}

.chart-type-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem 0.3rem 0.65rem;
  background: var(--bs-light, #f8f9fa);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.75rem;
  box-shadow: 0 0.15rem 0.5rem rgba(31, 45, 61, 0.06);
}

.chart-type-control label {
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.chart-type-selector {
  width: auto;
  min-width: 7.25rem;
  border-color: transparent;
  background-color: var(--bs-white, #fff);
  box-shadow: none;
  font-weight: 500;
}

.chart-type-selector:focus {
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.account-color-field .form-control-color,
.category-color-field .form-control-color {
  width: 100%;
  height: 38px;
}

.pagination-wrap {
  min-width: 0;
}

.pagination-wrap .pagination {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.pagination-wrap .page-link {
  min-width: 2.25rem;
  text-align: center;
}

.pagination-icon {
  display: none;
}

@media (max-width: 575.98px) {
  .scgpf-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.5rem 1rem;
  }

  .scgpf-footer-brand,
  .scgpf-footer-meta {
    min-width: 0;
  }

  .scgpf-footer-center {
    padding-left: 2.7rem;
  }

  .scgpf-footer-meta {
    justify-content: flex-start;
    padding-left: 2.7rem;
  }

  .page-heading {
    align-items: stretch !important;
  }

  .page-heading > div,
  .page-heading > a,
  .page-heading > .btn {
    width: 100%;
  }

  .groups-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .groups-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions .btn-secondary {
    width: auto;
  }

  .filter-actions {
    justify-content: stretch !important;
  }

  .filter-actions .btn {
    flex: 1;
  }

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

  .filter-form--one {
    grid-template-columns: 1fr;
  }

  .filter-field {
    grid-column: span 1;
  }

  .chart-type-selector {
    width: 100%;
  }

  .chart-type-control {
    width: 100%;
  }

  .pagination-wrap {
    justify-content: center !important;
  }

  .pagination-wrap .pagination {
    justify-content: center;
    max-width: 100%;
  }

  .pagination-wrap .pagination-label {
    display: none;
  }

  .pagination-wrap .pagination-icon {
    display: inline;
    font-size: 1.25rem;
    line-height: 1;
  }
}

@media (max-width: 575.98px) {
  .filter-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 576px) and (max-width: 1199.98px) {
  .filter-form--five {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* AI chat workspace */
.chat-header-credit { display: flex; align-items: center; gap: .55rem; margin-left: auto; padding: .35rem .55rem .35rem .4rem; color: inherit; background: #f7f6ff; border: 1px solid #e4e1ff; border-radius: .7rem; text-decoration: none; transition: border-color .2s, background .2s, transform .2s; }
.chat-header-credit:hover { color: inherit; background: #f1efff; border-color: #cfc9ff; transform: translateY(-1px); }
.chat-header-credit-icon { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; color: #fff; background: var(--chat-purple); border-radius: .5rem; font-size: .72rem; }
.chat-header-credit > span:nth-child(2) { display: flex; flex-direction: column; gap: .12rem; }
.chat-header-credit-label { color: #8994a8; font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.chat-header-credit strong { color: var(--chat-purple); font-size: .8rem; line-height: 1; }
.chat-header-credit-arrow { margin-left: .15rem; color: var(--chat-purple); font-size: .65rem; }
.ai-summary-heading { display: flex; align-items: center; gap: .65rem; }
.ai-summary-heading small { color: #8794aa; font-size: .7rem; }
.ai-summary-icon { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; color: #fff; background: #5387e4; border-radius: .5rem; font-size: .8rem; }
.ai-summary-lead { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .65rem .8rem; color: #526582; background: #f5f8fe; border: 1px solid #e5ebf6; border-radius: .5rem; font-size: .78rem; }
.ai-summary-lead i { color: #5387e4; }
.ai-summary-content { color: #344765; font-size: .88rem; line-height: 1.6; }
.ai-summary-content h1, .ai-summary-content h2, .ai-summary-content h3 { color: #263b61; margin-top: 1.25rem; margin-bottom: .45rem; font-weight: 700; }
.ai-summary-content h1 { font-size: 1.3rem; }
.ai-summary-content h2 { font-size: 1.08rem; }
.ai-summary-content h3 { font-size: .95rem; }
.ai-summary-content h1:first-child, .ai-summary-content h2:first-child { margin-top: 0; }
.ai-summary-content p { margin-bottom: .55rem; }
.ai-summary-content ul, .ai-summary-content ol { margin-bottom: .75rem; padding-left: 1.25rem; }
.ai-summary-content li { margin-bottom: .2rem; }
.ai-summary-content table { width: 100%; margin: .75rem 0; border-collapse: collapse; }
.ai-summary-content th, .ai-summary-content td { padding: .45rem .6rem; border-bottom: 1px solid #e7ebf3; text-align: left; }
.ai-summary-content th { color: #526582; font-size: .75rem; text-transform: uppercase; }
.ai-summary-content blockquote { margin: .75rem 0; padding: .65rem .9rem; color: #53657f; background: #f7f9fd; border-left: 3px solid #6758d9; }
.ai-summary-empty { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; background: #f8faff; border-radius: .5rem; }
.ai-summary-empty i { color: #6758d9; font-size: 1.1rem; }
.scgpf-chat-sidebar > a { display: flex; align-items: center; }
.scgpf-chat-sidebar > a > .badge { flex: 0 0 auto; font-size: .62rem; line-height: 1.2; }
.chat-page { --chat-ink: #172238; --chat-muted: #71809a; --chat-line: #e7ebf3; --chat-purple: #6758d9; width: 100%; }
.chat-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.chat-eyebrow, .chat-panel-label { color: var(--chat-purple); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.chat-eyebrow i { margin-right: .3rem; }
.chat-intro h1 { margin: .35rem 0 .25rem; color: var(--chat-ink); font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -.04em; }
.chat-intro p { margin: 0; color: var(--chat-muted); font-size: .9rem; }
.chat-intro p strong { color: var(--chat-ink); }
.chat-new-btn { padding: .7rem 1rem; color: #fff; background: var(--chat-ink); border: 0; border-radius: .7rem; font-size: .82rem; font-weight: 700; box-shadow: 0 .5rem 1.2rem rgba(23,34,56,.15); }
.chat-new-btn:hover { color: #fff; background: #283653; transform: translateY(-1px); }
.chat-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 620px; overflow: hidden; background: #fff; border: 1px solid var(--chat-line); border-radius: 1rem; box-shadow: 0 1rem 3rem rgba(31,45,61,.08); }
.chat-history-toggle, .chat-drawer-close, .chat-drawer-backdrop { display: none; }
.chat-sessions { display: flex; flex-direction: column; padding: 1.35rem .85rem .85rem; background: #f8f9fc; border-right: 1px solid var(--chat-line); }
.chat-sessions-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 .55rem 1rem; }
.chat-sessions h2 { margin: .2rem 0 0; color: var(--chat-ink); font-size: 1rem; font-weight: 700; }
.chat-session-count { display: grid; width: 1.5rem; height: 1.5rem; place-items: center; color: var(--chat-purple); background: #ebe9ff; border-radius: 50%; font-size: .68rem; font-weight: 800; }
.chat-session-list { display: flex; flex-direction: column; gap: .25rem; }
.chat-session-item { display: flex; align-items: center; gap: .65rem; padding: .7rem .55rem; color: var(--chat-muted); border-radius: .7rem; text-decoration: none; }
.chat-session-item:hover { color: var(--chat-ink); background: #eef0f8; }
.chat-session-item.is-active { color: var(--chat-ink); background: #fff; box-shadow: 0 .25rem .8rem rgba(31,45,61,.07); }
.chat-session-icon { display: grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; color: var(--chat-purple); background: #eeecff; border-radius: .55rem; font-size: .8rem; }
.chat-session-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: .15rem; }
.chat-session-copy strong { overflow: hidden; color: inherit; font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chat-session-copy small { color: #9aa5b8; font-size: .65rem; }
.chat-session-arrow { color: var(--chat-purple); font-size: .7rem; }
.chat-session-empty { padding: .8rem .55rem; color: #9aa5b8; font-size: .75rem; }
.chat-privacy { display: flex; gap: .55rem; align-items: flex-start; margin-top: auto; padding: .8rem .6rem .25rem; color: #8490a5; border-top: 1px solid var(--chat-line); }
.chat-privacy > i { margin-top: .15rem; color: #35a67c; }
.chat-privacy span { display: flex; flex-direction: column; gap: .15rem; }
.chat-privacy strong { color: #59677e; font-size: .7rem; }
.chat-privacy small { font-size: .64rem; line-height: 1.35; }
.chat-window { position: relative; display: flex; min-width: 0; flex-direction: column; background: #fff; }
.chat-window-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.35rem; border-bottom: 1px solid var(--chat-line); }
.chat-agent-identity { display: flex; align-items: center; gap: .7rem; }
.chat-agent-avatar, .chat-message-avatar { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #7869e5, #4d91cf); border-radius: .7rem; box-shadow: 0 .3rem .7rem rgba(103,88,217,.2); }
.chat-agent-avatar { width: 2.35rem; height: 2.35rem; font-size: 1rem; }
.chat-agent-identity > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.chat-agent-identity strong { color: var(--chat-ink); font-size: .85rem; }
.chat-agent-identity small { color: #8a96aa; font-size: .68rem; }
.chat-agent-identity small em { color: #65728a; font-style: normal; }
.chat-agent-identity small i { color: #37b886; font-size: .45rem; vertical-align: middle; }
.chat-window-actions { display: flex; align-items: center; gap: .4rem; }
.chat-icon-btn, .chat-rename-form button { display: grid; width: 2rem; height: 2rem; place-items: center; color: #7e8aa0; background: transparent; border: 0; border-radius: .5rem; }
.chat-icon-btn:hover, .chat-rename-form button:hover { color: var(--chat-purple); background: #f0efff; }
.chat-icon-btn.is-danger:hover { color: #d95368; background: #fff0f2; }
.chat-rename-form { display: flex; gap: .1rem; }
.chat-rename-form input { width: 0; padding: 0; opacity: 0; border: 0; transition: width .2s, opacity .2s; }
.chat-rename-form:hover input, .chat-rename-form input:focus { width: 140px; padding: .25rem .5rem; opacity: 1; border: 1px solid var(--chat-line); border-radius: .4rem; font-size: .72rem; }
.chat-messages { display: flex; flex: 1; min-height: 400px; max-height: 57vh; flex-direction: column; gap: 1.25rem; overflow-y: auto; padding: 1.75rem clamp(1rem, 5vw, 4rem); background: linear-gradient(180deg, #fcfcfe 0%, #fff 100%); }
.chat-messages { overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-message-row { display: flex; align-items: flex-start; gap: .7rem; max-width: 82%; }
.chat-message-row.is-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-message-avatar { width: 1.8rem; height: 1.8rem; flex: 0 0 1.8rem; font-size: .72rem; }
.chat-message-row.is-user .chat-message-avatar { color: #5b6a83; background: #e9edf4; box-shadow: none; }
.chat-bubble { padding: .8rem 1rem; color: #334057; background: #fff; border: 1px solid var(--chat-line); border-radius: .25rem 1rem 1rem 1rem; box-shadow: 0 .25rem .8rem rgba(31,45,61,.04); font-size: .84rem; line-height: 1.65; }
.chat-message-row.is-user .chat-bubble { color: #fff; background: var(--chat-ink); border: 0; border-radius: 1rem .25rem 1rem 1rem; box-shadow: 0 .35rem .8rem rgba(23,34,56,.13); }
.chat-bubble.is-loading { padding: .75rem .95rem; }
.chat-thinking { display: flex; align-items: center; gap: .25rem; color: #8b96a9; white-space: nowrap; }
.chat-thinking span { width: .38rem; height: .38rem; background: var(--chat-purple); border-radius: 50%; animation: chat-pulse 1.1s infinite ease-in-out; }
.chat-thinking span:nth-child(2) { animation-delay: .15s; }
.chat-thinking span:nth-child(3) { animation-delay: .3s; }
.chat-thinking em { margin-left: .35rem; color: #8995a8; font-size: .72rem; font-style: normal; }
@keyframes chat-pulse { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-.18rem); } }
.chat-markdown p:last-child { margin-bottom: 0; }
.chat-markdown pre, .chat-markdown table { max-width: 100%; overflow-x: auto; }
.chat-markdown pre { padding: .75rem; white-space: pre; }
.chat-markdown table { display: block; width: max-content; min-width: 100%; }
.chat-welcome { max-width: 550px; margin: auto; text-align: center; }
.chat-welcome-icon { display: grid; width: 3.25rem; height: 3.25rem; margin: 0 auto 1rem; place-items: center; color: #fff; background: linear-gradient(145deg, #796ae8, #4d91cf); border-radius: 1rem; box-shadow: 0 .7rem 1.5rem rgba(103,88,217,.22); font-size: 1.3rem; }
.chat-welcome h2 { margin: .35rem 0 .4rem; color: var(--chat-ink); font-size: 1.45rem; letter-spacing: -.03em; }
.chat-welcome p { margin: 0 0 1.25rem; color: var(--chat-muted); font-size: .82rem; }
.chat-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.chat-suggestions button { padding: .5rem .75rem; color: #586681; background: #fff; border: 1px solid var(--chat-line); border-radius: 999px; font-size: .72rem; }
.chat-suggestions button:hover { color: var(--chat-purple); border-color: #c9c4ff; background: #f7f6ff; }
.chat-composer { padding: 1rem clamp(1rem, 5vw, 4rem) 1.15rem; border-top: 1px solid var(--chat-line); }
.chat-input-wrap { display: flex; align-items: flex-end; gap: .6rem; padding: .5rem .5rem .5rem .9rem; background: #f7f8fb; border: 1px solid #e1e5ef; border-radius: .8rem; transition: border-color .2s, box-shadow .2s; }
.chat-input-wrap:focus-within { background: #fff; border-color: #aba4ef; box-shadow: 0 0 0 .2rem rgba(103,88,217,.1); }
.chat-input-wrap textarea { width: 100%; resize: none; color: var(--chat-ink); background: transparent; border: 0; outline: 0; font-size: .84rem; line-height: 1.5; }
.chat-input-wrap textarea::placeholder { color: #9aa5b7; }
.chat-input-wrap button { display: grid; width: 2.15rem; height: 2.15rem; flex: 0 0 2.15rem; place-items: center; color: #fff; background: var(--chat-purple); border: 0; border-radius: .6rem; box-shadow: 0 .3rem .6rem rgba(103,88,217,.25); }
.chat-input-wrap button:hover { background: #5547c4; }
.chat-input-wrap button:disabled { opacity: .55; }
.chat-composer > small { display: block; margin: .55rem .2rem 0; color: #9aa5b7; font-size: .64rem; }
.chat-composer > small i { color: #36a77e; margin-right: .2rem; }
.chat-composer > small span { margin: 0 .3rem; }
.chat-shortcut { color: #9aa5b7; }
.chat-latest-button { position: absolute; right: 1rem; bottom: .8rem; z-index: 2; padding: .55rem .75rem; color: var(--chat-purple); background: #fff; border: 1px solid #dcd9ff; border-radius: 999px; box-shadow: 0 .35rem .9rem rgba(31,45,61,.12); font-size: .72rem; font-weight: 700; }
.chat-messages-wrap { position: relative; min-height: 0; display: flex; flex: 1; }

/* Credit usage dashboard */
.credit-dashboard { --credit-ink: #172238; --credit-muted: #71809a; --credit-line: #e7ebf3; --credit-purple: #6758d9; }
.credit-dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.credit-dashboard-actions { display: flex; align-items: center; gap: .65rem; }
.credit-period { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .7rem; color: #71809a; background: #fff; border: 1px solid var(--credit-line); border-radius: .65rem; font-size: .68rem; }
.credit-dashboard-eyebrow { color: var(--credit-purple); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.credit-dashboard-heading h1 { margin: .35rem 0 .25rem; color: var(--credit-ink); font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.04em; }
.credit-dashboard-heading p { margin: 0; color: var(--credit-muted); font-size: .82rem; }
.credit-back-btn { color: var(--credit-ink); background: #fff; border: 1px solid var(--credit-line); border-radius: .65rem; font-size: .75rem; font-weight: 700; }
.credit-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: .8rem; }
.credit-kpi { display: flex; align-items: center; gap: .75rem; min-height: 6.4rem; padding: 1rem; background: #fff; border: 1px solid var(--credit-line); border-radius: .85rem; box-shadow: 0 .35rem 1rem rgba(31,45,61,.04); }
.credit-kpi-primary { background: linear-gradient(135deg, #f4f2ff, #fff); border-color: #dfdcff; }
.credit-kpi-icon { position: relative; display: inline-flex; width: 2.65rem; height: 2.65rem; flex: 0 0 2.65rem; align-items: center; justify-content: center; margin: 0; padding: 0; color: #526685; border: 0; border-radius: 50%; line-height: 1; text-align: center; }
.credit-kpi-icon i { position: absolute; top: 50%; left: 50%; display: block; width: auto; height: auto; margin: 0; padding: 0; font-size: 1rem; line-height: 1; transform: translate(-50%, -50%); }
.credit-kpi-icon i::before { display: block; margin: 0; line-height: 1; vertical-align: middle; }
.credit-kpi:nth-child(1) .credit-kpi-icon { color: #526fa5; background: #e4edff; }
.credit-kpi:nth-child(2) .credit-kpi-icon { color: #348a78; background: #dcf7ef; }
.credit-kpi:nth-child(3) .credit-kpi-icon { color: #ba695e; background: #fff0ed; }
.credit-kpi:nth-child(4) .credit-kpi-icon { color: #4382a1; background: #e1f3ff; }
.credit-kpi small, .credit-kpi span { display: block; color: #8994a8; font-size: .65rem; }
.credit-kpi strong { display: block; margin: .12rem 0; color: var(--credit-ink); font-size: 1.35rem; line-height: 1.1; }
.credit-kpi strong em { color: #9aa5b7; font-size: .72rem; font-style: normal; font-weight: 600; }
.credit-analytics-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 1fr); gap: .8rem; margin-bottom: .8rem; }
.credit-panel { padding: 1.1rem 1.2rem; background: #fff; border: 1px solid var(--credit-line); border-radius: .85rem; box-shadow: 0 .35rem 1rem rgba(31,45,61,.04); }
.credit-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.credit-panel h2 { margin: 0; color: var(--credit-ink); font-size: .9rem; }
.credit-panel p { margin: .2rem 0 0; color: #9aa5b7; font-size: .68rem; }
.credit-panel-total { padding: .3rem .55rem; color: var(--credit-purple); background: #f4f2ff; border-radius: 999px; font-size: .65rem; font-weight: 700; }
.credit-line-chart { width: 100%; min-height: 15.5rem; padding-top: .35rem; }
.credit-status-list { display: flex; flex-direction: column; gap: 1rem; padding-top: .35rem; }
.credit-status-row { display: grid; grid-template-columns: 1fr auto; gap: .35rem .7rem; align-items: center; color: #65728a; font-size: .72rem; }
.credit-status-row > span { display: flex; align-items: center; gap: .4rem; }
.credit-status-row strong { color: var(--credit-ink); font-size: .78rem; }
.credit-status-dot { width: .45rem; height: .45rem; border-radius: 50%; }
.credit-status-dot.is-consumed { background: #6758d9; }.credit-status-dot.is-refunded { background: #e5a84b; }.credit-status-dot.is-rejected { background: #d95368; }
.credit-status-track { grid-column: 1 / -1; height: .35rem; background: #f0f2f6; border-radius: 999px; overflow: hidden; }
.credit-status-track i { display: block; height: 100%; border-radius: inherit; }.credit-status-track i.is-consumed { background: #6758d9; }.credit-status-track i.is-refunded { background: #e5a84b; }.credit-status-track i.is-rejected { background: #d95368; }
.credit-history-panel { padding: 1.1rem 0 0; overflow: hidden; }.credit-history-panel .credit-panel-heading { padding: 0 1.2rem; }
.credit-history-count { color: #8994a8; font-size: .68rem; }
.credit-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem 1rem; border-top: 1px solid #edf0f5; }.credit-pagination-summary { color: #8994a8; font-size: .68rem; }.credit-pagination .pagination { display: flex; gap: .25rem; }.credit-pagination .page-link { display: grid; width: 1.9rem; height: 1.9rem; place-items: center; color: var(--credit-purple); background: #f4f2ff; border: 1px solid #e4e1ff; border-radius: .45rem; font-size: .7rem; text-decoration: none; }.credit-pagination .page-link:hover { background: #ebe9ff; }.credit-pagination .page-link.is-disabled { color: #b8bfcc; background: #f7f8fa; border-color: #edf0f5; cursor: default; }
.credit-history-panel .table { font-size: .75rem; }.credit-history-panel thead th { color: #6b7890; background: #f5f6fa; border: 0; font-size: .65rem; font-weight: 700; text-transform: uppercase; }.credit-history-panel tbody td { color: #334057; border-color: #edf0f5; }.credit-history-status { padding: .25rem .45rem; border-radius: 999px; font-size: .62rem; font-weight: 700; }.credit-history-status.is-consumed { color: #347d62; background: #e8f7f0; }.credit-history-status.is-refunded { color: #9c6c1d; background: #fff5de; }.credit-history-status.is-rejected { color: #ae4052; background: #fff0f2; }

@media (max-width: 767.98px) {
  .chat-page { width: calc(100vw - 1.5rem); max-width: 100%; }
  .chat-header-credit { gap: .35rem; }
  .chat-header-credit-label { font-size: .56rem; }
  .chat-header-credit { padding: .25rem .4rem .25rem .3rem; }
  .chat-header-credit-icon { width: 1.5rem; height: 1.5rem; }
  .chat-header-credit strong { font-size: .7rem; }
  .chat-intro { align-items: stretch; flex-direction: column; }
  .chat-intro p { max-width: 35rem; }
  .chat-new-btn { width: auto; align-self: flex-start; }
  .chat-layout { position: relative; display: flex; height: calc(100dvh - 7.5rem); min-height: 31rem; flex-direction: column; overflow: hidden; border-radius: .8rem; }
  .chat-history-toggle { display: inline-flex; position: absolute; top: .7rem; left: .7rem; z-index: 3; align-items: center; gap: .35rem; min-height: 44px; padding: .5rem .7rem; color: var(--chat-purple); background: #f5f4ff; border: 1px solid #dfdcff; border-radius: .6rem; font-size: .75rem; font-weight: 700; }
  .chat-sessions { position: absolute; inset: 0 auto 0 0; z-index: 5; display: flex; width: min(84vw, 20rem); max-height: none; padding: 1rem .85rem; transform: translateX(-105%); transition: transform .2s ease; border-right: 1px solid var(--chat-line); border-bottom: 0; box-shadow: 1rem 0 2rem rgba(23,34,56,.12); }
  .chat-layout.is-history-open .chat-sessions { transform: translateX(0); }
  .chat-layout.is-history-open .chat-drawer-backdrop { display: block; position: absolute; inset: 0; z-index: 4; background: rgba(23,34,56,.35); }
  .chat-sessions-heading { align-items: center; }
  .chat-drawer-close { display: inline-grid; width: 44px; height: 44px; margin-left: auto; place-items: center; color: var(--chat-muted); background: transparent; border: 0; font-size: 1rem; }
  .chat-sessions-heading .chat-session-count { order: 3; }
  .chat-session-list { max-height: none; overflow-y: auto; }
  .chat-privacy { display: flex; }
  .chat-window { min-height: 0; flex: 1; }
  .chat-window-header { min-height: 4.2rem; padding: .7rem .75rem .7rem 5.5rem; }
  .chat-agent-avatar { width: 2rem; height: 2rem; }
  .chat-window-actions { gap: .1rem; }
  .chat-messages { min-height: 0; max-height: none; padding: 1rem .7rem; }
  .chat-message-row { max-width: 94%; }
  .chat-bubble { max-width: calc(100vw - 5rem); overflow-wrap: anywhere; }
  .chat-composer { position: sticky; bottom: 0; z-index: 2; padding: .65rem .7rem calc(.65rem + env(safe-area-inset-bottom)); background: #fff; }
  .chat-composer > small { line-height: 1.35; }
  .chat-shortcut { display: none; }
  .chat-rename-form input { display: none; }
  .credit-dashboard-heading { align-items: stretch; flex-direction: column; }
  .credit-back-btn { align-self: flex-start; }
  .credit-kpis { grid-template-columns: repeat(2, 1fr); }
  .credit-analytics-grid { grid-template-columns: 1fr; }
  .credit-dashboard-actions { align-items: flex-start; flex-direction: column; }
  .credit-period { font-size: .64rem; }
  .credit-history-panel .credit-panel-heading { align-items: flex-start; flex-direction: column; }
  .credit-pagination { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 767.98px) and (orientation: landscape) {
  .chat-layout { height: calc(100dvh - 3.5rem); min-height: 20rem; }
  .chat-intro { display: none; }
  .chat-messages { padding-top: .65rem; padding-bottom: .65rem; }
  .chat-composer { padding-top: .4rem; }
}

/* Transaction form: keep the primary task focused on a readable measure. */
.transaction-form-shell { max-width: none; }
.record-form-shell { max-width: none; }
.transaction-form-card { overflow: hidden; border: 1px solid #e4e9f2; box-shadow: 0 1rem 2.5rem rgba(35, 52, 82, .07); }
.record-form-card { overflow: hidden; border: 1px solid #e4e9f2; border-radius: .8rem; box-shadow: 0 1rem 2.5rem rgba(35, 52, 82, .07); }
.transaction-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem; background: linear-gradient(135deg, #f8faff 0%, #fff 72%); border-bottom: 1px solid #e8edf5; }
.record-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem; background: linear-gradient(135deg, #f8faff 0%, #fff 72%); border-bottom: 1px solid #e8edf5; }
.transaction-form-header .card-title { color: #1f2d45; font-size: 1.1rem; }
.record-form-header .card-title { color: #1f2d45; font-size: 1.1rem; }
.transaction-form-subtitle { margin: .35rem 0 0; color: #71809a; font-size: .82rem; }
.record-form-subtitle { margin: .35rem 0 0; color: #71809a; font-size: .82rem; }
.transaction-form-step { flex: 0 0 auto; padding: .4rem .65rem; color: #3c6fc5; background: #edf4ff; border: 1px solid #dce9ff; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.record-form-step { flex: 0 0 auto; padding: .4rem .65rem; color: #3c6fc5; background: #edf4ff; border: 1px solid #dce9ff; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.transaction-form-body { padding: 1.5rem; }
.record-form-body { padding: 1.5rem; }
.record-form-body .form-label { color: #34445d; font-size: .78rem; font-weight: 600; }
.record-form-body .form-control, .record-form-body .form-select { min-height: 2.55rem; border-color: #d8e0ed; border-radius: .5rem; font-size: .84rem; }
.record-form-body .form-control:focus, .record-form-body .form-select:focus { border-color: #6c9be8; box-shadow: 0 0 0 .2rem rgba(83, 135, 228, .12); }
.record-form-body .form-text { color: #8190a7; font-size: .72rem; }
.record-form-body .btn-primary { padding-inline: 1.25rem; }
.transaction-form-section { padding: 0 0 1.35rem; margin-bottom: 1.35rem; border-bottom: 1px solid #edf0f5; }
.transaction-card-section { padding: 1.15rem; background: #f8faff; border: 1px solid #e4ecfb; border-radius: .8rem; }
.transaction-section-heading { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: 1rem; }
.transaction-section-heading h6 { margin: .05rem 0 .2rem; color: #253550; font-size: .9rem; font-weight: 700; }
.transaction-section-heading p { margin: 0; color: #8190a7; font-size: .75rem; }
.transaction-section-index { display: grid; width: 1.65rem; height: 1.65rem; flex: 0 0 auto; place-items: center; color: #356dca; background: #e8f0ff; border-radius: .5rem; font-size: .67rem; font-weight: 800; }
.transaction-form-body .form-label { color: #34445d; font-size: .78rem; font-weight: 600; }
.transaction-form-body .form-control, .transaction-form-body .form-select { min-height: 2.55rem; border-color: #d8e0ed; border-radius: .5rem; font-size: .84rem; }
.transaction-form-body .form-control:focus, .transaction-form-body .form-select:focus { border-color: #6c9be8; box-shadow: 0 0 0 .2rem rgba(83, 135, 228, .12); }
.transaction-form-body .form-text { color: #8190a7; font-size: .72rem; }
.transaction-form-body #purchase-mode-field, .transaction-form-body #installment-count-field { margin-top: .25rem; padding: .8rem; background: rgba(255, 255, 255, .8); border: 1px solid #e1e9f7; border-radius: .65rem; }
.transaction-form-body #purchase-mode-field .btn, .transaction-form-body #expense-mode-field .btn { min-height: 2.45rem; font-size: .78rem; font-weight: 600; }
.transaction-form-body #installment-summary { margin-bottom: 0; color: #3c628f; background: #edf5ff; border-color: #d6e8ff; font-size: .75rem; }
.transaction-form-body #transfer-field { padding: 1rem; background: #fffaf1; border: 1px solid #f5e7c9; border-radius: .7rem; }
.transaction-form-footer-section { padding-top: .15rem; }
.transaction-form-footer-section .form-check { padding: .75rem .85rem .75rem 2.35rem; background: #fafbfd; border: 1px solid #edf0f5; border-radius: .55rem; }
.transaction-form-body .btn-primary { padding-inline: 1.25rem; }
.retroactive-confirmation { color: #76591f; background: #fff8e7; border-color: #f2dfaa; }
.retroactive-confirmation strong { color: #5d471b; }
.retroactive-confirmation p { font-size: .78rem; line-height: 1.5; }
.retroactive-confirmation .form-check-label { color: #5d471b; font-size: .78rem; font-weight: 600; }

@media (max-width: 575.98px) {
  .transaction-form-header { padding: 1rem; }
  .record-form-header { padding: 1rem; }
  .transaction-form-step { display: none; }
  .record-form-step { display: none; }
  .transaction-form-body { padding: 1rem; }
  .record-form-body { padding: 1rem; }
  .transaction-form-section { padding-bottom: 1rem; margin-bottom: 1rem; }
  .transaction-card-section { padding: .85rem; }
  .transaction-section-heading p { line-height: 1.35; }
}

/* Transaction detail: a deliberate reading order for the movement and its
   related records. */
.transaction-detail-page { width: 100%; }
.transaction-detail-card { overflow: hidden; background: #fff; border: 1px solid #e3e9f2; border-radius: 1rem; box-shadow: 0 1rem 2.5rem rgba(35, 52, 82, .07); }
.transaction-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.6rem 1.8rem; color: #fff; background: linear-gradient(120deg, #1d2d4a 0%, #29466d 62%, #3d6da4 100%); }
.transaction-detail-heading { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.transaction-detail-icon { display: grid; width: 3rem; height: 3rem; flex: 0 0 3rem; place-items: center; color: #dbe9ff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); border-radius: .8rem; font-size: 1.25rem; }
.transaction-detail-kicker { display: block; color: #7b8ba4; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.transaction-detail-hero .transaction-detail-kicker { color: #b8c9e4; }
.transaction-detail-hero h1 { margin: .25rem 0 .2rem; color: #fff; font-size: clamp(1.15rem, 2vw, 1.45rem); letter-spacing: -.025em; }
.transaction-detail-hero p { margin: 0; color: #c1d0e5; font-size: .76rem; }
.transaction-detail-actions { display: flex; align-items: center; flex: 0 0 auto; gap: .7rem; }
.transaction-status { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .65rem; border-radius: 999px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.transaction-installment-badge { display: inline-flex; align-items: center; padding: .4rem .65rem; color: #dceaff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.transaction-status--paid { color: #246d58; background: #dff6ec; }.transaction-status--pending { color: #91651d; background: #fff0c9; }
.transaction-detail-hero .transaction-status--paid { color: #d9f8eb; background: rgba(60, 190, 145, .2); }.transaction-detail-hero .transaction-status--pending { color: #ffe7a9; background: rgba(232, 177, 64, .2); }
.transaction-detail-body { padding: 1.5rem 1.8rem 1.7rem; }
.transaction-overview { display: grid; grid-template-columns: minmax(15rem, .85fr) minmax(0, 1.7fr); gap: 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid #edf0f5; }
.transaction-amount-card { display: flex; min-height: 8.5rem; flex-direction: column; justify-content: center; padding: 1.25rem 1.4rem; color: #fff; background: linear-gradient(145deg, #345e96, #263e65); border-radius: .8rem; box-shadow: 0 .55rem 1.2rem rgba(39, 70, 110, .16); }
.transaction-amount-card--income { background: linear-gradient(145deg, #287d69, #205b59); }.transaction-amount-card--expense { background: linear-gradient(145deg, #a64e52, #743947); }
.transaction-section-label, .transaction-amount-card > span:last-child { color: rgba(255, 255, 255, .7); font-size: .68rem; }.transaction-amount-card strong { margin: .45rem 0 .6rem; font-size: 1.75rem; letter-spacing: -.04em; line-height: 1; }
.transaction-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: .15rem 0; }.transaction-fact { padding: .8rem .95rem; background: #f8faff; border: 1px solid #edf1f7; border-radius: .65rem; }.transaction-fact span { display: block; margin-bottom: .3rem; color: #8390a5; font-size: .66rem; }.transaction-fact strong { display: block; overflow: hidden; color: #263852; font-size: .8rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.transaction-detail-section { padding: 1.5rem 0; border-bottom: 1px solid #edf0f5; }.transaction-detail-section:last-child { border-bottom: 0; padding-bottom: .3rem; }.transaction-section-heading { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }.transaction-section-heading-icon { display: grid; width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; place-items: center; color: #356dca; background: #eaf2ff; border-radius: .65rem; font-size: .95rem; }.transaction-section-heading h2 { margin: .15rem 0 .15rem; color: #263852; font-size: .98rem; font-weight: 700; }.transaction-section-heading p { margin: 0; color: #8390a5; font-size: .72rem; }.transaction-section-heading-actions { display: flex; align-items: center; gap: .45rem; margin-left: auto; }
.installment-section { padding: 1.35rem; margin-top: 1.5rem; background: #fbfcff; border: 1px solid #e4ebf7; border-radius: .8rem; }.installment-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }.installment-summary > div { padding: .75rem .9rem; background: #fff; border: 1px solid #e8edf5; border-radius: .55rem; }.installment-summary span { display: block; margin-bottom: .25rem; color: #8390a5; font-size: .65rem; }.installment-summary strong { color: #2e476b; font-size: .86rem; }.transaction-table-wrap { border: 1px solid #e7ecf4; border-radius: .6rem; }.transaction-installment-table { font-size: .75rem; }.transaction-installment-table thead th { padding: .7rem .8rem; color: #70809a; background: #f3f6fb; border-bottom: 1px solid #e3e9f2; font-size: .63rem; font-weight: 800; text-transform: uppercase; }.transaction-installment-table tbody td { padding: .72rem .8rem; color: #40516b; border-color: #edf0f5; }.transaction-installment-table tbody tr:last-child td { border-bottom: 0; }.transaction-installment-table .table-active td { color: #294f8b; background: #f1f6ff; }.current-installment { display: inline-block; margin-left: .4rem; padding: .18rem .4rem; color: #356dca; background: #dceaff; border-radius: 999px; font-size: .58rem; font-weight: 700; }.invoice-status { padding: .25rem .45rem; color: #8b651e; background: #fff3d2; border-radius: 999px; font-size: .62rem; font-weight: 700; }.invoice-status--paid { color: #27745d; background: #e1f7ed; }.invoice-status--future { color: #6f7f96; background: #edf1f6; }.table-action { color: #356dca; font-size: .7rem; font-weight: 700; text-decoration: none; }.table-action:hover { color: #1f4d9a; }.transaction-attachments-section { padding-bottom: 0; }.transaction-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.8rem; background: #fafbfd; border-top: 1px solid #edf0f5; }.transaction-footer-note { color: #8794a8; font-size: .68rem; }
@media (max-width: 767.98px) { .transaction-detail-hero { align-items: flex-start; flex-direction: column; padding: 1.25rem; }.transaction-detail-actions { width: 100%; justify-content: space-between; }.transaction-detail-body { padding: 1rem; }.transaction-overview { grid-template-columns: 1fr; }.transaction-fact-grid { grid-template-columns: 1fr 1fr; }.transaction-section-heading { align-items: flex-start; flex-wrap: wrap; }.transaction-section-heading-actions { width: 100%; margin-left: 3rem; }.installment-section { padding: 1rem; margin-top: 1rem; }.installment-summary { grid-template-columns: 1fr; }.transaction-detail-footer { align-items: stretch; flex-direction: column; padding: 1rem; }.transaction-footer-note { text-align: center; } }
@media (max-width: 575.98px) { .transaction-detail-heading { align-items: flex-start; }.transaction-detail-icon { width: 2.5rem; height: 2.5rem; flex-basis: 2.5rem; }.transaction-fact-grid { grid-template-columns: 1fr; }.transaction-section-heading-actions { margin-left: 0; }.transaction-section-heading-actions .btn { flex: 1; }.transaction-installment-table { min-width: 38rem; }.transaction-detail-actions .btn { flex: 1; } }

/* Destructive purchase confirmation: keep the transaction layout language while
   making the scope and consequences of the action explicit. */
.purchase-delete-page { width: 100%; max-width: none; margin: 0; }
.purchase-delete-card { overflow: hidden; background: #fff; border: 1px solid #e5e9f1; border-radius: 1rem; box-shadow: 0 1rem 2.5rem rgba(35, 52, 82, .08); }
.purchase-delete-header { display: flex; align-items: center; gap: 1rem; padding: 1.6rem 1.8rem; color: #fff; background: linear-gradient(120deg, #1d2d4a 0%, #29466d 62%, #3d6da4 100%); }
.purchase-delete-icon { display: grid; width: 3rem; height: 3rem; flex: 0 0 3rem; place-items: center; color: #ffd9d5; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18); border-radius: .8rem; font-size: 1.2rem; }
.purchase-delete-eyebrow { color: #ffb5b0; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.purchase-delete-header h1 { margin: .25rem 0 .2rem; color: #fff; font-size: 1.3rem; letter-spacing: -.03em; }.purchase-delete-header p { margin: 0; color: #c1d0e5; font-size: .76rem; }
.purchase-delete-body { padding: 1.7rem 1.8rem 1.5rem; }.purchase-delete-purchase { display: flex; align-items: center; gap: .85rem; padding: 0 1rem 1.25rem; background: #fbfcff; border: 1px solid #e7edf7; border-radius: .75rem; }.purchase-delete-purchase-icon { display: grid; width: 2.7rem; height: 2.7rem; flex: 0 0 2.7rem; place-items: center; color: #496c9f; background: #edf3ff; border-radius: .7rem; font-size: 1.05rem; }.purchase-delete-label { color: #8491a6; font-size: .64rem; font-weight: 700; }.purchase-delete-purchase h2 { margin: .2rem 0 .1rem; color: #293b58; font-size: 1rem; }.purchase-delete-purchase p { margin: 0; color: #8290a5; font-size: .72rem; }
.purchase-delete-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; padding: 1.25rem 0; }.purchase-delete-summary > div { padding: .8rem .9rem; background: #f8faff; border: 1px solid #e8edf5; border-radius: .6rem; }.purchase-delete-summary span { display: block; margin-bottom: .3rem; color: #8491a6; font-size: .65rem; }.purchase-delete-summary strong { color: #2d456b; font-size: .9rem; }
.purchase-delete-warning { display: flex; gap: .7rem; margin-top: 1.25rem; padding: 1rem 1.1rem; color: #795d27; background: #fff8e7; border: 1px solid #f5e5b5; border-radius: .7rem; }.purchase-delete-warning > i { margin-top: .1rem; color: #d39a27; }.purchase-delete-warning strong { display: block; font-size: .76rem; }.purchase-delete-warning p { margin: .3rem 0 0; font-size: .72rem; line-height: 1.5; }.purchase-delete-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.8rem; background: #fafbfd; border-top: 1px solid #edf0f5; }.purchase-delete-question { margin: 0; color: #34445d; font-size: .82rem; font-weight: 700; }.purchase-delete-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; }.purchase-delete-actions .btn-danger { background: #d9534f; border-color: #d9534f; }.purchase-delete-actions .btn-danger:hover { background: #b94340; border-color: #b94340; }
@media (max-width: 575.98px) { .purchase-delete-header { align-items: flex-start; padding: 1.2rem; }.purchase-delete-body { padding: 1.2rem; }.purchase-delete-summary { grid-template-columns: 1fr; }.purchase-delete-footer { align-items: stretch; flex-direction: column; padding: 1rem 1.2rem; }.purchase-delete-actions { align-items: stretch; flex-direction: column-reverse; }.purchase-delete-actions .btn { width: 100%; } }
