/*
 * JengaPoa responsive remorph
 *
 * This is intentionally an additive layer over the legacy Mobilekit stylesheet.
 * It keeps every existing PHP route, data query, form, and media binding intact
 * while giving the same markup a deliberate mobile and desktop frame.
 */

:root {
  --jp-accent: #AF1F24;
  --jp-accent-strong: #8E171C;
  --jp-accent-soft: #FCE8E8;
  --jp-ink: #020617;
  --jp-ink-soft: #334155;
  --jp-muted: #64748B;
  --jp-subtle: #94A3B8;
  --jp-line: #E7EAF0;
  --jp-canvas: #F3F5F8;
  --jp-surface: #FFFFFF;
  --jp-surface-muted: #F8FAFC;
  --jp-success: #16825D;
  --jp-warning: #B45309;
  --jp-danger: #B42318;
  --jp-shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.04), 0 6px 18px rgba(2, 6, 23, 0.045);
  --jp-shadow-md: 0 10px 32px rgba(2, 6, 23, 0.08);
}

html {
  background: var(--jp-canvas);
  color: var(--jp-ink);
}

body,
body.dark-mode-active {
  min-height: 100%;
  color: var(--jp-ink) !important;
  background: var(--jp-canvas) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
}

body.dark-mode-active .bg-white,
body.dark-mode-active .card,
body.dark-mode-active .listview,
body.dark-mode-active .modal-content,
body.dark-mode-active .appHeader,
body.dark-mode-active .extraHeader {
  background: var(--jp-surface) !important;
}

body.dark-mode-active .text-white,
body.dark-mode-active .listview,
body.dark-mode-active .appHeader,
body.dark-mode-active .extraHeader {
  color: var(--jp-ink) !important;
}

a,
a:hover,
a:focus,
a:active {
  color: var(--jp-accent);
}

::selection {
  color: #FFFFFF;
  background: var(--jp-accent);
}

/* Shared light-first frame ------------------------------------------------ */

.appHeader,
body .appHeader.text-light,
body.dark-mode-active .appHeader.text-light {
  min-height: 58px;
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border-bottom: 1px solid var(--jp-line);
  box-shadow: none;
}

.appHeader:before {
  display: none;
}

.appHeader .pageTitle {
  color: var(--jp-ink) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.appHeader .left,
.appHeader .right {
  min-width: 72px;
}

.appHeader .headerButton,
.appHeader .headerButton:hover,
.appHeader .headerButton:focus {
  color: var(--jp-accent) !important;
}

.appHeader .headerButton svg [stroke="#26BBFF"],
.jp-project-nav svg [stroke="#26BBFF"] {
  stroke: var(--jp-accent);
}

.appHeader .headerButton svg [fill="#26BBFF"],
.jp-project-nav svg [fill="#26BBFF"] {
  fill: var(--jp-accent);
}

.appHeader .headerButton svg [fill="#26BBFF"] {
  stroke: none;
}

#appCapsule {
  min-height: 100vh;
  padding: 74px 0 86px;
  background: var(--jp-canvas);
}

#appCapsule.extra-header-active {
  padding-top: 124px;
}

.section {
  padding-right: 16px;
  padding-left: 16px;
}

.section-title,
.listview-title {
  color: var(--jp-ink) !important;
  font-weight: 700;
  letter-spacing: -0.018em;
}

.section-title.large {
  font-size: 25px;
  line-height: 1.2;
}

.text-muted,
body.dark-mode-active .text-muted {
  color: var(--jp-muted) !important;
}

.text-primary,
body.dark-mode-active .text-primary {
  color: var(--jp-accent) !important;
}

.text-success,
body.dark-mode-active .text-success {
  color: var(--jp-success) !important;
}

.text-warning,
body.dark-mode-active .text-warning {
  color: var(--jp-warning) !important;
}

.text-danger,
body.dark-mode-active .text-danger {
  color: var(--jp-danger) !important;
}

.bg-primary,
a.bg-primary,
a.bg-primary:hover,
a.bg-primary:active {
  color: #FFFFFF !important;
  background: var(--jp-accent) !important;
}

.form-check-input:checked ~ .form-check-label:after {
  background-color: var(--jp-accent) !important;
  border-color: var(--jp-accent) !important;
}

#sidebarPanel svg [stroke="#26BBFF"] {
  stroke: var(--jp-accent);
}

#sidebarPanel svg [fill="#26BBFF"] {
  fill: var(--jp-accent);
}

.card,
body.dark-mode-active .card {
  overflow: hidden;
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.card .card-header,
.card .card-footer {
  color: inherit;
  background: transparent;
  border-color: var(--jp-line);
}

.card .card-title,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5 {
  color: var(--jp-ink);
}

.listview,
body.dark-mode-active .listview {
  overflow: hidden;
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.listview > li {
  min-height: 58px;
  padding: 10px 16px;
}

.listview > li:after,
body.dark-mode-active .listview > li:after {
  right: 16px;
  left: 16px;
  background: var(--jp-line);
}

.listview > li:last-child:after {
  display: none;
}

.listview .item,
.listview .item:hover {
  color: var(--jp-ink);
}

.listview .item .in {
  min-width: 0;
}

.listview .item .in > div {
  min-width: 0;
}

.listview .item header,
.listview .item footer {
  color: var(--jp-muted);
}

.listview .item .in > div:not(.icon-box),
.listview .item .in > div > :not(svg) {
  overflow-wrap: anywhere;
}

.listview.image-listview .image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px !important;
  background: var(--jp-surface-muted);
}

.profile-stats {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  margin: 8px 0 16px;
  background: var(--jp-surface);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--jp-shadow-sm);
}

.profile-stats .item {
  padding: 12px 14px;
}

.form-control,
.form-select,
body.dark-mode-active .form-control,
body.dark-mode-active .form-select {
  min-height: 44px;
  color: var(--jp-ink) !important;
  background-color: var(--jp-surface) !important;
  border: 1px solid var(--jp-line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(175, 31, 36, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(175, 31, 36, 0.12) !important;
}

.input-wrapper,
.form-group.boxed .input-wrapper {
  background: transparent !important;
  border: 0 !important;
}

.btn {
  min-height: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 10px;
  box-shadow: none;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #FFFFFF !important;
  background: var(--jp-accent) !important;
  border-color: var(--jp-accent) !important;
}

.btn-outline-primary,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  color: var(--jp-accent) !important;
  background: transparent;
  border-color: rgba(175, 31, 36, 0.38) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  color: #FFFFFF !important;
  background: var(--jp-accent) !important;
}

.modal-content,
body.dark-mode-active .modal-content {
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
  border: 0;
}

.modal-header,
.modal-footer {
  border-color: var(--jp-line);
}

/* Existing mobile navigation, retained and made legible ----------------- */

.jp-global-rail {
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
  border-top: 1px solid var(--jp-line) !important;
  box-shadow: 0 -10px 28px rgba(2, 6, 23, 0.06);
}

.jp-global-rail .item {
  color: var(--jp-muted) !important;
}

.jp-global-rail .item strong {
  font-size: 9px;
  font-weight: 700;
}

.jp-global-rail .item.is-active,
.jp-global-rail .item.is-active strong {
  color: var(--jp-accent) !important;
}

.jp-global-rail .item svg {
  filter: brightness(0) saturate(100%) invert(8%) sepia(26%) saturate(1902%) hue-rotate(198deg) brightness(89%) contrast(112%);
}

.jp-global-rail .item.is-active svg {
  filter: invert(16%) sepia(90%) saturate(2799%) hue-rotate(339deg) brightness(91%) contrast(87%);
}

.jp-global-rail .action-button,
.jp-global-rail .item .action-button {
  color: var(--jp-accent) !important;
  background: var(--jp-accent-soft) !important;
}

.jp-project-context {
  display: none;
}

.jp-project-nav {
  /* Match the remorphed 58px header exactly; the legacy extra-header starts
     at 56px, which otherwise creates a subtle two-pixel stack overlap. */
  top: 58px !important;
  overflow-x: auto;
  justify-content: flex-start;
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
  border-bottom: 1px solid var(--jp-line);
  box-shadow: 0 7px 20px rgba(2, 6, 23, 0.04);
  scrollbar-width: none;
}

.jp-project-nav::-webkit-scrollbar {
  display: none;
}

.jp-project-nav .item {
  position: relative;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 84px;
  min-height: 54px;
  margin: 0 !important;
  padding: 6px 10px;
  color: var(--jp-muted) !important;
}

.jp-project-nav .item .col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
}

.jp-project-nav .item svg,
.jp-project-nav .item i {
  width: 20px;
  height: 20px;
  font-size: 19px;
}

.jp-project-nav .item strong {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.jp-project-nav .item.is-active,
.jp-project-nav .item.is-active strong {
  color: var(--jp-accent) !important;
}

.jp-project-nav .item.is-active:after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 2px;
  content: "";
  background: var(--jp-accent);
  border-radius: 999px 999px 0 0;
}

body:has(.jp-project-nav) #appCapsule {
  padding-top: 126px;
}

/* Mobile record rhythm: title/meta and amount cannot fight for one column. */
.listview.image-listview > li .item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.listview.image-listview > li .item .in {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.listview.image-listview > li .item .in > span {
  flex: 0 0 auto;
  max-width: 96px;
  color: var(--jp-ink) !important;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: right;
  white-space: normal;
}

/* Financial records ------------------------------------------------------ */

.jp-record-page {
  padding-top: 138px;
}

.jp-record-toolbar {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.jp-record-title {
  margin: 0;
  color: var(--jp-ink) !important;
  font-size: 18px;
  line-height: 1.25;
}

.jp-record-scope {
  display: inline-block;
  margin-left: 8px;
  padding-left: 9px;
  color: var(--jp-muted);
  border-left: 1px solid var(--jp-line);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  vertical-align: 1px;
}

.jp-record-total {
  width: fit-content;
  min-width: 156px;
  margin: 0;
  border-radius: 12px;
}

.jp-record-total .item {
  display: block;
  padding: 10px 12px;
}

.jp-record-total .item:before {
  display: block;
  margin-bottom: 3px;
  color: var(--jp-muted);
  content: "Approved total";
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.jp-record-total strong {
  display: block;
  color: var(--jp-ink) !important;
  font-size: 16px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.jp-record-filter {
  width: 100%;
  margin: 0;
}

.jp-record-filter .input-wrapper {
  width: 100%;
}

.jp-record-filter .form-select {
  height: 44px !important;
  font-size: 13px !important;
}

.jp-record-list-wrap {
  margin-top: 12px !important;
}

.jp-record-list {
  margin: 0;
}

.jp-record-list .jp-record-row {
  min-height: 72px;
}

.jp-record-list .jp-record-link {
  min-height: 72px;
}

.jp-record-list .image,
.jp-payment-records__icon {
  padding: 10px;
  background: var(--jp-accent-soft);
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(17%) sepia(54%) saturate(3319%) hue-rotate(339deg) brightness(90%) contrast(91%);
}

.jp-record-copy {
  min-width: 0;
}

.jp-record-owner {
  margin-bottom: 2px;
  color: var(--jp-muted) !important;
  font-size: 11px;
  line-height: 1.25;
}

.jp-record-name {
  display: block;
  overflow: hidden;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-record-meta {
  margin-top: 3px;
  color: var(--jp-muted) !important;
  font-size: 10px;
  line-height: 1.35;
}

.jp-record-meta span {
  font-weight: 700;
}

.jp-record-amount {
  color: var(--jp-ink) !important;
  font-size: 12px !important;
  font-weight: 780 !important;
  letter-spacing: -0.02em;
}

.jp-record-empty {
  padding: 18px 16px !important;
}

.jp-record-empty .divider,
.jp-record-empty .lead:not(:first-of-type) {
  display: none;
}

.jp-record-empty .card-body {
  padding: 12px 0;
}

.jp-record-empty h3 {
  color: var(--jp-ink);
  font-size: 18px;
}

.jp-record-empty .lead {
  margin: 8px auto 16px;
  max-width: 30rem;
  color: var(--jp-muted) !important;
  font-size: 13px;
  line-height: 1.5;
}

/* Project directory ------------------------------------------------------ */

.jp-project-directory {
  padding-top: 82px;
}

.jp-project-directory__owned,
.jp-project-directory__linked {
  display: grid;
  gap: 10px;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
}

.jp-project-directory__linked {
  padding-top: 4px;
}

.jp-project-directory__section-title {
  display: block;
  margin: 0 0 2px;
  color: var(--jp-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jp-project-card-link,
.jp-project-card-container {
  display: block;
  min-width: 0;
}

.jp-project-card {
  min-height: 128px;
  margin: 0 !important;
  border-radius: 15px;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.jp-project-card-link:hover .jp-project-card,
.jp-project-card-link:focus-visible .jp-project-card {
  box-shadow: var(--jp-shadow-md);
  transform: translateY(-1px);
}

.jp-project-card__body {
  padding: 16px !important;
}

.jp-project-card__title {
  margin: 0 0 8px !important;
  color: var(--jp-ink) !important;
  font-size: 16px;
  font-weight: 750 !important;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.jp-project-card__budget {
  margin: 0;
  color: var(--jp-muted) !important;
  font-size: 12px;
}

.jp-project-card__budget b {
  color: var(--jp-ink-soft);
  font-weight: 700;
}

.jp-project-card__footer {
  padding: 10px 16px !important;
}

.jp-project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--jp-muted) !important;
  font-size: 10px;
}

.jp-project-card__status {
  float: none !important;
  flex: 0 0 auto;
  color: var(--jp-success) !important;
  font-size: 10px;
  font-weight: 750;
}

.jp-project-card__status.text-danger {
  color: var(--jp-danger) !important;
}

.jp-project-card--renewal {
  border: 1px solid rgba(180, 83, 9, 0.18);
  box-shadow: none;
}

.jp-project-card__renewal-notice {
  margin: 12px 0 4px;
  color: var(--jp-warning) !important;
  font-size: 12px;
}

.jp-project-card__renewal-price {
  margin: 0 0 10px;
  color: var(--jp-ink);
  font-size: 14px;
}

.jp-project-card__renewal-action {
  min-height: 34px;
  border-radius: 8px;
}

.jp-project-card__renewal-meta {
  display: none;
}

.jp-project-empty-state,
.jp-payees-empty-state,
.jp-empty-state,
.jp-payment-empty-state {
  margin-top: 0 !important;
  padding: 20px 16px !important;
}

.jp-project-empty-state .divider,
.jp-payees-empty-state .divider,
.jp-empty-state .divider,
.jp-payment-empty-state .divider,
.jp-empty-state-guidance,
.jp-payment-empty-state__copy:not(:first-of-type),
.jp-payees-empty-state__copy:not(:first-of-type) {
  display: none;
}

.jp-project-empty-state__content,
.jp-payees-empty-state__content,
.jp-empty-state-card,
.jp-payment-empty-state__content {
  padding: 12px 0 !important;
}

.jp-project-empty-state__title,
.jp-payees-empty-state__title,
.jp-empty-state-title,
.jp-payment-empty-state__title {
  margin: 0;
  color: var(--jp-ink);
  font-size: 18px;
  font-weight: 750;
}

.jp-project-empty-state__copy,
.jp-payees-empty-state__copy:first-of-type,
.jp-empty-state-description,
.jp-payment-empty-state__copy:first-of-type {
  margin: 8px auto 16px;
  max-width: 31rem;
  color: var(--jp-muted) !important;
  font-size: 13px;
  line-height: 1.5;
}

.jp-project-directory__empty-linked {
  display: block;
  padding: 12px 0;
  color: var(--jp-muted) !important;
  font-size: 12px;
  line-height: 1.45;
}

/* Payments and payees ---------------------------------------------------- */

.jp-payment-page,
.jp-payees-page {
  padding-top: 138px;
}

.jp-payment-records,
.jp-payees-directory,
.jp-notes-list-section {
  margin-top: 0 !important;
}

.jp-payment-records__list,
.jp-payees-list,
.jp-notes-list {
  margin: 0;
}

.jp-payment-records__item,
.jp-payees-list__item,
.jp-note-record {
  min-height: 72px;
}

.jp-payment-records__trigger,
.jp-payee-record,
.jp-note-record-action {
  min-height: 72px;
}

.jp-payment-records__summary,
.jp-payee-record__identity,
.jp-note-record-copy {
  min-width: 0;
}

.jp-payment-records__actor,
.jp-payee-record__label,
.jp-note-record-author {
  margin-bottom: 2px;
  color: var(--jp-muted) !important;
  font-size: 11px;
  line-height: 1.25;
}

.jp-payment-records__title,
.jp-payee-record__name,
.jp-note-record-title {
  display: block;
  overflow: hidden;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-payment-records__date,
.jp-payment-records__status,
.jp-payee-record__account,
.jp-note-record-created {
  margin-top: 3px;
  color: var(--jp-muted) !important;
  font-size: 10px;
  line-height: 1.3;
}

.jp-payment-records__status span {
  font-weight: 700;
}

.jp-payment-records__amount {
  max-width: 112px !important;
  color: var(--jp-ink) !important;
  font-size: 11px !important;
  font-weight: 780 !important;
  letter-spacing: -0.02em;
  white-space: nowrap !important;
}

.jp-payee-record__category {
  align-self: center;
  max-width: 92px;
  padding: 4px 7px;
  overflow: hidden;
  color: var(--jp-ink-soft) !important;
  background: var(--jp-surface-muted);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-payment-detail,
.jp-note-record-detail {
  color: var(--jp-ink);
  background: var(--jp-surface) !important;
}

.jp-payment-detail__header,
.jp-note-record-detail-header {
  min-height: 60px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--jp-line);
}

.jp-payment-detail__content,
.jp-note-record-detail-content {
  padding: 4px 0 !important;
}

.jp-payment-detail__metadata,
.jp-note-record-detail-preview {
  color: var(--jp-ink-soft) !important;
  line-height: 1.5;
}

.jp-payment-detail__date,
.jp-note-record-detail-author,
.jp-note-record-detail-created {
  color: var(--jp-muted);
  font-size: 12px;
}

.jp-payee-form__actions,
.jp-note-create-modal .modal-body .form-group:last-child {
  margin-bottom: 0 !important;
}

/* Media library ---------------------------------------------------------- */

.jp-media-page-content {
  padding-top: 136px;
}

.jp-media-library {
  margin-top: 0 !important;
}

.jp-media-library-body {
  padding: 0 !important;
}

.jp-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  text-align: left !important;
}

.jp-media-grid > [class*="col-"] {
  width: auto;
  max-width: none;
  margin: 0 !important;
  padding: 0;
}

.jp-media-date-group {
  grid-column: 1 / -1;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

.jp-media-date-label {
  color: var(--jp-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jp-media-item {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  background: var(--jp-surface);
  border-radius: 14px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-media-item--video {
  grid-column: 1 / -1;
}

.jp-media-preview {
  display: block;
  width: 100% !important;
  margin: 0;
  background: var(--jp-surface-muted);
}

.jp-media-preview--image,
.jp-media-preview--document {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.jp-media-preview--document {
  height: auto;
}

.jp-media-preview--video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.jp-media-item__fallback {
  display: none;
}

.jp-media-item.is-preview-unavailable {
  display: grid;
  min-height: 116px;
  padding: 14px;
  color: var(--jp-muted);
  background: linear-gradient(135deg, #FFFFFF 0%, var(--jp-surface-muted) 100%);
  place-items: center;
  text-align: center;
}

.jp-media-item.is-preview-unavailable .jp-media-preview {
  display: none !important;
}

.jp-media-item.is-preview-unavailable .jp-media-item__fallback {
  display: block;
  color: var(--jp-ink-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.jp-media-item.is-preview-unavailable .jp-media-item__fallback:before {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 8px;
  color: var(--jp-accent);
  content: "!";
  background: var(--jp-accent-soft);
  border-radius: 9px;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.jp-media-item.is-preview-unavailable .jp-media-item__fallback small {
  display: block;
  margin-top: 2px;
  color: var(--jp-muted);
  font-size: 10px;
  font-weight: 600;
}

.jp-media-upload-dropzone {
  color: var(--jp-ink) !important;
  background: var(--jp-surface-muted) !important;
  border-color: var(--jp-line) !important;
}

.jp-media-upload-content {
  padding-top: 0 !important;
}

.jp-media-upload-content br {
  display: none;
}

.jp-media-upload-description {
  margin: 12px 0 18px;
  color: var(--jp-muted);
  font-size: 13px;
}

/* Project overview ------------------------------------------------------- */

.jp-project-summary {
  padding-top: 14px;
}

.jp-project-summary__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.jp-project-summary__eyebrow,
.jp-phase-section__head p,
.jp-empty-phase__content p {
  margin: 0 0 3px;
  color: var(--jp-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.jp-project-summary__head h1,
.jp-phase-section__head h2,
.jp-empty-phase__content h2 {
  margin: 0;
  color: var(--jp-ink);
  font-size: 23px;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.jp-project-summary__schedule {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--jp-success);
  background: #ECFDF5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.jp-project-summary__schedule.is-overdue {
  color: var(--jp-danger);
  background: #FFF1F2;
}

.jp-project-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.jp-project-metric {
  display: flex;
  min-width: 0;
  min-height: 90px;
  padding: 13px;
  color: var(--jp-ink);
  background: var(--jp-surface);
  border-radius: 14px;
  box-shadow: var(--jp-shadow-sm);
  flex-direction: column;
  justify-content: space-between;
}

a.jp-project-metric:hover,
a.jp-project-metric:focus-visible {
  color: var(--jp-ink);
  box-shadow: 0 0 0 3px rgba(175, 31, 36, 0.12), var(--jp-shadow-sm);
}

.jp-project-metric > span {
  color: var(--jp-muted);
  font-size: 11px;
  font-weight: 700;
}

.jp-project-metric > strong {
  overflow: hidden;
  color: var(--jp-ink);
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-project-metric--position.is-available > strong {
  color: var(--jp-success);
}

.jp-project-metric--position.is-unfunded > strong {
  color: var(--jp-danger);
}

.jp-phase-section,
.jp-empty-phase {
  margin-top: 26px;
}

.jp-phase-section__head,
.jp-empty-phase__content {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.jp-phase-section__head h2,
.jp-empty-phase__content h2 {
  font-size: 17px;
}

.jp-inline-action {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  padding: 7px 9px;
  color: var(--jp-accent);
  background: var(--jp-accent-soft);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.jp-inline-action:hover,
.jp-inline-action:focus-visible {
  color: #FFFFFF;
  background: var(--jp-accent);
}

.jp-phase-list {
  margin-bottom: 20px;
}

.jp-phase-list > li {
  padding: 0;
}

.jp-phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 14px;
  color: var(--jp-ink) !important;
}

.jp-phase-row__name,
.jp-phase-row__position {
  min-width: 0;
}

.jp-phase-row__name strong,
.jp-phase-row__name span,
.jp-phase-row__position strong,
.jp-phase-row__position span {
  display: block;
}

.jp-phase-row__name strong {
  overflow: hidden;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 730;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-phase-row__name span,
.jp-phase-row__position span {
  margin-top: 3px;
  color: var(--jp-muted);
  font-size: 10px;
  font-weight: 650;
}

.jp-phase-row__position {
  text-align: right;
}

.jp-phase-row__position strong {
  color: var(--jp-success);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.jp-phase-row__position.is-unfunded strong {
  color: var(--jp-danger);
}

.jp-empty-phase__content {
  min-height: 126px;
  padding: 20px;
  background: var(--jp-surface);
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-empty-phase__content > div > span {
  display: block;
  max-width: 280px;
  margin-top: 6px;
  color: var(--jp-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Desktop frame ---------------------------------------------------------- */

@media (min-width: 1024px) {
  body,
  body.dark-mode-active {
    min-width: 1024px;
    background: #E9EDF2 !important;
  }

  .jp-global-rail {
    position: fixed !important;
    z-index: 1200 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    width: 72px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 14px 8px !important;
    overflow: visible;
    color: #FFFFFF;
    background: var(--jp-ink) !important;
    border: 0 !important;
    box-shadow: none;
  }

  .jp-global-rail:before {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin: 0 0 20px;
    color: #FFFFFF;
    content: "J";
    place-items: center;
    background: var(--jp-accent);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(175, 31, 36, 0.34);
    font-size: 17px;
    font-weight: 800;
  }

  .jp-global-rail .item {
    position: relative;
    display: flex !important;
    flex: 0 0 52px !important;
    align-items: center;
    justify-content: center;
    width: 52px !important;
    height: 52px;
    min-height: 52px;
    margin: 0 0 4px;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.68) !important;
    border-radius: 14px;
  }

  .jp-global-rail .item:hover,
  .jp-global-rail .item:focus-visible,
  .jp-global-rail .item.is-active {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.1);
  }

  .jp-global-rail .item.is-active:before {
    position: absolute;
    left: -8px;
    width: 3px;
    height: 22px;
    content: "";
    background: var(--jp-accent);
    border-radius: 0 999px 999px 0;
  }

  .jp-global-rail .item strong {
    display: none;
  }

  .jp-global-rail .item svg {
    width: 22px;
    height: 22px;
    filter: none;
  }

  .jp-global-rail .item.is-active svg {
    filter: none;
  }

  .jp-global-rail .item .action-button {
    display: grid;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    color: #FFFFFF !important;
    background: var(--jp-accent) !important;
    border-radius: 12px !important;
    place-items: center;
  }

  .jp-global-rail .item .action-button i {
    color: #FFFFFF !important;
  }

  #sidebarPanel {
    display: none !important;
  }

  .appHeader,
  body .appHeader.text-light,
  body.dark-mode-active .appHeader.text-light {
    top: 0;
    left: 72px;
    min-height: 72px;
    padding: 0 28px;
    color: var(--jp-ink) !important;
    background: var(--jp-surface) !important;
    border-bottom: 1px solid var(--jp-line);
    box-shadow: none;
  }

  .appHeader .pageTitle {
    position: static;
    flex: 1 1 auto;
    padding: 0 12px;
    text-align: left;
    font-size: 18px;
  }

  .appHeader .left,
  .appHeader .right {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-width: auto;
  }

  .appHeader .left .headerButton {
    display: none;
  }

  .appHeader .right .headerButton {
    min-width: auto;
    height: 38px;
    padding: 0 12px;
    color: var(--jp-accent) !important;
    background: var(--jp-accent-soft);
    border-radius: 9px;
  }

  #appCapsule {
    min-height: 100vh;
    margin-left: 72px;
    padding: 104px 38px 56px;
    background: var(--jp-canvas);
    border-radius: 26px 0 0 0;
  }

  #appCapsule.extra-header-active {
    padding-top: 104px;
  }

  #appCapsule > .section,
  #appCapsule > .wide-block,
  #appCapsule > .section.full {
    width: min(100%, 1440px);
    margin-right: auto;
    margin-left: auto;
  }

  .jp-project-nav {
    position: fixed !important;
    z-index: 1100 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 72px !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    width: 254px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 18px 12px !important;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--jp-ink);
    background: var(--jp-surface) !important;
    border: 0;
    border-right: 1px solid var(--jp-line);
    box-shadow: none;
  }

  .jp-project-context {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    margin: 0 0 18px;
    padding: 8px;
  }

  .jp-project-context-back {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    color: var(--jp-muted);
    background: var(--jp-surface-muted);
    border-radius: 9px;
    place-items: center;
  }

  .jp-project-context-back:hover,
  .jp-project-context-back:focus-visible {
    color: var(--jp-accent);
    background: var(--jp-accent-soft);
  }

  .jp-project-context span,
  .jp-project-context strong {
    display: block;
    max-width: 174px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .jp-project-context span {
    margin-bottom: 2px;
    color: var(--jp-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .jp-project-context strong {
    color: var(--jp-ink);
    font-size: 14px;
    font-weight: 750;
  }

  .jp-project-nav .item {
    display: block;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0;
    min-height: 44px;
    margin: 0 0 3px !important;
    padding: 0 10px;
    color: var(--jp-muted) !important;
    border-radius: 10px;
  }

  .jp-project-nav .item:hover,
  .jp-project-nav .item:focus-visible,
  .jp-project-nav .item.is-active {
    color: var(--jp-accent) !important;
    background: var(--jp-accent-soft);
  }

  .jp-project-nav .item.is-active:after {
    display: none;
  }

  .jp-project-nav .item .col {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    min-height: 44px;
    padding: 0;
  }

  .jp-project-nav .item svg,
  .jp-project-nav .item i {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    font-size: 18px;
  }

  .jp-project-nav .item strong {
    color: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  .jp-project-nav .item[href*="project-statement.php"] {
    display: none;
  }

  body:has(.jp-project-nav) .appHeader {
    left: 326px;
  }

  body:has(.jp-project-nav) #appCapsule {
    margin-left: 326px;
    padding-top: 104px;
  }

  body:has(.jp-project-nav) #appCapsule.extra-header-active {
    padding-top: 104px;
  }

  /* The overview keeps its phase action beside the phase list, where it has
     context. Avoid repeating the same action in the desktop page header. */
  body:has(.jp-project-summary) .appHeader .right {
    display: none;
  }

  .section {
    padding-right: 0;
    padding-left: 0;
  }

  .section.full {
    padding-right: 0;
    padding-left: 0;
  }

  .section-title,
  .listview-title {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .listview {
    border-radius: 18px;
  }

  .listview > li {
    min-height: 68px;
    padding: 0;
  }

  .listview > li:after {
    right: 20px;
    left: 20px;
  }

  .listview.image-listview > li .item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    min-height: 68px;
    padding: 12px 20px;
  }

  .listview.image-listview > li .item .in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, max-content);
    gap: 24px;
    align-items: center;
  }

  .listview.image-listview > li .item .in > span {
    max-width: none;
    color: var(--jp-ink) !important;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
  }

  .listview.image-listview .image {
    width: 44px;
    height: 44px;
  }

  .profile-stats {
    width: fit-content;
    min-width: 220px;
  }

  .card {
    border-radius: 18px;
  }

  .form-group.boxed {
    max-width: 680px;
  }

  .jp-record-page {
    padding-top: 112px !important;
  }

  .jp-record-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(190px, 240px);
    gap: 14px;
    align-items: end;
    max-width: 1040px !important;
    padding: 0 !important;
  }

  .jp-record-title {
    margin-bottom: 5px;
    font-size: 21px;
  }

  .jp-record-total {
    min-width: 184px;
  }

  .jp-record-filter {
    max-width: none !important;
  }

  .jp-record-list-wrap {
    max-width: 1040px !important;
    margin-top: 16px !important;
  }

  .jp-record-list .jp-record-link {
    min-height: 76px;
  }

  .jp-record-name {
    font-size: 14px;
  }

  .jp-record-meta {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .jp-record-meta br {
    display: none;
  }

  .jp-record-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .jp-record-meta span:before {
    width: 3px;
    height: 3px;
    content: "";
    background: currentColor;
    border-radius: 50%;
  }

  .jp-record-amount {
    font-size: 13px !important;
  }

  .jp-project-directory {
    width: min(100%, 1240px);
    margin-right: auto;
    margin-left: auto;
    padding-top: 106px;
  }

  .jp-project-directory__owned,
  .jp-project-directory__linked {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin-bottom: 28px !important;
  }

  .jp-project-directory__section-title,
  .jp-project-directory__empty-linked {
    grid-column: 1 / -1;
  }

  .jp-project-directory__section-title {
    margin-bottom: 0;
  }

  .jp-project-card {
    min-height: 146px;
    border-radius: 17px;
  }

  .jp-project-card__body {
    padding: 18px !important;
  }

  .jp-project-card__title {
    font-size: 17px;
  }

  .jp-payment-page,
  .jp-payees-page,
  .jp-media-page-content,
  .jp-notes-page-content {
    padding-top: 112px !important;
  }

  .jp-payment-records,
  .jp-payees-directory,
  .jp-notes-list-section {
    max-width: 1040px !important;
  }

  .jp-payment-records__trigger,
  .jp-payee-record,
  .jp-note-record-action {
    min-height: 76px;
  }

  .jp-payment-records__title,
  .jp-payee-record__name,
  .jp-note-record-title {
    font-size: 14px;
  }

  .jp-payment-records__date,
  .jp-payment-records__status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .jp-payment-records__date:after {
    width: 3px;
    height: 3px;
    content: "";
    background: var(--jp-subtle);
    border-radius: 50%;
  }

  .jp-payment-records__status {
    margin-left: 4px;
  }

  .jp-payment-records__amount {
    font-size: 13px !important;
  }

  .jp-payee-record__category {
    max-width: 154px;
    padding: 5px 9px;
    font-size: 11px;
  }

  .jp-payment-detail,
  .jp-note-record-detail {
    right: 32px !important;
    bottom: 32px !important;
    left: auto !important;
    width: min(480px, calc(100vw - 390px)) !important;
    height: auto !important;
    max-height: calc(100vh - 64px);
    border: 0 !important;
    border-radius: 18px !important;
    box-shadow: var(--jp-shadow-md);
  }

  .jp-media-library {
    max-width: 1080px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  .jp-media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .jp-media-date-group {
    margin-top: 14px !important;
  }

  .jp-media-item {
    min-height: 164px;
    border-radius: 16px;
  }

  .jp-media-item.is-preview-unavailable {
    min-height: 164px;
  }

  .jp-project-summary {
    padding-top: 6px;
  }

  .jp-project-summary__head h1 {
    font-size: 28px;
  }

  .jp-project-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .jp-project-metric {
    min-height: 118px;
    padding: 18px;
    border-radius: 16px;
  }

  .jp-project-metric > strong {
    font-size: 18px;
  }

  .jp-phase-section {
    max-width: 1040px;
  }

  .jp-phase-section__head {
    margin-bottom: 14px;
  }

  .jp-phase-row {
    grid-template-columns: minmax(0, 1fr) 178px;
    gap: 18px;
    min-height: 68px;
    padding: 12px 20px;
  }

  .jp-phase-row__name strong {
    font-size: 14px;
  }

  .jp-phase-row__position strong {
    font-size: 13px;
  }

  /* Mobilekit makes every `.modalbox` a fixed, full-viewport sheet. On the
     desktop workspace, restore it to a deliberate dialog without changing
     the underlying form or its mobile behaviour. The longer selectors are
     necessary to override the legacy three-level modal rules. */
  .modalbox .modal-dialog,
  .modalbox .modal-dialog.jp-composer__dialog {
    width: min(640px, calc(100vw - 48px));
    max-width: 640px;
    min-width: 0 !important;
    height: auto !important;
    max-height: calc(100vh - 24px);
    min-height: 0 !important;
    margin: 12px auto;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  .modalbox .modal-dialog .modal-content,
  .modalbox .modal-dialog .jp-composer__content {
    position: relative !important;
    inset: auto !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - 24px);
    padding-top: 0 !important;
    border-radius: 18px  !important;
    box-shadow: var(--jp-shadow-md);
  }

  .modalbox .modal-dialog .modal-content .modal-header {
    position: static !important;
    flex: 0 0 auto;
    min-height: 64px;
    padding: 18px 20px;
    background: var(--jp-surface) !important;
  }

  .modalbox .modal-dialog .modal-content .modal-body {
    flex: 1 1 auto;
    max-height: calc(100vh - 88px);
    padding: 20px;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .jp-project-nav .item {
    min-width: 78px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .jp-project-nav .item strong {
    font-size: 9px;
  }

  .listview.image-listview > li .item .in > span {
    max-width: 84px;
    font-size: 11px;
  }
}

/* Deeper project workspace views ---------------------------------------- */

/* Cost detail: the source view contains real cost, payee, receipt and
   approval records. These rules only give those existing records a stable
   reading order; they do not alter any financial calculation or action. */
.jp-cost-detail-page {
  padding-bottom: 112px;
}

.jp-cost-detail {
  width: min(100%, 1040px);
  margin: 0 auto !important;
  padding-top: 0 !important;
}

.jp-cost-detail__heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px !important;
  padding: 2px 0 !important;
  color: var(--jp-ink) !important;
  font-size: 20px !important;
  font-weight: 780 !important;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.jp-cost-detail__heading > br {
  display: none;
}

.jp-cost-detail__status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 5px 9px;
  background: #ECFDF5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.jp-cost-detail__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 16px !important;
  padding: 16px !important;
  color: var(--jp-muted);
  background: var(--jp-surface) !important;
  border: 0 !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-cost-detail__summary > br {
  display: none;
}

.jp-cost-detail__summary-item {
  display: block;
  min-width: 0;
  padding: 10px 12px;
  color: var(--jp-muted);
  background: var(--jp-surface-muted);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.jp-cost-detail__summary-value,
.jp-cost-detail__summary .text-white,
.jp-cost-detail__summary b {
  color: var(--jp-ink) !important;
  font-size: 12px;
  font-weight: 730;
}

.jp-cost-detail__attachment-action {
  display: grid;
  min-height: 90px;
  margin: 0 0 14px;
  color: var(--jp-accent);
  background: var(--jp-accent-soft) !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 750;
  place-content: center;
}

.jp-cost-detail__attachment-action i {
  margin-bottom: 5px;
  font-size: 19px;
}

.jp-cost-detail__payments {
  display: grid;
  gap: 14px;
}

.jp-cost-detail__payment-table-wrap {
  overflow-x: auto;
  background: var(--jp-surface);
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-cost-detail__payment-table {
  width: 100%;
  min-width: 520px;
  margin: 0 !important;
  color: var(--jp-ink);
}

.jp-cost-detail__payment-table-head,
.jp-cost-detail__payment-table-head-row,
.jp-cost-detail__payment-row {
  color: var(--jp-ink) !important;
  background: transparent !important;
}

.jp-cost-detail__payment-table th,
.jp-cost-detail__payment-table td {
  padding: 14px 16px !important;
  color: var(--jp-ink) !important;
  vertical-align: middle;
  border-color: var(--jp-line) !important;
  font-size: 12px;
}

.jp-cost-detail__payment-table th {
  color: var(--jp-muted) !important;
  font-size: 10px;
  font-weight: 750 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.jp-cost-detail__payment-amount {
  color: var(--jp-ink) !important;
  font-weight: 780;
}

.jp-cost-detail__payment-change {
  display: inline-block;
  margin-top: 3px;
  color: var(--jp-accent) !important;
  font-size: 11px;
  font-weight: 720;
}

.jp-cost-detail__payment-remove-action {
  display: inline-grid;
  width: 30px;
  height: 30px;
  color: var(--jp-danger);
  background: #FFF1F2;
  border-radius: 8px;
  place-items: center;
}

.jp-cost-detail__attachments {
  margin: 0 !important;
  color: var(--jp-ink) !important;
}

.jp-cost-detail__attachments img,
.jp-cost-detail__attachments embed,
.jp-cost-detail__attachments iframe {
  display: block;
  width: 100% !important;
  max-height: min(60vh, 620px);
  margin: 0 auto;
  object-fit: contain;
  background: var(--jp-surface);
  border: 0 !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-cost-detail__total {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  align-items: baseline;
  margin: 0 !important;
  padding: 16px !important;
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
  font-size: 19px;
  font-weight: 790;
  letter-spacing: -0.03em;
}

.jp-cost-detail__total-label {
  flex: 1 0 100%;
  margin: 0;
  color: var(--jp-muted) !important;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.jp-cost-detail__approval-actions,
.jp-cost-detail__approval-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 !important;
  padding: 14px 0 !important;
  color: var(--jp-ink) !important;
}

.jp-cost-detail__approval-summary {
  padding: 14px 16px !important;
  color: var(--jp-success) !important;
  background: #ECFDF5;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 720;
}

.jp-cost-detail__approval-action {
  min-width: 108px;
}

.jp-cost-detail__payment-editor,
.jp-cost-detail__modal-content,
.jp-cost-detail__payee-form {
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
}

.jp-cost-detail__payment-editor-header,
.jp-cost-detail__modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--jp-line) !important;
}

.jp-cost-detail__payment-editor-title,
.jp-cost-detail__modal-title {
  color: var(--jp-ink) !important;
  font-size: 16px;
  font-weight: 760;
}

.jp-cost-detail__payment-editor-body,
.jp-cost-detail__modal-body {
  color: var(--jp-ink) !important;
}

.jp-cost-detail__upload-guidance,
.jp-cost-detail__payee-empty-state {
  color: var(--jp-muted) !important;
  font-size: 13px;
  line-height: 1.45;
}

/* Phase views: larger real currency values need their own cells rather than
   the legacy narrow profile-stat strip. */
.jp-phase-overview-title {
  margin: 0 0 10px !important;
  color: var(--jp-muted) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.jp-phase-summary {
  margin: 0 0 16px !important;
}

.jp-phase-summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
  background: transparent !important;
  box-shadow: none;
}

.jp-phase-summary-item {
  display: flex !important;
  min-width: 0;
  min-height: 96px;
  padding: 14px !important;
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border-radius: 14px;
  box-shadow: var(--jp-shadow-sm);
  flex-direction: column;
  justify-content: flex-end;
}

.jp-phase-summary-item--budget {
  grid-column: 1 / -1;
}

.jp-phase-summary-value,
.jp-phase-summary .text-white {
  overflow: hidden;
  color: var(--jp-ink) !important;
  font-size: 15px;
  font-weight: 790;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-phase-summary-item--payments .jp-phase-summary-value {
  color: var(--jp-success) !important;
}

.jp-phase-summary-item--costs .jp-phase-summary-value {
  color: var(--jp-accent) !important;
}

.jp-phase-summary-label {
  margin-top: 5px;
  color: var(--jp-muted);
  font-size: 10px;
  font-weight: 700;
}

.jp-phase-actions-list {
  margin: 0 !important;
}

.jp-phase-actions-list--empty {
  display: none;
}

.jp-phase-action {
  min-height: 68px;
  padding: 12px 14px !important;
}

.jp-phase-action-icon {
  width: 38px !important;
  height: 38px !important;
  color: var(--jp-accent) !important;
  background: var(--jp-accent-soft) !important;
  border-radius: 11px !important;
}

.jp-phase-action-title {
  display: block;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 750;
}

.jp-phase-action-meta {
  display: block;
  margin-top: 3px;
  color: var(--jp-muted) !important;
  font-size: 11px;
  font-weight: 700;
}

.jp-phase-records-section,
.jp-phase-empty-state {
  margin-top: 0 !important;
}

.jp-phase-records-list {
  margin: 0 !important;
}

.jp-phase-record-action {
  min-height: 68px;
  padding: 10px 14px !important;
}

.jp-phase-record-thumbnail {
  padding: 9px;
  object-fit: contain !important;
  background: var(--jp-accent-soft) !important;
  filter: brightness(0) saturate(100%) invert(17%) sepia(54%) saturate(3319%) hue-rotate(339deg) brightness(90%) contrast(91%);
}

.jp-phase-record-content {
  gap: 10px !important;
}

.jp-phase-record-copy {
  min-width: 0;
}

.jp-phase-record-author,
.jp-phase-record-created {
  display: block;
  overflow: hidden;
  color: var(--jp-muted) !important;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-phase-record-title {
  overflow: hidden;
  margin: 2px 0;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 730;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-phase-record-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  background: var(--jp-surface-muted);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  text-transform: capitalize;
}

.jp-phase-empty-state-panel {
  margin: 0 !important;
  background: var(--jp-surface) !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-phase-empty-state-card {
  padding: 20px !important;
}

.jp-phase-empty-state-title {
  color: var(--jp-ink) !important;
  font-size: 17px;
  font-weight: 760;
}

.jp-phase-empty-state-description,
.jp-phase-empty-state-guidance {
  color: var(--jp-muted) !important;
  font-size: 13px !important;
  line-height: 1.45;
}

/* Team and permission management. The existing role permissions are kept as
   is, but the view gets a readable directory and a deliberate permission form. */
.jp-roles-workspace,
.jp-role-invite-workspace {
  padding-bottom: 112px;
}

.jp-roles-directory,
.jp-role-invite-form-shell {
  width: min(100%, 920px);
  margin: 0 auto !important;
}

.jp-roles-directory-list {
  margin: 0 !important;
}

.jp-roles-directory-row {
  min-height: 70px;
  padding: 10px 14px !important;
}

.jp-roles-avatar {
  background: var(--jp-accent-soft) !important;
}

.jp-roles-identity {
  display: block !important;
  min-width: 0;
  padding-right: 0 !important;
}

.jp-roles-identity > div {
  overflow: hidden;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-roles-identity > span {
  display: block !important;
  max-width: none !important;
  margin-top: 3px;
  overflow: hidden;
  color: var(--jp-muted) !important;
  font-size: 11px !important;
  font-weight: 620;
  line-height: 1.25;
  text-align: left !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-roles-empty-state {
  width: min(100%, 620px);
  margin: 0 auto !important;
}

.jp-roles-empty-divider {
  display: none;
}

.jp-roles-empty-content {
  margin: 0 !important;
  background: var(--jp-surface) !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-roles-empty-body {
  padding: 22px !important;
}

.jp-roles-empty-body h3 {
  color: var(--jp-ink);
  font-size: 17px;
  font-weight: 760;
}

.jp-roles-empty-body p {
  margin: 7px auto 16px;
  color: var(--jp-muted);
  font-size: 13px;
  line-height: 1.45;
}

.jp-role-invite-form {
  padding: 16px;
  background: var(--jp-surface);
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-role-invite-field {
  margin-bottom: 10px !important;
}

.jp-role-invite-permissions {
  padding: 10px 0 0 !important;
}

.jp-role-invite-permissions > .section-title {
  margin: 18px 0 7px !important;
  color: var(--jp-ink) !important;
  font-size: 12px;
  font-weight: 740;
}

.jp-role-invite-permission-group {
  overflow: hidden;
  background: var(--jp-surface-muted);
  border-radius: 11px;
}

.jp-role-invite-permission-group .input-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.jp-role-invite-permission-group .form-check {
  min-height: 42px;
  margin: 0 !important;
  padding: 11px 12px 11px 36px;
}

.jp-role-invite-permission-group .form-check + .form-check {
  border-left: 1px solid var(--jp-line);
}

.jp-role-invite-permission-group .form-check-label {
  color: var(--jp-ink);
  font-size: 12px;
  font-weight: 700;
}

.jp-role-invite-submit-row {
  margin: 20px 0 0 !important;
}

.jp-role-invite-submit {
  width: 100%;
  color: #FFFFFF !important;
  background: var(--jp-accent) !important;
  border-color: var(--jp-accent) !important;
}

/* Wallet and statement retain their real ledger rows, with a quieter reading
   surface and controls that wrap before they can collide on small screens. */
.jp-wallet-page,
.jp-statement-page {
  padding-bottom: 112px;
}

.jp-wallet-summary,
.jp-wallet-ledger,
.jp-statement-controls,
.jp-statement-document {
  width: min(100%, 1040px);
  margin-right: auto !important;
  margin-left: auto !important;
}

.jp-wallet-summary {
  margin-top: 0 !important;
}

.jp-wallet-summary__card,
.jp-wallet-ledger__surface,
.jp-statement-controls__surface,
.jp-statement-document {
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border: 0 !important;
  border-radius: 16px;
  box-shadow: var(--jp-shadow-sm);
}

.jp-wallet-summary__body {
  padding: 18px !important;
}

.jp-wallet-summary__label {
  margin: 0 0 5px;
  color: var(--jp-muted) !important;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.jp-wallet-summary__balance {
  margin: 0;
  color: var(--jp-ink) !important;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.jp-wallet-summary__supporting-text {
  margin: 6px 0 14px;
  color: var(--jp-muted) !important;
  font-size: 12px;
}

.jp-wallet-ledger__scroll,
.jp-statement-document__scroll {
  overflow-x: auto;
}

.jp-wallet-ledger__table,
.jp-statement-document__table {
  width: 100%;
  min-width: 620px;
  margin: 0 !important;
  color: var(--jp-ink);
}

.jp-wallet-ledger__head,
.jp-statement-document__head {
  color: var(--jp-muted);
  background: var(--jp-surface-muted);
}

.jp-wallet-ledger__table th,
.jp-wallet-ledger__table td,
.jp-statement-document__table th,
.jp-statement-document__table td {
  padding: 13px 16px !important;
  color: var(--jp-ink) !important;
  border-color: var(--jp-line) !important;
  font-size: 12px;
  vertical-align: middle;
}

.jp-wallet-ledger__head th,
.jp-statement-document__head th {
  color: var(--jp-muted) !important;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.jp-wallet-ledger__amount--debit {
  color: var(--jp-danger) !important;
  font-weight: 750;
}

.jp-wallet-ledger__amount--credit {
  color: var(--jp-success) !important;
  font-weight: 750;
}

.jp-statement-controls__surface {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px !important;
}

.jp-statement-controls__filter,
.jp-statement-controls__actions {
  flex: 1 1 220px;
  margin: 0 !important;
}

.jp-statement-controls__actions {
  display: flex;
  gap: 8px;
}

.jp-statement-controls__action {
  flex: 1 1 0;
  margin: 0 !important;
}

.jp-statement-controls__button {
  width: 100%;
  white-space: nowrap;
}

.jp-statement-document {
  overflow: hidden;
}

.jp-statement-document__title {
  padding: 17px 16px 11px !important;
  text-align: left !important;
}

.jp-statement-document__heading {
  margin: 0;
  color: var(--jp-ink) !important;
  font-size: 16px;
  font-weight: 760;
}

.jp-statement-document__row--balance {
  background: var(--jp-surface-muted);
  font-weight: 750;
}

@media (min-width: 720px) {
  .jp-cost-detail__summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 18px !important;
  }

  .jp-phase-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .jp-phase-summary-item,
  .jp-phase-summary-item--budget {
    grid-column: auto;
    min-height: 112px;
    padding: 17px !important;
  }
}

@media (min-width: 1024px) {
  .jp-cost-detail-page,
  .jp-phase-page-content,
  .jp-roles-workspace,
  .jp-role-invite-workspace,
  .jp-wallet-page,
  .jp-statement-page {
    padding-top: 104px !important;
  }

  .jp-cost-detail {
    max-width: 1060px;
  }

  .jp-cost-detail__heading {
    font-size: 24px !important;
  }

  .jp-phase-page-content {
    width: min(100%, 1040px);
    margin-right: auto;
    margin-left: auto;
  }

  .jp-phase-overview-title {
    margin-top: 0 !important;
  }

  .jp-phase-actions-list,
  .jp-phase-records-section {
    max-width: 780px;
  }

  .jp-roles-directory,
  .jp-role-invite-form-shell {
    max-width: 780px;
  }

  .jp-role-invite-form {
    padding: 22px;
  }

  .jp-payment-detail.offcanvas-bottom,
  .jp-note-record-detail.offcanvas-bottom,
  .jp-cost-detail__payment-editor.offcanvas-bottom,
  .jp-roles-details-panel.offcanvas-bottom {
    top: 32px !important;
    right: 32px !important;
    bottom: 32px !important;
    left: auto !important;
    width: min(460px, calc(100vw - 390px)) !important;
    height: auto !important;
    max-height: none !important;
    color: var(--jp-ink) !important;
    background: var(--jp-surface) !important;
    border: 0 !important;
    border-radius: 18px !important;
    box-shadow: var(--jp-shadow-md);
    transform: translateX(calc(100% + 32px)) !important;
  }

  .jp-payment-detail.offcanvas-bottom.show,
  .jp-note-record-detail.offcanvas-bottom.show,
  .jp-cost-detail__payment-editor.offcanvas-bottom.show,
  .jp-roles-details-panel.offcanvas-bottom.show {
    transform: translateX(0) !important;
  }

  .jp-cost-detail__payment-editor-body,
  .jp-roles-details-panel .offcanvas-body {
    overflow-y: auto;
  }

  .jp-roles-details-panel .offcanvas-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--jp-line);
  }

  .jp-roles-details-title {
    color: var(--jp-ink) !important;
    font-size: 16px;
    font-weight: 760;
  }

  .jp-roles-permission-body {
    padding: 20px !important;
  }

  .jp-roles-permission-body p {
    margin: 0 0 9px;
    color: var(--jp-success) !important;
    font-size: 13px;
    font-weight: 700;
  }
}

@media (max-width: 719px) {
  /* A short wallet ledger can read as compact transaction cards on a phone. */
  .jp-wallet-ledger__scroll {
    overflow: visible;
  }

  .jp-wallet-ledger__table,
  .jp-wallet-ledger__body,
  .jp-wallet-ledger__row,
  .jp-wallet-ledger__date,
  .jp-wallet-ledger__row td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .jp-wallet-ledger__head {
    display: none;
  }

  .jp-wallet-ledger__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 4px 12px;
    min-height: 0;
    padding: 13px 16px;
    border-bottom: 1px solid var(--jp-line);
  }

  .jp-wallet-ledger__row:last-child {
    border-bottom: 0;
  }

  .jp-wallet-ledger__table th,
  .jp-wallet-ledger__table td {
    min-height: 0;
    padding: 0 !important;
    border: 0 !important;
    font-size: 11px;
  }

  .jp-wallet-ledger__date {
    grid-column: 1 / -1;
    color: var(--jp-muted) !important;
    font-size: 10px !important;
    font-weight: 650;
  }

  .jp-wallet-ledger__amount {
    grid-column: 1;
    grid-row: 2 / span 2;
    align-self: center;
    font-size: 14px !important;
  }

  .jp-wallet-ledger__reference,
  .jp-wallet-ledger__type {
    grid-column: 2;
    color: var(--jp-muted) !important;
    font-size: 10px !important;
    text-align: right;
  }

  .jp-wallet-ledger__reference:before {
    content: "Ref · ";
  }

  .jp-wallet-ledger__type:before {
    content: "Type · ";
  }

  /* Statements retain their four real columns, but fit them deliberately in
     the phone width rather than hiding the money columns beyond a scroll. */
  .jp-statement-document__scroll {
    overflow-x: visible;
  }

  .jp-statement-document__table {
    min-width: 0;
    table-layout: fixed;
  }

  .jp-statement-document__table th,
  .jp-statement-document__table td {
    padding: 10px 8px !important;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.28;
  }

  .jp-statement-document__table th:nth-child(1),
  .jp-statement-document__table td:nth-child(1) {
    width: 20%;
  }

  .jp-statement-document__table th:nth-child(2),
  .jp-statement-document__table td:nth-child(2) {
    width: 40%;
  }

  .jp-statement-document__table th:nth-child(3),
  .jp-statement-document__table td:nth-child(3),
  .jp-statement-document__table th:nth-child(4),
  .jp-statement-document__table td:nth-child(4) {
    width: 20%;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  .jp-statement-document__head th {
    font-size: 8px;
    letter-spacing: 0.035em;
  }
}

/* Record composers -------------------------------------------------------
   The legacy forms keep their existing field order and workflow logic. This
   shared layer makes creation feel like one deliberate product surface. */
.jp-composer__content,
.jp-note-create-content,
.jp-payee-modal .modal-content,
.jp-phase-create-content {
  overflow: hidden;
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border-radius: 18px !important;
}

.jp-composer__header,
.jp-note-create-header,
.jp-payee-modal__header,
.jp-phase-create-header {
  min-height: 64px;
  padding: 17px 20px !important;
  color: var(--jp-ink) !important;
  background: var(--jp-surface) !important;
  border-bottom: 1px solid var(--jp-line) !important;
}

.jp-composer__title,
.jp-note-create-title,
.jp-payee-modal .modal-title,
.jp-phase-create-title {
  color: var(--jp-ink) !important;
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.jp-composer__header [data-bs-dismiss],
.jp-note-create-close,
.jp-payee-modal__header [data-bs-dismiss],
.jp-phase-create-close {
  display: inline-grid;
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--jp-accent) !important;
  background: var(--jp-accent-soft);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  place-items: center;
}

.jp-composer__body,
.jp-payee-modal__body,
.jp-phase-create-body {
  padding: 20px !important;
  background: var(--jp-surface) !important;
}

.jp-composer__form,
.jp-payee-form,
.jp-phase-create-form,
.jp-note-create-modal form {
  display: grid;
  gap: 12px;
}

.jp-composer__field,
.jp-payee-form__field,
.jp-phase-create-field,
.jp-note-create-modal .form-group.boxed {
  max-width: none !important;
  margin: 0 !important;
}

.jp-composer__field .form-control,
.jp-payee-form .form-control,
.jp-phase-create-input,
.jp-note-create-modal .form-control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px !important;
  color: var(--jp-ink) !important;
  background: var(--jp-surface-muted) !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  font-size: 14px;
  font-weight: 620;
}

.jp-composer__field textarea.form-control,
.jp-phase-create-field--metadata textarea,
.jp-note-create-modal textarea.form-control {
  min-height: 112px;
  resize: vertical;
}

.jp-composer__field .form-control:focus,
.jp-payee-form .form-control:focus,
.jp-phase-create-input:focus,
.jp-note-create-modal .form-control:focus {
  background: var(--jp-surface) !important;
  border-color: rgba(175, 31, 36, 0.52) !important;
  box-shadow: 0 0 0 3px rgba(175, 31, 36, 0.1) !important;
}

.jp-composer__upload,
#newJobCard .upload-btn,
#newPayment .upload-btn {
  display: grid;
  min-height: 132px !important;
  margin: 2px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #FFF7F7 0%, var(--jp-surface-muted) 100%) !important;
  border: 1px dashed rgba(175, 31, 36, 0.42) !important;
  border-radius: 13px !important;
  place-items: center;
}

.jp-composer__upload > *,
#newJobCard .upload-btn > *,
#newPayment .upload-btn > * {
  max-width: 100%;
}

.jp-composer__actions,
.jp-payee-form__actions,
.jp-phase-create-field--submit,
.jp-note-create-modal form .form-group:last-child {
  margin-top: 4px !important;
  padding-top: 4px;
}

.jp-composer__submit,
.jp-payee-form__submit,
.jp-phase-create-submit,
.jp-note-create-modal #newnotes,
.jp-composer-actions .btn {
  min-height: 48px;
  color: #FFFFFF !important;
  background: var(--jp-accent) !important;
  border-color: var(--jp-accent) !important;
  box-shadow: 0 8px 18px rgba(175, 31, 36, 0.18) !important;
}

/* Notes intentionally present the two supported ways to create a note as
   compact modes rather than exposing the legacy accordion chrome. */
.jp-note-create-modal .modal-body {
  padding: 8px !important;
  background: var(--jp-surface) !important;
}

.jp-note-create-modal #noteHandler {
  display: grid;
  gap: 10px;
  padding: 0 !important;
  background: transparent !important;
}

.jp-note-create-modal .accordion-item {
  overflow: hidden;
  background: var(--jp-surface-muted) !important;
  border: 0 !important;
  border-radius: 13px !important;
}

.jp-note-create-modal .accordion-button {
  min-height: 58px;
  padding: 13px 15px;
  color: var(--jp-ink) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 740;
}

.jp-note-create-modal .accordion-button i {
  margin-right: 10px;
  color: var(--jp-accent);
  font-size: 17px;
}

.jp-note-create-modal .accordion-button:not(.collapsed) {
  color: var(--jp-accent) !important;
  background: #FFF7F7 !important;
}

.jp-note-create-modal .accordion-button:after {
  width: 16px;
  height: 16px;
  background-size: 16px;
}

.jp-note-create-modal .accordion-body {
  padding: 12px !important;
  border-top: 1px solid var(--jp-line);
}

.jp-note-create-modal .uploadcare--widget,
.jp-note-create-modal .uploadcare--widget__button,
.jp-note-create-modal .uploadcare--widget__button_type_open {
  max-width: 100%;
}

/* The payee account fields retain their existing show/hide logic, while the
   form now reads as a single registration flow whenever a field is shown. */
.jp-payee-form__field--bank,
.jp-payee-form__field--account {
  padding-top: 2px;
}

.jp-payee-form .input-wrapper.form-control {
  min-height: 0;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.jp-payee-form select.form-control {
  appearance: auto;
}

@media (min-width: 720px) {
  .jp-composer__form,
  .jp-payee-form,
  .jp-phase-create-form,
  .jp-note-create-modal form {
    gap: 14px;
  }

  .jp-composer__body,
  .jp-payee-modal__body,
  .jp-phase-create-body {
    padding: 24px !important;
  }

  .jp-note-create-modal .modal-body {
    padding: 12px !important;
  }

  .jp-note-create-modal #noteHandler {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  /* The desktop payment form fits its proof uploader and final action in one
     composed dialog. This avoids a sticky button sitting over an active
     upload target while preserving the full existing form. */
  #newPayment .jp-composer__form {
    gap: 10px;
  }

  #newPayment .jp-composer__field textarea.form-control {
    min-height: 96px;
  }

  #newPayment .jp-composer__upload,
  #newPayment .upload-btn {
    min-height: 112px !important;
    height: 112px !important;
  }
}


/* Permission switches use the legacy markup, reset only within the new
   two-column permission groups so their geometry remains intentional. */
.jp-role-invite-permission-group .input-list .form-check {
  min-height: 42px;
  padding: 0 !important;
}

.jp-role-invite-permission-group .input-list .form-check:after {
  display: none !important;
}

.jp-role-invite-permission-group .input-list .form-check-label {
  min-height: 42px;
  padding: 10px 12px 10px 36px !important;
}

.jp-role-invite-permission-group .input-list .form-check-label:before,
.jp-role-invite-permission-group .input-list .form-check-label:after {
  top: 50% !important;
  left: 12px !important;
  transform: translateY(-50%);
}

/* Bootstrap overlays must always take precedence over the app rails. */
.modal,
.offcanvas {
  z-index: 1300 !important;
}

.modal-backdrop,
.offcanvas-backdrop {
  z-index: 1290 !important;
}

@media (min-width: 1024px) {
  /* Public and account pages do not render the authenticated global rail. */
  body:not(:has(.jp-global-rail)) .appHeader {
    left: 0 !important;
    width: 100% !important;
    padding: 0 24px !important;
  }

  body:not(:has(.jp-global-rail)) .appHeader.no-border.transparent {
    background: transparent !important;
    border-bottom: 0 !important;
  }

  body:not(:has(.jp-global-rail)) .appHeader .left .headerButton {
    display: inline-flex !important;
  }

  body:not(:has(.jp-global-rail)) #appCapsule {
    margin-left: 0 !important;
    padding: 74px 0 56px !important;
    border-radius: 0 !important;
  }

  body:has(.jp-global-rail) .appHeader .right {
    right: 28px;
  }
}

@media print {
  .appHeader,
  .jp-global-rail,
  .jp-project-nav,
  .jp-statement-controls,
  .appBottomMenu,
  .modal,
  .offcanvas {
    display: none !important;
  }

  body,
  #appCapsule,
  body:has(.jp-project-nav) #appCapsule {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    border-radius: 0 !important;
  }

  .jp-statement-document,
  .jp-statement-document__scroll {
    width: 100% !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  .jp-statement-document__table {
    min-width: 0 !important;
  }
}
