:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 88px;
  --table-scroll-max-height: clamp(18rem, calc(100vh - 11rem), 60rem);
}

body {
  background: #f6f7f9;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 1.25rem;
  background: #18202a;
  transition: width 160ms ease, padding 160ms ease;
}

.sidebar-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 0.75rem;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand--mobile {
  font-size: 1rem;
}

.brand-logo {
  background: #fff;
  border-radius: 0.5rem;
  display: block;
  flex: 0 0 2.5rem;
  height: 2.5rem;
  max-height: 2.5rem;
  max-width: 2.5rem;
  object-fit: contain;
  padding: 0.2rem;
  width: 2.5rem;
}

.brand img {
  height: 2.5rem;
  max-height: 2.5rem;
  max-width: 2.5rem;
  width: 2.5rem;
}

.sidebar .brand {
  min-width: 0;
}

.brand-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.375rem;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.5rem;
  justify-content: center;
  padding: 0;
  width: 2.5rem;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-toggle-icon,
.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  background: currentColor;
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 1.1rem;
}

.sidebar-toggle-icon {
  position: relative;
}

.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  content: "";
  left: 0;
  position: absolute;
}

.sidebar-toggle-icon::before {
  top: -0.35rem;
}

.sidebar-toggle-icon::after {
  top: 0.35rem;
}

.sidebar .nav-link,
.sidebar .nav-section-title {
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 0.375rem;
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item form {
  margin: 0;
}

.sidebar .nav-item > form {
  width: 100%;
}

.sidebar .nav-item > form .nav-link {
  border: 0;
  text-decoration: none;
  width: 100%;
}

.nav-disclosure {
  margin: 0;
}

.nav-disclosure > summary {
  cursor: pointer;
  list-style: none;
  position: relative;
}

.nav-disclosure > summary::-webkit-details-marker {
  display: none;
}

.nav-disclosure > summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.nav-disclosure[open] > summary::after {
  content: "-";
}

.nav-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 1.25rem;
  height: 1.25rem;
  justify-content: center;
  width: 1.25rem;
}

.nav-icon svg {
  display: block;
  fill: currentColor;
  height: 1.15rem;
  width: 1.15rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-section-title:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.75rem;
}

.nav-submenu .nav-link {
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
}

.nav-submenu .nav-link::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  flex: 0 0 0.3rem;
  height: 0.3rem;
  opacity: 0.55;
  width: 0.3rem;
}

.navbar-dark .nav-section-title {
  color: rgba(255, 255, 255, 0.7);
}

.navbar-dark .nav-submenu {
  padding-left: 0.75rem;
}

.content {
  padding: 1rem;
}

@media (min-width: 992px) {
  .content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 160ms ease;
  }

  body.sidebar-collapsed .sidebar {
    padding-inline: 1rem;
    width: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .sidebar-header {
    flex-direction: column;
  }

  body.sidebar-collapsed .brand {
    justify-content: center;
  }

  body.sidebar-collapsed .brand-label,
  body.sidebar-collapsed .nav-label {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  body.sidebar-collapsed .sidebar .nav-link,
  body.sidebar-collapsed .sidebar .nav-section-title {
    gap: 0;
    justify-content: center;
    padding-inline: 0;
  }

  body.sidebar-collapsed .sidebar .nav-item > form {
    display: flex;
    justify-content: center;
  }

  body.sidebar-collapsed .nav-disclosure > summary::after,
  body.sidebar-collapsed .nav-submenu {
    display: none;
  }

  body.sidebar-collapsed .nav-disclosure[open] > .nav-submenu {
    display: none;
  }

  body.sidebar-collapsed .sidebar-toggle {
    transform: rotate(180deg);
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin: 0;
}

.bulk-action-toolbar,
.invoice-bulk-toolbar {
  align-items: center;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 0.5rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem;
}

.bulk-action-toolbar__controls,
.invoice-bulk-toolbar__controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bulk-action-toolbar .form-select,
.invoice-bulk-toolbar .form-select {
  min-width: 12rem;
}

.invoice-bulk-toolbar__schedule {
  min-width: 14rem;
}

.table-check {
  text-align: center;
  width: 2.75rem;
}

.sortable-table th[data-sortable-column="true"] {
  cursor: pointer;
  padding-right: 1.75rem;
  position: relative;
  user-select: none;
}

.sortable-table th[data-sortable-column="true"]::after {
  color: #98a2b3;
  content: "\2195";
  font-size: 0.75rem;
  line-height: 1;
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
}

.sortable-table th[data-sortable-column="true"][data-sort-direction="asc"]::after {
  color: #344054;
  content: "\2191";
}

.sortable-table th[data-sortable-column="true"][data-sort-direction="desc"]::after {
  color: #344054;
  content: "\2193";
}

.sortable-table th[data-sortable-column="true"]:focus {
  outline: 2px solid #84caff;
  outline-offset: -2px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.metric,
.auth-panel,
.detail-panel,
.calculation-panel {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 0.5rem;
  padding: 1rem;
}

.metric span {
  color: #667085;
  display: block;
  font-size: 0.875rem;
}

.metric strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 0.35rem;
}

.calculation-panel {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.calculation-panel strong,
.calculation-panel span {
  display: block;
}

.calculation-panel strong {
  font-size: 1.25rem;
}

.searchable-select {
  position: relative;
}

.searchable-select__native {
  height: 1px !important;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 1px !important;
}

.searchable-select__input {
  background-color: #fff;
}

.searchable-select__list {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 0.375rem;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  left: 0;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.25rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 1080;
}

.searchable-select__option {
  background: transparent;
  border: 0;
  border-radius: 0.25rem;
  color: #101828;
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
  padding: 0.55rem 0.65rem;
  text-align: left;
  width: 100%;
}

.searchable-select__option:hover,
.searchable-select__option[aria-selected="true"] {
  background: #eef4ff;
}

.searchable-select__empty {
  color: #667085;
  font-size: 0.9rem;
  padding: 0.65rem;
}

.lease-pricing-summary {
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 0.5rem;
  padding: 1rem;
}

.lease-pricing-summary__header {
  border-bottom: 1px solid #e4e7ec;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.lease-pricing-summary__header h2 {
  font-size: 1rem;
  margin: 0;
}

.lease-pricing-summary__header p {
  color: #667085;
  font-size: 0.875rem;
  margin: 0.2rem 0 0;
}

.lease-pricing-summary__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lease-pricing-summary__section {
  min-width: 0;
}

.lease-pricing-summary__section--result {
  border-left: 1px solid #d0d5dd;
  padding-left: 1rem;
}

.lease-pricing-summary__section h3 {
  color: #344054;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.lease-pricing-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.lease-pricing-list div {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-width: 0;
}

.lease-pricing-list dt {
  color: #667085;
  font-size: 0.875rem;
  font-weight: 500;
}

.lease-pricing-list dd {
  color: #101828;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.lease-pricing-list__total {
  border-top: 1px solid #d0d5dd;
  margin-top: 0.25rem;
  padding-top: 0.65rem;
}

.lease-pricing-list__total dt,
.lease-pricing-list__total dd {
  color: #0f172a;
  font-size: 1rem;
}

@media (max-width: 991.98px) {
  .lease-pricing-summary__grid {
    grid-template-columns: 1fr;
  }

  .lease-pricing-summary__section + .lease-pricing-summary__section {
    border-top: 1px solid #e4e7ec;
    padding-top: 1rem;
  }

  .lease-pricing-summary__section--result {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 420px) {
  .lease-pricing-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .lease-pricing-list dd {
    text-align: left;
  }
}

.annexure-grid {
  display: grid;
  gap: 1rem;
}

.annexure-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 0.5rem;
  padding: 1rem;
}

.annexure-card__header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.annexure-card__header strong,
.annexure-card__header span {
  display: block;
}

.annexure-card__header span {
  color: #667085;
  font-size: 0.875rem;
}

.annexure-card dl {
  display: grid;
  grid-template-columns: minmax(7rem, 40%) 1fr;
  margin: 0;
  row-gap: 0.5rem;
}

.annexure-card dt {
  color: #667085;
  font-weight: 600;
}

.annexure-card dd {
  margin: 0;
  text-align: right;
}

.auth-panel {
  max-width: 420px;
}

form p label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

form p input,
form p select,
form p textarea {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.55rem 0.75rem;
}

.table-responsive {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 0.5rem;
  max-height: var(--table-scroll-max-height);
  overflow: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  padding: 0;
  scrollbar-gutter: stable;
}

.table-responsive > .table {
  margin-bottom: 0;
}

.table-responsive > .table > thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

.table-responsive > .table > thead > tr > th {
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #d0d5dd;
  position: sticky;
  top: 0;
  vertical-align: middle;
  z-index: 3;
}

.table-row-clickable {
  cursor: pointer;
}

.table-row-clickable:hover > *,
.table-row-clickable:focus > * {
  --bs-table-bg-state: #f6f9fc;
  background-color: #f6f9fc;
}

.table-row-clickable:focus {
  outline: 2px solid #84caff;
  outline-offset: -2px;
}

.search-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.relation-toolbar {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 12rem) minmax(10rem, 14rem) auto auto;
}

.schema-map-shell {
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 0.5rem;
}

.schema-map-scroll {
  overflow: auto;
  padding: 0.5rem;
}

.schema-map {
  position: relative;
}

.schema-map__edges {
  inset: 0;
  overflow: visible;
  position: absolute;
  z-index: 1;
}

.schema-map__edge {
  fill: none;
  opacity: 0.34;
  stroke: #246b8f;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.schema-map__edge--cross-app {
  stroke: #946037;
}

.schema-map__arrow {
  fill: #246b8f;
}

.schema-map__group-label {
  background: #eef3f7;
  border: 1px solid #d9e1ea;
  border-radius: 0.375rem;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow: hidden;
  padding: 0.45rem 0.65rem;
  position: absolute;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

.schema-node {
  background: #ffffff;
  border: 1px solid #b8c9d6;
  border-left: 0.28rem solid #1f7a9f;
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  color: #101828;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0.65rem 0.75rem;
  position: absolute;
  text-decoration: none;
  z-index: 3;
}

.schema-node:hover {
  border-color: #1f7a9f;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.14);
  color: #101828;
}

.schema-node--system {
  border-left-color: #946037;
}

.schema-node__name,
.schema-node__meta,
.schema-node__stats {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-node__name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  font-weight: 700;
}

.schema-node__meta,
.schema-node__stats {
  color: #667085;
  font-size: 0.78rem;
}

.schema-map-empty {
  color: #667085;
  padding: 2rem;
  text-align: center;
}

.search-row .form-control {
  min-width: min(100%, 22rem);
  flex: 1 1 18rem;
}

.site-check-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.site-check-list > div {
  min-width: 0;
}

.site-check-list__item {
  align-items: flex-start;
  display: flex;
  gap: 0.55rem;
  line-height: 1.35;
  margin: 0;
  min-width: 0;
}

.site-check-list__item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-check-list input[type="checkbox"] {
  flex: 0 0 auto;
  height: 1rem;
  margin-top: 0.18rem;
  width: 1rem;
}

.action-row .btn,
.page-header .btn {
  min-height: 2.5rem;
}

.report-filter-form__action {
  padding-top: 1.5rem;
}

@media (max-width: 767.98px) {
  .report-filter-form__action {
    padding-top: 0;
  }
}

@media (max-width: 575.98px) {
  :root {
    --table-scroll-max-height: clamp(16rem, calc(100vh - 8rem), 42rem);
  }

  .relation-toolbar {
    grid-template-columns: 1fr;
  }

  .page-header,
  .action-row {
    align-items: stretch;
  }

  .page-header .btn,
  .action-row .btn,
  .search-row .btn {
    width: 100%;
  }
}
